diff --git a/src/darwin/Framework/CHIP/MTRBaseClusterUtils.h b/src/darwin/Framework/CHIP/MTRBaseClusterUtils.h index b74c1855762dfa..6d8ac6c6c01cab 100644 --- a/src/darwin/Framework/CHIP/MTRBaseClusterUtils.h +++ b/src/darwin/Framework/CHIP/MTRBaseClusterUtils.h @@ -263,169 +263,4 @@ void MTRReadAttribute(MTRReadParams * _Nonnull params, std::move(*callbackBridge).DispatchAction(device); } -/** - * Utility functions base clusters use for doing commands. - */ -template -class MTRInvokeCallback : public chip::app::CommandSender::Callback { -public: - MTRInvokeCallback(InvokeBridgeType * _Nonnull bridge, typename InvokeBridgeType::SuccessCallbackType _Nonnull onResponse, - MTRErrorCallback _Nonnull onError) - : mBridge(bridge) - , mOnResponse(onResponse) - , mOnError(onError) - { - } - - ~MTRInvokeCallback() {} - - void AdoptCommandSender(chip::Platform::UniquePtr commandSender) - { - mCommandSender = std::move(commandSender); - } - -protected: - // We need to have different OnResponse implementations depending on whether - // ResponseType is DataModel::NullObjectType or not. Since template class methods - // can't be partially specialized (either you have to partially specialize - // the class template, or you have to fully specialize the method), use - // enable_if to deal with this. - void OnResponse(chip::app::CommandSender * commandSender, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::StatusIB & status, chip::TLV::TLVReader * reader) override - { - HandleResponse(commandSender, commandPath, status, reader); - } - - /** - * Response handler for data responses. - */ - template ::value, int> = 0> - void HandleResponse(chip::app::CommandSender * commandSender, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::StatusIB & status, chip::TLV::TLVReader * reader) - { - if (mCalledCallback) { - return; - } - mCalledCallback = true; - - ResponseType response; - CHIP_ERROR err = CHIP_NO_ERROR; - - // - // We're expecting response data in this variant of OnResponse. Consequently, reader should always be - // non-null. If it is, it means we received a success status code instead, which is not what was expected. - // - VerifyOrExit(reader != nullptr, err = CHIP_ERROR_SCHEMA_MISMATCH); - - // - // Validate that the data response we received matches what we expect in terms of its cluster and command IDs. - // - VerifyOrExit( - commandPath.mClusterId == ResponseType::GetClusterId() && commandPath.mCommandId == ResponseType::GetCommandId(), - err = CHIP_ERROR_SCHEMA_MISMATCH); - - err = chip::app::DataModel::Decode(*reader, response); - SuccessOrExit(err); - - mOnResponse(mBridge, response); - - exit: - if (err != CHIP_NO_ERROR) { - mOnError(mBridge, err); - } - } - - /** - * Response handler for status responses. - */ - template ::value, int> = 0> - void HandleResponse(chip::app::CommandSender * commandSender, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::StatusIB & status, chip::TLV::TLVReader * reader) - { - if (mCalledCallback) { - return; - } - mCalledCallback = true; - - // - // If we got a valid reader, it means we received response data that we were not expecting to receive. - // - if (reader != nullptr) { - mOnError(mBridge, CHIP_ERROR_SCHEMA_MISMATCH); - return; - } - - chip::app::DataModel::NullObjectType nullResp; - mOnResponse(mBridge, nullResp); - } - - void OnError(const chip::app::CommandSender * commandSender, CHIP_ERROR error) override - { - if (mCalledCallback) { - return; - } - mCalledCallback = true; - - mOnError(mBridge, error); - } - - void OnDone(chip::app::CommandSender * commandSender) override - { - if (!mCalledCallback) { - // This can happen if the server sends a response with an empty - // InvokeResponses list. Since we are not sending wildcard command - // paths, that's not a valid response and we should treat it as an - // error. Use the error we would have gotten if we in fact expected - // a nonempty list. - OnError(commandSender, CHIP_END_OF_TLV); - } - - chip::Platform::Delete(this); - } - - InvokeBridgeType * _Nonnull mBridge; - - typename InvokeBridgeType::SuccessCallbackType mOnResponse; - MTRErrorCallback mOnError; - chip::Platform::UniquePtr mCommandSender; - // For reads, we ensure that we make only one data/error callback to our consumer. - bool mCalledCallback = false; -}; - -/** - * timedInvokeTimeoutMs, if provided, is how long the server will wait for us to - * send the invoke after we sent the Timed Request message. - * - * invokeTimeout, if provided, will have possible MRP latency added to it and - * the result is how long we will wait for the server to respond. - */ -template -CHIP_ERROR MTRStartInvokeInteraction(BridgeType * _Nonnull bridge, const RequestDataType & requestData, - chip::Messaging::ExchangeManager & exchangeManager, const chip::SessionHandle & session, - typename BridgeType::SuccessCallbackType successCb, MTRErrorCallback failureCb, chip::EndpointId endpoint, - chip::Optional timedInvokeTimeoutMs, chip::Optional invokeTimeout) -{ - auto callback = chip::Platform::MakeUnique>( - bridge, successCb, failureCb); - VerifyOrReturnError(callback != nullptr, CHIP_ERROR_NO_MEMORY); - - auto commandSender - = chip::Platform::MakeUnique(callback.get(), &exchangeManager, timedInvokeTimeoutMs.HasValue()); - VerifyOrReturnError(commandSender != nullptr, CHIP_ERROR_NO_MEMORY); - - chip::app::CommandPathParams commandPath(endpoint, 0, RequestDataType::GetClusterId(), RequestDataType::GetCommandId(), - chip::app::CommandPathFlags::kEndpointIdValid); - ReturnErrorOnFailure(commandSender->AddRequestData(commandPath, requestData, timedInvokeTimeoutMs)); - - if (invokeTimeout.HasValue()) { - invokeTimeout.SetValue(session->ComputeRoundTripTimeout(invokeTimeout.Value())); - } - ReturnErrorOnFailure(commandSender->SendCommandRequest(session, invokeTimeout)); - - callback->AdoptCommandSender(std::move(commandSender)); - callback.release(); - - return CHIP_NO_ERROR; -}; - NS_ASSUME_NONNULL_END diff --git a/src/darwin/Framework/CHIP/MTRBaseDevice.mm b/src/darwin/Framework/CHIP/MTRBaseDevice.mm index ac9b0f9e3ad056..1d76e22d9fc53a 100644 --- a/src/darwin/Framework/CHIP/MTRBaseDevice.mm +++ b/src/darwin/Framework/CHIP/MTRBaseDevice.mm @@ -31,6 +31,7 @@ #import "MTRSetupPayload_Internal.h" #import "NSDataSpanConversion.h" #import "NSStringSpanConversion.h" +#import "zap-generated/MTRCommandPayloads_Internal.h" #include "app/ConcreteAttributePath.h" #include "app/ConcreteCommandPath.h" @@ -1308,6 +1309,47 @@ - (void)_invokeCommandWithEndpointID:(NSNumber *)endpointID std::move(*bridge).DispatchAction(self); } +- (void)_invokeKnownCommandWithEndpointID:(NSNumber *)endpointID + clusterID:(NSNumber *)clusterID + commandID:(NSNumber *)commandID + commandPayload:(id)commandPayload + timedInvokeTimeout:(NSNumber * _Nullable)timeout + serverSideProcessingTimeout:(NSNumber * _Nullable)serverSideProcessingTimeout + responseClass:(Class _Nullable)responseClass + queue:(dispatch_queue_t)queue + completion:(void (^)(id _Nullable response, NSError * _Nullable error))completion +{ + NSError * encodingError; + auto * commandFields = [commandPayload _encodeAsDataValue:&encodingError]; + if (commandFields == nil) { + dispatch_async(queue, ^{ + completion(nil, encodingError); + }); + return; + } + + auto responseHandler = ^(NSArray *> * _Nullable values, NSError * _Nullable error) { + id _Nullable response = nil; + if (error == nil) { + if (values.count != 1) { + error = [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeSchemaMismatch userInfo:nil]; + } else if (responseClass != nil) { + response = [[responseClass alloc] initWithResponseValue:values[0] error:&error]; + } + } + completion(response, error); + }; + + [self _invokeCommandWithEndpointID:endpointID + clusterID:clusterID + commandID:commandID + commandFields:commandFields + timedInvokeTimeout:timeout + serverSideProcessingTimeout:serverSideProcessingTimeout + queue:queue + completion:responseHandler]; +} + - (void)subscribeToAttributesWithEndpointID:(NSNumber * _Nullable)endpointID clusterID:(NSNumber * _Nullable)clusterID attributeID:(NSNumber * _Nullable)attributeID diff --git a/src/darwin/Framework/CHIP/MTRBaseDevice_Internal.h b/src/darwin/Framework/CHIP/MTRBaseDevice_Internal.h index 4033ff77ef12b3..671ef1a25b2660 100644 --- a/src/darwin/Framework/CHIP/MTRBaseDevice_Internal.h +++ b/src/darwin/Framework/CHIP/MTRBaseDevice_Internal.h @@ -111,6 +111,24 @@ static inline MTRTransportType MTRMakeTransportType(chip::Transport::Type type) queue:(dispatch_queue_t)queue completion:(MTRDeviceResponseHandler)completion; +/** + * Like the public invokeCommandWithEndpointID but: + * + * 1) Allows passing through a serverSideProcessingTimeout. + * 2) Expects one of the command payload structs as commandPayload + * 3) On success, returns an instance of responseClass via the completion (or + * nil if there is no responseClass, which indicates a status-only command). + */ +- (void)_invokeKnownCommandWithEndpointID:(NSNumber *)endpointID + clusterID:(NSNumber *)clusterID + commandID:(NSNumber *)commandID + commandPayload:(id)commandPayload + timedInvokeTimeout:(NSNumber * _Nullable)timeout + serverSideProcessingTimeout:(NSNumber * _Nullable)serverSideProcessingTimeout + responseClass:(Class _Nullable)responseClass + queue:(dispatch_queue_t)queue + completion:(void (^)(id _Nullable response, NSError * _Nullable error))completion; + @end @interface MTRClusterPath () diff --git a/src/darwin/Framework/CHIP/templates/MTRBaseClusters-src.zapt b/src/darwin/Framework/CHIP/templates/MTRBaseClusters-src.zapt index 1e0cf5eca4fe80..dc8d642ea21867 100644 --- a/src/darwin/Framework/CHIP/templates/MTRBaseClusters-src.zapt +++ b/src/darwin/Framework/CHIP/templates/MTRBaseClusters-src.zapt @@ -14,6 +14,7 @@ #import "NSStringSpanConversion.h" #import "NSDataSpanConversion.h" +#include #include #include #include @@ -53,7 +54,6 @@ using chip::System::Clock::Seconds16; {{! This is used as the implementation for both the new-name and old-name bits, so check for both here. }} {{#if (or (isSupported cluster command=command) (isSupported (compatClusterNameRemapping parent.name) command=(compatCommandNameRemapping parent.name name)))}} -{{#*inline "callbackName"}}{{#if hasSpecificResponse}}{{cluster}}Cluster{{asUpperCamelCase responseName preserveAcronyms=true}}{{else}}CommandSuccess{{/if}}{{/inline}} {{#*inline "paramsType"}} {{#unless (isSupported cluster command=command)}} MTR{{compatClusterNameRemapping parent.name}}Cluster{{compatCommandNameRemapping parent.name name}}Params @@ -69,61 +69,39 @@ MTR{{cluster}}Cluster{{command}}Params {{/unless}} - (void){{asLowerCamelCase name}}WithParams: ({{> paramsType}} * {{#unless commandHasRequiredField}}_Nullable{{/unless}})params completion:({{>command_completion_type command=.}})completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTR{{>callbackName}}CallbackBridge(self.callbackQueue, - {{#if hasSpecificResponse}} - {{! This treats completion as taking an id for the data. This is - not great from a type-safety perspective, of course. }} - completion, - {{else}} - {{! For now, don't change the bridge API; instead just use an adapter - to invoke our completion handler. This is not great from a - type-safety perspective, of course. }} - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - {{/if}} - ^(ExchangeManager & exchangeManager, const SessionHandle & session, {{>callbackName}}CallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_castcallbackName}}CallbackBridge *>(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - {{asUpperCamelCase parent.name}}::Commands::{{asUpperCamelCase name}}::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - {{#if mustUseTimedInvoke}} - if (!timedInvokeTimeoutMs.HasValue()) { - timedInvokeTimeoutMs.SetValue(10000); - } + if (params == nil) { + params = [[{{> paramsType}} alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + {{#if hasSpecificResponse}} + completion(response, error); + {{else}} + completion(error); {{/if}} - {{#zcl_command_arguments}} - {{#first}} - {{#unless parent.commandHasRequiredField}} - if (params != nil) { - {{/unless}} - {{/first}} - {{>encode_value target=(concat "request." (asLowerCamelCase label)) source=(concat "params." (asStructPropertyName label)) cluster=parent.parent.name errorCode="return CHIP_ERROR_INVALID_ARGUMENT;" depth=0}} - {{#last}} - {{#unless parent.commandHasRequiredField}} - } - {{/unless}} - {{/last}} - {{/zcl_command_arguments}} + }; - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + {{#if mustUseTimedInvoke}} + if (timedInvokeTimeoutMs == nil) { + timedInvokeTimeoutMs = @(10000); + } + {{/if}} + + using RequestType = {{asUpperCamelCase parent.name}}::Commands::{{asUpperCamelCase name}}::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout +{{#if hasSpecificResponse}} + responseClass:MTR{{cluster}}Cluster{{asUpperCamelCase responseName preserveAcronyms=true}}Params.class +{{else}} + responseClass:nil +{{/if}} + queue:self.callbackQueue + completion:responseHandler]; } {{/if}} {{/inline}} diff --git a/src/darwin/Framework/CHIP/templates/MTRCallbackBridge-src.zapt b/src/darwin/Framework/CHIP/templates/MTRCallbackBridge-src.zapt index 833d8f9c3eff62..0aad26541b0472 100644 --- a/src/darwin/Framework/CHIP/templates/MTRCallbackBridge-src.zapt +++ b/src/darwin/Framework/CHIP/templates/MTRCallbackBridge-src.zapt @@ -10,7 +10,6 @@ #include {{#>MTRCallbackBridge partial-type="Status" }}DefaultSuccessCallback{{/MTRCallbackBridge}} -{{#>MTRCallbackBridge partial-type="CommandStatus" }}CommandSuccessCallback{{/MTRCallbackBridge}} {{#>MTRCallbackBridge type="Octet_String" isNullable=false ns="chip"}}OctetStringAttributeCallback{{/MTRCallbackBridge}} {{#>MTRCallbackBridge type="Octet_String" isNullable=true ns="chip"}}NullableOctetStringAttributeCallback{{/MTRCallbackBridge}} {{#>MTRCallbackBridge type="Char_String" isNullable=false ns="chip"}}CharStringAttributeCallback{{/MTRCallbackBridge}} @@ -57,14 +56,6 @@ {{/zcl_attributes_server}} {{/zcl_clusters}} -{{#zcl_clusters}} -{{#zcl_command_responses}} -{{#if (isSupported (asUpperCamelCase ../name preserveAcronyms=true) command=(asUpperCamelCase name preserveAcronyms=true))}} -{{#>MTRCallbackBridge partial-type="Command" }}{{asUpperCamelCase ../../name preserveAcronyms=true}}Cluster{{asUpperCamelCase ../name preserveAcronyms=true}}Callback{{/MTRCallbackBridge}} -{{/if}} -{{/zcl_command_responses}} -{{/zcl_clusters}} - {{#zcl_clusters}} {{#zcl_enums}} {{#if (isSupported (asUpperCamelCase parent.name preserveAcronyms=true) enum=(asUpperCamelCase name preserveAcronyms=true))}} diff --git a/src/darwin/Framework/CHIP/templates/MTRCallbackBridge.zapt b/src/darwin/Framework/CHIP/templates/MTRCallbackBridge.zapt index 8e9e5f03244abe..7b493d62a10df0 100644 --- a/src/darwin/Framework/CHIP/templates/MTRCallbackBridge.zapt +++ b/src/darwin/Framework/CHIP/templates/MTRCallbackBridge.zapt @@ -8,21 +8,11 @@ #include #include -typedef void (*CommandSuccessCallback)(void *, const chip::app::DataModel::NullObjectType &); -using CommandSuccessCallbackType = CommandSuccessCallback; typedef void (*DefaultSuccessCallbackType)(void *); typedef void (*VendorIdAttributeCallback)(void *, chip::VendorId); typedef void (*NullableVendorIdAttributeCallback)(void *, const chip::app::DataModel::Nullable &); -{{#zcl_clusters}} -{{#zcl_command_responses}} -{{#if (isSupported (asUpperCamelCase parent.name preserveAcronyms=true) command=(asUpperCamelCase name preserveAcronyms=true))}} -typedef void (*{{asUpperCamelCase parent.name preserveAcronyms=true}}Cluster{{asUpperCamelCase name preserveAcronyms=true}}CallbackType)(void *, const chip::app::Clusters::{{asUpperCamelCase parent.name}}::Commands::{{asUpperCamelCase name}}::DecodableType &); -{{/if}} -{{/zcl_command_responses}} -{{/zcl_clusters}} - {{#zcl_clusters}} {{#zcl_enums}} {{#if (isSupported (asUpperCamelCase parent.name preserveAcronyms=true) enum=(asUpperCamelCase name preserveAcronyms=true))}} @@ -50,7 +40,6 @@ typedef void (*{{asUpperCamelCase parent.name preserveAcronyms=true}}{{asUpperCa {{/zcl_clusters}} {{#>MTRCallbackBridge header="1" partial-type="Status" }}DefaultSuccessCallback{{/MTRCallbackBridge}} -{{#>MTRCallbackBridge header="1" partial-type="CommandStatus" }}CommandSuccessCallback{{/MTRCallbackBridge}} {{#>MTRCallbackBridge header="1" type="Octet_String" isNullable=false ns="chip"}}OctetStringAttributeCallback{{/MTRCallbackBridge}} {{#>MTRCallbackBridge header="1" type="Octet_String" isNullable=true ns="chip"}}NullableOctetStringAttributeCallback{{/MTRCallbackBridge}} {{#>MTRCallbackBridge header="1" type="Char_String" isNullable=false ns="chip"}}CharStringAttributeCallback{{/MTRCallbackBridge}} @@ -97,14 +86,6 @@ typedef void (*{{asUpperCamelCase parent.name preserveAcronyms=true}}{{asUpperCa {{/zcl_attributes_server}} {{/zcl_clusters}} -{{#zcl_clusters}} -{{#zcl_command_responses}} -{{#if (isSupported (asUpperCamelCase parent.name preserveAcronyms=true) command=(asUpperCamelCase name preserveAcronyms=true))}} -{{#>MTRCallbackBridge header="1" partial-type="Command" provisional=(isProvisional (asUpperCamelCase parent.name preserveAcronyms=true) command=(asUpperCamelCase name preserveAcronyms=true))}}{{asUpperCamelCase ../../name preserveAcronyms=true}}Cluster{{asUpperCamelCase ../name preserveAcronyms=true}}Callback{{/MTRCallbackBridge}} -{{/if}} -{{/zcl_command_responses}} -{{/zcl_clusters}} - {{#zcl_clusters}} {{#zcl_enums}} {{#if (isSupported (asUpperCamelCase parent.name preserveAcronyms=true) enum=(asUpperCamelCase name preserveAcronyms=true))}} diff --git a/src/darwin/Framework/CHIP/templates/MTRClusters-src.zapt b/src/darwin/Framework/CHIP/templates/MTRClusters-src.zapt index 6a715541a7f4e0..c5076a3945e99e 100644 --- a/src/darwin/Framework/CHIP/templates/MTRClusters-src.zapt +++ b/src/darwin/Framework/CHIP/templates/MTRClusters-src.zapt @@ -11,7 +11,9 @@ #import "MTRCommandPayloadsObjc.h" #import "MTRLogging_Internal.h" +#include #include + #include using chip::Callback::Callback; @@ -54,20 +56,6 @@ MTR{{compatClusterNameRemapping parent.name}}Cluster{{compatCommandNameRemapping MTR{{cluster}}Cluster{{command}}Params {{/unless}} {{/inline}} -{{#*inline "clusterId"}} -{{#unless (isSupported cluster command=command)}} -{{asMEI ../manufacturerCode ../code}} -{{else}} -MTRClusterIDType{{cluster}}ID -{{/unless}} -{{/inline}} -{{#*inline "commandId"}} -{{#unless (isSupported cluster command=command)}} -{{asMEI manufacturerCode code}} -{{else}} -MTRCommandIDTypeCluster{{cluster}}Command{{command}}ID -{{/unless}} -{{/inline}} {{#unless hasArguments}} - (void){{asLowerCamelCase name}}WithExpectedValues:(NSArray *> *)expectedValues expectedValueInterval:(NSNumber *)expectedValueIntervalMs completion:({{>command_completion_type command=.}})completion { @@ -95,9 +83,10 @@ MTRCommandIDTypeCluster{{cluster}}Command{{command}}ID } {{/if}} + using RequestType = {{asUpperCamelCase parent.name}}::Commands::{{asUpperCamelCase name}}::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@({{> clusterId}}) - commandID:@({{> commandId}}) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs diff --git a/src/darwin/Framework/CHIP/templates/partials/MTRCallbackBridge.zapt b/src/darwin/Framework/CHIP/templates/partials/MTRCallbackBridge.zapt index aea117477b3bb8..95d63515ddb20f 100644 --- a/src/darwin/Framework/CHIP/templates/partials/MTRCallbackBridge.zapt +++ b/src/darwin/Framework/CHIP/templates/partials/MTRCallbackBridge.zapt @@ -1,14 +1,6 @@ {{#if header}} {{#*inline "callbackType"}} - {{#if partial-type}} - {{#if (isStrEqual partial-type "Command")}} - {{> @partial-block}}Type - {{else}} - {{> @partial-block}} - {{/if}} - {{else}} - {{> @partial-block}} - {{/if}} + {{> @partial-block}} {{/inline}} class {{#if provisional}}MTR_PROVISIONALLY_AVAILABLE{{/if}} MTR{{> @partial-block}}Bridge : public MTRCallbackBridge<{{>callbackType}}> { @@ -25,10 +17,6 @@ public: {{#if partial-type}} {{#if (isStrEqual partial-type "Status")}} {{! No more args in this case }} - {{else if (isStrEqual partial-type "Command")}} - , const chip::app::Clusters::{{asUpperCamelCase parent.name}}::Commands::{{asUpperCamelCase name}}::DecodableType & data - {{else if (isStrEqual partial-type "CommandStatus")}} - , const chip::app::DataModel::NullObjectType & {{else}} UNEXPECTED PARTIAL TYPE {{/if}} @@ -61,10 +49,6 @@ void MTR{{> @partial-block}}Bridge::OnSuccessFn(void * context {{#if partial-type}} {{#if (isStrEqual partial-type "Status")}} {{! No more args in this case }} - {{else if (isStrEqual partial-type "Command")}} - , const chip::app::Clusters::{{asUpperCamelCase parent.name}}::Commands::{{asUpperCamelCase name}}::DecodableType & data - {{else if (isStrEqual partial-type "CommandStatus")}} - , const chip::app::DataModel::NullObjectType & {{else}} UNEXPECTED PARTIAL TYPE {{/if}} @@ -76,17 +60,6 @@ void MTR{{> @partial-block}}Bridge::OnSuccessFn(void * context {{#if partial-type}} {{#if (isStrEqual partial-type "Status")}} DispatchSuccess(context, nil); - {{else if (isStrEqual partial-type "Command")}} - auto * response = [MTR{{asUpperCamelCase parent.name preserveAcronyms=true}}Cluster{{asUpperCamelCase name preserveAcronyms=true}}Params new]; - CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; - if (err != CHIP_NO_ERROR) { - OnFailureFn(context, err); - return; - } - SetAttestationChallengeIfNeeded(context, response); - DispatchSuccess(context, response); - {{else if (isStrEqual partial-type "CommandStatus")}} - DispatchSuccess(context, nil); {{else}} UNEXPECTED PARTIAL TYPE {{/if}} diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm index 8a75b4105b7876..0a5b259f062b7c 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm @@ -29,6 +29,7 @@ #import "NSDataSpanConversion.h" #import "NSStringSpanConversion.h" +#include #include #include #include @@ -61,71 +62,51 @@ - (instancetype)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)en - (void)identifyWithParams:(MTRIdentifyClusterIdentifyParams *)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - Identify::Commands::Identify::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.identifyTime = params.identifyTime.unsignedShortValue; + if (params == nil) { + params = [[MTRIdentifyClusterIdentifyParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = Identify::Commands::Identify::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} - (void)triggerEffectWithParams:(MTRIdentifyClusterTriggerEffectParams *)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - Identify::Commands::TriggerEffect::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.effectIdentifier = static_cast>(params.effectIdentifier.unsignedCharValue); - request.effectVariant = static_cast>(params.effectVariant.unsignedCharValue); + if (params == nil) { + params = [[MTRIdentifyClusterTriggerEffectParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = Identify::Commands::TriggerEffect::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; } - (void)readAttributeIdentifyTimeWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -759,220 +740,151 @@ - (instancetype)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)en - (void)addGroupWithParams:(MTRGroupsClusterAddGroupParams *)params completion:(void (^)(MTRGroupsClusterAddGroupResponseParams * _Nullable data, NSError * _Nullable error))completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRGroupsClusterAddGroupResponseCallbackBridge(self.callbackQueue, - completion, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, GroupsClusterAddGroupResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - Groups::Commands::AddGroup::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.groupID = params.groupID.unsignedShortValue; - request.groupName = AsCharSpan(params.groupName); + if (params == nil) { + params = [[MTRGroupsClusterAddGroupParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = Groups::Commands::AddGroup::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRGroupsClusterAddGroupResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} - (void)viewGroupWithParams:(MTRGroupsClusterViewGroupParams *)params completion:(void (^)(MTRGroupsClusterViewGroupResponseParams * _Nullable data, NSError * _Nullable error))completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRGroupsClusterViewGroupResponseCallbackBridge(self.callbackQueue, - completion, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, GroupsClusterViewGroupResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - Groups::Commands::ViewGroup::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.groupID = params.groupID.unsignedShortValue; + if (params == nil) { + params = [[MTRGroupsClusterViewGroupParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = Groups::Commands::ViewGroup::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRGroupsClusterViewGroupResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} - (void)getGroupMembershipWithParams:(MTRGroupsClusterGetGroupMembershipParams *)params completion:(void (^)(MTRGroupsClusterGetGroupMembershipResponseParams * _Nullable data, NSError * _Nullable error))completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRGroupsClusterGetGroupMembershipResponseCallbackBridge(self.callbackQueue, - completion, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, GroupsClusterGetGroupMembershipResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - Groups::Commands::GetGroupMembership::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (params.groupList.count != 0) { - auto * listHolder_0 = new ListHolder(params.groupList.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < params.groupList.count; ++i_0) { - if (![params.groupList[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) params.groupList[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedShortValue; - } - request.groupList = ListType_0(listHolder_0->mList, params.groupList.count); - } else { - request.groupList = ListType_0(); - } - } + if (params == nil) { + params = [[MTRGroupsClusterGetGroupMembershipParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = Groups::Commands::GetGroupMembership::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRGroupsClusterGetGroupMembershipResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} - (void)removeGroupWithParams:(MTRGroupsClusterRemoveGroupParams *)params completion:(void (^)(MTRGroupsClusterRemoveGroupResponseParams * _Nullable data, NSError * _Nullable error))completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRGroupsClusterRemoveGroupResponseCallbackBridge(self.callbackQueue, - completion, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, GroupsClusterRemoveGroupResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - Groups::Commands::RemoveGroup::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.groupID = params.groupID.unsignedShortValue; + if (params == nil) { + params = [[MTRGroupsClusterRemoveGroupParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = Groups::Commands::RemoveGroup::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRGroupsClusterRemoveGroupResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} - (void)removeAllGroupsWithCompletion:(MTRStatusCompletion)completion { [self removeAllGroupsWithParams:nil completion:completion]; } - (void)removeAllGroupsWithParams:(MTRGroupsClusterRemoveAllGroupsParams * _Nullable)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - Groups::Commands::RemoveAllGroups::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } + if (params == nil) { + params = [[MTRGroupsClusterRemoveAllGroupsParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = Groups::Commands::RemoveAllGroups::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} - (void)addGroupIfIdentifyingWithParams:(MTRGroupsClusterAddGroupIfIdentifyingParams *)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - Groups::Commands::AddGroupIfIdentifying::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.groupID = params.groupID.unsignedShortValue; - request.groupName = AsCharSpan(params.groupName); + if (params == nil) { + params = [[MTRGroupsClusterAddGroupIfIdentifyingParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = Groups::Commands::AddGroupIfIdentifying::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; } - (void)readAttributeNameSupportWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -1527,429 +1439,243 @@ - (instancetype)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)en - (void)addSceneWithParams:(MTRScenesClusterAddSceneParams *)params completion:(void (^)(MTRScenesClusterAddSceneResponseParams * _Nullable data, NSError * _Nullable error))completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRScenesClusterAddSceneResponseCallbackBridge(self.callbackQueue, - completion, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, ScenesClusterAddSceneResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - Scenes::Commands::AddScene::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.groupID = params.groupID.unsignedShortValue; - request.sceneID = params.sceneID.unsignedCharValue; - request.transitionTime = params.transitionTime.unsignedShortValue; - request.sceneName = AsCharSpan(params.sceneName); - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (params.extensionFieldSets.count != 0) { - auto * listHolder_0 = new ListHolder(params.extensionFieldSets.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < params.extensionFieldSets.count; ++i_0) { - if (![params.extensionFieldSets[i_0] isKindOfClass:[MTRScenesClusterExtensionFieldSet class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (MTRScenesClusterExtensionFieldSet *) params.extensionFieldSets[i_0]; - listHolder_0->mList[i_0].clusterID = element_0.clusterID.unsignedIntValue; - { - using ListType_2 = std::remove_reference_tmList[i_0].attributeValueList)>; - using ListMemberType_2 = ListMemberTypeGetter::Type; - if (element_0.attributeValueList.count != 0) { - auto * listHolder_2 = new ListHolder(element_0.attributeValueList.count); - if (listHolder_2 == nullptr || listHolder_2->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_2); - for (size_t i_2 = 0; i_2 < element_0.attributeValueList.count; ++i_2) { - if (![element_0.attributeValueList[i_2] isKindOfClass:[MTRScenesClusterAttributeValuePair class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_2 = (MTRScenesClusterAttributeValuePair *) element_0.attributeValueList[i_2]; - listHolder_2->mList[i_2].attributeID = element_2.attributeID.unsignedIntValue; - listHolder_2->mList[i_2].attributeValue = element_2.attributeValue.unsignedIntValue; - } - listHolder_0->mList[i_0].attributeValueList = ListType_2(listHolder_2->mList, element_0.attributeValueList.count); - } else { - listHolder_0->mList[i_0].attributeValueList = ListType_2(); - } - } - } - request.extensionFieldSets = ListType_0(listHolder_0->mList, params.extensionFieldSets.count); - } else { - request.extensionFieldSets = ListType_0(); - } - } + if (params == nil) { + params = [[MTRScenesClusterAddSceneParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = Scenes::Commands::AddScene::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRScenesClusterAddSceneResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} - (void)viewSceneWithParams:(MTRScenesClusterViewSceneParams *)params completion:(void (^)(MTRScenesClusterViewSceneResponseParams * _Nullable data, NSError * _Nullable error))completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRScenesClusterViewSceneResponseCallbackBridge(self.callbackQueue, - completion, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, ScenesClusterViewSceneResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - Scenes::Commands::ViewScene::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.groupID = params.groupID.unsignedShortValue; - request.sceneID = params.sceneID.unsignedCharValue; + if (params == nil) { + params = [[MTRScenesClusterViewSceneParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = Scenes::Commands::ViewScene::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRScenesClusterViewSceneResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} - (void)removeSceneWithParams:(MTRScenesClusterRemoveSceneParams *)params completion:(void (^)(MTRScenesClusterRemoveSceneResponseParams * _Nullable data, NSError * _Nullable error))completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRScenesClusterRemoveSceneResponseCallbackBridge(self.callbackQueue, - completion, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, ScenesClusterRemoveSceneResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - Scenes::Commands::RemoveScene::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.groupID = params.groupID.unsignedShortValue; - request.sceneID = params.sceneID.unsignedCharValue; + if (params == nil) { + params = [[MTRScenesClusterRemoveSceneParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = Scenes::Commands::RemoveScene::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRScenesClusterRemoveSceneResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} - (void)removeAllScenesWithParams:(MTRScenesClusterRemoveAllScenesParams *)params completion:(void (^)(MTRScenesClusterRemoveAllScenesResponseParams * _Nullable data, NSError * _Nullable error))completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRScenesClusterRemoveAllScenesResponseCallbackBridge(self.callbackQueue, - completion, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, ScenesClusterRemoveAllScenesResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - Scenes::Commands::RemoveAllScenes::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.groupID = params.groupID.unsignedShortValue; + if (params == nil) { + params = [[MTRScenesClusterRemoveAllScenesParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = Scenes::Commands::RemoveAllScenes::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRScenesClusterRemoveAllScenesResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} - (void)storeSceneWithParams:(MTRScenesClusterStoreSceneParams *)params completion:(void (^)(MTRScenesClusterStoreSceneResponseParams * _Nullable data, NSError * _Nullable error))completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRScenesClusterStoreSceneResponseCallbackBridge(self.callbackQueue, - completion, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, ScenesClusterStoreSceneResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - Scenes::Commands::StoreScene::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.groupID = params.groupID.unsignedShortValue; - request.sceneID = params.sceneID.unsignedCharValue; + if (params == nil) { + params = [[MTRScenesClusterStoreSceneParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = Scenes::Commands::StoreScene::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRScenesClusterStoreSceneResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} - (void)recallSceneWithParams:(MTRScenesClusterRecallSceneParams *)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - Scenes::Commands::RecallScene::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.groupID = params.groupID.unsignedShortValue; - request.sceneID = params.sceneID.unsignedCharValue; - if (params.transitionTime != nil) { - auto & definedValue_0 = request.transitionTime.Emplace(); - if (params.transitionTime == nil) { - definedValue_0.SetNull(); - } else { - auto & nonNullValue_1 = definedValue_0.SetNonNull(); - nonNullValue_1 = params.transitionTime.unsignedShortValue; - } - } + if (params == nil) { + params = [[MTRScenesClusterRecallSceneParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = Scenes::Commands::RecallScene::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} - (void)getSceneMembershipWithParams:(MTRScenesClusterGetSceneMembershipParams *)params completion:(void (^)(MTRScenesClusterGetSceneMembershipResponseParams * _Nullable data, NSError * _Nullable error))completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRScenesClusterGetSceneMembershipResponseCallbackBridge(self.callbackQueue, - completion, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, ScenesClusterGetSceneMembershipResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - Scenes::Commands::GetSceneMembership::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.groupID = params.groupID.unsignedShortValue; + if (params == nil) { + params = [[MTRScenesClusterGetSceneMembershipParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = Scenes::Commands::GetSceneMembership::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRScenesClusterGetSceneMembershipResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} - (void)enhancedAddSceneWithParams:(MTRScenesClusterEnhancedAddSceneParams *)params completion:(void (^)(MTRScenesClusterEnhancedAddSceneResponseParams * _Nullable data, NSError * _Nullable error))completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRScenesClusterEnhancedAddSceneResponseCallbackBridge(self.callbackQueue, - completion, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, ScenesClusterEnhancedAddSceneResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - Scenes::Commands::EnhancedAddScene::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.groupID = params.groupID.unsignedShortValue; - request.sceneID = params.sceneID.unsignedCharValue; - request.transitionTime = params.transitionTime.unsignedShortValue; - request.sceneName = AsCharSpan(params.sceneName); - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (params.extensionFieldSets.count != 0) { - auto * listHolder_0 = new ListHolder(params.extensionFieldSets.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < params.extensionFieldSets.count; ++i_0) { - if (![params.extensionFieldSets[i_0] isKindOfClass:[MTRScenesClusterExtensionFieldSet class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (MTRScenesClusterExtensionFieldSet *) params.extensionFieldSets[i_0]; - listHolder_0->mList[i_0].clusterID = element_0.clusterID.unsignedIntValue; - { - using ListType_2 = std::remove_reference_tmList[i_0].attributeValueList)>; - using ListMemberType_2 = ListMemberTypeGetter::Type; - if (element_0.attributeValueList.count != 0) { - auto * listHolder_2 = new ListHolder(element_0.attributeValueList.count); - if (listHolder_2 == nullptr || listHolder_2->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_2); - for (size_t i_2 = 0; i_2 < element_0.attributeValueList.count; ++i_2) { - if (![element_0.attributeValueList[i_2] isKindOfClass:[MTRScenesClusterAttributeValuePair class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_2 = (MTRScenesClusterAttributeValuePair *) element_0.attributeValueList[i_2]; - listHolder_2->mList[i_2].attributeID = element_2.attributeID.unsignedIntValue; - listHolder_2->mList[i_2].attributeValue = element_2.attributeValue.unsignedIntValue; - } - listHolder_0->mList[i_0].attributeValueList = ListType_2(listHolder_2->mList, element_0.attributeValueList.count); - } else { - listHolder_0->mList[i_0].attributeValueList = ListType_2(); - } - } - } - request.extensionFieldSets = ListType_0(listHolder_0->mList, params.extensionFieldSets.count); - } else { - request.extensionFieldSets = ListType_0(); - } - } + if (params == nil) { + params = [[MTRScenesClusterEnhancedAddSceneParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = Scenes::Commands::EnhancedAddScene::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRScenesClusterEnhancedAddSceneResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} - (void)enhancedViewSceneWithParams:(MTRScenesClusterEnhancedViewSceneParams *)params completion:(void (^)(MTRScenesClusterEnhancedViewSceneResponseParams * _Nullable data, NSError * _Nullable error))completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRScenesClusterEnhancedViewSceneResponseCallbackBridge(self.callbackQueue, - completion, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, ScenesClusterEnhancedViewSceneResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - Scenes::Commands::EnhancedViewScene::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.groupID = params.groupID.unsignedShortValue; - request.sceneID = params.sceneID.unsignedCharValue; + if (params == nil) { + params = [[MTRScenesClusterEnhancedViewSceneParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = Scenes::Commands::EnhancedViewScene::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRScenesClusterEnhancedViewSceneResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} - (void)copySceneWithParams:(MTRScenesClusterCopySceneParams *)params completion:(void (^)(MTRScenesClusterCopySceneResponseParams * _Nullable data, NSError * _Nullable error))completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRScenesClusterCopySceneResponseCallbackBridge(self.callbackQueue, - completion, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, ScenesClusterCopySceneResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - Scenes::Commands::CopyScene::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.mode = static_cast>(params.mode.unsignedCharValue); - request.groupIdentifierFrom = params.groupIdentifierFrom.unsignedShortValue; - request.sceneIdentifierFrom = params.sceneIdentifierFrom.unsignedCharValue; - request.groupIdentifierTo = params.groupIdentifierTo.unsignedShortValue; - request.sceneIdentifierTo = params.sceneIdentifierTo.unsignedCharValue; + if (params == nil) { + params = [[MTRScenesClusterCopySceneParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = Scenes::Commands::CopyScene::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRScenesClusterCopySceneResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; } - (void)readAttributeSceneCountWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -2980,217 +2706,159 @@ - (void)offWithCompletion:(MTRStatusCompletion)completion } - (void)offWithParams:(MTROnOffClusterOffParams * _Nullable)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - OnOff::Commands::Off::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } + if (params == nil) { + params = [[MTROnOffClusterOffParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = OnOff::Commands::Off::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} - (void)onWithCompletion:(MTRStatusCompletion)completion { [self onWithParams:nil completion:completion]; } - (void)onWithParams:(MTROnOffClusterOnParams * _Nullable)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - OnOff::Commands::On::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } + if (params == nil) { + params = [[MTROnOffClusterOnParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = OnOff::Commands::On::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} - (void)toggleWithCompletion:(MTRStatusCompletion)completion { [self toggleWithParams:nil completion:completion]; } - (void)toggleWithParams:(MTROnOffClusterToggleParams * _Nullable)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - OnOff::Commands::Toggle::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } + if (params == nil) { + params = [[MTROnOffClusterToggleParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = OnOff::Commands::Toggle::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} - (void)offWithEffectWithParams:(MTROnOffClusterOffWithEffectParams *)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - OnOff::Commands::OffWithEffect::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.effectIdentifier = static_cast>(params.effectIdentifier.unsignedCharValue); - request.effectVariant = params.effectVariant.unsignedCharValue; + if (params == nil) { + params = [[MTROnOffClusterOffWithEffectParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = OnOff::Commands::OffWithEffect::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} - (void)onWithRecallGlobalSceneWithCompletion:(MTRStatusCompletion)completion { [self onWithRecallGlobalSceneWithParams:nil completion:completion]; } - (void)onWithRecallGlobalSceneWithParams:(MTROnOffClusterOnWithRecallGlobalSceneParams * _Nullable)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - OnOff::Commands::OnWithRecallGlobalScene::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } + if (params == nil) { + params = [[MTROnOffClusterOnWithRecallGlobalSceneParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = OnOff::Commands::OnWithRecallGlobalScene::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} - (void)onWithTimedOffWithParams:(MTROnOffClusterOnWithTimedOffParams *)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - OnOff::Commands::OnWithTimedOff::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.onOffControl = static_cast>(params.onOffControl.unsignedCharValue); - request.onTime = params.onTime.unsignedShortValue; - request.offWaitTime = params.offWaitTime.unsignedShortValue; + if (params == nil) { + params = [[MTROnOffClusterOnWithTimedOffParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = OnOff::Commands::OnWithTimedOff::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; } - (void)readAttributeOnOffWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -4786,360 +4454,219 @@ - (instancetype)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)en - (void)moveToLevelWithParams:(MTRLevelControlClusterMoveToLevelParams *)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - LevelControl::Commands::MoveToLevel::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.level = params.level.unsignedCharValue; - if (params.transitionTime == nil) { - request.transitionTime.SetNull(); - } else { - auto & nonNullValue_0 = request.transitionTime.SetNonNull(); - nonNullValue_0 = params.transitionTime.unsignedShortValue; - } - request.optionsMask = static_cast>(params.optionsMask.unsignedCharValue); - request.optionsOverride = static_cast>(params.optionsOverride.unsignedCharValue); + if (params == nil) { + params = [[MTRLevelControlClusterMoveToLevelParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = LevelControl::Commands::MoveToLevel::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} - (void)moveWithParams:(MTRLevelControlClusterMoveParams *)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - LevelControl::Commands::Move::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.moveMode = static_cast>(params.moveMode.unsignedCharValue); - if (params.rate == nil) { - request.rate.SetNull(); - } else { - auto & nonNullValue_0 = request.rate.SetNonNull(); - nonNullValue_0 = params.rate.unsignedCharValue; - } - request.optionsMask = static_cast>(params.optionsMask.unsignedCharValue); - request.optionsOverride = static_cast>(params.optionsOverride.unsignedCharValue); + if (params == nil) { + params = [[MTRLevelControlClusterMoveParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = LevelControl::Commands::Move::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} - (void)stepWithParams:(MTRLevelControlClusterStepParams *)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - LevelControl::Commands::Step::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.stepMode = static_cast>(params.stepMode.unsignedCharValue); - request.stepSize = params.stepSize.unsignedCharValue; - if (params.transitionTime == nil) { - request.transitionTime.SetNull(); - } else { - auto & nonNullValue_0 = request.transitionTime.SetNonNull(); - nonNullValue_0 = params.transitionTime.unsignedShortValue; - } - request.optionsMask = static_cast>(params.optionsMask.unsignedCharValue); - request.optionsOverride = static_cast>(params.optionsOverride.unsignedCharValue); + if (params == nil) { + params = [[MTRLevelControlClusterStepParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = LevelControl::Commands::Step::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} - (void)stopWithParams:(MTRLevelControlClusterStopParams *)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - LevelControl::Commands::Stop::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.optionsMask = static_cast>(params.optionsMask.unsignedCharValue); - request.optionsOverride = static_cast>(params.optionsOverride.unsignedCharValue); + if (params == nil) { + params = [[MTRLevelControlClusterStopParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = LevelControl::Commands::Stop::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} - (void)moveToLevelWithOnOffWithParams:(MTRLevelControlClusterMoveToLevelWithOnOffParams *)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - LevelControl::Commands::MoveToLevelWithOnOff::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.level = params.level.unsignedCharValue; - if (params.transitionTime == nil) { - request.transitionTime.SetNull(); - } else { - auto & nonNullValue_0 = request.transitionTime.SetNonNull(); - nonNullValue_0 = params.transitionTime.unsignedShortValue; - } - request.optionsMask = static_cast>(params.optionsMask.unsignedCharValue); - request.optionsOverride = static_cast>(params.optionsOverride.unsignedCharValue); + if (params == nil) { + params = [[MTRLevelControlClusterMoveToLevelWithOnOffParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = LevelControl::Commands::MoveToLevelWithOnOff::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} - (void)moveWithOnOffWithParams:(MTRLevelControlClusterMoveWithOnOffParams *)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - LevelControl::Commands::MoveWithOnOff::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.moveMode = static_cast>(params.moveMode.unsignedCharValue); - if (params.rate == nil) { - request.rate.SetNull(); - } else { - auto & nonNullValue_0 = request.rate.SetNonNull(); - nonNullValue_0 = params.rate.unsignedCharValue; - } - request.optionsMask = static_cast>(params.optionsMask.unsignedCharValue); - request.optionsOverride = static_cast>(params.optionsOverride.unsignedCharValue); + if (params == nil) { + params = [[MTRLevelControlClusterMoveWithOnOffParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = LevelControl::Commands::MoveWithOnOff::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} - (void)stepWithOnOffWithParams:(MTRLevelControlClusterStepWithOnOffParams *)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - LevelControl::Commands::StepWithOnOff::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.stepMode = static_cast>(params.stepMode.unsignedCharValue); - request.stepSize = params.stepSize.unsignedCharValue; - if (params.transitionTime == nil) { - request.transitionTime.SetNull(); - } else { - auto & nonNullValue_0 = request.transitionTime.SetNonNull(); - nonNullValue_0 = params.transitionTime.unsignedShortValue; - } - request.optionsMask = static_cast>(params.optionsMask.unsignedCharValue); - request.optionsOverride = static_cast>(params.optionsOverride.unsignedCharValue); + if (params == nil) { + params = [[MTRLevelControlClusterStepWithOnOffParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = LevelControl::Commands::StepWithOnOff::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} - (void)stopWithOnOffWithParams:(MTRLevelControlClusterStopWithOnOffParams *)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - LevelControl::Commands::StopWithOnOff::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.optionsMask = static_cast>(params.optionsMask.unsignedCharValue); - request.optionsOverride = static_cast>(params.optionsOverride.unsignedCharValue); + if (params == nil) { + params = [[MTRLevelControlClusterStopWithOnOffParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = LevelControl::Commands::StopWithOnOff::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} - (void)moveToClosestFrequencyWithParams:(MTRLevelControlClusterMoveToClosestFrequencyParams *)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - LevelControl::Commands::MoveToClosestFrequency::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.frequency = params.frequency.unsignedShortValue; + if (params == nil) { + params = [[MTRLevelControlClusterMoveToClosestFrequencyParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = LevelControl::Commands::MoveToClosestFrequency::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; } - (void)readAttributeCurrentLevelWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -10881,463 +10408,291 @@ - (instancetype)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)en - (void)instantActionWithParams:(MTRActionsClusterInstantActionParams *)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - Actions::Commands::InstantAction::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.actionID = params.actionID.unsignedShortValue; - if (params.invokeID != nil) { - auto & definedValue_0 = request.invokeID.Emplace(); - definedValue_0 = params.invokeID.unsignedIntValue; - } + if (params == nil) { + params = [[MTRActionsClusterInstantActionParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = Actions::Commands::InstantAction::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} - (void)instantActionWithTransitionWithParams:(MTRActionsClusterInstantActionWithTransitionParams *)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - Actions::Commands::InstantActionWithTransition::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.actionID = params.actionID.unsignedShortValue; - if (params.invokeID != nil) { - auto & definedValue_0 = request.invokeID.Emplace(); - definedValue_0 = params.invokeID.unsignedIntValue; - } - request.transitionTime = params.transitionTime.unsignedShortValue; + if (params == nil) { + params = [[MTRActionsClusterInstantActionWithTransitionParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = Actions::Commands::InstantActionWithTransition::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} - (void)startActionWithParams:(MTRActionsClusterStartActionParams *)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - Actions::Commands::StartAction::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.actionID = params.actionID.unsignedShortValue; - if (params.invokeID != nil) { - auto & definedValue_0 = request.invokeID.Emplace(); - definedValue_0 = params.invokeID.unsignedIntValue; - } + if (params == nil) { + params = [[MTRActionsClusterStartActionParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = Actions::Commands::StartAction::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} - (void)startActionWithDurationWithParams:(MTRActionsClusterStartActionWithDurationParams *)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - Actions::Commands::StartActionWithDuration::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.actionID = params.actionID.unsignedShortValue; - if (params.invokeID != nil) { - auto & definedValue_0 = request.invokeID.Emplace(); - definedValue_0 = params.invokeID.unsignedIntValue; - } - request.duration = params.duration.unsignedIntValue; + if (params == nil) { + params = [[MTRActionsClusterStartActionWithDurationParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = Actions::Commands::StartActionWithDuration::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} - (void)stopActionWithParams:(MTRActionsClusterStopActionParams *)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - Actions::Commands::StopAction::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.actionID = params.actionID.unsignedShortValue; - if (params.invokeID != nil) { - auto & definedValue_0 = request.invokeID.Emplace(); - definedValue_0 = params.invokeID.unsignedIntValue; - } + if (params == nil) { + params = [[MTRActionsClusterStopActionParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = Actions::Commands::StopAction::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} - (void)pauseActionWithParams:(MTRActionsClusterPauseActionParams *)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - Actions::Commands::PauseAction::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.actionID = params.actionID.unsignedShortValue; - if (params.invokeID != nil) { - auto & definedValue_0 = request.invokeID.Emplace(); - definedValue_0 = params.invokeID.unsignedIntValue; - } + if (params == nil) { + params = [[MTRActionsClusterPauseActionParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = Actions::Commands::PauseAction::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} - (void)pauseActionWithDurationWithParams:(MTRActionsClusterPauseActionWithDurationParams *)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - Actions::Commands::PauseActionWithDuration::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.actionID = params.actionID.unsignedShortValue; - if (params.invokeID != nil) { - auto & definedValue_0 = request.invokeID.Emplace(); - definedValue_0 = params.invokeID.unsignedIntValue; - } - request.duration = params.duration.unsignedIntValue; + if (params == nil) { + params = [[MTRActionsClusterPauseActionWithDurationParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = Actions::Commands::PauseActionWithDuration::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} - (void)resumeActionWithParams:(MTRActionsClusterResumeActionParams *)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - Actions::Commands::ResumeAction::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.actionID = params.actionID.unsignedShortValue; - if (params.invokeID != nil) { - auto & definedValue_0 = request.invokeID.Emplace(); - definedValue_0 = params.invokeID.unsignedIntValue; - } + if (params == nil) { + params = [[MTRActionsClusterResumeActionParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = Actions::Commands::ResumeAction::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} - (void)enableActionWithParams:(MTRActionsClusterEnableActionParams *)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - Actions::Commands::EnableAction::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.actionID = params.actionID.unsignedShortValue; - if (params.invokeID != nil) { - auto & definedValue_0 = request.invokeID.Emplace(); - definedValue_0 = params.invokeID.unsignedIntValue; - } + if (params == nil) { + params = [[MTRActionsClusterEnableActionParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = Actions::Commands::EnableAction::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} - (void)enableActionWithDurationWithParams:(MTRActionsClusterEnableActionWithDurationParams *)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - Actions::Commands::EnableActionWithDuration::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.actionID = params.actionID.unsignedShortValue; - if (params.invokeID != nil) { - auto & definedValue_0 = request.invokeID.Emplace(); - definedValue_0 = params.invokeID.unsignedIntValue; - } - request.duration = params.duration.unsignedIntValue; + if (params == nil) { + params = [[MTRActionsClusterEnableActionWithDurationParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = Actions::Commands::EnableActionWithDuration::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} - (void)disableActionWithParams:(MTRActionsClusterDisableActionParams *)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - Actions::Commands::DisableAction::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.actionID = params.actionID.unsignedShortValue; - if (params.invokeID != nil) { - auto & definedValue_0 = request.invokeID.Emplace(); - definedValue_0 = params.invokeID.unsignedIntValue; - } + if (params == nil) { + params = [[MTRActionsClusterDisableActionParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = Actions::Commands::DisableAction::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} - (void)disableActionWithDurationWithParams:(MTRActionsClusterDisableActionWithDurationParams *)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - Actions::Commands::DisableActionWithDuration::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.actionID = params.actionID.unsignedShortValue; - if (params.invokeID != nil) { - auto & definedValue_0 = request.invokeID.Emplace(); - definedValue_0 = params.invokeID.unsignedIntValue; - } - request.duration = params.duration.unsignedIntValue; + if (params == nil) { + params = [[MTRActionsClusterDisableActionWithDurationParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = Actions::Commands::DisableActionWithDuration::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; } - (void)readAttributeActionListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion @@ -12056,35 +11411,27 @@ - (void)mfgSpecificPingWithCompletion:(MTRStatusCompletion)completion } - (void)mfgSpecificPingWithParams:(MTRBasicClusterMfgSpecificPingParams * _Nullable)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - BasicInformation::Commands::MfgSpecificPing::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } + if (params == nil) { + params = [[MTRBasicClusterMfgSpecificPingParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = BasicInformation::Commands::MfgSpecificPing::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; } - (void)readAttributeDataModelRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -14156,140 +13503,75 @@ - (instancetype)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)en - (void)queryImageWithParams:(MTROTASoftwareUpdateProviderClusterQueryImageParams *)params completion:(void (^)(MTROTASoftwareUpdateProviderClusterQueryImageResponseParams * _Nullable data, NSError * _Nullable error))completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTROTASoftwareUpdateProviderClusterQueryImageResponseCallbackBridge(self.callbackQueue, - completion, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, OTASoftwareUpdateProviderClusterQueryImageResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - OtaSoftwareUpdateProvider::Commands::QueryImage::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.vendorID = static_cast>(params.vendorID.unsignedShortValue); - request.productID = params.productID.unsignedShortValue; - request.softwareVersion = params.softwareVersion.unsignedIntValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (params.protocolsSupported.count != 0) { - auto * listHolder_0 = new ListHolder(params.protocolsSupported.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < params.protocolsSupported.count; ++i_0) { - if (![params.protocolsSupported[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) params.protocolsSupported[i_0]; - listHolder_0->mList[i_0] = static_castmList[i_0])>>(element_0.unsignedCharValue); - } - request.protocolsSupported = ListType_0(listHolder_0->mList, params.protocolsSupported.count); - } else { - request.protocolsSupported = ListType_0(); - } - } - if (params.hardwareVersion != nil) { - auto & definedValue_0 = request.hardwareVersion.Emplace(); - definedValue_0 = params.hardwareVersion.unsignedShortValue; - } - if (params.location != nil) { - auto & definedValue_0 = request.location.Emplace(); - definedValue_0 = AsCharSpan(params.location); - } - if (params.requestorCanConsent != nil) { - auto & definedValue_0 = request.requestorCanConsent.Emplace(); - definedValue_0 = params.requestorCanConsent.boolValue; - } - if (params.metadataForProvider != nil) { - auto & definedValue_0 = request.metadataForProvider.Emplace(); - definedValue_0 = AsByteSpan(params.metadataForProvider); - } + if (params == nil) { + params = [[MTROTASoftwareUpdateProviderClusterQueryImageParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = OtaSoftwareUpdateProvider::Commands::QueryImage::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTROTASoftwareUpdateProviderClusterQueryImageResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} - (void)applyUpdateRequestWithParams:(MTROTASoftwareUpdateProviderClusterApplyUpdateRequestParams *)params completion:(void (^)(MTROTASoftwareUpdateProviderClusterApplyUpdateResponseParams * _Nullable data, NSError * _Nullable error))completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTROTASoftwareUpdateProviderClusterApplyUpdateResponseCallbackBridge(self.callbackQueue, - completion, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, OTASoftwareUpdateProviderClusterApplyUpdateResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - OtaSoftwareUpdateProvider::Commands::ApplyUpdateRequest::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.updateToken = AsByteSpan(params.updateToken); - request.newVersion = params.newVersion.unsignedIntValue; + if (params == nil) { + params = [[MTROTASoftwareUpdateProviderClusterApplyUpdateRequestParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = OtaSoftwareUpdateProvider::Commands::ApplyUpdateRequest::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTROTASoftwareUpdateProviderClusterApplyUpdateResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} - (void)notifyUpdateAppliedWithParams:(MTROTASoftwareUpdateProviderClusterNotifyUpdateAppliedParams *)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - OtaSoftwareUpdateProvider::Commands::NotifyUpdateApplied::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.updateToken = AsByteSpan(params.updateToken); - request.softwareVersion = params.softwareVersion.unsignedIntValue; + if (params == nil) { + params = [[MTROTASoftwareUpdateProviderClusterNotifyUpdateAppliedParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = OtaSoftwareUpdateProvider::Commands::NotifyUpdateApplied::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; } - (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion @@ -14749,43 +14031,27 @@ - (instancetype)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)en - (void)announceOTAProviderWithParams:(MTROTASoftwareUpdateRequestorClusterAnnounceOTAProviderParams *)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - OtaSoftwareUpdateRequestor::Commands::AnnounceOTAProvider::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.providerNodeID = params.providerNodeID.unsignedLongLongValue; - request.vendorID = static_cast>(params.vendorID.unsignedShortValue); - request.announcementReason = static_cast>(params.announcementReason.unsignedCharValue); - if (params.metadataForNode != nil) { - auto & definedValue_0 = request.metadataForNode.Emplace(); - definedValue_0 = AsByteSpan(params.metadataForNode); - } - request.endpoint = params.endpoint.unsignedShortValue; + if (params == nil) { + params = [[MTROTASoftwareUpdateRequestorClusterAnnounceOTAProviderParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = OtaSoftwareUpdateRequestor::Commands::AnnounceOTAProvider::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; } - (void)readAttributeDefaultOTAProvidersWithParams:(MTRReadParams * _Nullable)params completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion @@ -20716,101 +19982,79 @@ - (instancetype)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)en - (void)armFailSafeWithParams:(MTRGeneralCommissioningClusterArmFailSafeParams *)params completion:(void (^)(MTRGeneralCommissioningClusterArmFailSafeResponseParams * _Nullable data, NSError * _Nullable error))completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRGeneralCommissioningClusterArmFailSafeResponseCallbackBridge(self.callbackQueue, - completion, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, GeneralCommissioningClusterArmFailSafeResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - GeneralCommissioning::Commands::ArmFailSafe::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.expiryLengthSeconds = params.expiryLengthSeconds.unsignedShortValue; - request.breadcrumb = params.breadcrumb.unsignedLongLongValue; + if (params == nil) { + params = [[MTRGeneralCommissioningClusterArmFailSafeParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = GeneralCommissioning::Commands::ArmFailSafe::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRGeneralCommissioningClusterArmFailSafeResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} - (void)setRegulatoryConfigWithParams:(MTRGeneralCommissioningClusterSetRegulatoryConfigParams *)params completion:(void (^)(MTRGeneralCommissioningClusterSetRegulatoryConfigResponseParams * _Nullable data, NSError * _Nullable error))completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRGeneralCommissioningClusterSetRegulatoryConfigResponseCallbackBridge(self.callbackQueue, - completion, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, GeneralCommissioningClusterSetRegulatoryConfigResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - GeneralCommissioning::Commands::SetRegulatoryConfig::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.newRegulatoryConfig = static_cast>(params.newRegulatoryConfig.unsignedCharValue); - request.countryCode = AsCharSpan(params.countryCode); - request.breadcrumb = params.breadcrumb.unsignedLongLongValue; + if (params == nil) { + params = [[MTRGeneralCommissioningClusterSetRegulatoryConfigParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = GeneralCommissioning::Commands::SetRegulatoryConfig::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRGeneralCommissioningClusterSetRegulatoryConfigResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} - (void)commissioningCompleteWithCompletion:(void (^)(MTRGeneralCommissioningClusterCommissioningCompleteResponseParams * _Nullable data, NSError * _Nullable error))completion { [self commissioningCompleteWithParams:nil completion:completion]; } - (void)commissioningCompleteWithParams:(MTRGeneralCommissioningClusterCommissioningCompleteParams * _Nullable)params completion:(void (^)(MTRGeneralCommissioningClusterCommissioningCompleteResponseParams * _Nullable data, NSError * _Nullable error))completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRGeneralCommissioningClusterCommissioningCompleteResponseCallbackBridge(self.callbackQueue, - completion, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, GeneralCommissioningClusterCommissioningCompleteResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - GeneralCommissioning::Commands::CommissioningComplete::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } + if (params == nil) { + params = [[MTRGeneralCommissioningClusterCommissioningCompleteParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = GeneralCommissioning::Commands::CommissioningComplete::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRGeneralCommissioningClusterCommissioningCompleteResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; } - (void)readAttributeBreadcrumbWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -21681,224 +20925,147 @@ - (instancetype)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)en - (void)scanNetworksWithParams:(MTRNetworkCommissioningClusterScanNetworksParams * _Nullable)params completion:(void (^)(MTRNetworkCommissioningClusterScanNetworksResponseParams * _Nullable data, NSError * _Nullable error))completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRNetworkCommissioningClusterScanNetworksResponseCallbackBridge(self.callbackQueue, - completion, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, NetworkCommissioningClusterScanNetworksResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - NetworkCommissioning::Commands::ScanNetworks::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - if (params != nil) { - if (params.ssid != nil) { - auto & definedValue_0 = request.ssid.Emplace(); - if (params.ssid == nil) { - definedValue_0.SetNull(); - } else { - auto & nonNullValue_1 = definedValue_0.SetNonNull(); - nonNullValue_1 = AsByteSpan(params.ssid); - } - } - if (params.breadcrumb != nil) { - auto & definedValue_0 = request.breadcrumb.Emplace(); - definedValue_0 = params.breadcrumb.unsignedLongLongValue; - } - } + if (params == nil) { + params = [[MTRNetworkCommissioningClusterScanNetworksParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = NetworkCommissioning::Commands::ScanNetworks::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRNetworkCommissioningClusterScanNetworksResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} - (void)addOrUpdateWiFiNetworkWithParams:(MTRNetworkCommissioningClusterAddOrUpdateWiFiNetworkParams *)params completion:(void (^)(MTRNetworkCommissioningClusterNetworkConfigResponseParams * _Nullable data, NSError * _Nullable error))completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRNetworkCommissioningClusterNetworkConfigResponseCallbackBridge(self.callbackQueue, - completion, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, NetworkCommissioningClusterNetworkConfigResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - NetworkCommissioning::Commands::AddOrUpdateWiFiNetwork::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.ssid = AsByteSpan(params.ssid); - request.credentials = AsByteSpan(params.credentials); - if (params.breadcrumb != nil) { - auto & definedValue_0 = request.breadcrumb.Emplace(); - definedValue_0 = params.breadcrumb.unsignedLongLongValue; - } + if (params == nil) { + params = [[MTRNetworkCommissioningClusterAddOrUpdateWiFiNetworkParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = NetworkCommissioning::Commands::AddOrUpdateWiFiNetwork::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRNetworkCommissioningClusterNetworkConfigResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} - (void)addOrUpdateThreadNetworkWithParams:(MTRNetworkCommissioningClusterAddOrUpdateThreadNetworkParams *)params completion:(void (^)(MTRNetworkCommissioningClusterNetworkConfigResponseParams * _Nullable data, NSError * _Nullable error))completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRNetworkCommissioningClusterNetworkConfigResponseCallbackBridge(self.callbackQueue, - completion, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, NetworkCommissioningClusterNetworkConfigResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - NetworkCommissioning::Commands::AddOrUpdateThreadNetwork::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.operationalDataset = AsByteSpan(params.operationalDataset); - if (params.breadcrumb != nil) { - auto & definedValue_0 = request.breadcrumb.Emplace(); - definedValue_0 = params.breadcrumb.unsignedLongLongValue; - } + if (params == nil) { + params = [[MTRNetworkCommissioningClusterAddOrUpdateThreadNetworkParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = NetworkCommissioning::Commands::AddOrUpdateThreadNetwork::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRNetworkCommissioningClusterNetworkConfigResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} - (void)removeNetworkWithParams:(MTRNetworkCommissioningClusterRemoveNetworkParams *)params completion:(void (^)(MTRNetworkCommissioningClusterNetworkConfigResponseParams * _Nullable data, NSError * _Nullable error))completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRNetworkCommissioningClusterNetworkConfigResponseCallbackBridge(self.callbackQueue, - completion, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, NetworkCommissioningClusterNetworkConfigResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - NetworkCommissioning::Commands::RemoveNetwork::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.networkID = AsByteSpan(params.networkID); - if (params.breadcrumb != nil) { - auto & definedValue_0 = request.breadcrumb.Emplace(); - definedValue_0 = params.breadcrumb.unsignedLongLongValue; - } + if (params == nil) { + params = [[MTRNetworkCommissioningClusterRemoveNetworkParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = NetworkCommissioning::Commands::RemoveNetwork::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRNetworkCommissioningClusterNetworkConfigResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} - (void)connectNetworkWithParams:(MTRNetworkCommissioningClusterConnectNetworkParams *)params completion:(void (^)(MTRNetworkCommissioningClusterConnectNetworkResponseParams * _Nullable data, NSError * _Nullable error))completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRNetworkCommissioningClusterConnectNetworkResponseCallbackBridge(self.callbackQueue, - completion, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, NetworkCommissioningClusterConnectNetworkResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - NetworkCommissioning::Commands::ConnectNetwork::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.networkID = AsByteSpan(params.networkID); - if (params.breadcrumb != nil) { - auto & definedValue_0 = request.breadcrumb.Emplace(); - definedValue_0 = params.breadcrumb.unsignedLongLongValue; - } + if (params == nil) { + params = [[MTRNetworkCommissioningClusterConnectNetworkParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = NetworkCommissioning::Commands::ConnectNetwork::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRNetworkCommissioningClusterConnectNetworkResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} - (void)reorderNetworkWithParams:(MTRNetworkCommissioningClusterReorderNetworkParams *)params completion:(void (^)(MTRNetworkCommissioningClusterNetworkConfigResponseParams * _Nullable data, NSError * _Nullable error))completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRNetworkCommissioningClusterNetworkConfigResponseCallbackBridge(self.callbackQueue, - completion, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, NetworkCommissioningClusterNetworkConfigResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - NetworkCommissioning::Commands::ReorderNetwork::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.networkID = AsByteSpan(params.networkID); - request.networkIndex = params.networkIndex.unsignedCharValue; - if (params.breadcrumb != nil) { - auto & definedValue_0 = request.breadcrumb.Emplace(); - definedValue_0 = params.breadcrumb.unsignedLongLongValue; - } + if (params == nil) { + params = [[MTRNetworkCommissioningClusterReorderNetworkParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = NetworkCommissioning::Commands::ReorderNetwork::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRNetworkCommissioningClusterNetworkConfigResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; } - (void)readAttributeMaxNetworksWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -23008,38 +22175,27 @@ - (instancetype)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)en - (void)retrieveLogsRequestWithParams:(MTRDiagnosticLogsClusterRetrieveLogsRequestParams *)params completion:(void (^)(MTRDiagnosticLogsClusterRetrieveLogsResponseParams * _Nullable data, NSError * _Nullable error))completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRDiagnosticLogsClusterRetrieveLogsResponseCallbackBridge(self.callbackQueue, - completion, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, DiagnosticLogsClusterRetrieveLogsResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - DiagnosticLogs::Commands::RetrieveLogsRequest::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.intent = static_cast>(params.intent.unsignedCharValue); - request.requestedProtocol = static_cast>(params.requestedProtocol.unsignedCharValue); - if (params.transferFileDesignator != nil) { - auto & definedValue_0 = request.transferFileDesignator.Emplace(); - definedValue_0 = AsCharSpan(params.transferFileDesignator); - } + if (params == nil) { + params = [[MTRDiagnosticLogsClusterRetrieveLogsRequestParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = DiagnosticLogs::Commands::RetrieveLogsRequest::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRDiagnosticLogsClusterRetrieveLogsResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; } - (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion @@ -23483,37 +22639,27 @@ - (instancetype)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)en - (void)testEventTriggerWithParams:(MTRGeneralDiagnosticsClusterTestEventTriggerParams *)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - GeneralDiagnostics::Commands::TestEventTrigger::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.enableKey = AsByteSpan(params.enableKey); - request.eventTrigger = params.eventTrigger.unsignedLongLongValue; + if (params == nil) { + params = [[MTRGeneralDiagnosticsClusterTestEventTriggerParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = GeneralDiagnostics::Commands::TestEventTrigger::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; } - (void)readAttributeNetworkInterfacesWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion @@ -24653,35 +23799,27 @@ - (void)resetWatermarksWithCompletion:(MTRStatusCompletion)completion } - (void)resetWatermarksWithParams:(MTRSoftwareDiagnosticsClusterResetWatermarksParams * _Nullable)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - SoftwareDiagnostics::Commands::ResetWatermarks::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } + if (params == nil) { + params = [[MTRSoftwareDiagnosticsClusterResetWatermarksParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = SoftwareDiagnostics::Commands::ResetWatermarks::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; } - (void)readAttributeThreadMetricsWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion @@ -25422,35 +24560,27 @@ - (void)resetCountsWithCompletion:(MTRStatusCompletion)completion } - (void)resetCountsWithParams:(MTRThreadNetworkDiagnosticsClusterResetCountsParams * _Nullable)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - ThreadNetworkDiagnostics::Commands::ResetCounts::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } + if (params == nil) { + params = [[MTRThreadNetworkDiagnosticsClusterResetCountsParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = ThreadNetworkDiagnostics::Commands::ResetCounts::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; } - (void)readAttributeChannelWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -30498,35 +29628,27 @@ - (void)resetCountsWithCompletion:(MTRStatusCompletion)completion } - (void)resetCountsWithParams:(MTRWiFiNetworkDiagnosticsClusterResetCountsParams * _Nullable)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - WiFiNetworkDiagnostics::Commands::ResetCounts::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } + if (params == nil) { + params = [[MTRWiFiNetworkDiagnosticsClusterResetCountsParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = WiFiNetworkDiagnostics::Commands::ResetCounts::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; } - (void)readAttributeBSSIDWithCompletion:(void (^)(NSData * _Nullable value, NSError * _Nullable error))completion @@ -31924,35 +31046,27 @@ - (void)resetCountsWithCompletion:(MTRStatusCompletion)completion } - (void)resetCountsWithParams:(MTREthernetNetworkDiagnosticsClusterResetCountsParams * _Nullable)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - EthernetNetworkDiagnostics::Commands::ResetCounts::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } + if (params == nil) { + params = [[MTREthernetNetworkDiagnosticsClusterResetCountsParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = EthernetNetworkDiagnostics::Commands::ResetCounts::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; } - (void)readAttributePHYRateWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -33054,239 +32168,123 @@ - (instancetype)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)en - (void)setUTCTimeWithParams:(MTRTimeSynchronizationClusterSetUTCTimeParams *)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - TimeSynchronization::Commands::SetUTCTime::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.UTCTime = params.utcTime.unsignedLongLongValue; - request.granularity = static_cast>(params.granularity.unsignedCharValue); - if (params.timeSource != nil) { - auto & definedValue_0 = request.timeSource.Emplace(); - definedValue_0 = static_cast>(params.timeSource.unsignedCharValue); - } + if (params == nil) { + params = [[MTRTimeSynchronizationClusterSetUTCTimeParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = TimeSynchronization::Commands::SetUTCTime::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} - (void)setTrustedTimeSourceWithParams:(MTRTimeSynchronizationClusterSetTrustedTimeSourceParams *)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - TimeSynchronization::Commands::SetTrustedTimeSource::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - if (params.trustedTimeSource == nil) { - request.trustedTimeSource.SetNull(); - } else { - auto & nonNullValue_0 = request.trustedTimeSource.SetNonNull(); - nonNullValue_0.nodeID = params.trustedTimeSource.nodeID.unsignedLongLongValue; - nonNullValue_0.endpoint = params.trustedTimeSource.endpoint.unsignedShortValue; - } + if (params == nil) { + params = [[MTRTimeSynchronizationClusterSetTrustedTimeSourceParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = TimeSynchronization::Commands::SetTrustedTimeSource::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} - (void)setTimeZoneWithParams:(MTRTimeSynchronizationClusterSetTimeZoneParams *)params completion:(void (^)(MTRTimeSynchronizationClusterSetTimeZoneResponseParams * _Nullable data, NSError * _Nullable error))completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRTimeSynchronizationClusterSetTimeZoneResponseCallbackBridge(self.callbackQueue, - completion, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, TimeSynchronizationClusterSetTimeZoneResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - TimeSynchronization::Commands::SetTimeZone::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (params.timeZone.count != 0) { - auto * listHolder_0 = new ListHolder(params.timeZone.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < params.timeZone.count; ++i_0) { - if (![params.timeZone[i_0] isKindOfClass:[MTRTimeSynchronizationClusterTimeZoneStruct class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (MTRTimeSynchronizationClusterTimeZoneStruct *) params.timeZone[i_0]; - listHolder_0->mList[i_0].offset = element_0.offset.intValue; - listHolder_0->mList[i_0].validAt = element_0.validAt.unsignedLongLongValue; - if (element_0.name != nil) { - auto & definedValue_2 = listHolder_0->mList[i_0].name.Emplace(); - definedValue_2 = AsCharSpan(element_0.name); - } - } - request.timeZone = ListType_0(listHolder_0->mList, params.timeZone.count); - } else { - request.timeZone = ListType_0(); - } - } + if (params == nil) { + params = [[MTRTimeSynchronizationClusterSetTimeZoneParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = TimeSynchronization::Commands::SetTimeZone::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRTimeSynchronizationClusterSetTimeZoneResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} - (void)setDSTOffsetWithParams:(MTRTimeSynchronizationClusterSetDSTOffsetParams *)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - TimeSynchronization::Commands::SetDSTOffset::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (params.dstOffset.count != 0) { - auto * listHolder_0 = new ListHolder(params.dstOffset.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < params.dstOffset.count; ++i_0) { - if (![params.dstOffset[i_0] isKindOfClass:[MTRTimeSynchronizationClusterDSTOffsetStruct class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (MTRTimeSynchronizationClusterDSTOffsetStruct *) params.dstOffset[i_0]; - listHolder_0->mList[i_0].offset = element_0.offset.intValue; - listHolder_0->mList[i_0].validStarting = element_0.validStarting.unsignedLongLongValue; - if (element_0.validUntil == nil) { - listHolder_0->mList[i_0].validUntil.SetNull(); - } else { - auto & nonNullValue_2 = listHolder_0->mList[i_0].validUntil.SetNonNull(); - nonNullValue_2 = element_0.validUntil.unsignedLongLongValue; - } - } - request.DSTOffset = ListType_0(listHolder_0->mList, params.dstOffset.count); - } else { - request.DSTOffset = ListType_0(); - } - } + if (params == nil) { + params = [[MTRTimeSynchronizationClusterSetDSTOffsetParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = TimeSynchronization::Commands::SetDSTOffset::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} - (void)setDefaultNTPWithParams:(MTRTimeSynchronizationClusterSetDefaultNTPParams *)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - TimeSynchronization::Commands::SetDefaultNTP::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - if (params.defaultNTP == nil) { - request.defaultNTP.SetNull(); - } else { - auto & nonNullValue_0 = request.defaultNTP.SetNonNull(); - nonNullValue_0 = AsCharSpan(params.defaultNTP); - } + if (params == nil) { + params = [[MTRTimeSynchronizationClusterSetDefaultNTPParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = TimeSynchronization::Commands::SetDefaultNTP::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; } - (void)readAttributeUTCTimeWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -36286,120 +35284,88 @@ - (instancetype)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)en - (void)openCommissioningWindowWithParams:(MTRAdministratorCommissioningClusterOpenCommissioningWindowParams *)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - AdministratorCommissioning::Commands::OpenCommissioningWindow::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - if (!timedInvokeTimeoutMs.HasValue()) { - timedInvokeTimeoutMs.SetValue(10000); - } - request.commissioningTimeout = params.commissioningTimeout.unsignedShortValue; - request.PAKEPasscodeVerifier = AsByteSpan(params.pakePasscodeVerifier); - request.discriminator = params.discriminator.unsignedShortValue; - request.iterations = params.iterations.unsignedIntValue; - request.salt = AsByteSpan(params.salt); + if (params == nil) { + params = [[MTRAdministratorCommissioningClusterOpenCommissioningWindowParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + if (timedInvokeTimeoutMs == nil) { + timedInvokeTimeoutMs = @(10000); + } + using RequestType = AdministratorCommissioning::Commands::OpenCommissioningWindow::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} - (void)openBasicCommissioningWindowWithParams:(MTRAdministratorCommissioningClusterOpenBasicCommissioningWindowParams *)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - if (!timedInvokeTimeoutMs.HasValue()) { - timedInvokeTimeoutMs.SetValue(10000); - } - request.commissioningTimeout = params.commissioningTimeout.unsignedShortValue; + if (params == nil) { + params = [[MTRAdministratorCommissioningClusterOpenBasicCommissioningWindowParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + if (timedInvokeTimeoutMs == nil) { + timedInvokeTimeoutMs = @(10000); + } + using RequestType = AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} - (void)revokeCommissioningWithCompletion:(MTRStatusCompletion)completion { [self revokeCommissioningWithParams:nil completion:completion]; } - (void)revokeCommissioningWithParams:(MTRAdministratorCommissioningClusterRevokeCommissioningParams * _Nullable)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - AdministratorCommissioning::Commands::RevokeCommissioning::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - if (!timedInvokeTimeoutMs.HasValue()) { - timedInvokeTimeoutMs.SetValue(10000); - } + if (params == nil) { + params = [[MTRAdministratorCommissioningClusterRevokeCommissioningParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + if (timedInvokeTimeoutMs == nil) { + timedInvokeTimeoutMs = @(10000); + } + + using RequestType = AdministratorCommissioning::Commands::RevokeCommissioning::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; } - (void)readAttributeWindowStatusWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -37073,268 +36039,195 @@ - (instancetype)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)en - (void)attestationRequestWithParams:(MTROperationalCredentialsClusterAttestationRequestParams *)params completion:(void (^)(MTROperationalCredentialsClusterAttestationResponseParams * _Nullable data, NSError * _Nullable error))completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTROperationalCredentialsClusterAttestationResponseCallbackBridge(self.callbackQueue, - completion, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, OperationalCredentialsClusterAttestationResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - OperationalCredentials::Commands::AttestationRequest::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.attestationNonce = AsByteSpan(params.attestationNonce); + if (params == nil) { + params = [[MTROperationalCredentialsClusterAttestationRequestParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = OperationalCredentials::Commands::AttestationRequest::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTROperationalCredentialsClusterAttestationResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} - (void)certificateChainRequestWithParams:(MTROperationalCredentialsClusterCertificateChainRequestParams *)params completion:(void (^)(MTROperationalCredentialsClusterCertificateChainResponseParams * _Nullable data, NSError * _Nullable error))completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTROperationalCredentialsClusterCertificateChainResponseCallbackBridge(self.callbackQueue, - completion, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, OperationalCredentialsClusterCertificateChainResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - OperationalCredentials::Commands::CertificateChainRequest::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.certificateType = static_cast>(params.certificateType.unsignedCharValue); + if (params == nil) { + params = [[MTROperationalCredentialsClusterCertificateChainRequestParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = OperationalCredentials::Commands::CertificateChainRequest::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTROperationalCredentialsClusterCertificateChainResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} - (void)CSRRequestWithParams:(MTROperationalCredentialsClusterCSRRequestParams *)params completion:(void (^)(MTROperationalCredentialsClusterCSRResponseParams * _Nullable data, NSError * _Nullable error))completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTROperationalCredentialsClusterCSRResponseCallbackBridge(self.callbackQueue, - completion, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, OperationalCredentialsClusterCSRResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - OperationalCredentials::Commands::CSRRequest::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.CSRNonce = AsByteSpan(params.csrNonce); - if (params.isForUpdateNOC != nil) { - auto & definedValue_0 = request.isForUpdateNOC.Emplace(); - definedValue_0 = params.isForUpdateNOC.boolValue; - } + if (params == nil) { + params = [[MTROperationalCredentialsClusterCSRRequestParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = OperationalCredentials::Commands::CSRRequest::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTROperationalCredentialsClusterCSRResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} - (void)addNOCWithParams:(MTROperationalCredentialsClusterAddNOCParams *)params completion:(void (^)(MTROperationalCredentialsClusterNOCResponseParams * _Nullable data, NSError * _Nullable error))completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTROperationalCredentialsClusterNOCResponseCallbackBridge(self.callbackQueue, - completion, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, OperationalCredentialsClusterNOCResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - OperationalCredentials::Commands::AddNOC::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.NOCValue = AsByteSpan(params.nocValue); - if (params.icacValue != nil) { - auto & definedValue_0 = request.ICACValue.Emplace(); - definedValue_0 = AsByteSpan(params.icacValue); - } - request.IPKValue = AsByteSpan(params.ipkValue); - request.caseAdminSubject = params.caseAdminSubject.unsignedLongLongValue; - request.adminVendorId = static_cast>(params.adminVendorId.unsignedShortValue); + if (params == nil) { + params = [[MTROperationalCredentialsClusterAddNOCParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = OperationalCredentials::Commands::AddNOC::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTROperationalCredentialsClusterNOCResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} - (void)updateNOCWithParams:(MTROperationalCredentialsClusterUpdateNOCParams *)params completion:(void (^)(MTROperationalCredentialsClusterNOCResponseParams * _Nullable data, NSError * _Nullable error))completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTROperationalCredentialsClusterNOCResponseCallbackBridge(self.callbackQueue, - completion, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, OperationalCredentialsClusterNOCResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - OperationalCredentials::Commands::UpdateNOC::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.NOCValue = AsByteSpan(params.nocValue); - if (params.icacValue != nil) { - auto & definedValue_0 = request.ICACValue.Emplace(); - definedValue_0 = AsByteSpan(params.icacValue); - } + if (params == nil) { + params = [[MTROperationalCredentialsClusterUpdateNOCParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = OperationalCredentials::Commands::UpdateNOC::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTROperationalCredentialsClusterNOCResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} - (void)updateFabricLabelWithParams:(MTROperationalCredentialsClusterUpdateFabricLabelParams *)params completion:(void (^)(MTROperationalCredentialsClusterNOCResponseParams * _Nullable data, NSError * _Nullable error))completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTROperationalCredentialsClusterNOCResponseCallbackBridge(self.callbackQueue, - completion, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, OperationalCredentialsClusterNOCResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - OperationalCredentials::Commands::UpdateFabricLabel::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.label = AsCharSpan(params.label); + if (params == nil) { + params = [[MTROperationalCredentialsClusterUpdateFabricLabelParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = OperationalCredentials::Commands::UpdateFabricLabel::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTROperationalCredentialsClusterNOCResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} - (void)removeFabricWithParams:(MTROperationalCredentialsClusterRemoveFabricParams *)params completion:(void (^)(MTROperationalCredentialsClusterNOCResponseParams * _Nullable data, NSError * _Nullable error))completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTROperationalCredentialsClusterNOCResponseCallbackBridge(self.callbackQueue, - completion, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, OperationalCredentialsClusterNOCResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - OperationalCredentials::Commands::RemoveFabric::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.fabricIndex = params.fabricIndex.unsignedCharValue; + if (params == nil) { + params = [[MTROperationalCredentialsClusterRemoveFabricParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = OperationalCredentials::Commands::RemoveFabric::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTROperationalCredentialsClusterNOCResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} - (void)addTrustedRootCertificateWithParams:(MTROperationalCredentialsClusterAddTrustedRootCertificateParams *)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - OperationalCredentials::Commands::AddTrustedRootCertificate::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.rootCACertificate = AsByteSpan(params.rootCACertificate); + if (params == nil) { + params = [[MTROperationalCredentialsClusterAddTrustedRootCertificateParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = OperationalCredentials::Commands::AddTrustedRootCertificate::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; } - (void)readAttributeNOCsWithParams:(MTRReadParams * _Nullable)params completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion @@ -38269,172 +37162,103 @@ - (instancetype)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)en - (void)keySetWriteWithParams:(MTRGroupKeyManagementClusterKeySetWriteParams *)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - GroupKeyManagement::Commands::KeySetWrite::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.groupKeySet.groupKeySetID = params.groupKeySet.groupKeySetID.unsignedShortValue; - request.groupKeySet.groupKeySecurityPolicy = static_cast>(params.groupKeySet.groupKeySecurityPolicy.unsignedCharValue); - if (params.groupKeySet.epochKey0 == nil) { - request.groupKeySet.epochKey0.SetNull(); - } else { - auto & nonNullValue_1 = request.groupKeySet.epochKey0.SetNonNull(); - nonNullValue_1 = AsByteSpan(params.groupKeySet.epochKey0); - } - if (params.groupKeySet.epochStartTime0 == nil) { - request.groupKeySet.epochStartTime0.SetNull(); - } else { - auto & nonNullValue_1 = request.groupKeySet.epochStartTime0.SetNonNull(); - nonNullValue_1 = params.groupKeySet.epochStartTime0.unsignedLongLongValue; - } - if (params.groupKeySet.epochKey1 == nil) { - request.groupKeySet.epochKey1.SetNull(); - } else { - auto & nonNullValue_1 = request.groupKeySet.epochKey1.SetNonNull(); - nonNullValue_1 = AsByteSpan(params.groupKeySet.epochKey1); - } - if (params.groupKeySet.epochStartTime1 == nil) { - request.groupKeySet.epochStartTime1.SetNull(); - } else { - auto & nonNullValue_1 = request.groupKeySet.epochStartTime1.SetNonNull(); - nonNullValue_1 = params.groupKeySet.epochStartTime1.unsignedLongLongValue; - } - if (params.groupKeySet.epochKey2 == nil) { - request.groupKeySet.epochKey2.SetNull(); - } else { - auto & nonNullValue_1 = request.groupKeySet.epochKey2.SetNonNull(); - nonNullValue_1 = AsByteSpan(params.groupKeySet.epochKey2); - } - if (params.groupKeySet.epochStartTime2 == nil) { - request.groupKeySet.epochStartTime2.SetNull(); - } else { - auto & nonNullValue_1 = request.groupKeySet.epochStartTime2.SetNonNull(); - nonNullValue_1 = params.groupKeySet.epochStartTime2.unsignedLongLongValue; - } + if (params == nil) { + params = [[MTRGroupKeyManagementClusterKeySetWriteParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = GroupKeyManagement::Commands::KeySetWrite::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} - (void)keySetReadWithParams:(MTRGroupKeyManagementClusterKeySetReadParams *)params completion:(void (^)(MTRGroupKeyManagementClusterKeySetReadResponseParams * _Nullable data, NSError * _Nullable error))completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRGroupKeyManagementClusterKeySetReadResponseCallbackBridge(self.callbackQueue, - completion, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, GroupKeyManagementClusterKeySetReadResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - GroupKeyManagement::Commands::KeySetRead::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.groupKeySetID = params.groupKeySetID.unsignedShortValue; + if (params == nil) { + params = [[MTRGroupKeyManagementClusterKeySetReadParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = GroupKeyManagement::Commands::KeySetRead::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRGroupKeyManagementClusterKeySetReadResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} - (void)keySetRemoveWithParams:(MTRGroupKeyManagementClusterKeySetRemoveParams *)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - GroupKeyManagement::Commands::KeySetRemove::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.groupKeySetID = params.groupKeySetID.unsignedShortValue; + if (params == nil) { + params = [[MTRGroupKeyManagementClusterKeySetRemoveParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = GroupKeyManagement::Commands::KeySetRemove::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} - (void)keySetReadAllIndicesWithCompletion:(void (^)(MTRGroupKeyManagementClusterKeySetReadAllIndicesResponseParams * _Nullable data, NSError * _Nullable error))completion { [self keySetReadAllIndicesWithParams:nil completion:completion]; } - (void)keySetReadAllIndicesWithParams:(MTRGroupKeyManagementClusterKeySetReadAllIndicesParams * _Nullable)params completion:(void (^)(MTRGroupKeyManagementClusterKeySetReadAllIndicesResponseParams * _Nullable data, NSError * _Nullable error))completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRGroupKeyManagementClusterKeySetReadAllIndicesResponseCallbackBridge(self.callbackQueue, - completion, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, GroupKeyManagementClusterKeySetReadAllIndicesResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - GroupKeyManagement::Commands::KeySetReadAllIndices::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } + if (params == nil) { + params = [[MTRGroupKeyManagementClusterKeySetReadAllIndicesParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = GroupKeyManagement::Commands::KeySetReadAllIndices::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRGroupKeyManagementClusterKeySetReadAllIndicesResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; } - (void)readAttributeGroupKeyMapWithParams:(MTRReadParams * _Nullable)params completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion @@ -40826,114 +39650,79 @@ - (instancetype)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)en - (void)registerClientWithParams:(MTRICDManagementClusterRegisterClientParams *)params completion:(void (^)(MTRICDManagementClusterRegisterClientResponseParams * _Nullable data, NSError * _Nullable error))completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRICDManagementClusterRegisterClientResponseCallbackBridge(self.callbackQueue, - completion, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, ICDManagementClusterRegisterClientResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - IcdManagement::Commands::RegisterClient::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.checkInNodeID = params.checkInNodeID.unsignedLongLongValue; - request.monitoredSubject = params.monitoredSubject.unsignedLongLongValue; - request.key = AsByteSpan(params.key); - if (params.verificationKey != nil) { - auto & definedValue_0 = request.verificationKey.Emplace(); - definedValue_0 = AsByteSpan(params.verificationKey); - } + if (params == nil) { + params = [[MTRICDManagementClusterRegisterClientParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = IcdManagement::Commands::RegisterClient::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRICDManagementClusterRegisterClientResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} - (void)unregisterClientWithParams:(MTRICDManagementClusterUnregisterClientParams *)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - IcdManagement::Commands::UnregisterClient::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.checkInNodeID = params.checkInNodeID.unsignedLongLongValue; - if (params.verificationKey != nil) { - auto & definedValue_0 = request.verificationKey.Emplace(); - definedValue_0 = AsByteSpan(params.verificationKey); - } + if (params == nil) { + params = [[MTRICDManagementClusterUnregisterClientParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = IcdManagement::Commands::UnregisterClient::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} - (void)stayActiveRequestWithCompletion:(MTRStatusCompletion)completion { [self stayActiveRequestWithParams:nil completion:completion]; } - (void)stayActiveRequestWithParams:(MTRICDManagementClusterStayActiveRequestParams * _Nullable)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - IcdManagement::Commands::StayActiveRequest::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } + if (params == nil) { + params = [[MTRICDManagementClusterStayActiveRequestParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = IcdManagement::Commands::StayActiveRequest::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; } - (void)readAttributeIdleModeIntervalWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -41410,36 +40199,27 @@ - (instancetype)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)en - (void)changeToModeWithParams:(MTRModeSelectClusterChangeToModeParams *)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - ModeSelect::Commands::ChangeToMode::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.newMode = params.newMode.unsignedCharValue; + if (params == nil) { + params = [[MTRModeSelectClusterChangeToModeParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = ModeSelect::Commands::ChangeToMode::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; } - (void)readAttributeDescriptionWithCompletion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion @@ -42412,33 +41192,27 @@ - (instancetype)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)en - (void)changeToModeWithParams:(MTRLaundryWasherModeClusterChangeToModeParams *)params completion:(void (^)(MTRLaundryWasherModeClusterChangeToModeResponseParams * _Nullable data, NSError * _Nullable error))completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRLaundryWasherModeClusterChangeToModeResponseCallbackBridge(self.callbackQueue, - completion, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, LaundryWasherModeClusterChangeToModeResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - LaundryWasherMode::Commands::ChangeToMode::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.newMode = params.newMode.unsignedCharValue; + if (params == nil) { + params = [[MTRLaundryWasherModeClusterChangeToModeParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = LaundryWasherMode::Commands::ChangeToMode::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRLaundryWasherModeClusterChangeToModeResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; } - (void)readAttributeSupportedModesWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion @@ -42917,33 +41691,27 @@ - (instancetype)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)en - (void)changeToModeWithParams:(MTRRefrigeratorAndTemperatureControlledCabinetModeClusterChangeToModeParams *)params completion:(void (^)(MTRRefrigeratorAndTemperatureControlledCabinetModeClusterChangeToModeResponseParams * _Nullable data, NSError * _Nullable error))completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRRefrigeratorAndTemperatureControlledCabinetModeClusterChangeToModeResponseCallbackBridge(self.callbackQueue, - completion, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, RefrigeratorAndTemperatureControlledCabinetModeClusterChangeToModeResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - RefrigeratorAndTemperatureControlledCabinetMode::Commands::ChangeToMode::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.newMode = params.newMode.unsignedCharValue; + if (params == nil) { + params = [[MTRRefrigeratorAndTemperatureControlledCabinetModeClusterChangeToModeParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = RefrigeratorAndTemperatureControlledCabinetMode::Commands::ChangeToMode::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRRefrigeratorAndTemperatureControlledCabinetModeClusterChangeToModeResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; } - (void)readAttributeSupportedModesWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion @@ -43891,33 +42659,27 @@ - (instancetype)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)en - (void)changeToModeWithParams:(MTRRVCRunModeClusterChangeToModeParams *)params completion:(void (^)(MTRRVCRunModeClusterChangeToModeResponseParams * _Nullable data, NSError * _Nullable error))completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRRVCRunModeClusterChangeToModeResponseCallbackBridge(self.callbackQueue, - completion, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, RVCRunModeClusterChangeToModeResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - RvcRunMode::Commands::ChangeToMode::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.newMode = params.newMode.unsignedCharValue; + if (params == nil) { + params = [[MTRRVCRunModeClusterChangeToModeParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = RvcRunMode::Commands::ChangeToMode::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRRVCRunModeClusterChangeToModeResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; } - (void)readAttributeSupportedModesWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion @@ -44396,33 +43158,27 @@ - (instancetype)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)en - (void)changeToModeWithParams:(MTRRVCCleanModeClusterChangeToModeParams *)params completion:(void (^)(MTRRVCCleanModeClusterChangeToModeResponseParams * _Nullable data, NSError * _Nullable error))completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRRVCCleanModeClusterChangeToModeResponseCallbackBridge(self.callbackQueue, - completion, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, RVCCleanModeClusterChangeToModeResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - RvcCleanMode::Commands::ChangeToMode::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.newMode = params.newMode.unsignedCharValue; + if (params == nil) { + params = [[MTRRVCCleanModeClusterChangeToModeParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = RvcCleanMode::Commands::ChangeToMode::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRRVCCleanModeClusterChangeToModeResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; } - (void)readAttributeSupportedModesWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion @@ -44901,45 +43657,27 @@ - (instancetype)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)en - (void)setTemperatureWithParams:(MTRTemperatureControlClusterSetTemperatureParams * _Nullable)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - TemperatureControl::Commands::SetTemperature::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - if (params != nil) { - if (params.targetTemperature != nil) { - auto & definedValue_0 = request.targetTemperature.Emplace(); - definedValue_0 = params.targetTemperature.shortValue; - } - if (params.targetTemperatureLevel != nil) { - auto & definedValue_0 = request.targetTemperatureLevel.Emplace(); - definedValue_0 = params.targetTemperatureLevel.unsignedCharValue; - } - } + if (params == nil) { + params = [[MTRTemperatureControlClusterSetTemperatureParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = TemperatureControl::Commands::SetTemperature::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; } - (void)readAttributeTemperatureSetpointWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -45774,33 +44512,27 @@ - (instancetype)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)en - (void)changeToModeWithParams:(MTRDishwasherModeClusterChangeToModeParams *)params completion:(void (^)(MTRDishwasherModeClusterChangeToModeResponseParams * _Nullable data, NSError * _Nullable error))completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRDishwasherModeClusterChangeToModeResponseCallbackBridge(self.callbackQueue, - completion, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, DishwasherModeClusterChangeToModeResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - DishwasherMode::Commands::ChangeToMode::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.newMode = params.newMode.unsignedCharValue; + if (params == nil) { + params = [[MTRDishwasherModeClusterChangeToModeParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = DishwasherMode::Commands::ChangeToMode::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRDishwasherModeClusterChangeToModeResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; } - (void)readAttributeSupportedModesWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion @@ -46565,35 +45297,27 @@ - (void)selfTestRequestWithCompletion:(MTRStatusCompletion)completion } - (void)selfTestRequestWithParams:(MTRSmokeCOAlarmClusterSelfTestRequestParams * _Nullable)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - SmokeCoAlarm::Commands::SelfTestRequest::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } + if (params == nil) { + params = [[MTRSmokeCOAlarmClusterSelfTestRequestParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = SmokeCoAlarm::Commands::SelfTestRequest::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; } - (void)readAttributeExpressedStateWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -47370,70 +46094,51 @@ - (instancetype)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)en - (void)resetWithParams:(MTRDishwasherAlarmClusterResetParams *)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - DishwasherAlarm::Commands::Reset::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.alarms = static_cast>(params.alarms.unsignedIntValue); + if (params == nil) { + params = [[MTRDishwasherAlarmClusterResetParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = DishwasherAlarm::Commands::Reset::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} - (void)modifyEnabledAlarmsWithParams:(MTRDishwasherAlarmClusterModifyEnabledAlarmsParams *)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - DishwasherAlarm::Commands::ModifyEnabledAlarms::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.mask = static_cast>(params.mask.unsignedIntValue); + if (params == nil) { + params = [[MTRDishwasherAlarmClusterModifyEnabledAlarmsParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = DishwasherAlarm::Commands::ModifyEnabledAlarms::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; } - (void)readAttributeMaskWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -47838,134 +46543,111 @@ - (void)pauseWithCompletion:(void (^)(MTROperationalStateClusterOperationalComma } - (void)pauseWithParams:(MTROperationalStateClusterPauseParams * _Nullable)params completion:(void (^)(MTROperationalStateClusterOperationalCommandResponseParams * _Nullable data, NSError * _Nullable error))completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTROperationalStateClusterOperationalCommandResponseCallbackBridge(self.callbackQueue, - completion, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, OperationalStateClusterOperationalCommandResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - OperationalState::Commands::Pause::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } + if (params == nil) { + params = [[MTROperationalStateClusterPauseParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = OperationalState::Commands::Pause::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTROperationalStateClusterOperationalCommandResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} - (void)stopWithCompletion:(void (^)(MTROperationalStateClusterOperationalCommandResponseParams * _Nullable data, NSError * _Nullable error))completion { [self stopWithParams:nil completion:completion]; } - (void)stopWithParams:(MTROperationalStateClusterStopParams * _Nullable)params completion:(void (^)(MTROperationalStateClusterOperationalCommandResponseParams * _Nullable data, NSError * _Nullable error))completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTROperationalStateClusterOperationalCommandResponseCallbackBridge(self.callbackQueue, - completion, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, OperationalStateClusterOperationalCommandResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - OperationalState::Commands::Stop::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } + if (params == nil) { + params = [[MTROperationalStateClusterStopParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = OperationalState::Commands::Stop::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTROperationalStateClusterOperationalCommandResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} - (void)startWithCompletion:(void (^)(MTROperationalStateClusterOperationalCommandResponseParams * _Nullable data, NSError * _Nullable error))completion { [self startWithParams:nil completion:completion]; } - (void)startWithParams:(MTROperationalStateClusterStartParams * _Nullable)params completion:(void (^)(MTROperationalStateClusterOperationalCommandResponseParams * _Nullable data, NSError * _Nullable error))completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTROperationalStateClusterOperationalCommandResponseCallbackBridge(self.callbackQueue, - completion, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, OperationalStateClusterOperationalCommandResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - OperationalState::Commands::Start::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } + if (params == nil) { + params = [[MTROperationalStateClusterStartParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = OperationalState::Commands::Start::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTROperationalStateClusterOperationalCommandResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} - (void)resumeWithCompletion:(void (^)(MTROperationalStateClusterOperationalCommandResponseParams * _Nullable data, NSError * _Nullable error))completion { [self resumeWithParams:nil completion:completion]; } - (void)resumeWithParams:(MTROperationalStateClusterResumeParams * _Nullable)params completion:(void (^)(MTROperationalStateClusterOperationalCommandResponseParams * _Nullable data, NSError * _Nullable error))completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTROperationalStateClusterOperationalCommandResponseCallbackBridge(self.callbackQueue, - completion, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, OperationalStateClusterOperationalCommandResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - OperationalState::Commands::Resume::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } + if (params == nil) { + params = [[MTROperationalStateClusterResumeParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = OperationalState::Commands::Resume::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTROperationalStateClusterOperationalCommandResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; } - (void)readAttributePhaseListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion @@ -48446,134 +47128,111 @@ - (void)pauseWithCompletion:(void (^)(MTRRVCOperationalStateClusterOperationalCo } - (void)pauseWithParams:(MTRRVCOperationalStateClusterPauseParams * _Nullable)params completion:(void (^)(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable data, NSError * _Nullable error))completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRRVCOperationalStateClusterOperationalCommandResponseCallbackBridge(self.callbackQueue, - completion, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, RVCOperationalStateClusterOperationalCommandResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - RvcOperationalState::Commands::Pause::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } + if (params == nil) { + params = [[MTRRVCOperationalStateClusterPauseParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = RvcOperationalState::Commands::Pause::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRRVCOperationalStateClusterOperationalCommandResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} - (void)stopWithCompletion:(void (^)(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable data, NSError * _Nullable error))completion { [self stopWithParams:nil completion:completion]; } - (void)stopWithParams:(MTRRVCOperationalStateClusterStopParams * _Nullable)params completion:(void (^)(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable data, NSError * _Nullable error))completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRRVCOperationalStateClusterOperationalCommandResponseCallbackBridge(self.callbackQueue, - completion, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, RVCOperationalStateClusterOperationalCommandResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - RvcOperationalState::Commands::Stop::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } + if (params == nil) { + params = [[MTRRVCOperationalStateClusterStopParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = RvcOperationalState::Commands::Stop::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRRVCOperationalStateClusterOperationalCommandResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} - (void)startWithCompletion:(void (^)(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable data, NSError * _Nullable error))completion { [self startWithParams:nil completion:completion]; } - (void)startWithParams:(MTRRVCOperationalStateClusterStartParams * _Nullable)params completion:(void (^)(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable data, NSError * _Nullable error))completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRRVCOperationalStateClusterOperationalCommandResponseCallbackBridge(self.callbackQueue, - completion, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, RVCOperationalStateClusterOperationalCommandResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - RvcOperationalState::Commands::Start::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } + if (params == nil) { + params = [[MTRRVCOperationalStateClusterStartParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = RvcOperationalState::Commands::Start::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRRVCOperationalStateClusterOperationalCommandResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} - (void)resumeWithCompletion:(void (^)(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable data, NSError * _Nullable error))completion { [self resumeWithParams:nil completion:completion]; } - (void)resumeWithParams:(MTRRVCOperationalStateClusterResumeParams * _Nullable)params completion:(void (^)(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable data, NSError * _Nullable error))completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRRVCOperationalStateClusterOperationalCommandResponseCallbackBridge(self.callbackQueue, - completion, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, RVCOperationalStateClusterOperationalCommandResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - RvcOperationalState::Commands::Resume::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } + if (params == nil) { + params = [[MTRRVCOperationalStateClusterResumeParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = RvcOperationalState::Commands::Resume::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRRVCOperationalStateClusterOperationalCommandResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; } - (void)readAttributePhaseListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion @@ -49054,35 +47713,27 @@ - (void)resetConditionWithCompletion:(MTRStatusCompletion)completion } - (void)resetConditionWithParams:(MTRHEPAFilterMonitoringClusterResetConditionParams * _Nullable)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - HepaFilterMonitoring::Commands::ResetCondition::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } + if (params == nil) { + params = [[MTRHEPAFilterMonitoringClusterResetConditionParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = HepaFilterMonitoring::Commands::ResetCondition::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; } - (void)readAttributeConditionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -49602,35 +48253,27 @@ - (void)resetConditionWithCompletion:(MTRStatusCompletion)completion } - (void)resetConditionWithParams:(MTRActivatedCarbonFilterMonitoringClusterResetConditionParams * _Nullable)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - ActivatedCarbonFilterMonitoring::Commands::ResetCondition::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } + if (params == nil) { + params = [[MTRActivatedCarbonFilterMonitoringClusterResetConditionParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = ActivatedCarbonFilterMonitoring::Commands::ResetCondition::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; } - (void)readAttributeConditionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -50146,748 +48789,483 @@ - (instancetype)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)en - (void)lockDoorWithParams:(MTRDoorLockClusterLockDoorParams * _Nullable)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - DoorLock::Commands::LockDoor::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - if (!timedInvokeTimeoutMs.HasValue()) { - timedInvokeTimeoutMs.SetValue(10000); - } - if (params != nil) { - if (params.pinCode != nil) { - auto & definedValue_0 = request.PINCode.Emplace(); - definedValue_0 = AsByteSpan(params.pinCode); - } - } + if (params == nil) { + params = [[MTRDoorLockClusterLockDoorParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + if (timedInvokeTimeoutMs == nil) { + timedInvokeTimeoutMs = @(10000); + } + using RequestType = DoorLock::Commands::LockDoor::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} - (void)unlockDoorWithParams:(MTRDoorLockClusterUnlockDoorParams * _Nullable)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - DoorLock::Commands::UnlockDoor::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - if (!timedInvokeTimeoutMs.HasValue()) { - timedInvokeTimeoutMs.SetValue(10000); - } - if (params != nil) { - if (params.pinCode != nil) { - auto & definedValue_0 = request.PINCode.Emplace(); - definedValue_0 = AsByteSpan(params.pinCode); - } - } + if (params == nil) { + params = [[MTRDoorLockClusterUnlockDoorParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + if (timedInvokeTimeoutMs == nil) { + timedInvokeTimeoutMs = @(10000); + } + + using RequestType = DoorLock::Commands::UnlockDoor::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} - (void)unlockWithTimeoutWithParams:(MTRDoorLockClusterUnlockWithTimeoutParams *)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - DoorLock::Commands::UnlockWithTimeout::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - if (!timedInvokeTimeoutMs.HasValue()) { - timedInvokeTimeoutMs.SetValue(10000); - } - request.timeout = params.timeout.unsignedShortValue; - if (params.pinCode != nil) { - auto & definedValue_0 = request.PINCode.Emplace(); - definedValue_0 = AsByteSpan(params.pinCode); - } + if (params == nil) { + params = [[MTRDoorLockClusterUnlockWithTimeoutParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + if (timedInvokeTimeoutMs == nil) { + timedInvokeTimeoutMs = @(10000); + } + + using RequestType = DoorLock::Commands::UnlockWithTimeout::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} - (void)setWeekDayScheduleWithParams:(MTRDoorLockClusterSetWeekDayScheduleParams *)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - DoorLock::Commands::SetWeekDaySchedule::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.weekDayIndex = params.weekDayIndex.unsignedCharValue; - request.userIndex = params.userIndex.unsignedShortValue; - request.daysMask = static_cast>(params.daysMask.unsignedCharValue); - request.startHour = params.startHour.unsignedCharValue; - request.startMinute = params.startMinute.unsignedCharValue; - request.endHour = params.endHour.unsignedCharValue; - request.endMinute = params.endMinute.unsignedCharValue; + if (params == nil) { + params = [[MTRDoorLockClusterSetWeekDayScheduleParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = DoorLock::Commands::SetWeekDaySchedule::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} - (void)getWeekDayScheduleWithParams:(MTRDoorLockClusterGetWeekDayScheduleParams *)params completion:(void (^)(MTRDoorLockClusterGetWeekDayScheduleResponseParams * _Nullable data, NSError * _Nullable error))completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRDoorLockClusterGetWeekDayScheduleResponseCallbackBridge(self.callbackQueue, - completion, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, DoorLockClusterGetWeekDayScheduleResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - DoorLock::Commands::GetWeekDaySchedule::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.weekDayIndex = params.weekDayIndex.unsignedCharValue; - request.userIndex = params.userIndex.unsignedShortValue; + if (params == nil) { + params = [[MTRDoorLockClusterGetWeekDayScheduleParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = DoorLock::Commands::GetWeekDaySchedule::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRDoorLockClusterGetWeekDayScheduleResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} - (void)clearWeekDayScheduleWithParams:(MTRDoorLockClusterClearWeekDayScheduleParams *)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - DoorLock::Commands::ClearWeekDaySchedule::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.weekDayIndex = params.weekDayIndex.unsignedCharValue; - request.userIndex = params.userIndex.unsignedShortValue; + if (params == nil) { + params = [[MTRDoorLockClusterClearWeekDayScheduleParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = DoorLock::Commands::ClearWeekDaySchedule::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} - (void)setYearDayScheduleWithParams:(MTRDoorLockClusterSetYearDayScheduleParams *)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - DoorLock::Commands::SetYearDaySchedule::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.yearDayIndex = params.yearDayIndex.unsignedCharValue; - request.userIndex = params.userIndex.unsignedShortValue; - request.localStartTime = params.localStartTime.unsignedIntValue; - request.localEndTime = params.localEndTime.unsignedIntValue; + if (params == nil) { + params = [[MTRDoorLockClusterSetYearDayScheduleParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = DoorLock::Commands::SetYearDaySchedule::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} - (void)getYearDayScheduleWithParams:(MTRDoorLockClusterGetYearDayScheduleParams *)params completion:(void (^)(MTRDoorLockClusterGetYearDayScheduleResponseParams * _Nullable data, NSError * _Nullable error))completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRDoorLockClusterGetYearDayScheduleResponseCallbackBridge(self.callbackQueue, - completion, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, DoorLockClusterGetYearDayScheduleResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - DoorLock::Commands::GetYearDaySchedule::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.yearDayIndex = params.yearDayIndex.unsignedCharValue; - request.userIndex = params.userIndex.unsignedShortValue; + if (params == nil) { + params = [[MTRDoorLockClusterGetYearDayScheduleParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = DoorLock::Commands::GetYearDaySchedule::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRDoorLockClusterGetYearDayScheduleResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} - (void)clearYearDayScheduleWithParams:(MTRDoorLockClusterClearYearDayScheduleParams *)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - DoorLock::Commands::ClearYearDaySchedule::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.yearDayIndex = params.yearDayIndex.unsignedCharValue; - request.userIndex = params.userIndex.unsignedShortValue; + if (params == nil) { + params = [[MTRDoorLockClusterClearYearDayScheduleParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = DoorLock::Commands::ClearYearDaySchedule::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} - (void)setHolidayScheduleWithParams:(MTRDoorLockClusterSetHolidayScheduleParams *)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - DoorLock::Commands::SetHolidaySchedule::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.holidayIndex = params.holidayIndex.unsignedCharValue; - request.localStartTime = params.localStartTime.unsignedIntValue; - request.localEndTime = params.localEndTime.unsignedIntValue; - request.operatingMode = static_cast>(params.operatingMode.unsignedCharValue); + if (params == nil) { + params = [[MTRDoorLockClusterSetHolidayScheduleParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = DoorLock::Commands::SetHolidaySchedule::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} - (void)getHolidayScheduleWithParams:(MTRDoorLockClusterGetHolidayScheduleParams *)params completion:(void (^)(MTRDoorLockClusterGetHolidayScheduleResponseParams * _Nullable data, NSError * _Nullable error))completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRDoorLockClusterGetHolidayScheduleResponseCallbackBridge(self.callbackQueue, - completion, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, DoorLockClusterGetHolidayScheduleResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - DoorLock::Commands::GetHolidaySchedule::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.holidayIndex = params.holidayIndex.unsignedCharValue; + if (params == nil) { + params = [[MTRDoorLockClusterGetHolidayScheduleParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = DoorLock::Commands::GetHolidaySchedule::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRDoorLockClusterGetHolidayScheduleResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} - (void)clearHolidayScheduleWithParams:(MTRDoorLockClusterClearHolidayScheduleParams *)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - DoorLock::Commands::ClearHolidaySchedule::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.holidayIndex = params.holidayIndex.unsignedCharValue; + if (params == nil) { + params = [[MTRDoorLockClusterClearHolidayScheduleParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = DoorLock::Commands::ClearHolidaySchedule::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} - (void)setUserWithParams:(MTRDoorLockClusterSetUserParams *)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - DoorLock::Commands::SetUser::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - if (!timedInvokeTimeoutMs.HasValue()) { - timedInvokeTimeoutMs.SetValue(10000); - } - request.operationType = static_cast>(params.operationType.unsignedCharValue); - request.userIndex = params.userIndex.unsignedShortValue; - if (params.userName == nil) { - request.userName.SetNull(); - } else { - auto & nonNullValue_0 = request.userName.SetNonNull(); - nonNullValue_0 = AsCharSpan(params.userName); - } - if (params.userUniqueID == nil) { - request.userUniqueID.SetNull(); - } else { - auto & nonNullValue_0 = request.userUniqueID.SetNonNull(); - nonNullValue_0 = params.userUniqueID.unsignedIntValue; - } - if (params.userStatus == nil) { - request.userStatus.SetNull(); - } else { - auto & nonNullValue_0 = request.userStatus.SetNonNull(); - nonNullValue_0 = static_cast>(params.userStatus.unsignedCharValue); - } - if (params.userType == nil) { - request.userType.SetNull(); - } else { - auto & nonNullValue_0 = request.userType.SetNonNull(); - nonNullValue_0 = static_cast>(params.userType.unsignedCharValue); - } - if (params.credentialRule == nil) { - request.credentialRule.SetNull(); - } else { - auto & nonNullValue_0 = request.credentialRule.SetNonNull(); - nonNullValue_0 = static_cast>(params.credentialRule.unsignedCharValue); - } + if (params == nil) { + params = [[MTRDoorLockClusterSetUserParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + if (timedInvokeTimeoutMs == nil) { + timedInvokeTimeoutMs = @(10000); + } + + using RequestType = DoorLock::Commands::SetUser::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} - (void)getUserWithParams:(MTRDoorLockClusterGetUserParams *)params completion:(void (^)(MTRDoorLockClusterGetUserResponseParams * _Nullable data, NSError * _Nullable error))completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRDoorLockClusterGetUserResponseCallbackBridge(self.callbackQueue, - completion, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, DoorLockClusterGetUserResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - DoorLock::Commands::GetUser::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.userIndex = params.userIndex.unsignedShortValue; + if (params == nil) { + params = [[MTRDoorLockClusterGetUserParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = DoorLock::Commands::GetUser::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRDoorLockClusterGetUserResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} - (void)clearUserWithParams:(MTRDoorLockClusterClearUserParams *)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - DoorLock::Commands::ClearUser::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - if (!timedInvokeTimeoutMs.HasValue()) { - timedInvokeTimeoutMs.SetValue(10000); - } - request.userIndex = params.userIndex.unsignedShortValue; + if (params == nil) { + params = [[MTRDoorLockClusterClearUserParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + if (timedInvokeTimeoutMs == nil) { + timedInvokeTimeoutMs = @(10000); + } + + using RequestType = DoorLock::Commands::ClearUser::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} - (void)setCredentialWithParams:(MTRDoorLockClusterSetCredentialParams *)params completion:(void (^)(MTRDoorLockClusterSetCredentialResponseParams * _Nullable data, NSError * _Nullable error))completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRDoorLockClusterSetCredentialResponseCallbackBridge(self.callbackQueue, - completion, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, DoorLockClusterSetCredentialResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - DoorLock::Commands::SetCredential::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - if (!timedInvokeTimeoutMs.HasValue()) { - timedInvokeTimeoutMs.SetValue(10000); - } - request.operationType = static_cast>(params.operationType.unsignedCharValue); - request.credential.credentialType = static_cast>(params.credential.credentialType.unsignedCharValue); - request.credential.credentialIndex = params.credential.credentialIndex.unsignedShortValue; - request.credentialData = AsByteSpan(params.credentialData); - if (params.userIndex == nil) { - request.userIndex.SetNull(); - } else { - auto & nonNullValue_0 = request.userIndex.SetNonNull(); - nonNullValue_0 = params.userIndex.unsignedShortValue; - } - if (params.userStatus == nil) { - request.userStatus.SetNull(); - } else { - auto & nonNullValue_0 = request.userStatus.SetNonNull(); - nonNullValue_0 = static_cast>(params.userStatus.unsignedCharValue); - } - if (params.userType == nil) { - request.userType.SetNull(); - } else { - auto & nonNullValue_0 = request.userType.SetNonNull(); - nonNullValue_0 = static_cast>(params.userType.unsignedCharValue); - } + if (params == nil) { + params = [[MTRDoorLockClusterSetCredentialParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + if (timedInvokeTimeoutMs == nil) { + timedInvokeTimeoutMs = @(10000); + } + using RequestType = DoorLock::Commands::SetCredential::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRDoorLockClusterSetCredentialResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} - (void)getCredentialStatusWithParams:(MTRDoorLockClusterGetCredentialStatusParams *)params completion:(void (^)(MTRDoorLockClusterGetCredentialStatusResponseParams * _Nullable data, NSError * _Nullable error))completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRDoorLockClusterGetCredentialStatusResponseCallbackBridge(self.callbackQueue, - completion, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, DoorLockClusterGetCredentialStatusResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - DoorLock::Commands::GetCredentialStatus::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.credential.credentialType = static_cast>(params.credential.credentialType.unsignedCharValue); - request.credential.credentialIndex = params.credential.credentialIndex.unsignedShortValue; + if (params == nil) { + params = [[MTRDoorLockClusterGetCredentialStatusParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = DoorLock::Commands::GetCredentialStatus::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRDoorLockClusterGetCredentialStatusResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} - (void)clearCredentialWithParams:(MTRDoorLockClusterClearCredentialParams *)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - DoorLock::Commands::ClearCredential::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - if (!timedInvokeTimeoutMs.HasValue()) { - timedInvokeTimeoutMs.SetValue(10000); - } - if (params.credential == nil) { - request.credential.SetNull(); - } else { - auto & nonNullValue_0 = request.credential.SetNonNull(); - nonNullValue_0.credentialType = static_cast>(params.credential.credentialType.unsignedCharValue); - nonNullValue_0.credentialIndex = params.credential.credentialIndex.unsignedShortValue; - } + if (params == nil) { + params = [[MTRDoorLockClusterClearCredentialParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + if (timedInvokeTimeoutMs == nil) { + timedInvokeTimeoutMs = @(10000); + } + using RequestType = DoorLock::Commands::ClearCredential::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} - (void)unboltDoorWithParams:(MTRDoorLockClusterUnboltDoorParams * _Nullable)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - DoorLock::Commands::UnboltDoor::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - if (!timedInvokeTimeoutMs.HasValue()) { - timedInvokeTimeoutMs.SetValue(10000); - } - if (params != nil) { - if (params.pinCode != nil) { - auto & definedValue_0 = request.PINCode.Emplace(); - definedValue_0 = AsByteSpan(params.pinCode); - } - } + if (params == nil) { + params = [[MTRDoorLockClusterUnboltDoorParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + if (timedInvokeTimeoutMs == nil) { + timedInvokeTimeoutMs = @(10000); + } + + using RequestType = DoorLock::Commands::UnboltDoor::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; } - (void)readAttributeLockStateWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -54819,245 +53197,179 @@ - (void)upOrOpenWithCompletion:(MTRStatusCompletion)completion } - (void)upOrOpenWithParams:(MTRWindowCoveringClusterUpOrOpenParams * _Nullable)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - WindowCovering::Commands::UpOrOpen::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } + if (params == nil) { + params = [[MTRWindowCoveringClusterUpOrOpenParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = WindowCovering::Commands::UpOrOpen::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} - (void)downOrCloseWithCompletion:(MTRStatusCompletion)completion { [self downOrCloseWithParams:nil completion:completion]; } - (void)downOrCloseWithParams:(MTRWindowCoveringClusterDownOrCloseParams * _Nullable)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - WindowCovering::Commands::DownOrClose::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } + if (params == nil) { + params = [[MTRWindowCoveringClusterDownOrCloseParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = WindowCovering::Commands::DownOrClose::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} - (void)stopMotionWithCompletion:(MTRStatusCompletion)completion { [self stopMotionWithParams:nil completion:completion]; } - (void)stopMotionWithParams:(MTRWindowCoveringClusterStopMotionParams * _Nullable)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - WindowCovering::Commands::StopMotion::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } + if (params == nil) { + params = [[MTRWindowCoveringClusterStopMotionParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = WindowCovering::Commands::StopMotion::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} - (void)goToLiftValueWithParams:(MTRWindowCoveringClusterGoToLiftValueParams *)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - WindowCovering::Commands::GoToLiftValue::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.liftValue = params.liftValue.unsignedShortValue; + if (params == nil) { + params = [[MTRWindowCoveringClusterGoToLiftValueParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = WindowCovering::Commands::GoToLiftValue::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} - (void)goToLiftPercentageWithParams:(MTRWindowCoveringClusterGoToLiftPercentageParams *)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - WindowCovering::Commands::GoToLiftPercentage::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.liftPercent100thsValue = params.liftPercent100thsValue.unsignedShortValue; + if (params == nil) { + params = [[MTRWindowCoveringClusterGoToLiftPercentageParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = WindowCovering::Commands::GoToLiftPercentage::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} - (void)goToTiltValueWithParams:(MTRWindowCoveringClusterGoToTiltValueParams *)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - WindowCovering::Commands::GoToTiltValue::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.tiltValue = params.tiltValue.unsignedShortValue; + if (params == nil) { + params = [[MTRWindowCoveringClusterGoToTiltValueParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = WindowCovering::Commands::GoToTiltValue::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} - (void)goToTiltPercentageWithParams:(MTRWindowCoveringClusterGoToTiltPercentageParams *)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - WindowCovering::Commands::GoToTiltPercentage::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.tiltPercent100thsValue = params.tiltPercent100thsValue.unsignedShortValue; + if (params == nil) { + params = [[MTRWindowCoveringClusterGoToTiltPercentageParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = WindowCovering::Commands::GoToTiltPercentage::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; } - (void)readAttributeTypeWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -57188,73 +55500,55 @@ - (instancetype)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)en - (void)barrierControlGoToPercentWithParams:(MTRBarrierControlClusterBarrierControlGoToPercentParams *)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - BarrierControl::Commands::BarrierControlGoToPercent::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.percentOpen = params.percentOpen.unsignedCharValue; + if (params == nil) { + params = [[MTRBarrierControlClusterBarrierControlGoToPercentParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = BarrierControl::Commands::BarrierControlGoToPercent::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} - (void)barrierControlStopWithCompletion:(MTRStatusCompletion)completion { [self barrierControlStopWithParams:nil completion:completion]; } - (void)barrierControlStopWithParams:(MTRBarrierControlClusterBarrierControlStopParams * _Nullable)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - BarrierControl::Commands::BarrierControlStop::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } + if (params == nil) { + params = [[MTRBarrierControlClusterBarrierControlStopParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = BarrierControl::Commands::BarrierControlStop::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; } - (void)readAttributeBarrierMovingStateWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -60973,176 +59267,103 @@ - (instancetype)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)en - (void)setpointRaiseLowerWithParams:(MTRThermostatClusterSetpointRaiseLowerParams *)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - Thermostat::Commands::SetpointRaiseLower::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.mode = static_cast>(params.mode.unsignedCharValue); - request.amount = params.amount.charValue; + if (params == nil) { + params = [[MTRThermostatClusterSetpointRaiseLowerParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = Thermostat::Commands::SetpointRaiseLower::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} - (void)setWeeklyScheduleWithParams:(MTRThermostatClusterSetWeeklyScheduleParams *)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - Thermostat::Commands::SetWeeklySchedule::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.numberOfTransitionsForSequence = params.numberOfTransitionsForSequence.unsignedCharValue; - request.dayOfWeekForSequence = static_cast>(params.dayOfWeekForSequence.unsignedCharValue); - request.modeForSequence = static_cast>(params.modeForSequence.unsignedCharValue); - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (params.transitions.count != 0) { - auto * listHolder_0 = new ListHolder(params.transitions.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < params.transitions.count; ++i_0) { - if (![params.transitions[i_0] isKindOfClass:[MTRThermostatClusterThermostatScheduleTransition class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (MTRThermostatClusterThermostatScheduleTransition *) params.transitions[i_0]; - listHolder_0->mList[i_0].transitionTime = element_0.transitionTime.unsignedShortValue; - if (element_0.heatSetpoint == nil) { - listHolder_0->mList[i_0].heatSetpoint.SetNull(); - } else { - auto & nonNullValue_2 = listHolder_0->mList[i_0].heatSetpoint.SetNonNull(); - nonNullValue_2 = element_0.heatSetpoint.shortValue; - } - if (element_0.coolSetpoint == nil) { - listHolder_0->mList[i_0].coolSetpoint.SetNull(); - } else { - auto & nonNullValue_2 = listHolder_0->mList[i_0].coolSetpoint.SetNonNull(); - nonNullValue_2 = element_0.coolSetpoint.shortValue; - } - } - request.transitions = ListType_0(listHolder_0->mList, params.transitions.count); - } else { - request.transitions = ListType_0(); - } - } + if (params == nil) { + params = [[MTRThermostatClusterSetWeeklyScheduleParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = Thermostat::Commands::SetWeeklySchedule::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} - (void)getWeeklyScheduleWithParams:(MTRThermostatClusterGetWeeklyScheduleParams *)params completion:(void (^)(MTRThermostatClusterGetWeeklyScheduleResponseParams * _Nullable data, NSError * _Nullable error))completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRThermostatClusterGetWeeklyScheduleResponseCallbackBridge(self.callbackQueue, - completion, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, ThermostatClusterGetWeeklyScheduleResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - Thermostat::Commands::GetWeeklySchedule::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.daysToReturn = static_cast>(params.daysToReturn.unsignedCharValue); - request.modeToReturn = static_cast>(params.modeToReturn.unsignedCharValue); + if (params == nil) { + params = [[MTRThermostatClusterGetWeeklyScheduleParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = Thermostat::Commands::GetWeeklySchedule::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRThermostatClusterGetWeeklyScheduleResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} - (void)clearWeeklyScheduleWithCompletion:(MTRStatusCompletion)completion { [self clearWeeklyScheduleWithParams:nil completion:completion]; } - (void)clearWeeklyScheduleWithParams:(MTRThermostatClusterClearWeeklyScheduleParams * _Nullable)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - Thermostat::Commands::ClearWeeklySchedule::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } + if (params == nil) { + params = [[MTRThermostatClusterClearWeeklyScheduleParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = Thermostat::Commands::ClearWeeklySchedule::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; } - (void)readAttributeLocalTemperatureWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -66331,44 +64552,27 @@ - (instancetype)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)en - (void)stepWithParams:(MTRFanControlClusterStepParams *)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - FanControl::Commands::Step::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.direction = static_cast>(params.direction.unsignedCharValue); - if (params.wrap != nil) { - auto & definedValue_0 = request.wrap.Emplace(); - definedValue_0 = params.wrap.boolValue; - } - if (params.lowestOff != nil) { - auto & definedValue_0 = request.lowestOff.Emplace(); - definedValue_0 = params.lowestOff.boolValue; - } + if (params == nil) { + params = [[MTRFanControlClusterStepParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = FanControl::Commands::Step::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; } - (void)readAttributeFanModeWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -68715,720 +66919,459 @@ - (instancetype)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)en - (void)moveToHueWithParams:(MTRColorControlClusterMoveToHueParams *)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - ColorControl::Commands::MoveToHue::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.hue = params.hue.unsignedCharValue; - request.direction = static_cast>(params.direction.unsignedCharValue); - request.transitionTime = params.transitionTime.unsignedShortValue; - request.optionsMask = params.optionsMask.unsignedCharValue; - request.optionsOverride = params.optionsOverride.unsignedCharValue; + if (params == nil) { + params = [[MTRColorControlClusterMoveToHueParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = ColorControl::Commands::MoveToHue::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} - (void)moveHueWithParams:(MTRColorControlClusterMoveHueParams *)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - ColorControl::Commands::MoveHue::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.moveMode = static_cast>(params.moveMode.unsignedCharValue); - request.rate = params.rate.unsignedCharValue; - request.optionsMask = params.optionsMask.unsignedCharValue; - request.optionsOverride = params.optionsOverride.unsignedCharValue; + if (params == nil) { + params = [[MTRColorControlClusterMoveHueParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = ColorControl::Commands::MoveHue::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} - (void)stepHueWithParams:(MTRColorControlClusterStepHueParams *)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - ColorControl::Commands::StepHue::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.stepMode = static_cast>(params.stepMode.unsignedCharValue); - request.stepSize = params.stepSize.unsignedCharValue; - request.transitionTime = params.transitionTime.unsignedCharValue; - request.optionsMask = params.optionsMask.unsignedCharValue; - request.optionsOverride = params.optionsOverride.unsignedCharValue; + if (params == nil) { + params = [[MTRColorControlClusterStepHueParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = ColorControl::Commands::StepHue::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} - (void)moveToSaturationWithParams:(MTRColorControlClusterMoveToSaturationParams *)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - ColorControl::Commands::MoveToSaturation::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.saturation = params.saturation.unsignedCharValue; - request.transitionTime = params.transitionTime.unsignedShortValue; - request.optionsMask = params.optionsMask.unsignedCharValue; - request.optionsOverride = params.optionsOverride.unsignedCharValue; + if (params == nil) { + params = [[MTRColorControlClusterMoveToSaturationParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = ColorControl::Commands::MoveToSaturation::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} - (void)moveSaturationWithParams:(MTRColorControlClusterMoveSaturationParams *)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - ColorControl::Commands::MoveSaturation::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.moveMode = static_cast>(params.moveMode.unsignedCharValue); - request.rate = params.rate.unsignedCharValue; - request.optionsMask = params.optionsMask.unsignedCharValue; - request.optionsOverride = params.optionsOverride.unsignedCharValue; + if (params == nil) { + params = [[MTRColorControlClusterMoveSaturationParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = ColorControl::Commands::MoveSaturation::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} - (void)stepSaturationWithParams:(MTRColorControlClusterStepSaturationParams *)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - ColorControl::Commands::StepSaturation::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.stepMode = static_cast>(params.stepMode.unsignedCharValue); - request.stepSize = params.stepSize.unsignedCharValue; - request.transitionTime = params.transitionTime.unsignedCharValue; - request.optionsMask = params.optionsMask.unsignedCharValue; - request.optionsOverride = params.optionsOverride.unsignedCharValue; + if (params == nil) { + params = [[MTRColorControlClusterStepSaturationParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = ColorControl::Commands::StepSaturation::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} - (void)moveToHueAndSaturationWithParams:(MTRColorControlClusterMoveToHueAndSaturationParams *)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - ColorControl::Commands::MoveToHueAndSaturation::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.hue = params.hue.unsignedCharValue; - request.saturation = params.saturation.unsignedCharValue; - request.transitionTime = params.transitionTime.unsignedShortValue; - request.optionsMask = params.optionsMask.unsignedCharValue; - request.optionsOverride = params.optionsOverride.unsignedCharValue; + if (params == nil) { + params = [[MTRColorControlClusterMoveToHueAndSaturationParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = ColorControl::Commands::MoveToHueAndSaturation::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} - (void)moveToColorWithParams:(MTRColorControlClusterMoveToColorParams *)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - ColorControl::Commands::MoveToColor::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.colorX = params.colorX.unsignedShortValue; - request.colorY = params.colorY.unsignedShortValue; - request.transitionTime = params.transitionTime.unsignedShortValue; - request.optionsMask = params.optionsMask.unsignedCharValue; - request.optionsOverride = params.optionsOverride.unsignedCharValue; + if (params == nil) { + params = [[MTRColorControlClusterMoveToColorParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = ColorControl::Commands::MoveToColor::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} - (void)moveColorWithParams:(MTRColorControlClusterMoveColorParams *)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - ColorControl::Commands::MoveColor::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.rateX = params.rateX.shortValue; - request.rateY = params.rateY.shortValue; - request.optionsMask = params.optionsMask.unsignedCharValue; - request.optionsOverride = params.optionsOverride.unsignedCharValue; + if (params == nil) { + params = [[MTRColorControlClusterMoveColorParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = ColorControl::Commands::MoveColor::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} - (void)stepColorWithParams:(MTRColorControlClusterStepColorParams *)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - ColorControl::Commands::StepColor::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.stepX = params.stepX.shortValue; - request.stepY = params.stepY.shortValue; - request.transitionTime = params.transitionTime.unsignedShortValue; - request.optionsMask = params.optionsMask.unsignedCharValue; - request.optionsOverride = params.optionsOverride.unsignedCharValue; + if (params == nil) { + params = [[MTRColorControlClusterStepColorParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = ColorControl::Commands::StepColor::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} - (void)moveToColorTemperatureWithParams:(MTRColorControlClusterMoveToColorTemperatureParams *)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - ColorControl::Commands::MoveToColorTemperature::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.colorTemperatureMireds = params.colorTemperatureMireds.unsignedShortValue; - request.transitionTime = params.transitionTime.unsignedShortValue; - request.optionsMask = params.optionsMask.unsignedCharValue; - request.optionsOverride = params.optionsOverride.unsignedCharValue; + if (params == nil) { + params = [[MTRColorControlClusterMoveToColorTemperatureParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = ColorControl::Commands::MoveToColorTemperature::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} - (void)enhancedMoveToHueWithParams:(MTRColorControlClusterEnhancedMoveToHueParams *)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - ColorControl::Commands::EnhancedMoveToHue::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.enhancedHue = params.enhancedHue.unsignedShortValue; - request.direction = static_cast>(params.direction.unsignedCharValue); - request.transitionTime = params.transitionTime.unsignedShortValue; - request.optionsMask = params.optionsMask.unsignedCharValue; - request.optionsOverride = params.optionsOverride.unsignedCharValue; + if (params == nil) { + params = [[MTRColorControlClusterEnhancedMoveToHueParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = ColorControl::Commands::EnhancedMoveToHue::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} - (void)enhancedMoveHueWithParams:(MTRColorControlClusterEnhancedMoveHueParams *)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - ColorControl::Commands::EnhancedMoveHue::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.moveMode = static_cast>(params.moveMode.unsignedCharValue); - request.rate = params.rate.unsignedShortValue; - request.optionsMask = params.optionsMask.unsignedCharValue; - request.optionsOverride = params.optionsOverride.unsignedCharValue; + if (params == nil) { + params = [[MTRColorControlClusterEnhancedMoveHueParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = ColorControl::Commands::EnhancedMoveHue::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} - (void)enhancedStepHueWithParams:(MTRColorControlClusterEnhancedStepHueParams *)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - ColorControl::Commands::EnhancedStepHue::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.stepMode = static_cast>(params.stepMode.unsignedCharValue); - request.stepSize = params.stepSize.unsignedShortValue; - request.transitionTime = params.transitionTime.unsignedShortValue; - request.optionsMask = params.optionsMask.unsignedCharValue; - request.optionsOverride = params.optionsOverride.unsignedCharValue; + if (params == nil) { + params = [[MTRColorControlClusterEnhancedStepHueParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = ColorControl::Commands::EnhancedStepHue::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} - (void)enhancedMoveToHueAndSaturationWithParams:(MTRColorControlClusterEnhancedMoveToHueAndSaturationParams *)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - ColorControl::Commands::EnhancedMoveToHueAndSaturation::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.enhancedHue = params.enhancedHue.unsignedShortValue; - request.saturation = params.saturation.unsignedCharValue; - request.transitionTime = params.transitionTime.unsignedShortValue; - request.optionsMask = params.optionsMask.unsignedCharValue; - request.optionsOverride = params.optionsOverride.unsignedCharValue; + if (params == nil) { + params = [[MTRColorControlClusterEnhancedMoveToHueAndSaturationParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = ColorControl::Commands::EnhancedMoveToHueAndSaturation::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} - (void)colorLoopSetWithParams:(MTRColorControlClusterColorLoopSetParams *)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - ColorControl::Commands::ColorLoopSet::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.updateFlags = static_cast>(params.updateFlags.unsignedCharValue); - request.action = static_cast>(params.action.unsignedCharValue); - request.direction = static_cast>(params.direction.unsignedCharValue); - request.time = params.time.unsignedShortValue; - request.startHue = params.startHue.unsignedShortValue; - request.optionsMask = params.optionsMask.unsignedCharValue; - request.optionsOverride = params.optionsOverride.unsignedCharValue; + if (params == nil) { + params = [[MTRColorControlClusterColorLoopSetParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = ColorControl::Commands::ColorLoopSet::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} - (void)stopMoveStepWithParams:(MTRColorControlClusterStopMoveStepParams *)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - ColorControl::Commands::StopMoveStep::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.optionsMask = params.optionsMask.unsignedCharValue; - request.optionsOverride = params.optionsOverride.unsignedCharValue; + if (params == nil) { + params = [[MTRColorControlClusterStopMoveStepParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = ColorControl::Commands::StopMoveStep::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} - (void)moveColorTemperatureWithParams:(MTRColorControlClusterMoveColorTemperatureParams *)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - ColorControl::Commands::MoveColorTemperature::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.moveMode = static_cast>(params.moveMode.unsignedCharValue); - request.rate = params.rate.unsignedShortValue; - request.colorTemperatureMinimumMireds = params.colorTemperatureMinimumMireds.unsignedShortValue; - request.colorTemperatureMaximumMireds = params.colorTemperatureMaximumMireds.unsignedShortValue; - request.optionsMask = params.optionsMask.unsignedCharValue; - request.optionsOverride = params.optionsOverride.unsignedCharValue; + if (params == nil) { + params = [[MTRColorControlClusterMoveColorTemperatureParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = ColorControl::Commands::MoveColorTemperature::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} - (void)stepColorTemperatureWithParams:(MTRColorControlClusterStepColorTemperatureParams *)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - ColorControl::Commands::StepColorTemperature::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.stepMode = static_cast>(params.stepMode.unsignedCharValue); - request.stepSize = params.stepSize.unsignedShortValue; - request.transitionTime = params.transitionTime.unsignedShortValue; - request.colorTemperatureMinimumMireds = params.colorTemperatureMinimumMireds.unsignedShortValue; - request.colorTemperatureMaximumMireds = params.colorTemperatureMaximumMireds.unsignedShortValue; - request.optionsMask = params.optionsMask.unsignedCharValue; - request.optionsOverride = params.optionsOverride.unsignedCharValue; + if (params == nil) { + params = [[MTRColorControlClusterStepColorTemperatureParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = ColorControl::Commands::StepColorTemperature::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; } - (void)readAttributeCurrentHueWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -89076,102 +87019,75 @@ - (instancetype)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)en - (void)changeChannelWithParams:(MTRChannelClusterChangeChannelParams *)params completion:(void (^)(MTRChannelClusterChangeChannelResponseParams * _Nullable data, NSError * _Nullable error))completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRChannelClusterChangeChannelResponseCallbackBridge(self.callbackQueue, - completion, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, ChannelClusterChangeChannelResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - Channel::Commands::ChangeChannel::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.match = AsCharSpan(params.match); + if (params == nil) { + params = [[MTRChannelClusterChangeChannelParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = Channel::Commands::ChangeChannel::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRChannelClusterChangeChannelResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} - (void)changeChannelByNumberWithParams:(MTRChannelClusterChangeChannelByNumberParams *)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - Channel::Commands::ChangeChannelByNumber::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.majorNumber = params.majorNumber.unsignedShortValue; - request.minorNumber = params.minorNumber.unsignedShortValue; + if (params == nil) { + params = [[MTRChannelClusterChangeChannelByNumberParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = Channel::Commands::ChangeChannelByNumber::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} - (void)skipChannelWithParams:(MTRChannelClusterSkipChannelParams *)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - Channel::Commands::SkipChannel::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.count = params.count.shortValue; + if (params == nil) { + params = [[MTRChannelClusterSkipChannelParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = Channel::Commands::SkipChannel::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; } - (void)readAttributeChannelListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion @@ -89844,37 +87760,27 @@ - (instancetype)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)en - (void)navigateTargetWithParams:(MTRTargetNavigatorClusterNavigateTargetParams *)params completion:(void (^)(MTRTargetNavigatorClusterNavigateTargetResponseParams * _Nullable data, NSError * _Nullable error))completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRTargetNavigatorClusterNavigateTargetResponseCallbackBridge(self.callbackQueue, - completion, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, TargetNavigatorClusterNavigateTargetResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - TargetNavigator::Commands::NavigateTarget::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.target = params.target.unsignedCharValue; - if (params.data != nil) { - auto & definedValue_0 = request.data.Emplace(); - definedValue_0 = AsCharSpan(params.data); - } + if (params == nil) { + params = [[MTRTargetNavigatorClusterNavigateTargetParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = TargetNavigator::Commands::NavigateTarget::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRTargetNavigatorClusterNavigateTargetResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; } - (void)readAttributeTargetListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion @@ -90468,363 +88374,295 @@ - (void)playWithCompletion:(void (^)(MTRMediaPlaybackClusterPlaybackResponsePara } - (void)playWithParams:(MTRMediaPlaybackClusterPlayParams * _Nullable)params completion:(void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, NSError * _Nullable error))completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRMediaPlaybackClusterPlaybackResponseCallbackBridge(self.callbackQueue, - completion, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, MediaPlaybackClusterPlaybackResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - MediaPlayback::Commands::Play::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } + if (params == nil) { + params = [[MTRMediaPlaybackClusterPlayParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = MediaPlayback::Commands::Play::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRMediaPlaybackClusterPlaybackResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} - (void)pauseWithCompletion:(void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, NSError * _Nullable error))completion { [self pauseWithParams:nil completion:completion]; } - (void)pauseWithParams:(MTRMediaPlaybackClusterPauseParams * _Nullable)params completion:(void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, NSError * _Nullable error))completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRMediaPlaybackClusterPlaybackResponseCallbackBridge(self.callbackQueue, - completion, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, MediaPlaybackClusterPlaybackResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - MediaPlayback::Commands::Pause::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } + if (params == nil) { + params = [[MTRMediaPlaybackClusterPauseParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = MediaPlayback::Commands::Pause::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRMediaPlaybackClusterPlaybackResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} - (void)stopWithCompletion:(void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, NSError * _Nullable error))completion { [self stopWithParams:nil completion:completion]; } - (void)stopWithParams:(MTRMediaPlaybackClusterStopParams * _Nullable)params completion:(void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, NSError * _Nullable error))completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRMediaPlaybackClusterPlaybackResponseCallbackBridge(self.callbackQueue, - completion, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, MediaPlaybackClusterPlaybackResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - MediaPlayback::Commands::Stop::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } + if (params == nil) { + params = [[MTRMediaPlaybackClusterStopParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = MediaPlayback::Commands::Stop::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRMediaPlaybackClusterPlaybackResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} - (void)startOverWithCompletion:(void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, NSError * _Nullable error))completion { [self startOverWithParams:nil completion:completion]; } - (void)startOverWithParams:(MTRMediaPlaybackClusterStartOverParams * _Nullable)params completion:(void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, NSError * _Nullable error))completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRMediaPlaybackClusterPlaybackResponseCallbackBridge(self.callbackQueue, - completion, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, MediaPlaybackClusterPlaybackResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - MediaPlayback::Commands::StartOver::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } + if (params == nil) { + params = [[MTRMediaPlaybackClusterStartOverParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = MediaPlayback::Commands::StartOver::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRMediaPlaybackClusterPlaybackResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} - (void)previousWithCompletion:(void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, NSError * _Nullable error))completion { [self previousWithParams:nil completion:completion]; } - (void)previousWithParams:(MTRMediaPlaybackClusterPreviousParams * _Nullable)params completion:(void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, NSError * _Nullable error))completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRMediaPlaybackClusterPlaybackResponseCallbackBridge(self.callbackQueue, - completion, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, MediaPlaybackClusterPlaybackResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - MediaPlayback::Commands::Previous::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } + if (params == nil) { + params = [[MTRMediaPlaybackClusterPreviousParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = MediaPlayback::Commands::Previous::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRMediaPlaybackClusterPlaybackResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} - (void)nextWithCompletion:(void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, NSError * _Nullable error))completion { [self nextWithParams:nil completion:completion]; } - (void)nextWithParams:(MTRMediaPlaybackClusterNextParams * _Nullable)params completion:(void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, NSError * _Nullable error))completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRMediaPlaybackClusterPlaybackResponseCallbackBridge(self.callbackQueue, - completion, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, MediaPlaybackClusterPlaybackResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - MediaPlayback::Commands::Next::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } + if (params == nil) { + params = [[MTRMediaPlaybackClusterNextParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = MediaPlayback::Commands::Next::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRMediaPlaybackClusterPlaybackResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} - (void)rewindWithCompletion:(void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, NSError * _Nullable error))completion { [self rewindWithParams:nil completion:completion]; } - (void)rewindWithParams:(MTRMediaPlaybackClusterRewindParams * _Nullable)params completion:(void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, NSError * _Nullable error))completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRMediaPlaybackClusterPlaybackResponseCallbackBridge(self.callbackQueue, - completion, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, MediaPlaybackClusterPlaybackResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - MediaPlayback::Commands::Rewind::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } + if (params == nil) { + params = [[MTRMediaPlaybackClusterRewindParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = MediaPlayback::Commands::Rewind::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRMediaPlaybackClusterPlaybackResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} - (void)fastForwardWithCompletion:(void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, NSError * _Nullable error))completion { [self fastForwardWithParams:nil completion:completion]; } - (void)fastForwardWithParams:(MTRMediaPlaybackClusterFastForwardParams * _Nullable)params completion:(void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, NSError * _Nullable error))completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRMediaPlaybackClusterPlaybackResponseCallbackBridge(self.callbackQueue, - completion, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, MediaPlaybackClusterPlaybackResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - MediaPlayback::Commands::FastForward::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } + if (params == nil) { + params = [[MTRMediaPlaybackClusterFastForwardParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = MediaPlayback::Commands::FastForward::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRMediaPlaybackClusterPlaybackResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} - (void)skipForwardWithParams:(MTRMediaPlaybackClusterSkipForwardParams *)params completion:(void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, NSError * _Nullable error))completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRMediaPlaybackClusterPlaybackResponseCallbackBridge(self.callbackQueue, - completion, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, MediaPlaybackClusterPlaybackResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - MediaPlayback::Commands::SkipForward::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.deltaPositionMilliseconds = params.deltaPositionMilliseconds.unsignedLongLongValue; + if (params == nil) { + params = [[MTRMediaPlaybackClusterSkipForwardParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = MediaPlayback::Commands::SkipForward::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRMediaPlaybackClusterPlaybackResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} - (void)skipBackwardWithParams:(MTRMediaPlaybackClusterSkipBackwardParams *)params completion:(void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, NSError * _Nullable error))completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRMediaPlaybackClusterPlaybackResponseCallbackBridge(self.callbackQueue, - completion, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, MediaPlaybackClusterPlaybackResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - MediaPlayback::Commands::SkipBackward::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.deltaPositionMilliseconds = params.deltaPositionMilliseconds.unsignedLongLongValue; + if (params == nil) { + params = [[MTRMediaPlaybackClusterSkipBackwardParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = MediaPlayback::Commands::SkipBackward::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRMediaPlaybackClusterPlaybackResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} - (void)seekWithParams:(MTRMediaPlaybackClusterSeekParams *)params completion:(void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, NSError * _Nullable error))completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRMediaPlaybackClusterPlaybackResponseCallbackBridge(self.callbackQueue, - completion, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, MediaPlaybackClusterPlaybackResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - MediaPlayback::Commands::Seek::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.position = params.position.unsignedLongLongValue; + if (params == nil) { + params = [[MTRMediaPlaybackClusterSeekParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = MediaPlayback::Commands::Seek::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRMediaPlaybackClusterPlaybackResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; } - (void)readAttributeCurrentStateWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -91891,145 +89729,107 @@ - (instancetype)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)en - (void)selectInputWithParams:(MTRMediaInputClusterSelectInputParams *)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - MediaInput::Commands::SelectInput::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.index = params.index.unsignedCharValue; + if (params == nil) { + params = [[MTRMediaInputClusterSelectInputParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = MediaInput::Commands::SelectInput::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} - (void)showInputStatusWithCompletion:(MTRStatusCompletion)completion { [self showInputStatusWithParams:nil completion:completion]; } - (void)showInputStatusWithParams:(MTRMediaInputClusterShowInputStatusParams * _Nullable)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - MediaInput::Commands::ShowInputStatus::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } + if (params == nil) { + params = [[MTRMediaInputClusterShowInputStatusParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = MediaInput::Commands::ShowInputStatus::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} - (void)hideInputStatusWithCompletion:(MTRStatusCompletion)completion { [self hideInputStatusWithParams:nil completion:completion]; } - (void)hideInputStatusWithParams:(MTRMediaInputClusterHideInputStatusParams * _Nullable)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - MediaInput::Commands::HideInputStatus::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } + if (params == nil) { + params = [[MTRMediaInputClusterHideInputStatusParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = MediaInput::Commands::HideInputStatus::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} - (void)renameInputWithParams:(MTRMediaInputClusterRenameInputParams *)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - MediaInput::Commands::RenameInput::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.index = params.index.unsignedCharValue; - request.name = AsCharSpan(params.name); + if (params == nil) { + params = [[MTRMediaInputClusterRenameInputParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = MediaInput::Commands::RenameInput::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; } - (void)readAttributeInputListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion @@ -92643,35 +90443,27 @@ - (void)sleepWithCompletion:(MTRStatusCompletion)completion } - (void)sleepWithParams:(MTRLowPowerClusterSleepParams * _Nullable)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - LowPower::Commands::Sleep::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } + if (params == nil) { + params = [[MTRLowPowerClusterSleepParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = LowPower::Commands::Sleep::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; } - (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion @@ -93116,33 +90908,27 @@ - (instancetype)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)en - (void)sendKeyWithParams:(MTRKeypadInputClusterSendKeyParams *)params completion:(void (^)(MTRKeypadInputClusterSendKeyResponseParams * _Nullable data, NSError * _Nullable error))completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRKeypadInputClusterSendKeyResponseCallbackBridge(self.callbackQueue, - completion, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, KeypadInputClusterSendKeyResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - KeypadInput::Commands::SendKey::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.keyCode = static_cast>(params.keyCode.unsignedCharValue); + if (params == nil) { + params = [[MTRKeypadInputClusterSendKeyParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = KeypadInput::Commands::SendKey::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRKeypadInputClusterSendKeyResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; } - (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion @@ -93586,210 +91372,51 @@ - (instancetype)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)en - (void)launchContentWithParams:(MTRContentLauncherClusterLaunchContentParams *)params completion:(void (^)(MTRContentLauncherClusterLauncherResponseParams * _Nullable data, NSError * _Nullable error))completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRContentLauncherClusterLauncherResponseCallbackBridge(self.callbackQueue, - completion, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, ContentLauncherClusterLauncherResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - ContentLauncher::Commands::LaunchContent::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - { - using ListType_1 = std::remove_reference_t; - using ListMemberType_1 = ListMemberTypeGetter::Type; - if (params.search.parameterList.count != 0) { - auto * listHolder_1 = new ListHolder(params.search.parameterList.count); - if (listHolder_1 == nullptr || listHolder_1->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_1); - for (size_t i_1 = 0; i_1 < params.search.parameterList.count; ++i_1) { - if (![params.search.parameterList[i_1] isKindOfClass:[MTRContentLauncherClusterParameterStruct class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_1 = (MTRContentLauncherClusterParameterStruct *) params.search.parameterList[i_1]; - listHolder_1->mList[i_1].type = static_castmList[i_1].type)>>(element_1.type.unsignedCharValue); - listHolder_1->mList[i_1].value = AsCharSpan(element_1.value); - if (element_1.externalIDList != nil) { - auto & definedValue_3 = listHolder_1->mList[i_1].externalIDList.Emplace(); - { - using ListType_4 = std::remove_reference_t; - using ListMemberType_4 = ListMemberTypeGetter::Type; - if (element_1.externalIDList.count != 0) { - auto * listHolder_4 = new ListHolder(element_1.externalIDList.count); - if (listHolder_4 == nullptr || listHolder_4->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_4); - for (size_t i_4 = 0; i_4 < element_1.externalIDList.count; ++i_4) { - if (![element_1.externalIDList[i_4] isKindOfClass:[MTRContentLauncherClusterAdditionalInfoStruct class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_4 = (MTRContentLauncherClusterAdditionalInfoStruct *) element_1.externalIDList[i_4]; - listHolder_4->mList[i_4].name = AsCharSpan(element_4.name); - listHolder_4->mList[i_4].value = AsCharSpan(element_4.value); - } - definedValue_3 = ListType_4(listHolder_4->mList, element_1.externalIDList.count); - } else { - definedValue_3 = ListType_4(); - } - } - } - } - request.search.parameterList = ListType_1(listHolder_1->mList, params.search.parameterList.count); - } else { - request.search.parameterList = ListType_1(); - } - } - request.autoPlay = params.autoPlay.boolValue; - if (params.data != nil) { - auto & definedValue_0 = request.data.Emplace(); - definedValue_0 = AsCharSpan(params.data); - } + if (params == nil) { + params = [[MTRContentLauncherClusterLaunchContentParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = ContentLauncher::Commands::LaunchContent::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRContentLauncherClusterLauncherResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} - (void)launchURLWithParams:(MTRContentLauncherClusterLaunchURLParams *)params completion:(void (^)(MTRContentLauncherClusterLauncherResponseParams * _Nullable data, NSError * _Nullable error))completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRContentLauncherClusterLauncherResponseCallbackBridge(self.callbackQueue, - completion, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, ContentLauncherClusterLauncherResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - ContentLauncher::Commands::LaunchURL::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.contentURL = AsCharSpan(params.contentURL); - if (params.displayString != nil) { - auto & definedValue_0 = request.displayString.Emplace(); - definedValue_0 = AsCharSpan(params.displayString); - } - if (params.brandingInformation != nil) { - auto & definedValue_0 = request.brandingInformation.Emplace(); - definedValue_0.providerName = AsCharSpan(params.brandingInformation.providerName); - if (params.brandingInformation.background != nil) { - auto & definedValue_2 = definedValue_0.background.Emplace(); - if (params.brandingInformation.background.imageURL != nil) { - auto & definedValue_4 = definedValue_2.imageURL.Emplace(); - definedValue_4 = AsCharSpan(params.brandingInformation.background.imageURL); - } - if (params.brandingInformation.background.color != nil) { - auto & definedValue_4 = definedValue_2.color.Emplace(); - definedValue_4 = AsCharSpan(params.brandingInformation.background.color); - } - if (params.brandingInformation.background.size != nil) { - auto & definedValue_4 = definedValue_2.size.Emplace(); - definedValue_4.width = params.brandingInformation.background.size.width.doubleValue; - definedValue_4.height = params.brandingInformation.background.size.height.doubleValue; - definedValue_4.metric = static_cast>(params.brandingInformation.background.size.metric.unsignedCharValue); - } - } - if (params.brandingInformation.logo != nil) { - auto & definedValue_2 = definedValue_0.logo.Emplace(); - if (params.brandingInformation.logo.imageURL != nil) { - auto & definedValue_4 = definedValue_2.imageURL.Emplace(); - definedValue_4 = AsCharSpan(params.brandingInformation.logo.imageURL); - } - if (params.brandingInformation.logo.color != nil) { - auto & definedValue_4 = definedValue_2.color.Emplace(); - definedValue_4 = AsCharSpan(params.brandingInformation.logo.color); - } - if (params.brandingInformation.logo.size != nil) { - auto & definedValue_4 = definedValue_2.size.Emplace(); - definedValue_4.width = params.brandingInformation.logo.size.width.doubleValue; - definedValue_4.height = params.brandingInformation.logo.size.height.doubleValue; - definedValue_4.metric = static_cast>(params.brandingInformation.logo.size.metric.unsignedCharValue); - } - } - if (params.brandingInformation.progressBar != nil) { - auto & definedValue_2 = definedValue_0.progressBar.Emplace(); - if (params.brandingInformation.progressBar.imageURL != nil) { - auto & definedValue_4 = definedValue_2.imageURL.Emplace(); - definedValue_4 = AsCharSpan(params.brandingInformation.progressBar.imageURL); - } - if (params.brandingInformation.progressBar.color != nil) { - auto & definedValue_4 = definedValue_2.color.Emplace(); - definedValue_4 = AsCharSpan(params.brandingInformation.progressBar.color); - } - if (params.brandingInformation.progressBar.size != nil) { - auto & definedValue_4 = definedValue_2.size.Emplace(); - definedValue_4.width = params.brandingInformation.progressBar.size.width.doubleValue; - definedValue_4.height = params.brandingInformation.progressBar.size.height.doubleValue; - definedValue_4.metric = static_cast>(params.brandingInformation.progressBar.size.metric.unsignedCharValue); - } - } - if (params.brandingInformation.splash != nil) { - auto & definedValue_2 = definedValue_0.splash.Emplace(); - if (params.brandingInformation.splash.imageURL != nil) { - auto & definedValue_4 = definedValue_2.imageURL.Emplace(); - definedValue_4 = AsCharSpan(params.brandingInformation.splash.imageURL); - } - if (params.brandingInformation.splash.color != nil) { - auto & definedValue_4 = definedValue_2.color.Emplace(); - definedValue_4 = AsCharSpan(params.brandingInformation.splash.color); - } - if (params.brandingInformation.splash.size != nil) { - auto & definedValue_4 = definedValue_2.size.Emplace(); - definedValue_4.width = params.brandingInformation.splash.size.width.doubleValue; - definedValue_4.height = params.brandingInformation.splash.size.height.doubleValue; - definedValue_4.metric = static_cast>(params.brandingInformation.splash.size.metric.unsignedCharValue); - } - } - if (params.brandingInformation.waterMark != nil) { - auto & definedValue_2 = definedValue_0.waterMark.Emplace(); - if (params.brandingInformation.waterMark.imageURL != nil) { - auto & definedValue_4 = definedValue_2.imageURL.Emplace(); - definedValue_4 = AsCharSpan(params.brandingInformation.waterMark.imageURL); - } - if (params.brandingInformation.waterMark.color != nil) { - auto & definedValue_4 = definedValue_2.color.Emplace(); - definedValue_4 = AsCharSpan(params.brandingInformation.waterMark.color); - } - if (params.brandingInformation.waterMark.size != nil) { - auto & definedValue_4 = definedValue_2.size.Emplace(); - definedValue_4.width = params.brandingInformation.waterMark.size.width.doubleValue; - definedValue_4.height = params.brandingInformation.waterMark.size.height.doubleValue; - definedValue_4.metric = static_cast>(params.brandingInformation.waterMark.size.metric.unsignedCharValue); - } - } - } + if (params == nil) { + params = [[MTRContentLauncherClusterLaunchURLParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = ContentLauncher::Commands::LaunchURL::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRContentLauncherClusterLauncherResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; } - (void)readAttributeAcceptHeaderWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion @@ -94429,71 +92056,51 @@ - (instancetype)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)en - (void)selectOutputWithParams:(MTRAudioOutputClusterSelectOutputParams *)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - AudioOutput::Commands::SelectOutput::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.index = params.index.unsignedCharValue; + if (params == nil) { + params = [[MTRAudioOutputClusterSelectOutputParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = AudioOutput::Commands::SelectOutput::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} - (void)renameOutputWithParams:(MTRAudioOutputClusterRenameOutputParams *)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - AudioOutput::Commands::RenameOutput::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.index = params.index.unsignedCharValue; - request.name = AsCharSpan(params.name); + if (params == nil) { + params = [[MTRAudioOutputClusterRenameOutputParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = AudioOutput::Commands::RenameOutput::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; } - (void)readAttributeOutputListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion @@ -95085,117 +92692,75 @@ - (instancetype)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)en - (void)launchAppWithParams:(MTRApplicationLauncherClusterLaunchAppParams * _Nullable)params completion:(void (^)(MTRApplicationLauncherClusterLauncherResponseParams * _Nullable data, NSError * _Nullable error))completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRApplicationLauncherClusterLauncherResponseCallbackBridge(self.callbackQueue, - completion, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, ApplicationLauncherClusterLauncherResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - ApplicationLauncher::Commands::LaunchApp::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - if (params != nil) { - if (params.application != nil) { - auto & definedValue_0 = request.application.Emplace(); - definedValue_0.catalogVendorID = params.application.catalogVendorID.unsignedShortValue; - definedValue_0.applicationID = AsCharSpan(params.application.applicationID); - } - if (params.data != nil) { - auto & definedValue_0 = request.data.Emplace(); - definedValue_0 = AsByteSpan(params.data); - } - } + if (params == nil) { + params = [[MTRApplicationLauncherClusterLaunchAppParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = ApplicationLauncher::Commands::LaunchApp::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRApplicationLauncherClusterLauncherResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} - (void)stopAppWithParams:(MTRApplicationLauncherClusterStopAppParams * _Nullable)params completion:(void (^)(MTRApplicationLauncherClusterLauncherResponseParams * _Nullable data, NSError * _Nullable error))completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRApplicationLauncherClusterLauncherResponseCallbackBridge(self.callbackQueue, - completion, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, ApplicationLauncherClusterLauncherResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - ApplicationLauncher::Commands::StopApp::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - if (params != nil) { - if (params.application != nil) { - auto & definedValue_0 = request.application.Emplace(); - definedValue_0.catalogVendorID = params.application.catalogVendorID.unsignedShortValue; - definedValue_0.applicationID = AsCharSpan(params.application.applicationID); - } - } + if (params == nil) { + params = [[MTRApplicationLauncherClusterStopAppParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = ApplicationLauncher::Commands::StopApp::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRApplicationLauncherClusterLauncherResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} - (void)hideAppWithParams:(MTRApplicationLauncherClusterHideAppParams * _Nullable)params completion:(void (^)(MTRApplicationLauncherClusterLauncherResponseParams * _Nullable data, NSError * _Nullable error))completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRApplicationLauncherClusterLauncherResponseCallbackBridge(self.callbackQueue, - completion, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, ApplicationLauncherClusterLauncherResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - ApplicationLauncher::Commands::HideApp::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - if (params != nil) { - if (params.application != nil) { - auto & definedValue_0 = request.application.Emplace(); - definedValue_0.catalogVendorID = params.application.catalogVendorID.unsignedShortValue; - definedValue_0.applicationID = AsCharSpan(params.application.applicationID); - } - } + if (params == nil) { + params = [[MTRApplicationLauncherClusterHideAppParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = ApplicationLauncher::Commands::HideApp::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRApplicationLauncherClusterLauncherResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; } - (void)readAttributeCatalogListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion @@ -96867,114 +94432,88 @@ - (instancetype)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)en - (void)getSetupPINWithParams:(MTRAccountLoginClusterGetSetupPINParams *)params completion:(void (^)(MTRAccountLoginClusterGetSetupPINResponseParams * _Nullable data, NSError * _Nullable error))completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRAccountLoginClusterGetSetupPINResponseCallbackBridge(self.callbackQueue, - completion, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, AccountLoginClusterGetSetupPINResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - AccountLogin::Commands::GetSetupPIN::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - if (!timedInvokeTimeoutMs.HasValue()) { - timedInvokeTimeoutMs.SetValue(10000); - } - request.tempAccountIdentifier = AsCharSpan(params.tempAccountIdentifier); + if (params == nil) { + params = [[MTRAccountLoginClusterGetSetupPINParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + if (timedInvokeTimeoutMs == nil) { + timedInvokeTimeoutMs = @(10000); + } + using RequestType = AccountLogin::Commands::GetSetupPIN::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRAccountLoginClusterGetSetupPINResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} - (void)loginWithParams:(MTRAccountLoginClusterLoginParams *)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - AccountLogin::Commands::Login::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - if (!timedInvokeTimeoutMs.HasValue()) { - timedInvokeTimeoutMs.SetValue(10000); - } - request.tempAccountIdentifier = AsCharSpan(params.tempAccountIdentifier); - request.setupPIN = AsCharSpan(params.setupPIN); + if (params == nil) { + params = [[MTRAccountLoginClusterLoginParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + if (timedInvokeTimeoutMs == nil) { + timedInvokeTimeoutMs = @(10000); + } + using RequestType = AccountLogin::Commands::Login::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} - (void)logoutWithCompletion:(MTRStatusCompletion)completion { [self logoutWithParams:nil completion:completion]; } - (void)logoutWithParams:(MTRAccountLoginClusterLogoutParams * _Nullable)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - AccountLogin::Commands::Logout::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - if (!timedInvokeTimeoutMs.HasValue()) { - timedInvokeTimeoutMs.SetValue(10000); - } + if (params == nil) { + params = [[MTRAccountLoginClusterLogoutParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + if (timedInvokeTimeoutMs == nil) { + timedInvokeTimeoutMs = @(10000); + } + + using RequestType = AccountLogin::Commands::Logout::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; } - (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion @@ -97436,71 +94975,51 @@ - (void)getProfileInfoCommandWithCompletion:(MTRStatusCompletion)completion } - (void)getProfileInfoCommandWithParams:(MTRElectricalMeasurementClusterGetProfileInfoCommandParams * _Nullable)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - ElectricalMeasurement::Commands::GetProfileInfoCommand::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } + if (params == nil) { + params = [[MTRElectricalMeasurementClusterGetProfileInfoCommandParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = ElectricalMeasurement::Commands::GetProfileInfoCommand::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} - (void)getMeasurementProfileCommandWithParams:(MTRElectricalMeasurementClusterGetMeasurementProfileCommandParams *)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - ElectricalMeasurement::Commands::GetMeasurementProfileCommand::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.attributeId = params.attributeId.unsignedShortValue; - request.startTime = params.startTime.unsignedIntValue; - request.numberOfIntervals = params.numberOfIntervals.unsignedCharValue; + if (params == nil) { + params = [[MTRElectricalMeasurementClusterGetMeasurementProfileCommandParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = ElectricalMeasurement::Commands::GetMeasurementProfileCommand::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; } - (void)readAttributeMeasurementTypeWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -107634,1413 +105153,550 @@ - (void)testWithCompletion:(MTRStatusCompletion)completion } - (void)testWithParams:(MTRUnitTestingClusterTestParams * _Nullable)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - UnitTesting::Commands::Test::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } + if (params == nil) { + params = [[MTRUnitTestingClusterTestParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = UnitTesting::Commands::Test::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} - (void)testNotHandledWithCompletion:(MTRStatusCompletion)completion { [self testNotHandledWithParams:nil completion:completion]; } - (void)testNotHandledWithParams:(MTRUnitTestingClusterTestNotHandledParams * _Nullable)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - UnitTesting::Commands::TestNotHandled::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } + if (params == nil) { + params = [[MTRUnitTestingClusterTestNotHandledParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = UnitTesting::Commands::TestNotHandled::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} - (void)testSpecificWithCompletion:(void (^)(MTRUnitTestingClusterTestSpecificResponseParams * _Nullable data, NSError * _Nullable error))completion { [self testSpecificWithParams:nil completion:completion]; } - (void)testSpecificWithParams:(MTRUnitTestingClusterTestSpecificParams * _Nullable)params completion:(void (^)(MTRUnitTestingClusterTestSpecificResponseParams * _Nullable data, NSError * _Nullable error))completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRUnitTestingClusterTestSpecificResponseCallbackBridge(self.callbackQueue, - completion, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, UnitTestingClusterTestSpecificResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - UnitTesting::Commands::TestSpecific::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } + if (params == nil) { + params = [[MTRUnitTestingClusterTestSpecificParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = UnitTesting::Commands::TestSpecific::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRUnitTestingClusterTestSpecificResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} - (void)testUnknownCommandWithCompletion:(MTRStatusCompletion)completion { [self testUnknownCommandWithParams:nil completion:completion]; } - (void)testUnknownCommandWithParams:(MTRUnitTestingClusterTestUnknownCommandParams * _Nullable)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - UnitTesting::Commands::TestUnknownCommand::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } + if (params == nil) { + params = [[MTRUnitTestingClusterTestUnknownCommandParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = UnitTesting::Commands::TestUnknownCommand::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} - (void)testAddArgumentsWithParams:(MTRUnitTestingClusterTestAddArgumentsParams *)params completion:(void (^)(MTRUnitTestingClusterTestAddArgumentsResponseParams * _Nullable data, NSError * _Nullable error))completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRUnitTestingClusterTestAddArgumentsResponseCallbackBridge(self.callbackQueue, - completion, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, UnitTestingClusterTestAddArgumentsResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - UnitTesting::Commands::TestAddArguments::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.arg1 = params.arg1.unsignedCharValue; - request.arg2 = params.arg2.unsignedCharValue; + if (params == nil) { + params = [[MTRUnitTestingClusterTestAddArgumentsParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = UnitTesting::Commands::TestAddArguments::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRUnitTestingClusterTestAddArgumentsResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} - (void)testSimpleArgumentRequestWithParams:(MTRUnitTestingClusterTestSimpleArgumentRequestParams *)params completion:(void (^)(MTRUnitTestingClusterTestSimpleArgumentResponseParams * _Nullable data, NSError * _Nullable error))completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRUnitTestingClusterTestSimpleArgumentResponseCallbackBridge(self.callbackQueue, - completion, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, UnitTestingClusterTestSimpleArgumentResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - UnitTesting::Commands::TestSimpleArgumentRequest::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.arg1 = params.arg1.boolValue; + if (params == nil) { + params = [[MTRUnitTestingClusterTestSimpleArgumentRequestParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = UnitTesting::Commands::TestSimpleArgumentRequest::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRUnitTestingClusterTestSimpleArgumentResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} - (void)testStructArrayArgumentRequestWithParams:(MTRUnitTestingClusterTestStructArrayArgumentRequestParams *)params completion:(void (^)(MTRUnitTestingClusterTestStructArrayArgumentResponseParams * _Nullable data, NSError * _Nullable error))completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRUnitTestingClusterTestStructArrayArgumentResponseCallbackBridge(self.callbackQueue, - completion, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, UnitTestingClusterTestStructArrayArgumentResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - UnitTesting::Commands::TestStructArrayArgumentRequest::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (params.arg1.count != 0) { - auto * listHolder_0 = new ListHolder(params.arg1.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < params.arg1.count; ++i_0) { - if (![params.arg1[i_0] isKindOfClass:[MTRUnitTestingClusterNestedStructList class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (MTRUnitTestingClusterNestedStructList *) params.arg1[i_0]; - listHolder_0->mList[i_0].a = element_0.a.unsignedCharValue; - listHolder_0->mList[i_0].b = element_0.b.boolValue; - listHolder_0->mList[i_0].c.a = element_0.c.a.unsignedCharValue; - listHolder_0->mList[i_0].c.b = element_0.c.b.boolValue; - listHolder_0->mList[i_0].c.c = static_castmList[i_0].c.c)>>(element_0.c.c.unsignedCharValue); - listHolder_0->mList[i_0].c.d = AsByteSpan(element_0.c.d); - listHolder_0->mList[i_0].c.e = AsCharSpan(element_0.c.e); - listHolder_0->mList[i_0].c.f = static_castmList[i_0].c.f)>>(element_0.c.f.unsignedCharValue); - listHolder_0->mList[i_0].c.g = element_0.c.g.floatValue; - listHolder_0->mList[i_0].c.h = element_0.c.h.doubleValue; - { - using ListType_2 = std::remove_reference_tmList[i_0].d)>; - using ListMemberType_2 = ListMemberTypeGetter::Type; - if (element_0.d.count != 0) { - auto * listHolder_2 = new ListHolder(element_0.d.count); - if (listHolder_2 == nullptr || listHolder_2->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_2); - for (size_t i_2 = 0; i_2 < element_0.d.count; ++i_2) { - if (![element_0.d[i_2] isKindOfClass:[MTRUnitTestingClusterSimpleStruct class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_2 = (MTRUnitTestingClusterSimpleStruct *) element_0.d[i_2]; - listHolder_2->mList[i_2].a = element_2.a.unsignedCharValue; - listHolder_2->mList[i_2].b = element_2.b.boolValue; - listHolder_2->mList[i_2].c = static_castmList[i_2].c)>>(element_2.c.unsignedCharValue); - listHolder_2->mList[i_2].d = AsByteSpan(element_2.d); - listHolder_2->mList[i_2].e = AsCharSpan(element_2.e); - listHolder_2->mList[i_2].f = static_castmList[i_2].f)>>(element_2.f.unsignedCharValue); - listHolder_2->mList[i_2].g = element_2.g.floatValue; - listHolder_2->mList[i_2].h = element_2.h.doubleValue; - } - listHolder_0->mList[i_0].d = ListType_2(listHolder_2->mList, element_0.d.count); - } else { - listHolder_0->mList[i_0].d = ListType_2(); - } - } - { - using ListType_2 = std::remove_reference_tmList[i_0].e)>; - using ListMemberType_2 = ListMemberTypeGetter::Type; - if (element_0.e.count != 0) { - auto * listHolder_2 = new ListHolder(element_0.e.count); - if (listHolder_2 == nullptr || listHolder_2->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_2); - for (size_t i_2 = 0; i_2 < element_0.e.count; ++i_2) { - if (![element_0.e[i_2] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_2 = (NSNumber *) element_0.e[i_2]; - listHolder_2->mList[i_2] = element_2.unsignedIntValue; - } - listHolder_0->mList[i_0].e = ListType_2(listHolder_2->mList, element_0.e.count); - } else { - listHolder_0->mList[i_0].e = ListType_2(); - } - } - { - using ListType_2 = std::remove_reference_tmList[i_0].f)>; - using ListMemberType_2 = ListMemberTypeGetter::Type; - if (element_0.f.count != 0) { - auto * listHolder_2 = new ListHolder(element_0.f.count); - if (listHolder_2 == nullptr || listHolder_2->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_2); - for (size_t i_2 = 0; i_2 < element_0.f.count; ++i_2) { - if (![element_0.f[i_2] isKindOfClass:[NSData class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_2 = (NSData *) element_0.f[i_2]; - listHolder_2->mList[i_2] = AsByteSpan(element_2); - } - listHolder_0->mList[i_0].f = ListType_2(listHolder_2->mList, element_0.f.count); - } else { - listHolder_0->mList[i_0].f = ListType_2(); - } - } - { - using ListType_2 = std::remove_reference_tmList[i_0].g)>; - using ListMemberType_2 = ListMemberTypeGetter::Type; - if (element_0.g.count != 0) { - auto * listHolder_2 = new ListHolder(element_0.g.count); - if (listHolder_2 == nullptr || listHolder_2->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_2); - for (size_t i_2 = 0; i_2 < element_0.g.count; ++i_2) { - if (![element_0.g[i_2] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_2 = (NSNumber *) element_0.g[i_2]; - listHolder_2->mList[i_2] = element_2.unsignedCharValue; - } - listHolder_0->mList[i_0].g = ListType_2(listHolder_2->mList, element_0.g.count); - } else { - listHolder_0->mList[i_0].g = ListType_2(); - } - } - } - request.arg1 = ListType_0(listHolder_0->mList, params.arg1.count); - } else { - request.arg1 = ListType_0(); - } - } - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (params.arg2.count != 0) { - auto * listHolder_0 = new ListHolder(params.arg2.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < params.arg2.count; ++i_0) { - if (![params.arg2[i_0] isKindOfClass:[MTRUnitTestingClusterSimpleStruct class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (MTRUnitTestingClusterSimpleStruct *) params.arg2[i_0]; - listHolder_0->mList[i_0].a = element_0.a.unsignedCharValue; - listHolder_0->mList[i_0].b = element_0.b.boolValue; - listHolder_0->mList[i_0].c = static_castmList[i_0].c)>>(element_0.c.unsignedCharValue); - listHolder_0->mList[i_0].d = AsByteSpan(element_0.d); - listHolder_0->mList[i_0].e = AsCharSpan(element_0.e); - listHolder_0->mList[i_0].f = static_castmList[i_0].f)>>(element_0.f.unsignedCharValue); - listHolder_0->mList[i_0].g = element_0.g.floatValue; - listHolder_0->mList[i_0].h = element_0.h.doubleValue; - } - request.arg2 = ListType_0(listHolder_0->mList, params.arg2.count); - } else { - request.arg2 = ListType_0(); - } - } - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (params.arg3.count != 0) { - auto * listHolder_0 = new ListHolder(params.arg3.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < params.arg3.count; ++i_0) { - if (![params.arg3[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) params.arg3[i_0]; - listHolder_0->mList[i_0] = static_castmList[i_0])>>(element_0.unsignedCharValue); - } - request.arg3 = ListType_0(listHolder_0->mList, params.arg3.count); - } else { - request.arg3 = ListType_0(); - } - } - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (params.arg4.count != 0) { - auto * listHolder_0 = new ListHolder(params.arg4.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < params.arg4.count; ++i_0) { - if (![params.arg4[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) params.arg4[i_0]; - listHolder_0->mList[i_0] = element_0.boolValue; - } - request.arg4 = ListType_0(listHolder_0->mList, params.arg4.count); - } else { - request.arg4 = ListType_0(); - } - } - request.arg5 = static_cast>(params.arg5.unsignedCharValue); - request.arg6 = params.arg6.boolValue; + if (params == nil) { + params = [[MTRUnitTestingClusterTestStructArrayArgumentRequestParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = UnitTesting::Commands::TestStructArrayArgumentRequest::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRUnitTestingClusterTestStructArrayArgumentResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} - (void)testStructArgumentRequestWithParams:(MTRUnitTestingClusterTestStructArgumentRequestParams *)params completion:(void (^)(MTRUnitTestingClusterBooleanResponseParams * _Nullable data, NSError * _Nullable error))completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRUnitTestingClusterBooleanResponseCallbackBridge(self.callbackQueue, - completion, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, UnitTestingClusterBooleanResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - UnitTesting::Commands::TestStructArgumentRequest::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.arg1.a = params.arg1.a.unsignedCharValue; - request.arg1.b = params.arg1.b.boolValue; - request.arg1.c = static_cast>(params.arg1.c.unsignedCharValue); - request.arg1.d = AsByteSpan(params.arg1.d); - request.arg1.e = AsCharSpan(params.arg1.e); - request.arg1.f = static_cast>(params.arg1.f.unsignedCharValue); - request.arg1.g = params.arg1.g.floatValue; - request.arg1.h = params.arg1.h.doubleValue; + if (params == nil) { + params = [[MTRUnitTestingClusterTestStructArgumentRequestParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = UnitTesting::Commands::TestStructArgumentRequest::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRUnitTestingClusterBooleanResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} - (void)testNestedStructArgumentRequestWithParams:(MTRUnitTestingClusterTestNestedStructArgumentRequestParams *)params completion:(void (^)(MTRUnitTestingClusterBooleanResponseParams * _Nullable data, NSError * _Nullable error))completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRUnitTestingClusterBooleanResponseCallbackBridge(self.callbackQueue, - completion, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, UnitTestingClusterBooleanResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - UnitTesting::Commands::TestNestedStructArgumentRequest::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.arg1.a = params.arg1.a.unsignedCharValue; - request.arg1.b = params.arg1.b.boolValue; - request.arg1.c.a = params.arg1.c.a.unsignedCharValue; - request.arg1.c.b = params.arg1.c.b.boolValue; - request.arg1.c.c = static_cast>(params.arg1.c.c.unsignedCharValue); - request.arg1.c.d = AsByteSpan(params.arg1.c.d); - request.arg1.c.e = AsCharSpan(params.arg1.c.e); - request.arg1.c.f = static_cast>(params.arg1.c.f.unsignedCharValue); - request.arg1.c.g = params.arg1.c.g.floatValue; - request.arg1.c.h = params.arg1.c.h.doubleValue; - - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + if (params == nil) { + params = [[MTRUnitTestingClusterTestNestedStructArgumentRequestParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = UnitTesting::Commands::TestNestedStructArgumentRequest::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRUnitTestingClusterBooleanResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} - (void)testListStructArgumentRequestWithParams:(MTRUnitTestingClusterTestListStructArgumentRequestParams *)params completion:(void (^)(MTRUnitTestingClusterBooleanResponseParams * _Nullable data, NSError * _Nullable error))completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRUnitTestingClusterBooleanResponseCallbackBridge(self.callbackQueue, - completion, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, UnitTestingClusterBooleanResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - UnitTesting::Commands::TestListStructArgumentRequest::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (params.arg1.count != 0) { - auto * listHolder_0 = new ListHolder(params.arg1.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < params.arg1.count; ++i_0) { - if (![params.arg1[i_0] isKindOfClass:[MTRUnitTestingClusterSimpleStruct class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (MTRUnitTestingClusterSimpleStruct *) params.arg1[i_0]; - listHolder_0->mList[i_0].a = element_0.a.unsignedCharValue; - listHolder_0->mList[i_0].b = element_0.b.boolValue; - listHolder_0->mList[i_0].c = static_castmList[i_0].c)>>(element_0.c.unsignedCharValue); - listHolder_0->mList[i_0].d = AsByteSpan(element_0.d); - listHolder_0->mList[i_0].e = AsCharSpan(element_0.e); - listHolder_0->mList[i_0].f = static_castmList[i_0].f)>>(element_0.f.unsignedCharValue); - listHolder_0->mList[i_0].g = element_0.g.floatValue; - listHolder_0->mList[i_0].h = element_0.h.doubleValue; - } - request.arg1 = ListType_0(listHolder_0->mList, params.arg1.count); - } else { - request.arg1 = ListType_0(); - } - } + if (params == nil) { + params = [[MTRUnitTestingClusterTestListStructArgumentRequestParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = UnitTesting::Commands::TestListStructArgumentRequest::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRUnitTestingClusterBooleanResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} - (void)testListInt8UArgumentRequestWithParams:(MTRUnitTestingClusterTestListInt8UArgumentRequestParams *)params completion:(void (^)(MTRUnitTestingClusterBooleanResponseParams * _Nullable data, NSError * _Nullable error))completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRUnitTestingClusterBooleanResponseCallbackBridge(self.callbackQueue, - completion, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, UnitTestingClusterBooleanResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - UnitTesting::Commands::TestListInt8UArgumentRequest::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (params.arg1.count != 0) { - auto * listHolder_0 = new ListHolder(params.arg1.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < params.arg1.count; ++i_0) { - if (![params.arg1[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) params.arg1[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedCharValue; - } - request.arg1 = ListType_0(listHolder_0->mList, params.arg1.count); - } else { - request.arg1 = ListType_0(); - } - } + if (params == nil) { + params = [[MTRUnitTestingClusterTestListInt8UArgumentRequestParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = UnitTesting::Commands::TestListInt8UArgumentRequest::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRUnitTestingClusterBooleanResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} - (void)testNestedStructListArgumentRequestWithParams:(MTRUnitTestingClusterTestNestedStructListArgumentRequestParams *)params completion:(void (^)(MTRUnitTestingClusterBooleanResponseParams * _Nullable data, NSError * _Nullable error))completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRUnitTestingClusterBooleanResponseCallbackBridge(self.callbackQueue, - completion, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, UnitTestingClusterBooleanResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - UnitTesting::Commands::TestNestedStructListArgumentRequest::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.arg1.a = params.arg1.a.unsignedCharValue; - request.arg1.b = params.arg1.b.boolValue; - request.arg1.c.a = params.arg1.c.a.unsignedCharValue; - request.arg1.c.b = params.arg1.c.b.boolValue; - request.arg1.c.c = static_cast>(params.arg1.c.c.unsignedCharValue); - request.arg1.c.d = AsByteSpan(params.arg1.c.d); - request.arg1.c.e = AsCharSpan(params.arg1.c.e); - request.arg1.c.f = static_cast>(params.arg1.c.f.unsignedCharValue); - request.arg1.c.g = params.arg1.c.g.floatValue; - request.arg1.c.h = params.arg1.c.h.doubleValue; - { - using ListType_1 = std::remove_reference_t; - using ListMemberType_1 = ListMemberTypeGetter::Type; - if (params.arg1.d.count != 0) { - auto * listHolder_1 = new ListHolder(params.arg1.d.count); - if (listHolder_1 == nullptr || listHolder_1->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_1); - for (size_t i_1 = 0; i_1 < params.arg1.d.count; ++i_1) { - if (![params.arg1.d[i_1] isKindOfClass:[MTRUnitTestingClusterSimpleStruct class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_1 = (MTRUnitTestingClusterSimpleStruct *) params.arg1.d[i_1]; - listHolder_1->mList[i_1].a = element_1.a.unsignedCharValue; - listHolder_1->mList[i_1].b = element_1.b.boolValue; - listHolder_1->mList[i_1].c = static_castmList[i_1].c)>>(element_1.c.unsignedCharValue); - listHolder_1->mList[i_1].d = AsByteSpan(element_1.d); - listHolder_1->mList[i_1].e = AsCharSpan(element_1.e); - listHolder_1->mList[i_1].f = static_castmList[i_1].f)>>(element_1.f.unsignedCharValue); - listHolder_1->mList[i_1].g = element_1.g.floatValue; - listHolder_1->mList[i_1].h = element_1.h.doubleValue; - } - request.arg1.d = ListType_1(listHolder_1->mList, params.arg1.d.count); - } else { - request.arg1.d = ListType_1(); - } - } - { - using ListType_1 = std::remove_reference_t; - using ListMemberType_1 = ListMemberTypeGetter::Type; - if (params.arg1.e.count != 0) { - auto * listHolder_1 = new ListHolder(params.arg1.e.count); - if (listHolder_1 == nullptr || listHolder_1->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_1); - for (size_t i_1 = 0; i_1 < params.arg1.e.count; ++i_1) { - if (![params.arg1.e[i_1] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_1 = (NSNumber *) params.arg1.e[i_1]; - listHolder_1->mList[i_1] = element_1.unsignedIntValue; - } - request.arg1.e = ListType_1(listHolder_1->mList, params.arg1.e.count); - } else { - request.arg1.e = ListType_1(); - } - } - { - using ListType_1 = std::remove_reference_t; - using ListMemberType_1 = ListMemberTypeGetter::Type; - if (params.arg1.f.count != 0) { - auto * listHolder_1 = new ListHolder(params.arg1.f.count); - if (listHolder_1 == nullptr || listHolder_1->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_1); - for (size_t i_1 = 0; i_1 < params.arg1.f.count; ++i_1) { - if (![params.arg1.f[i_1] isKindOfClass:[NSData class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_1 = (NSData *) params.arg1.f[i_1]; - listHolder_1->mList[i_1] = AsByteSpan(element_1); - } - request.arg1.f = ListType_1(listHolder_1->mList, params.arg1.f.count); - } else { - request.arg1.f = ListType_1(); - } - } - { - using ListType_1 = std::remove_reference_t; - using ListMemberType_1 = ListMemberTypeGetter::Type; - if (params.arg1.g.count != 0) { - auto * listHolder_1 = new ListHolder(params.arg1.g.count); - if (listHolder_1 == nullptr || listHolder_1->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_1); - for (size_t i_1 = 0; i_1 < params.arg1.g.count; ++i_1) { - if (![params.arg1.g[i_1] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_1 = (NSNumber *) params.arg1.g[i_1]; - listHolder_1->mList[i_1] = element_1.unsignedCharValue; - } - request.arg1.g = ListType_1(listHolder_1->mList, params.arg1.g.count); - } else { - request.arg1.g = ListType_1(); - } - } + if (params == nil) { + params = [[MTRUnitTestingClusterTestNestedStructListArgumentRequestParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = UnitTesting::Commands::TestNestedStructListArgumentRequest::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRUnitTestingClusterBooleanResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} - (void)testListNestedStructListArgumentRequestWithParams:(MTRUnitTestingClusterTestListNestedStructListArgumentRequestParams *)params completion:(void (^)(MTRUnitTestingClusterBooleanResponseParams * _Nullable data, NSError * _Nullable error))completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRUnitTestingClusterBooleanResponseCallbackBridge(self.callbackQueue, - completion, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, UnitTestingClusterBooleanResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - UnitTesting::Commands::TestListNestedStructListArgumentRequest::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (params.arg1.count != 0) { - auto * listHolder_0 = new ListHolder(params.arg1.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < params.arg1.count; ++i_0) { - if (![params.arg1[i_0] isKindOfClass:[MTRUnitTestingClusterNestedStructList class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (MTRUnitTestingClusterNestedStructList *) params.arg1[i_0]; - listHolder_0->mList[i_0].a = element_0.a.unsignedCharValue; - listHolder_0->mList[i_0].b = element_0.b.boolValue; - listHolder_0->mList[i_0].c.a = element_0.c.a.unsignedCharValue; - listHolder_0->mList[i_0].c.b = element_0.c.b.boolValue; - listHolder_0->mList[i_0].c.c = static_castmList[i_0].c.c)>>(element_0.c.c.unsignedCharValue); - listHolder_0->mList[i_0].c.d = AsByteSpan(element_0.c.d); - listHolder_0->mList[i_0].c.e = AsCharSpan(element_0.c.e); - listHolder_0->mList[i_0].c.f = static_castmList[i_0].c.f)>>(element_0.c.f.unsignedCharValue); - listHolder_0->mList[i_0].c.g = element_0.c.g.floatValue; - listHolder_0->mList[i_0].c.h = element_0.c.h.doubleValue; - { - using ListType_2 = std::remove_reference_tmList[i_0].d)>; - using ListMemberType_2 = ListMemberTypeGetter::Type; - if (element_0.d.count != 0) { - auto * listHolder_2 = new ListHolder(element_0.d.count); - if (listHolder_2 == nullptr || listHolder_2->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_2); - for (size_t i_2 = 0; i_2 < element_0.d.count; ++i_2) { - if (![element_0.d[i_2] isKindOfClass:[MTRUnitTestingClusterSimpleStruct class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_2 = (MTRUnitTestingClusterSimpleStruct *) element_0.d[i_2]; - listHolder_2->mList[i_2].a = element_2.a.unsignedCharValue; - listHolder_2->mList[i_2].b = element_2.b.boolValue; - listHolder_2->mList[i_2].c = static_castmList[i_2].c)>>(element_2.c.unsignedCharValue); - listHolder_2->mList[i_2].d = AsByteSpan(element_2.d); - listHolder_2->mList[i_2].e = AsCharSpan(element_2.e); - listHolder_2->mList[i_2].f = static_castmList[i_2].f)>>(element_2.f.unsignedCharValue); - listHolder_2->mList[i_2].g = element_2.g.floatValue; - listHolder_2->mList[i_2].h = element_2.h.doubleValue; - } - listHolder_0->mList[i_0].d = ListType_2(listHolder_2->mList, element_0.d.count); - } else { - listHolder_0->mList[i_0].d = ListType_2(); - } - } - { - using ListType_2 = std::remove_reference_tmList[i_0].e)>; - using ListMemberType_2 = ListMemberTypeGetter::Type; - if (element_0.e.count != 0) { - auto * listHolder_2 = new ListHolder(element_0.e.count); - if (listHolder_2 == nullptr || listHolder_2->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_2); - for (size_t i_2 = 0; i_2 < element_0.e.count; ++i_2) { - if (![element_0.e[i_2] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_2 = (NSNumber *) element_0.e[i_2]; - listHolder_2->mList[i_2] = element_2.unsignedIntValue; - } - listHolder_0->mList[i_0].e = ListType_2(listHolder_2->mList, element_0.e.count); - } else { - listHolder_0->mList[i_0].e = ListType_2(); - } - } - { - using ListType_2 = std::remove_reference_tmList[i_0].f)>; - using ListMemberType_2 = ListMemberTypeGetter::Type; - if (element_0.f.count != 0) { - auto * listHolder_2 = new ListHolder(element_0.f.count); - if (listHolder_2 == nullptr || listHolder_2->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_2); - for (size_t i_2 = 0; i_2 < element_0.f.count; ++i_2) { - if (![element_0.f[i_2] isKindOfClass:[NSData class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_2 = (NSData *) element_0.f[i_2]; - listHolder_2->mList[i_2] = AsByteSpan(element_2); - } - listHolder_0->mList[i_0].f = ListType_2(listHolder_2->mList, element_0.f.count); - } else { - listHolder_0->mList[i_0].f = ListType_2(); - } - } - { - using ListType_2 = std::remove_reference_tmList[i_0].g)>; - using ListMemberType_2 = ListMemberTypeGetter::Type; - if (element_0.g.count != 0) { - auto * listHolder_2 = new ListHolder(element_0.g.count); - if (listHolder_2 == nullptr || listHolder_2->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_2); - for (size_t i_2 = 0; i_2 < element_0.g.count; ++i_2) { - if (![element_0.g[i_2] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_2 = (NSNumber *) element_0.g[i_2]; - listHolder_2->mList[i_2] = element_2.unsignedCharValue; - } - listHolder_0->mList[i_0].g = ListType_2(listHolder_2->mList, element_0.g.count); - } else { - listHolder_0->mList[i_0].g = ListType_2(); - } - } - } - request.arg1 = ListType_0(listHolder_0->mList, params.arg1.count); - } else { - request.arg1 = ListType_0(); - } - } + if (params == nil) { + params = [[MTRUnitTestingClusterTestListNestedStructListArgumentRequestParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = UnitTesting::Commands::TestListNestedStructListArgumentRequest::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRUnitTestingClusterBooleanResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} - (void)testListInt8UReverseRequestWithParams:(MTRUnitTestingClusterTestListInt8UReverseRequestParams *)params completion:(void (^)(MTRUnitTestingClusterTestListInt8UReverseResponseParams * _Nullable data, NSError * _Nullable error))completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRUnitTestingClusterTestListInt8UReverseResponseCallbackBridge(self.callbackQueue, - completion, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, UnitTestingClusterTestListInt8UReverseResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - UnitTesting::Commands::TestListInt8UReverseRequest::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (params.arg1.count != 0) { - auto * listHolder_0 = new ListHolder(params.arg1.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < params.arg1.count; ++i_0) { - if (![params.arg1[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) params.arg1[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedCharValue; - } - request.arg1 = ListType_0(listHolder_0->mList, params.arg1.count); - } else { - request.arg1 = ListType_0(); - } - } + if (params == nil) { + params = [[MTRUnitTestingClusterTestListInt8UReverseRequestParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = UnitTesting::Commands::TestListInt8UReverseRequest::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRUnitTestingClusterTestListInt8UReverseResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} - (void)testEnumsRequestWithParams:(MTRUnitTestingClusterTestEnumsRequestParams *)params completion:(void (^)(MTRUnitTestingClusterTestEnumsResponseParams * _Nullable data, NSError * _Nullable error))completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRUnitTestingClusterTestEnumsResponseCallbackBridge(self.callbackQueue, - completion, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, UnitTestingClusterTestEnumsResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - UnitTesting::Commands::TestEnumsRequest::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.arg1 = static_cast>(params.arg1.unsignedShortValue); - request.arg2 = static_cast>(params.arg2.unsignedCharValue); + if (params == nil) { + params = [[MTRUnitTestingClusterTestEnumsRequestParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = UnitTesting::Commands::TestEnumsRequest::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRUnitTestingClusterTestEnumsResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} - (void)testNullableOptionalRequestWithParams:(MTRUnitTestingClusterTestNullableOptionalRequestParams * _Nullable)params completion:(void (^)(MTRUnitTestingClusterTestNullableOptionalResponseParams * _Nullable data, NSError * _Nullable error))completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRUnitTestingClusterTestNullableOptionalResponseCallbackBridge(self.callbackQueue, - completion, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, UnitTestingClusterTestNullableOptionalResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - UnitTesting::Commands::TestNullableOptionalRequest::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - if (params != nil) { - if (params.arg1 != nil) { - auto & definedValue_0 = request.arg1.Emplace(); - if (params.arg1 == nil) { - definedValue_0.SetNull(); - } else { - auto & nonNullValue_1 = definedValue_0.SetNonNull(); - nonNullValue_1 = params.arg1.unsignedCharValue; - } - } - } + if (params == nil) { + params = [[MTRUnitTestingClusterTestNullableOptionalRequestParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = UnitTesting::Commands::TestNullableOptionalRequest::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRUnitTestingClusterTestNullableOptionalResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} - (void)testComplexNullableOptionalRequestWithParams:(MTRUnitTestingClusterTestComplexNullableOptionalRequestParams *)params completion:(void (^)(MTRUnitTestingClusterTestComplexNullableOptionalResponseParams * _Nullable data, NSError * _Nullable error))completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRUnitTestingClusterTestComplexNullableOptionalResponseCallbackBridge(self.callbackQueue, - completion, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, UnitTestingClusterTestComplexNullableOptionalResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - UnitTesting::Commands::TestComplexNullableOptionalRequest::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - if (params.nullableInt == nil) { - request.nullableInt.SetNull(); - } else { - auto & nonNullValue_0 = request.nullableInt.SetNonNull(); - nonNullValue_0 = params.nullableInt.unsignedShortValue; - } - if (params.optionalInt != nil) { - auto & definedValue_0 = request.optionalInt.Emplace(); - definedValue_0 = params.optionalInt.unsignedShortValue; - } - if (params.nullableOptionalInt != nil) { - auto & definedValue_0 = request.nullableOptionalInt.Emplace(); - if (params.nullableOptionalInt == nil) { - definedValue_0.SetNull(); - } else { - auto & nonNullValue_1 = definedValue_0.SetNonNull(); - nonNullValue_1 = params.nullableOptionalInt.unsignedShortValue; - } - } - if (params.nullableString == nil) { - request.nullableString.SetNull(); - } else { - auto & nonNullValue_0 = request.nullableString.SetNonNull(); - nonNullValue_0 = AsCharSpan(params.nullableString); - } - if (params.optionalString != nil) { - auto & definedValue_0 = request.optionalString.Emplace(); - definedValue_0 = AsCharSpan(params.optionalString); - } - if (params.nullableOptionalString != nil) { - auto & definedValue_0 = request.nullableOptionalString.Emplace(); - if (params.nullableOptionalString == nil) { - definedValue_0.SetNull(); - } else { - auto & nonNullValue_1 = definedValue_0.SetNonNull(); - nonNullValue_1 = AsCharSpan(params.nullableOptionalString); - } - } - if (params.nullableStruct == nil) { - request.nullableStruct.SetNull(); - } else { - auto & nonNullValue_0 = request.nullableStruct.SetNonNull(); - nonNullValue_0.a = params.nullableStruct.a.unsignedCharValue; - nonNullValue_0.b = params.nullableStruct.b.boolValue; - nonNullValue_0.c = static_cast>(params.nullableStruct.c.unsignedCharValue); - nonNullValue_0.d = AsByteSpan(params.nullableStruct.d); - nonNullValue_0.e = AsCharSpan(params.nullableStruct.e); - nonNullValue_0.f = static_cast>(params.nullableStruct.f.unsignedCharValue); - nonNullValue_0.g = params.nullableStruct.g.floatValue; - nonNullValue_0.h = params.nullableStruct.h.doubleValue; - } - if (params.optionalStruct != nil) { - auto & definedValue_0 = request.optionalStruct.Emplace(); - definedValue_0.a = params.optionalStruct.a.unsignedCharValue; - definedValue_0.b = params.optionalStruct.b.boolValue; - definedValue_0.c = static_cast>(params.optionalStruct.c.unsignedCharValue); - definedValue_0.d = AsByteSpan(params.optionalStruct.d); - definedValue_0.e = AsCharSpan(params.optionalStruct.e); - definedValue_0.f = static_cast>(params.optionalStruct.f.unsignedCharValue); - definedValue_0.g = params.optionalStruct.g.floatValue; - definedValue_0.h = params.optionalStruct.h.doubleValue; - } - if (params.nullableOptionalStruct != nil) { - auto & definedValue_0 = request.nullableOptionalStruct.Emplace(); - if (params.nullableOptionalStruct == nil) { - definedValue_0.SetNull(); - } else { - auto & nonNullValue_1 = definedValue_0.SetNonNull(); - nonNullValue_1.a = params.nullableOptionalStruct.a.unsignedCharValue; - nonNullValue_1.b = params.nullableOptionalStruct.b.boolValue; - nonNullValue_1.c = static_cast>(params.nullableOptionalStruct.c.unsignedCharValue); - nonNullValue_1.d = AsByteSpan(params.nullableOptionalStruct.d); - nonNullValue_1.e = AsCharSpan(params.nullableOptionalStruct.e); - nonNullValue_1.f = static_cast>(params.nullableOptionalStruct.f.unsignedCharValue); - nonNullValue_1.g = params.nullableOptionalStruct.g.floatValue; - nonNullValue_1.h = params.nullableOptionalStruct.h.doubleValue; - } - } - if (params.nullableList == nil) { - request.nullableList.SetNull(); - } else { - auto & nonNullValue_0 = request.nullableList.SetNonNull(); - { - using ListType_1 = std::remove_reference_t; - using ListMemberType_1 = ListMemberTypeGetter::Type; - if (params.nullableList.count != 0) { - auto * listHolder_1 = new ListHolder(params.nullableList.count); - if (listHolder_1 == nullptr || listHolder_1->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_1); - for (size_t i_1 = 0; i_1 < params.nullableList.count; ++i_1) { - if (![params.nullableList[i_1] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_1 = (NSNumber *) params.nullableList[i_1]; - listHolder_1->mList[i_1] = static_castmList[i_1])>>(element_1.unsignedCharValue); - } - nonNullValue_0 = ListType_1(listHolder_1->mList, params.nullableList.count); - } else { - nonNullValue_0 = ListType_1(); - } - } - } - if (params.optionalList != nil) { - auto & definedValue_0 = request.optionalList.Emplace(); - { - using ListType_1 = std::remove_reference_t; - using ListMemberType_1 = ListMemberTypeGetter::Type; - if (params.optionalList.count != 0) { - auto * listHolder_1 = new ListHolder(params.optionalList.count); - if (listHolder_1 == nullptr || listHolder_1->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_1); - for (size_t i_1 = 0; i_1 < params.optionalList.count; ++i_1) { - if (![params.optionalList[i_1] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_1 = (NSNumber *) params.optionalList[i_1]; - listHolder_1->mList[i_1] = static_castmList[i_1])>>(element_1.unsignedCharValue); - } - definedValue_0 = ListType_1(listHolder_1->mList, params.optionalList.count); - } else { - definedValue_0 = ListType_1(); - } - } - } - if (params.nullableOptionalList != nil) { - auto & definedValue_0 = request.nullableOptionalList.Emplace(); - if (params.nullableOptionalList == nil) { - definedValue_0.SetNull(); - } else { - auto & nonNullValue_1 = definedValue_0.SetNonNull(); - { - using ListType_2 = std::remove_reference_t; - using ListMemberType_2 = ListMemberTypeGetter::Type; - if (params.nullableOptionalList.count != 0) { - auto * listHolder_2 = new ListHolder(params.nullableOptionalList.count); - if (listHolder_2 == nullptr || listHolder_2->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_2); - for (size_t i_2 = 0; i_2 < params.nullableOptionalList.count; ++i_2) { - if (![params.nullableOptionalList[i_2] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_2 = (NSNumber *) params.nullableOptionalList[i_2]; - listHolder_2->mList[i_2] = static_castmList[i_2])>>(element_2.unsignedCharValue); - } - nonNullValue_1 = ListType_2(listHolder_2->mList, params.nullableOptionalList.count); - } else { - nonNullValue_1 = ListType_2(); - } - } - } - } + if (params == nil) { + params = [[MTRUnitTestingClusterTestComplexNullableOptionalRequestParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = UnitTesting::Commands::TestComplexNullableOptionalRequest::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRUnitTestingClusterTestComplexNullableOptionalResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} - (void)simpleStructEchoRequestWithParams:(MTRUnitTestingClusterSimpleStructEchoRequestParams *)params completion:(void (^)(MTRUnitTestingClusterSimpleStructResponseParams * _Nullable data, NSError * _Nullable error))completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRUnitTestingClusterSimpleStructResponseCallbackBridge(self.callbackQueue, - completion, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, UnitTestingClusterSimpleStructResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - UnitTesting::Commands::SimpleStructEchoRequest::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.arg1.a = params.arg1.a.unsignedCharValue; - request.arg1.b = params.arg1.b.boolValue; - request.arg1.c = static_cast>(params.arg1.c.unsignedCharValue); - request.arg1.d = AsByteSpan(params.arg1.d); - request.arg1.e = AsCharSpan(params.arg1.e); - request.arg1.f = static_cast>(params.arg1.f.unsignedCharValue); - request.arg1.g = params.arg1.g.floatValue; - request.arg1.h = params.arg1.h.doubleValue; + if (params == nil) { + params = [[MTRUnitTestingClusterSimpleStructEchoRequestParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = UnitTesting::Commands::SimpleStructEchoRequest::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRUnitTestingClusterSimpleStructResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} - (void)timedInvokeRequestWithCompletion:(MTRStatusCompletion)completion { [self timedInvokeRequestWithParams:nil completion:completion]; } - (void)timedInvokeRequestWithParams:(MTRUnitTestingClusterTimedInvokeRequestParams * _Nullable)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - UnitTesting::Commands::TimedInvokeRequest::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - if (!timedInvokeTimeoutMs.HasValue()) { - timedInvokeTimeoutMs.SetValue(10000); - } + if (params == nil) { + params = [[MTRUnitTestingClusterTimedInvokeRequestParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + if (timedInvokeTimeoutMs == nil) { + timedInvokeTimeoutMs = @(10000); + } + + using RequestType = UnitTesting::Commands::TimedInvokeRequest::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} - (void)testSimpleOptionalArgumentRequestWithParams:(MTRUnitTestingClusterTestSimpleOptionalArgumentRequestParams * _Nullable)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - UnitTesting::Commands::TestSimpleOptionalArgumentRequest::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - if (params != nil) { - if (params.arg1 != nil) { - auto & definedValue_0 = request.arg1.Emplace(); - definedValue_0 = params.arg1.boolValue; - } - } + if (params == nil) { + params = [[MTRUnitTestingClusterTestSimpleOptionalArgumentRequestParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = UnitTesting::Commands::TestSimpleOptionalArgumentRequest::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} - (void)testEmitTestEventRequestWithParams:(MTRUnitTestingClusterTestEmitTestEventRequestParams *)params completion:(void (^)(MTRUnitTestingClusterTestEmitTestEventResponseParams * _Nullable data, NSError * _Nullable error))completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRUnitTestingClusterTestEmitTestEventResponseCallbackBridge(self.callbackQueue, - completion, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, UnitTestingClusterTestEmitTestEventResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - UnitTesting::Commands::TestEmitTestEventRequest::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.arg1 = params.arg1.unsignedCharValue; - request.arg2 = static_cast>(params.arg2.unsignedCharValue); - request.arg3 = params.arg3.boolValue; + if (params == nil) { + params = [[MTRUnitTestingClusterTestEmitTestEventRequestParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = UnitTesting::Commands::TestEmitTestEventRequest::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRUnitTestingClusterTestEmitTestEventResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} - (void)testEmitTestFabricScopedEventRequestWithParams:(MTRUnitTestingClusterTestEmitTestFabricScopedEventRequestParams *)params completion:(void (^)(MTRUnitTestingClusterTestEmitTestFabricScopedEventResponseParams * _Nullable data, NSError * _Nullable error))completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRUnitTestingClusterTestEmitTestFabricScopedEventResponseCallbackBridge(self.callbackQueue, - completion, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, UnitTestingClusterTestEmitTestFabricScopedEventResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - UnitTesting::Commands::TestEmitTestFabricScopedEventRequest::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.arg1 = params.arg1.unsignedCharValue; + if (params == nil) { + params = [[MTRUnitTestingClusterTestEmitTestFabricScopedEventRequestParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = UnitTesting::Commands::TestEmitTestFabricScopedEventRequest::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRUnitTestingClusterTestEmitTestFabricScopedEventResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; } - (void)readAttributeBooleanWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -119610,67 +116266,51 @@ - (void)pingWithCompletion:(MTRStatusCompletion)completion } - (void)pingWithParams:(MTRSampleMEIClusterPingParams * _Nullable)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - SampleMei::Commands::Ping::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } + if (params == nil) { + params = [[MTRSampleMEIClusterPingParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = SampleMei::Commands::Ping::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} - (void)addArgumentsWithParams:(MTRSampleMEIClusterAddArgumentsParams *)params completion:(void (^)(MTRSampleMEIClusterAddArgumentsResponseParams * _Nullable data, NSError * _Nullable error))completion { - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRSampleMEIClusterAddArgumentsResponseCallbackBridge(self.callbackQueue, - completion, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, SampleMEIClusterAddArgumentsResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - SampleMei::Commands::AddArguments::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.arg1 = params.arg1.unsignedCharValue; - request.arg2 = params.arg2.unsignedCharValue; + if (params == nil) { + params = [[MTRSampleMEIClusterAddArgumentsParams + alloc] init]; + } - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = SampleMei::Commands::AddArguments::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRSampleMEIClusterAddArgumentsResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; } - (void)readAttributeFlipFlopWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.h b/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.h index db2cda745ccbc1..cefe10ff1e2aea 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.h @@ -23,143 +23,11 @@ #include #include -typedef void (*CommandSuccessCallback)(void *, const chip::app::DataModel::NullObjectType &); -using CommandSuccessCallbackType = CommandSuccessCallback; typedef void (*DefaultSuccessCallbackType)(void *); typedef void (*VendorIdAttributeCallback)(void *, chip::VendorId); typedef void (*NullableVendorIdAttributeCallback)(void *, const chip::app::DataModel::Nullable &); -typedef void (*GroupsClusterAddGroupResponseCallbackType)( - void *, const chip::app::Clusters::Groups::Commands::AddGroupResponse::DecodableType &); -typedef void (*GroupsClusterViewGroupResponseCallbackType)( - void *, const chip::app::Clusters::Groups::Commands::ViewGroupResponse::DecodableType &); -typedef void (*GroupsClusterGetGroupMembershipResponseCallbackType)( - void *, const chip::app::Clusters::Groups::Commands::GetGroupMembershipResponse::DecodableType &); -typedef void (*GroupsClusterRemoveGroupResponseCallbackType)( - void *, const chip::app::Clusters::Groups::Commands::RemoveGroupResponse::DecodableType &); -typedef void (*ScenesClusterAddSceneResponseCallbackType)( - void *, const chip::app::Clusters::Scenes::Commands::AddSceneResponse::DecodableType &); -typedef void (*ScenesClusterViewSceneResponseCallbackType)( - void *, const chip::app::Clusters::Scenes::Commands::ViewSceneResponse::DecodableType &); -typedef void (*ScenesClusterRemoveSceneResponseCallbackType)( - void *, const chip::app::Clusters::Scenes::Commands::RemoveSceneResponse::DecodableType &); -typedef void (*ScenesClusterRemoveAllScenesResponseCallbackType)( - void *, const chip::app::Clusters::Scenes::Commands::RemoveAllScenesResponse::DecodableType &); -typedef void (*ScenesClusterStoreSceneResponseCallbackType)( - void *, const chip::app::Clusters::Scenes::Commands::StoreSceneResponse::DecodableType &); -typedef void (*ScenesClusterGetSceneMembershipResponseCallbackType)( - void *, const chip::app::Clusters::Scenes::Commands::GetSceneMembershipResponse::DecodableType &); -typedef void (*ScenesClusterEnhancedAddSceneResponseCallbackType)( - void *, const chip::app::Clusters::Scenes::Commands::EnhancedAddSceneResponse::DecodableType &); -typedef void (*ScenesClusterEnhancedViewSceneResponseCallbackType)( - void *, const chip::app::Clusters::Scenes::Commands::EnhancedViewSceneResponse::DecodableType &); -typedef void (*ScenesClusterCopySceneResponseCallbackType)( - void *, const chip::app::Clusters::Scenes::Commands::CopySceneResponse::DecodableType &); -typedef void (*OTASoftwareUpdateProviderClusterQueryImageResponseCallbackType)( - void *, const chip::app::Clusters::OtaSoftwareUpdateProvider::Commands::QueryImageResponse::DecodableType &); -typedef void (*OTASoftwareUpdateProviderClusterApplyUpdateResponseCallbackType)( - void *, const chip::app::Clusters::OtaSoftwareUpdateProvider::Commands::ApplyUpdateResponse::DecodableType &); -typedef void (*GeneralCommissioningClusterArmFailSafeResponseCallbackType)( - void *, const chip::app::Clusters::GeneralCommissioning::Commands::ArmFailSafeResponse::DecodableType &); -typedef void (*GeneralCommissioningClusterSetRegulatoryConfigResponseCallbackType)( - void *, const chip::app::Clusters::GeneralCommissioning::Commands::SetRegulatoryConfigResponse::DecodableType &); -typedef void (*GeneralCommissioningClusterCommissioningCompleteResponseCallbackType)( - void *, const chip::app::Clusters::GeneralCommissioning::Commands::CommissioningCompleteResponse::DecodableType &); -typedef void (*NetworkCommissioningClusterScanNetworksResponseCallbackType)( - void *, const chip::app::Clusters::NetworkCommissioning::Commands::ScanNetworksResponse::DecodableType &); -typedef void (*NetworkCommissioningClusterNetworkConfigResponseCallbackType)( - void *, const chip::app::Clusters::NetworkCommissioning::Commands::NetworkConfigResponse::DecodableType &); -typedef void (*NetworkCommissioningClusterConnectNetworkResponseCallbackType)( - void *, const chip::app::Clusters::NetworkCommissioning::Commands::ConnectNetworkResponse::DecodableType &); -typedef void (*DiagnosticLogsClusterRetrieveLogsResponseCallbackType)( - void *, const chip::app::Clusters::DiagnosticLogs::Commands::RetrieveLogsResponse::DecodableType &); -typedef void (*TimeSynchronizationClusterSetTimeZoneResponseCallbackType)( - void *, const chip::app::Clusters::TimeSynchronization::Commands::SetTimeZoneResponse::DecodableType &); -typedef void (*OperationalCredentialsClusterAttestationResponseCallbackType)( - void *, const chip::app::Clusters::OperationalCredentials::Commands::AttestationResponse::DecodableType &); -typedef void (*OperationalCredentialsClusterCertificateChainResponseCallbackType)( - void *, const chip::app::Clusters::OperationalCredentials::Commands::CertificateChainResponse::DecodableType &); -typedef void (*OperationalCredentialsClusterCSRResponseCallbackType)( - void *, const chip::app::Clusters::OperationalCredentials::Commands::CSRResponse::DecodableType &); -typedef void (*OperationalCredentialsClusterNOCResponseCallbackType)( - void *, const chip::app::Clusters::OperationalCredentials::Commands::NOCResponse::DecodableType &); -typedef void (*GroupKeyManagementClusterKeySetReadResponseCallbackType)( - void *, const chip::app::Clusters::GroupKeyManagement::Commands::KeySetReadResponse::DecodableType &); -typedef void (*GroupKeyManagementClusterKeySetReadAllIndicesResponseCallbackType)( - void *, const chip::app::Clusters::GroupKeyManagement::Commands::KeySetReadAllIndicesResponse::DecodableType &); -typedef void (*ICDManagementClusterRegisterClientResponseCallbackType)( - void *, const chip::app::Clusters::IcdManagement::Commands::RegisterClientResponse::DecodableType &); -typedef void (*LaundryWasherModeClusterChangeToModeResponseCallbackType)( - void *, const chip::app::Clusters::LaundryWasherMode::Commands::ChangeToModeResponse::DecodableType &); -typedef void (*RefrigeratorAndTemperatureControlledCabinetModeClusterChangeToModeResponseCallbackType)( - void *, - const chip::app::Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Commands::ChangeToModeResponse::DecodableType &); -typedef void (*RVCRunModeClusterChangeToModeResponseCallbackType)( - void *, const chip::app::Clusters::RvcRunMode::Commands::ChangeToModeResponse::DecodableType &); -typedef void (*RVCCleanModeClusterChangeToModeResponseCallbackType)( - void *, const chip::app::Clusters::RvcCleanMode::Commands::ChangeToModeResponse::DecodableType &); -typedef void (*DishwasherModeClusterChangeToModeResponseCallbackType)( - void *, const chip::app::Clusters::DishwasherMode::Commands::ChangeToModeResponse::DecodableType &); -typedef void (*OperationalStateClusterOperationalCommandResponseCallbackType)( - void *, const chip::app::Clusters::OperationalState::Commands::OperationalCommandResponse::DecodableType &); -typedef void (*RVCOperationalStateClusterOperationalCommandResponseCallbackType)( - void *, const chip::app::Clusters::RvcOperationalState::Commands::OperationalCommandResponse::DecodableType &); -typedef void (*DoorLockClusterGetWeekDayScheduleResponseCallbackType)( - void *, const chip::app::Clusters::DoorLock::Commands::GetWeekDayScheduleResponse::DecodableType &); -typedef void (*DoorLockClusterGetYearDayScheduleResponseCallbackType)( - void *, const chip::app::Clusters::DoorLock::Commands::GetYearDayScheduleResponse::DecodableType &); -typedef void (*DoorLockClusterGetHolidayScheduleResponseCallbackType)( - void *, const chip::app::Clusters::DoorLock::Commands::GetHolidayScheduleResponse::DecodableType &); -typedef void (*DoorLockClusterGetUserResponseCallbackType)( - void *, const chip::app::Clusters::DoorLock::Commands::GetUserResponse::DecodableType &); -typedef void (*DoorLockClusterSetCredentialResponseCallbackType)( - void *, const chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType &); -typedef void (*DoorLockClusterGetCredentialStatusResponseCallbackType)( - void *, const chip::app::Clusters::DoorLock::Commands::GetCredentialStatusResponse::DecodableType &); -typedef void (*ThermostatClusterGetWeeklyScheduleResponseCallbackType)( - void *, const chip::app::Clusters::Thermostat::Commands::GetWeeklyScheduleResponse::DecodableType &); -typedef void (*ChannelClusterChangeChannelResponseCallbackType)( - void *, const chip::app::Clusters::Channel::Commands::ChangeChannelResponse::DecodableType &); -typedef void (*TargetNavigatorClusterNavigateTargetResponseCallbackType)( - void *, const chip::app::Clusters::TargetNavigator::Commands::NavigateTargetResponse::DecodableType &); -typedef void (*MediaPlaybackClusterPlaybackResponseCallbackType)( - void *, const chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::DecodableType &); -typedef void (*KeypadInputClusterSendKeyResponseCallbackType)( - void *, const chip::app::Clusters::KeypadInput::Commands::SendKeyResponse::DecodableType &); -typedef void (*ContentLauncherClusterLauncherResponseCallbackType)( - void *, const chip::app::Clusters::ContentLauncher::Commands::LauncherResponse::DecodableType &); -typedef void (*ApplicationLauncherClusterLauncherResponseCallbackType)( - void *, const chip::app::Clusters::ApplicationLauncher::Commands::LauncherResponse::DecodableType &); -typedef void (*AccountLoginClusterGetSetupPINResponseCallbackType)( - void *, const chip::app::Clusters::AccountLogin::Commands::GetSetupPINResponse::DecodableType &); -typedef void (*UnitTestingClusterTestSpecificResponseCallbackType)( - void *, const chip::app::Clusters::UnitTesting::Commands::TestSpecificResponse::DecodableType &); -typedef void (*UnitTestingClusterTestAddArgumentsResponseCallbackType)( - void *, const chip::app::Clusters::UnitTesting::Commands::TestAddArgumentsResponse::DecodableType &); -typedef void (*UnitTestingClusterTestSimpleArgumentResponseCallbackType)( - void *, const chip::app::Clusters::UnitTesting::Commands::TestSimpleArgumentResponse::DecodableType &); -typedef void (*UnitTestingClusterTestStructArrayArgumentResponseCallbackType)( - void *, const chip::app::Clusters::UnitTesting::Commands::TestStructArrayArgumentResponse::DecodableType &); -typedef void (*UnitTestingClusterTestListInt8UReverseResponseCallbackType)( - void *, const chip::app::Clusters::UnitTesting::Commands::TestListInt8UReverseResponse::DecodableType &); -typedef void (*UnitTestingClusterTestEnumsResponseCallbackType)( - void *, const chip::app::Clusters::UnitTesting::Commands::TestEnumsResponse::DecodableType &); -typedef void (*UnitTestingClusterTestNullableOptionalResponseCallbackType)( - void *, const chip::app::Clusters::UnitTesting::Commands::TestNullableOptionalResponse::DecodableType &); -typedef void (*UnitTestingClusterTestComplexNullableOptionalResponseCallbackType)( - void *, const chip::app::Clusters::UnitTesting::Commands::TestComplexNullableOptionalResponse::DecodableType &); -typedef void (*UnitTestingClusterBooleanResponseCallbackType)( - void *, const chip::app::Clusters::UnitTesting::Commands::BooleanResponse::DecodableType &); -typedef void (*UnitTestingClusterSimpleStructResponseCallbackType)( - void *, const chip::app::Clusters::UnitTesting::Commands::SimpleStructResponse::DecodableType &); -typedef void (*UnitTestingClusterTestEmitTestEventResponseCallbackType)( - void *, const chip::app::Clusters::UnitTesting::Commands::TestEmitTestEventResponse::DecodableType &); -typedef void (*UnitTestingClusterTestEmitTestFabricScopedEventResponseCallbackType)( - void *, const chip::app::Clusters::UnitTesting::Commands::TestEmitTestFabricScopedEventResponse::DecodableType &); -typedef void (*SampleMEIClusterAddArgumentsResponseCallbackType)( - void *, const chip::app::Clusters::SampleMei::Commands::AddArgumentsResponse::DecodableType &); - typedef void (*IdentifyClusterEffectIdentifierEnumAttributeCallback)(void *, chip::app::Clusters::Identify::EffectIdentifierEnum); typedef void (*NullableIdentifyClusterEffectIdentifierEnumAttributeCallback)( void *, const chip::app::DataModel::Nullable &); @@ -1868,18 +1736,6 @@ class MTRDefaultSuccessCallbackBridge : public MTRCallbackBridge -{ -public: - MTRCommandSuccessCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : - MTRCallbackBridge(queue, handler, OnSuccessFn){}; - - MTRCommandSuccessCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action) : - MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; - - static void OnSuccessFn(void * context, const chip::app::DataModel::NullObjectType &); -}; - class MTROctetStringAttributeCallbackBridge : public MTRCallbackBridge { public: @@ -18931,948 +18787,6 @@ class MTR_PROVISIONALLY_AVAILABLE MTRSampleMEIAttributeListListAttributeCallback MTRSubscriptionEstablishedHandler mEstablishedHandler; }; -class MTRGroupsClusterAddGroupResponseCallbackBridge : public MTRCallbackBridge -{ -public: - MTRGroupsClusterAddGroupResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : - MTRCallbackBridge(queue, handler, OnSuccessFn){}; - - MTRGroupsClusterAddGroupResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action) : - MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; - - static void OnSuccessFn(void * context, const chip::app::Clusters::Groups::Commands::AddGroupResponse::DecodableType & data); -}; - -class MTRGroupsClusterViewGroupResponseCallbackBridge : public MTRCallbackBridge -{ -public: - MTRGroupsClusterViewGroupResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : - MTRCallbackBridge(queue, handler, OnSuccessFn){}; - - MTRGroupsClusterViewGroupResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action) : - MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; - - static void OnSuccessFn(void * context, const chip::app::Clusters::Groups::Commands::ViewGroupResponse::DecodableType & data); -}; - -class MTRGroupsClusterGetGroupMembershipResponseCallbackBridge - : public MTRCallbackBridge -{ -public: - MTRGroupsClusterGetGroupMembershipResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : - MTRCallbackBridge(queue, handler, OnSuccessFn){}; - - MTRGroupsClusterGetGroupMembershipResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - MTRActionBlock action) : - MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; - - static void OnSuccessFn(void * context, - const chip::app::Clusters::Groups::Commands::GetGroupMembershipResponse::DecodableType & data); -}; - -class MTRGroupsClusterRemoveGroupResponseCallbackBridge : public MTRCallbackBridge -{ -public: - MTRGroupsClusterRemoveGroupResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : - MTRCallbackBridge(queue, handler, OnSuccessFn){}; - - MTRGroupsClusterRemoveGroupResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action) : - MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; - - static void OnSuccessFn(void * context, const chip::app::Clusters::Groups::Commands::RemoveGroupResponse::DecodableType & data); -}; - -class MTRScenesClusterAddSceneResponseCallbackBridge : public MTRCallbackBridge -{ -public: - MTRScenesClusterAddSceneResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : - MTRCallbackBridge(queue, handler, OnSuccessFn){}; - - MTRScenesClusterAddSceneResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action) : - MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; - - static void OnSuccessFn(void * context, const chip::app::Clusters::Scenes::Commands::AddSceneResponse::DecodableType & data); -}; - -class MTRScenesClusterViewSceneResponseCallbackBridge : public MTRCallbackBridge -{ -public: - MTRScenesClusterViewSceneResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : - MTRCallbackBridge(queue, handler, OnSuccessFn){}; - - MTRScenesClusterViewSceneResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action) : - MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; - - static void OnSuccessFn(void * context, const chip::app::Clusters::Scenes::Commands::ViewSceneResponse::DecodableType & data); -}; - -class MTRScenesClusterRemoveSceneResponseCallbackBridge : public MTRCallbackBridge -{ -public: - MTRScenesClusterRemoveSceneResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : - MTRCallbackBridge(queue, handler, OnSuccessFn){}; - - MTRScenesClusterRemoveSceneResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action) : - MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; - - static void OnSuccessFn(void * context, const chip::app::Clusters::Scenes::Commands::RemoveSceneResponse::DecodableType & data); -}; - -class MTRScenesClusterRemoveAllScenesResponseCallbackBridge - : public MTRCallbackBridge -{ -public: - MTRScenesClusterRemoveAllScenesResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : - MTRCallbackBridge(queue, handler, OnSuccessFn){}; - - MTRScenesClusterRemoveAllScenesResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action) : - MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; - - static void OnSuccessFn(void * context, - const chip::app::Clusters::Scenes::Commands::RemoveAllScenesResponse::DecodableType & data); -}; - -class MTRScenesClusterStoreSceneResponseCallbackBridge : public MTRCallbackBridge -{ -public: - MTRScenesClusterStoreSceneResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : - MTRCallbackBridge(queue, handler, OnSuccessFn){}; - - MTRScenesClusterStoreSceneResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action) : - MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; - - static void OnSuccessFn(void * context, const chip::app::Clusters::Scenes::Commands::StoreSceneResponse::DecodableType & data); -}; - -class MTRScenesClusterGetSceneMembershipResponseCallbackBridge - : public MTRCallbackBridge -{ -public: - MTRScenesClusterGetSceneMembershipResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : - MTRCallbackBridge(queue, handler, OnSuccessFn){}; - - MTRScenesClusterGetSceneMembershipResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - MTRActionBlock action) : - MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; - - static void OnSuccessFn(void * context, - const chip::app::Clusters::Scenes::Commands::GetSceneMembershipResponse::DecodableType & data); -}; - -class MTRScenesClusterEnhancedAddSceneResponseCallbackBridge - : public MTRCallbackBridge -{ -public: - MTRScenesClusterEnhancedAddSceneResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : - MTRCallbackBridge(queue, handler, OnSuccessFn){}; - - MTRScenesClusterEnhancedAddSceneResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action) : - MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; - - static void OnSuccessFn(void * context, - const chip::app::Clusters::Scenes::Commands::EnhancedAddSceneResponse::DecodableType & data); -}; - -class MTRScenesClusterEnhancedViewSceneResponseCallbackBridge - : public MTRCallbackBridge -{ -public: - MTRScenesClusterEnhancedViewSceneResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : - MTRCallbackBridge(queue, handler, OnSuccessFn){}; - - MTRScenesClusterEnhancedViewSceneResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - MTRActionBlock action) : - MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; - - static void OnSuccessFn(void * context, - const chip::app::Clusters::Scenes::Commands::EnhancedViewSceneResponse::DecodableType & data); -}; - -class MTRScenesClusterCopySceneResponseCallbackBridge : public MTRCallbackBridge -{ -public: - MTRScenesClusterCopySceneResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : - MTRCallbackBridge(queue, handler, OnSuccessFn){}; - - MTRScenesClusterCopySceneResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action) : - MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; - - static void OnSuccessFn(void * context, const chip::app::Clusters::Scenes::Commands::CopySceneResponse::DecodableType & data); -}; - -class MTROTASoftwareUpdateProviderClusterQueryImageResponseCallbackBridge - : public MTRCallbackBridge -{ -public: - MTROTASoftwareUpdateProviderClusterQueryImageResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : - MTRCallbackBridge(queue, handler, OnSuccessFn){}; - - MTROTASoftwareUpdateProviderClusterQueryImageResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - MTRActionBlock action) : - MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; - - static void - OnSuccessFn(void * context, - const chip::app::Clusters::OtaSoftwareUpdateProvider::Commands::QueryImageResponse::DecodableType & data); -}; - -class MTROTASoftwareUpdateProviderClusterApplyUpdateResponseCallbackBridge - : public MTRCallbackBridge -{ -public: - MTROTASoftwareUpdateProviderClusterApplyUpdateResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : - MTRCallbackBridge(queue, handler, OnSuccessFn){}; - - MTROTASoftwareUpdateProviderClusterApplyUpdateResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - MTRActionBlock action) : - MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; - - static void - OnSuccessFn(void * context, - const chip::app::Clusters::OtaSoftwareUpdateProvider::Commands::ApplyUpdateResponse::DecodableType & data); -}; - -class MTRGeneralCommissioningClusterArmFailSafeResponseCallbackBridge - : public MTRCallbackBridge -{ -public: - MTRGeneralCommissioningClusterArmFailSafeResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : - MTRCallbackBridge(queue, handler, OnSuccessFn){}; - - MTRGeneralCommissioningClusterArmFailSafeResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - MTRActionBlock action) : - MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; - - static void OnSuccessFn(void * context, - const chip::app::Clusters::GeneralCommissioning::Commands::ArmFailSafeResponse::DecodableType & data); -}; - -class MTRGeneralCommissioningClusterSetRegulatoryConfigResponseCallbackBridge - : public MTRCallbackBridge -{ -public: - MTRGeneralCommissioningClusterSetRegulatoryConfigResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : - MTRCallbackBridge(queue, handler, OnSuccessFn){}; - - MTRGeneralCommissioningClusterSetRegulatoryConfigResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - MTRActionBlock action) : - MTRCallbackBridge(queue, handler, action, - OnSuccessFn){}; - - static void - OnSuccessFn(void * context, - const chip::app::Clusters::GeneralCommissioning::Commands::SetRegulatoryConfigResponse::DecodableType & data); -}; - -class MTRGeneralCommissioningClusterCommissioningCompleteResponseCallbackBridge - : public MTRCallbackBridge -{ -public: - MTRGeneralCommissioningClusterCommissioningCompleteResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : - MTRCallbackBridge(queue, handler, OnSuccessFn){}; - - MTRGeneralCommissioningClusterCommissioningCompleteResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - MTRActionBlock action) : - MTRCallbackBridge(queue, handler, action, - OnSuccessFn){}; - - static void - OnSuccessFn(void * context, - const chip::app::Clusters::GeneralCommissioning::Commands::CommissioningCompleteResponse::DecodableType & data); -}; - -class MTRNetworkCommissioningClusterScanNetworksResponseCallbackBridge - : public MTRCallbackBridge -{ -public: - MTRNetworkCommissioningClusterScanNetworksResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : - MTRCallbackBridge(queue, handler, OnSuccessFn){}; - - MTRNetworkCommissioningClusterScanNetworksResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - MTRActionBlock action) : - MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; - - static void OnSuccessFn(void * context, - const chip::app::Clusters::NetworkCommissioning::Commands::ScanNetworksResponse::DecodableType & data); -}; - -class MTRNetworkCommissioningClusterNetworkConfigResponseCallbackBridge - : public MTRCallbackBridge -{ -public: - MTRNetworkCommissioningClusterNetworkConfigResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : - MTRCallbackBridge(queue, handler, OnSuccessFn){}; - - MTRNetworkCommissioningClusterNetworkConfigResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - MTRActionBlock action) : - MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; - - static void OnSuccessFn(void * context, - const chip::app::Clusters::NetworkCommissioning::Commands::NetworkConfigResponse::DecodableType & data); -}; - -class MTRNetworkCommissioningClusterConnectNetworkResponseCallbackBridge - : public MTRCallbackBridge -{ -public: - MTRNetworkCommissioningClusterConnectNetworkResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : - MTRCallbackBridge(queue, handler, OnSuccessFn){}; - - MTRNetworkCommissioningClusterConnectNetworkResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - MTRActionBlock action) : - MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; - - static void - OnSuccessFn(void * context, - const chip::app::Clusters::NetworkCommissioning::Commands::ConnectNetworkResponse::DecodableType & data); -}; - -class MTRDiagnosticLogsClusterRetrieveLogsResponseCallbackBridge - : public MTRCallbackBridge -{ -public: - MTRDiagnosticLogsClusterRetrieveLogsResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : - MTRCallbackBridge(queue, handler, OnSuccessFn){}; - - MTRDiagnosticLogsClusterRetrieveLogsResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - MTRActionBlock action) : - MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; - - static void OnSuccessFn(void * context, - const chip::app::Clusters::DiagnosticLogs::Commands::RetrieveLogsResponse::DecodableType & data); -}; - -class MTR_PROVISIONALLY_AVAILABLE MTRTimeSynchronizationClusterSetTimeZoneResponseCallbackBridge - : public MTRCallbackBridge -{ -public: - MTRTimeSynchronizationClusterSetTimeZoneResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : - MTRCallbackBridge(queue, handler, OnSuccessFn){}; - - MTRTimeSynchronizationClusterSetTimeZoneResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - MTRActionBlock action) : - MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; - - static void OnSuccessFn(void * context, - const chip::app::Clusters::TimeSynchronization::Commands::SetTimeZoneResponse::DecodableType & data); -}; - -class MTROperationalCredentialsClusterAttestationResponseCallbackBridge - : public MTRCallbackBridge -{ -public: - MTROperationalCredentialsClusterAttestationResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : - MTRCallbackBridge(queue, handler, OnSuccessFn){}; - - MTROperationalCredentialsClusterAttestationResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - MTRActionBlock action) : - MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; - - static void OnSuccessFn(void * context, - const chip::app::Clusters::OperationalCredentials::Commands::AttestationResponse::DecodableType & data); -}; - -class MTROperationalCredentialsClusterCertificateChainResponseCallbackBridge - : public MTRCallbackBridge -{ -public: - MTROperationalCredentialsClusterCertificateChainResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : - MTRCallbackBridge(queue, handler, OnSuccessFn){}; - - MTROperationalCredentialsClusterCertificateChainResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - MTRActionBlock action) : - MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; - - static void - OnSuccessFn(void * context, - const chip::app::Clusters::OperationalCredentials::Commands::CertificateChainResponse::DecodableType & data); -}; - -class MTROperationalCredentialsClusterCSRResponseCallbackBridge - : public MTRCallbackBridge -{ -public: - MTROperationalCredentialsClusterCSRResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : - MTRCallbackBridge(queue, handler, OnSuccessFn){}; - - MTROperationalCredentialsClusterCSRResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - MTRActionBlock action) : - MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; - - static void OnSuccessFn(void * context, - const chip::app::Clusters::OperationalCredentials::Commands::CSRResponse::DecodableType & data); -}; - -class MTROperationalCredentialsClusterNOCResponseCallbackBridge - : public MTRCallbackBridge -{ -public: - MTROperationalCredentialsClusterNOCResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : - MTRCallbackBridge(queue, handler, OnSuccessFn){}; - - MTROperationalCredentialsClusterNOCResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - MTRActionBlock action) : - MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; - - static void OnSuccessFn(void * context, - const chip::app::Clusters::OperationalCredentials::Commands::NOCResponse::DecodableType & data); -}; - -class MTRGroupKeyManagementClusterKeySetReadResponseCallbackBridge - : public MTRCallbackBridge -{ -public: - MTRGroupKeyManagementClusterKeySetReadResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : - MTRCallbackBridge(queue, handler, OnSuccessFn){}; - - MTRGroupKeyManagementClusterKeySetReadResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - MTRActionBlock action) : - MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; - - static void OnSuccessFn(void * context, - const chip::app::Clusters::GroupKeyManagement::Commands::KeySetReadResponse::DecodableType & data); -}; - -class MTRGroupKeyManagementClusterKeySetReadAllIndicesResponseCallbackBridge - : public MTRCallbackBridge -{ -public: - MTRGroupKeyManagementClusterKeySetReadAllIndicesResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : - MTRCallbackBridge(queue, handler, OnSuccessFn){}; - - MTRGroupKeyManagementClusterKeySetReadAllIndicesResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - MTRActionBlock action) : - MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; - - static void - OnSuccessFn(void * context, - const chip::app::Clusters::GroupKeyManagement::Commands::KeySetReadAllIndicesResponse::DecodableType & data); -}; - -class MTR_PROVISIONALLY_AVAILABLE MTRICDManagementClusterRegisterClientResponseCallbackBridge - : public MTRCallbackBridge -{ -public: - MTRICDManagementClusterRegisterClientResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : - MTRCallbackBridge(queue, handler, OnSuccessFn){}; - - MTRICDManagementClusterRegisterClientResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - MTRActionBlock action) : - MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; - - static void OnSuccessFn(void * context, - const chip::app::Clusters::IcdManagement::Commands::RegisterClientResponse::DecodableType & data); -}; - -class MTR_PROVISIONALLY_AVAILABLE MTRLaundryWasherModeClusterChangeToModeResponseCallbackBridge - : public MTRCallbackBridge -{ -public: - MTRLaundryWasherModeClusterChangeToModeResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : - MTRCallbackBridge(queue, handler, OnSuccessFn){}; - - MTRLaundryWasherModeClusterChangeToModeResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - MTRActionBlock action) : - MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; - - static void OnSuccessFn(void * context, - const chip::app::Clusters::LaundryWasherMode::Commands::ChangeToModeResponse::DecodableType & data); -}; - -class MTR_PROVISIONALLY_AVAILABLE MTRRefrigeratorAndTemperatureControlledCabinetModeClusterChangeToModeResponseCallbackBridge - : public MTRCallbackBridge -{ -public: - MTRRefrigeratorAndTemperatureControlledCabinetModeClusterChangeToModeResponseCallbackBridge(dispatch_queue_t queue, - ResponseHandler handler) : - MTRCallbackBridge(queue, handler, - OnSuccessFn){}; - - MTRRefrigeratorAndTemperatureControlledCabinetModeClusterChangeToModeResponseCallbackBridge(dispatch_queue_t queue, - ResponseHandler handler, - MTRActionBlock action) : - MTRCallbackBridge( - queue, handler, action, OnSuccessFn){}; - - static void OnSuccessFn( - void * context, - const chip::app::Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Commands::ChangeToModeResponse::DecodableType & - data); -}; - -class MTR_PROVISIONALLY_AVAILABLE MTRRVCRunModeClusterChangeToModeResponseCallbackBridge - : public MTRCallbackBridge -{ -public: - MTRRVCRunModeClusterChangeToModeResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : - MTRCallbackBridge(queue, handler, OnSuccessFn){}; - - MTRRVCRunModeClusterChangeToModeResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action) : - MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; - - static void OnSuccessFn(void * context, - const chip::app::Clusters::RvcRunMode::Commands::ChangeToModeResponse::DecodableType & data); -}; - -class MTR_PROVISIONALLY_AVAILABLE MTRRVCCleanModeClusterChangeToModeResponseCallbackBridge - : public MTRCallbackBridge -{ -public: - MTRRVCCleanModeClusterChangeToModeResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : - MTRCallbackBridge(queue, handler, OnSuccessFn){}; - - MTRRVCCleanModeClusterChangeToModeResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - MTRActionBlock action) : - MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; - - static void OnSuccessFn(void * context, - const chip::app::Clusters::RvcCleanMode::Commands::ChangeToModeResponse::DecodableType & data); -}; - -class MTR_PROVISIONALLY_AVAILABLE MTRDishwasherModeClusterChangeToModeResponseCallbackBridge - : public MTRCallbackBridge -{ -public: - MTRDishwasherModeClusterChangeToModeResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : - MTRCallbackBridge(queue, handler, OnSuccessFn){}; - - MTRDishwasherModeClusterChangeToModeResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - MTRActionBlock action) : - MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; - - static void OnSuccessFn(void * context, - const chip::app::Clusters::DishwasherMode::Commands::ChangeToModeResponse::DecodableType & data); -}; - -class MTR_PROVISIONALLY_AVAILABLE MTROperationalStateClusterOperationalCommandResponseCallbackBridge - : public MTRCallbackBridge -{ -public: - MTROperationalStateClusterOperationalCommandResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : - MTRCallbackBridge(queue, handler, OnSuccessFn){}; - - MTROperationalStateClusterOperationalCommandResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - MTRActionBlock action) : - MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; - - static void - OnSuccessFn(void * context, - const chip::app::Clusters::OperationalState::Commands::OperationalCommandResponse::DecodableType & data); -}; - -class MTR_PROVISIONALLY_AVAILABLE MTRRVCOperationalStateClusterOperationalCommandResponseCallbackBridge - : public MTRCallbackBridge -{ -public: - MTRRVCOperationalStateClusterOperationalCommandResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : - MTRCallbackBridge(queue, handler, OnSuccessFn){}; - - MTRRVCOperationalStateClusterOperationalCommandResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - MTRActionBlock action) : - MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; - - static void - OnSuccessFn(void * context, - const chip::app::Clusters::RvcOperationalState::Commands::OperationalCommandResponse::DecodableType & data); -}; - -class MTRDoorLockClusterGetWeekDayScheduleResponseCallbackBridge - : public MTRCallbackBridge -{ -public: - MTRDoorLockClusterGetWeekDayScheduleResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : - MTRCallbackBridge(queue, handler, OnSuccessFn){}; - - MTRDoorLockClusterGetWeekDayScheduleResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - MTRActionBlock action) : - MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; - - static void OnSuccessFn(void * context, - const chip::app::Clusters::DoorLock::Commands::GetWeekDayScheduleResponse::DecodableType & data); -}; - -class MTRDoorLockClusterGetYearDayScheduleResponseCallbackBridge - : public MTRCallbackBridge -{ -public: - MTRDoorLockClusterGetYearDayScheduleResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : - MTRCallbackBridge(queue, handler, OnSuccessFn){}; - - MTRDoorLockClusterGetYearDayScheduleResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - MTRActionBlock action) : - MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; - - static void OnSuccessFn(void * context, - const chip::app::Clusters::DoorLock::Commands::GetYearDayScheduleResponse::DecodableType & data); -}; - -class MTRDoorLockClusterGetHolidayScheduleResponseCallbackBridge - : public MTRCallbackBridge -{ -public: - MTRDoorLockClusterGetHolidayScheduleResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : - MTRCallbackBridge(queue, handler, OnSuccessFn){}; - - MTRDoorLockClusterGetHolidayScheduleResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - MTRActionBlock action) : - MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; - - static void OnSuccessFn(void * context, - const chip::app::Clusters::DoorLock::Commands::GetHolidayScheduleResponse::DecodableType & data); -}; - -class MTRDoorLockClusterGetUserResponseCallbackBridge : public MTRCallbackBridge -{ -public: - MTRDoorLockClusterGetUserResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : - MTRCallbackBridge(queue, handler, OnSuccessFn){}; - - MTRDoorLockClusterGetUserResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action) : - MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; - - static void OnSuccessFn(void * context, const chip::app::Clusters::DoorLock::Commands::GetUserResponse::DecodableType & data); -}; - -class MTRDoorLockClusterSetCredentialResponseCallbackBridge - : public MTRCallbackBridge -{ -public: - MTRDoorLockClusterSetCredentialResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : - MTRCallbackBridge(queue, handler, OnSuccessFn){}; - - MTRDoorLockClusterSetCredentialResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action) : - MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; - - static void OnSuccessFn(void * context, - const chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType & data); -}; - -class MTRDoorLockClusterGetCredentialStatusResponseCallbackBridge - : public MTRCallbackBridge -{ -public: - MTRDoorLockClusterGetCredentialStatusResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : - MTRCallbackBridge(queue, handler, OnSuccessFn){}; - - MTRDoorLockClusterGetCredentialStatusResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - MTRActionBlock action) : - MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; - - static void OnSuccessFn(void * context, - const chip::app::Clusters::DoorLock::Commands::GetCredentialStatusResponse::DecodableType & data); -}; - -class MTRThermostatClusterGetWeeklyScheduleResponseCallbackBridge - : public MTRCallbackBridge -{ -public: - MTRThermostatClusterGetWeeklyScheduleResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : - MTRCallbackBridge(queue, handler, OnSuccessFn){}; - - MTRThermostatClusterGetWeeklyScheduleResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - MTRActionBlock action) : - MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; - - static void OnSuccessFn(void * context, - const chip::app::Clusters::Thermostat::Commands::GetWeeklyScheduleResponse::DecodableType & data); -}; - -class MTRChannelClusterChangeChannelResponseCallbackBridge - : public MTRCallbackBridge -{ -public: - MTRChannelClusterChangeChannelResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : - MTRCallbackBridge(queue, handler, OnSuccessFn){}; - - MTRChannelClusterChangeChannelResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action) : - MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; - - static void OnSuccessFn(void * context, - const chip::app::Clusters::Channel::Commands::ChangeChannelResponse::DecodableType & data); -}; - -class MTRTargetNavigatorClusterNavigateTargetResponseCallbackBridge - : public MTRCallbackBridge -{ -public: - MTRTargetNavigatorClusterNavigateTargetResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : - MTRCallbackBridge(queue, handler, OnSuccessFn){}; - - MTRTargetNavigatorClusterNavigateTargetResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - MTRActionBlock action) : - MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; - - static void OnSuccessFn(void * context, - const chip::app::Clusters::TargetNavigator::Commands::NavigateTargetResponse::DecodableType & data); -}; - -class MTRMediaPlaybackClusterPlaybackResponseCallbackBridge - : public MTRCallbackBridge -{ -public: - MTRMediaPlaybackClusterPlaybackResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : - MTRCallbackBridge(queue, handler, OnSuccessFn){}; - - MTRMediaPlaybackClusterPlaybackResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action) : - MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; - - static void OnSuccessFn(void * context, - const chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::DecodableType & data); -}; - -class MTRKeypadInputClusterSendKeyResponseCallbackBridge : public MTRCallbackBridge -{ -public: - MTRKeypadInputClusterSendKeyResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : - MTRCallbackBridge(queue, handler, OnSuccessFn){}; - - MTRKeypadInputClusterSendKeyResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action) : - MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; - - static void OnSuccessFn(void * context, - const chip::app::Clusters::KeypadInput::Commands::SendKeyResponse::DecodableType & data); -}; - -class MTRContentLauncherClusterLauncherResponseCallbackBridge - : public MTRCallbackBridge -{ -public: - MTRContentLauncherClusterLauncherResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : - MTRCallbackBridge(queue, handler, OnSuccessFn){}; - - MTRContentLauncherClusterLauncherResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - MTRActionBlock action) : - MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; - - static void OnSuccessFn(void * context, - const chip::app::Clusters::ContentLauncher::Commands::LauncherResponse::DecodableType & data); -}; - -class MTRApplicationLauncherClusterLauncherResponseCallbackBridge - : public MTRCallbackBridge -{ -public: - MTRApplicationLauncherClusterLauncherResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : - MTRCallbackBridge(queue, handler, OnSuccessFn){}; - - MTRApplicationLauncherClusterLauncherResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - MTRActionBlock action) : - MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; - - static void OnSuccessFn(void * context, - const chip::app::Clusters::ApplicationLauncher::Commands::LauncherResponse::DecodableType & data); -}; - -class MTRAccountLoginClusterGetSetupPINResponseCallbackBridge - : public MTRCallbackBridge -{ -public: - MTRAccountLoginClusterGetSetupPINResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : - MTRCallbackBridge(queue, handler, OnSuccessFn){}; - - MTRAccountLoginClusterGetSetupPINResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - MTRActionBlock action) : - MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; - - static void OnSuccessFn(void * context, - const chip::app::Clusters::AccountLogin::Commands::GetSetupPINResponse::DecodableType & data); -}; - -class MTRUnitTestingClusterTestSpecificResponseCallbackBridge - : public MTRCallbackBridge -{ -public: - MTRUnitTestingClusterTestSpecificResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : - MTRCallbackBridge(queue, handler, OnSuccessFn){}; - - MTRUnitTestingClusterTestSpecificResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - MTRActionBlock action) : - MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; - - static void OnSuccessFn(void * context, - const chip::app::Clusters::UnitTesting::Commands::TestSpecificResponse::DecodableType & data); -}; - -class MTRUnitTestingClusterTestAddArgumentsResponseCallbackBridge - : public MTRCallbackBridge -{ -public: - MTRUnitTestingClusterTestAddArgumentsResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : - MTRCallbackBridge(queue, handler, OnSuccessFn){}; - - MTRUnitTestingClusterTestAddArgumentsResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - MTRActionBlock action) : - MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; - - static void OnSuccessFn(void * context, - const chip::app::Clusters::UnitTesting::Commands::TestAddArgumentsResponse::DecodableType & data); -}; - -class MTRUnitTestingClusterTestSimpleArgumentResponseCallbackBridge - : public MTRCallbackBridge -{ -public: - MTRUnitTestingClusterTestSimpleArgumentResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : - MTRCallbackBridge(queue, handler, OnSuccessFn){}; - - MTRUnitTestingClusterTestSimpleArgumentResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - MTRActionBlock action) : - MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; - - static void OnSuccessFn(void * context, - const chip::app::Clusters::UnitTesting::Commands::TestSimpleArgumentResponse::DecodableType & data); -}; - -class MTRUnitTestingClusterTestStructArrayArgumentResponseCallbackBridge - : public MTRCallbackBridge -{ -public: - MTRUnitTestingClusterTestStructArrayArgumentResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : - MTRCallbackBridge(queue, handler, OnSuccessFn){}; - - MTRUnitTestingClusterTestStructArrayArgumentResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - MTRActionBlock action) : - MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; - - static void - OnSuccessFn(void * context, - const chip::app::Clusters::UnitTesting::Commands::TestStructArrayArgumentResponse::DecodableType & data); -}; - -class MTRUnitTestingClusterTestListInt8UReverseResponseCallbackBridge - : public MTRCallbackBridge -{ -public: - MTRUnitTestingClusterTestListInt8UReverseResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : - MTRCallbackBridge(queue, handler, OnSuccessFn){}; - - MTRUnitTestingClusterTestListInt8UReverseResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - MTRActionBlock action) : - MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; - - static void OnSuccessFn(void * context, - const chip::app::Clusters::UnitTesting::Commands::TestListInt8UReverseResponse::DecodableType & data); -}; - -class MTRUnitTestingClusterTestEnumsResponseCallbackBridge - : public MTRCallbackBridge -{ -public: - MTRUnitTestingClusterTestEnumsResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : - MTRCallbackBridge(queue, handler, OnSuccessFn){}; - - MTRUnitTestingClusterTestEnumsResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action) : - MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; - - static void OnSuccessFn(void * context, - const chip::app::Clusters::UnitTesting::Commands::TestEnumsResponse::DecodableType & data); -}; - -class MTRUnitTestingClusterTestNullableOptionalResponseCallbackBridge - : public MTRCallbackBridge -{ -public: - MTRUnitTestingClusterTestNullableOptionalResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : - MTRCallbackBridge(queue, handler, OnSuccessFn){}; - - MTRUnitTestingClusterTestNullableOptionalResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - MTRActionBlock action) : - MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; - - static void OnSuccessFn(void * context, - const chip::app::Clusters::UnitTesting::Commands::TestNullableOptionalResponse::DecodableType & data); -}; - -class MTRUnitTestingClusterTestComplexNullableOptionalResponseCallbackBridge - : public MTRCallbackBridge -{ -public: - MTRUnitTestingClusterTestComplexNullableOptionalResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : - MTRCallbackBridge(queue, handler, OnSuccessFn){}; - - MTRUnitTestingClusterTestComplexNullableOptionalResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - MTRActionBlock action) : - MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; - - static void - OnSuccessFn(void * context, - const chip::app::Clusters::UnitTesting::Commands::TestComplexNullableOptionalResponse::DecodableType & data); -}; - -class MTRUnitTestingClusterBooleanResponseCallbackBridge : public MTRCallbackBridge -{ -public: - MTRUnitTestingClusterBooleanResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : - MTRCallbackBridge(queue, handler, OnSuccessFn){}; - - MTRUnitTestingClusterBooleanResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action) : - MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; - - static void OnSuccessFn(void * context, - const chip::app::Clusters::UnitTesting::Commands::BooleanResponse::DecodableType & data); -}; - -class MTRUnitTestingClusterSimpleStructResponseCallbackBridge - : public MTRCallbackBridge -{ -public: - MTRUnitTestingClusterSimpleStructResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : - MTRCallbackBridge(queue, handler, OnSuccessFn){}; - - MTRUnitTestingClusterSimpleStructResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - MTRActionBlock action) : - MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; - - static void OnSuccessFn(void * context, - const chip::app::Clusters::UnitTesting::Commands::SimpleStructResponse::DecodableType & data); -}; - -class MTRUnitTestingClusterTestEmitTestEventResponseCallbackBridge - : public MTRCallbackBridge -{ -public: - MTRUnitTestingClusterTestEmitTestEventResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : - MTRCallbackBridge(queue, handler, OnSuccessFn){}; - - MTRUnitTestingClusterTestEmitTestEventResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - MTRActionBlock action) : - MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; - - static void OnSuccessFn(void * context, - const chip::app::Clusters::UnitTesting::Commands::TestEmitTestEventResponse::DecodableType & data); -}; - -class MTRUnitTestingClusterTestEmitTestFabricScopedEventResponseCallbackBridge - : public MTRCallbackBridge -{ -public: - MTRUnitTestingClusterTestEmitTestFabricScopedEventResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : - MTRCallbackBridge(queue, handler, OnSuccessFn){}; - - MTRUnitTestingClusterTestEmitTestFabricScopedEventResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - MTRActionBlock action) : - MTRCallbackBridge(queue, handler, action, - OnSuccessFn){}; - - static void - OnSuccessFn(void * context, - const chip::app::Clusters::UnitTesting::Commands::TestEmitTestFabricScopedEventResponse::DecodableType & data); -}; - -class MTR_PROVISIONALLY_AVAILABLE MTRSampleMEIClusterAddArgumentsResponseCallbackBridge - : public MTRCallbackBridge -{ -public: - MTRSampleMEIClusterAddArgumentsResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : - MTRCallbackBridge(queue, handler, OnSuccessFn){}; - - MTRSampleMEIClusterAddArgumentsResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action) : - MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; - - static void OnSuccessFn(void * context, - const chip::app::Clusters::SampleMei::Commands::AddArgumentsResponse::DecodableType & data); -}; - class MTRIdentifyClusterEffectIdentifierEnumAttributeCallbackBridge : public MTRCallbackBridge { diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.mm b/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.mm index fa0e5945b89190..97d481dfcf7245 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.mm @@ -29,11 +29,6 @@ DispatchSuccess(context, nil); }; -void MTRCommandSuccessCallbackBridge::OnSuccessFn(void * context, const chip::app::DataModel::NullObjectType &) -{ - DispatchSuccess(context, nil); -}; - void MTROctetStringAttributeCallbackBridge::OnSuccessFn(void * context, chip::ByteSpan value) { NSData * _Nonnull objCValue; @@ -19211,774 +19206,6 @@ } } -void MTRGroupsClusterAddGroupResponseCallbackBridge::OnSuccessFn(void * context, const chip::app::Clusters::Groups::Commands::AddGroupResponse::DecodableType & data) -{ - auto * response = [MTRGroupsClusterAddGroupResponseParams new]; - CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; - if (err != CHIP_NO_ERROR) { - OnFailureFn(context, err); - return; - } - SetAttestationChallengeIfNeeded(context, response); - DispatchSuccess(context, response); -}; - -void MTRGroupsClusterViewGroupResponseCallbackBridge::OnSuccessFn(void * context, const chip::app::Clusters::Groups::Commands::ViewGroupResponse::DecodableType & data) -{ - auto * response = [MTRGroupsClusterViewGroupResponseParams new]; - CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; - if (err != CHIP_NO_ERROR) { - OnFailureFn(context, err); - return; - } - SetAttestationChallengeIfNeeded(context, response); - DispatchSuccess(context, response); -}; - -void MTRGroupsClusterGetGroupMembershipResponseCallbackBridge::OnSuccessFn(void * context, const chip::app::Clusters::Groups::Commands::GetGroupMembershipResponse::DecodableType & data) -{ - auto * response = [MTRGroupsClusterGetGroupMembershipResponseParams new]; - CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; - if (err != CHIP_NO_ERROR) { - OnFailureFn(context, err); - return; - } - SetAttestationChallengeIfNeeded(context, response); - DispatchSuccess(context, response); -}; - -void MTRGroupsClusterRemoveGroupResponseCallbackBridge::OnSuccessFn(void * context, const chip::app::Clusters::Groups::Commands::RemoveGroupResponse::DecodableType & data) -{ - auto * response = [MTRGroupsClusterRemoveGroupResponseParams new]; - CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; - if (err != CHIP_NO_ERROR) { - OnFailureFn(context, err); - return; - } - SetAttestationChallengeIfNeeded(context, response); - DispatchSuccess(context, response); -}; - -void MTRScenesClusterAddSceneResponseCallbackBridge::OnSuccessFn(void * context, const chip::app::Clusters::Scenes::Commands::AddSceneResponse::DecodableType & data) -{ - auto * response = [MTRScenesClusterAddSceneResponseParams new]; - CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; - if (err != CHIP_NO_ERROR) { - OnFailureFn(context, err); - return; - } - SetAttestationChallengeIfNeeded(context, response); - DispatchSuccess(context, response); -}; - -void MTRScenesClusterViewSceneResponseCallbackBridge::OnSuccessFn(void * context, const chip::app::Clusters::Scenes::Commands::ViewSceneResponse::DecodableType & data) -{ - auto * response = [MTRScenesClusterViewSceneResponseParams new]; - CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; - if (err != CHIP_NO_ERROR) { - OnFailureFn(context, err); - return; - } - SetAttestationChallengeIfNeeded(context, response); - DispatchSuccess(context, response); -}; - -void MTRScenesClusterRemoveSceneResponseCallbackBridge::OnSuccessFn(void * context, const chip::app::Clusters::Scenes::Commands::RemoveSceneResponse::DecodableType & data) -{ - auto * response = [MTRScenesClusterRemoveSceneResponseParams new]; - CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; - if (err != CHIP_NO_ERROR) { - OnFailureFn(context, err); - return; - } - SetAttestationChallengeIfNeeded(context, response); - DispatchSuccess(context, response); -}; - -void MTRScenesClusterRemoveAllScenesResponseCallbackBridge::OnSuccessFn(void * context, const chip::app::Clusters::Scenes::Commands::RemoveAllScenesResponse::DecodableType & data) -{ - auto * response = [MTRScenesClusterRemoveAllScenesResponseParams new]; - CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; - if (err != CHIP_NO_ERROR) { - OnFailureFn(context, err); - return; - } - SetAttestationChallengeIfNeeded(context, response); - DispatchSuccess(context, response); -}; - -void MTRScenesClusterStoreSceneResponseCallbackBridge::OnSuccessFn(void * context, const chip::app::Clusters::Scenes::Commands::StoreSceneResponse::DecodableType & data) -{ - auto * response = [MTRScenesClusterStoreSceneResponseParams new]; - CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; - if (err != CHIP_NO_ERROR) { - OnFailureFn(context, err); - return; - } - SetAttestationChallengeIfNeeded(context, response); - DispatchSuccess(context, response); -}; - -void MTRScenesClusterGetSceneMembershipResponseCallbackBridge::OnSuccessFn(void * context, const chip::app::Clusters::Scenes::Commands::GetSceneMembershipResponse::DecodableType & data) -{ - auto * response = [MTRScenesClusterGetSceneMembershipResponseParams new]; - CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; - if (err != CHIP_NO_ERROR) { - OnFailureFn(context, err); - return; - } - SetAttestationChallengeIfNeeded(context, response); - DispatchSuccess(context, response); -}; - -void MTRScenesClusterEnhancedAddSceneResponseCallbackBridge::OnSuccessFn(void * context, const chip::app::Clusters::Scenes::Commands::EnhancedAddSceneResponse::DecodableType & data) -{ - auto * response = [MTRScenesClusterEnhancedAddSceneResponseParams new]; - CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; - if (err != CHIP_NO_ERROR) { - OnFailureFn(context, err); - return; - } - SetAttestationChallengeIfNeeded(context, response); - DispatchSuccess(context, response); -}; - -void MTRScenesClusterEnhancedViewSceneResponseCallbackBridge::OnSuccessFn(void * context, const chip::app::Clusters::Scenes::Commands::EnhancedViewSceneResponse::DecodableType & data) -{ - auto * response = [MTRScenesClusterEnhancedViewSceneResponseParams new]; - CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; - if (err != CHIP_NO_ERROR) { - OnFailureFn(context, err); - return; - } - SetAttestationChallengeIfNeeded(context, response); - DispatchSuccess(context, response); -}; - -void MTRScenesClusterCopySceneResponseCallbackBridge::OnSuccessFn(void * context, const chip::app::Clusters::Scenes::Commands::CopySceneResponse::DecodableType & data) -{ - auto * response = [MTRScenesClusterCopySceneResponseParams new]; - CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; - if (err != CHIP_NO_ERROR) { - OnFailureFn(context, err); - return; - } - SetAttestationChallengeIfNeeded(context, response); - DispatchSuccess(context, response); -}; - -void MTROTASoftwareUpdateProviderClusterQueryImageResponseCallbackBridge::OnSuccessFn(void * context, const chip::app::Clusters::OtaSoftwareUpdateProvider::Commands::QueryImageResponse::DecodableType & data) -{ - auto * response = [MTROTASoftwareUpdateProviderClusterQueryImageResponseParams new]; - CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; - if (err != CHIP_NO_ERROR) { - OnFailureFn(context, err); - return; - } - SetAttestationChallengeIfNeeded(context, response); - DispatchSuccess(context, response); -}; - -void MTROTASoftwareUpdateProviderClusterApplyUpdateResponseCallbackBridge::OnSuccessFn(void * context, const chip::app::Clusters::OtaSoftwareUpdateProvider::Commands::ApplyUpdateResponse::DecodableType & data) -{ - auto * response = [MTROTASoftwareUpdateProviderClusterApplyUpdateResponseParams new]; - CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; - if (err != CHIP_NO_ERROR) { - OnFailureFn(context, err); - return; - } - SetAttestationChallengeIfNeeded(context, response); - DispatchSuccess(context, response); -}; - -void MTRGeneralCommissioningClusterArmFailSafeResponseCallbackBridge::OnSuccessFn(void * context, const chip::app::Clusters::GeneralCommissioning::Commands::ArmFailSafeResponse::DecodableType & data) -{ - auto * response = [MTRGeneralCommissioningClusterArmFailSafeResponseParams new]; - CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; - if (err != CHIP_NO_ERROR) { - OnFailureFn(context, err); - return; - } - SetAttestationChallengeIfNeeded(context, response); - DispatchSuccess(context, response); -}; - -void MTRGeneralCommissioningClusterSetRegulatoryConfigResponseCallbackBridge::OnSuccessFn(void * context, const chip::app::Clusters::GeneralCommissioning::Commands::SetRegulatoryConfigResponse::DecodableType & data) -{ - auto * response = [MTRGeneralCommissioningClusterSetRegulatoryConfigResponseParams new]; - CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; - if (err != CHIP_NO_ERROR) { - OnFailureFn(context, err); - return; - } - SetAttestationChallengeIfNeeded(context, response); - DispatchSuccess(context, response); -}; - -void MTRGeneralCommissioningClusterCommissioningCompleteResponseCallbackBridge::OnSuccessFn(void * context, const chip::app::Clusters::GeneralCommissioning::Commands::CommissioningCompleteResponse::DecodableType & data) -{ - auto * response = [MTRGeneralCommissioningClusterCommissioningCompleteResponseParams new]; - CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; - if (err != CHIP_NO_ERROR) { - OnFailureFn(context, err); - return; - } - SetAttestationChallengeIfNeeded(context, response); - DispatchSuccess(context, response); -}; - -void MTRNetworkCommissioningClusterScanNetworksResponseCallbackBridge::OnSuccessFn(void * context, const chip::app::Clusters::NetworkCommissioning::Commands::ScanNetworksResponse::DecodableType & data) -{ - auto * response = [MTRNetworkCommissioningClusterScanNetworksResponseParams new]; - CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; - if (err != CHIP_NO_ERROR) { - OnFailureFn(context, err); - return; - } - SetAttestationChallengeIfNeeded(context, response); - DispatchSuccess(context, response); -}; - -void MTRNetworkCommissioningClusterNetworkConfigResponseCallbackBridge::OnSuccessFn(void * context, const chip::app::Clusters::NetworkCommissioning::Commands::NetworkConfigResponse::DecodableType & data) -{ - auto * response = [MTRNetworkCommissioningClusterNetworkConfigResponseParams new]; - CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; - if (err != CHIP_NO_ERROR) { - OnFailureFn(context, err); - return; - } - SetAttestationChallengeIfNeeded(context, response); - DispatchSuccess(context, response); -}; - -void MTRNetworkCommissioningClusterConnectNetworkResponseCallbackBridge::OnSuccessFn(void * context, const chip::app::Clusters::NetworkCommissioning::Commands::ConnectNetworkResponse::DecodableType & data) -{ - auto * response = [MTRNetworkCommissioningClusterConnectNetworkResponseParams new]; - CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; - if (err != CHIP_NO_ERROR) { - OnFailureFn(context, err); - return; - } - SetAttestationChallengeIfNeeded(context, response); - DispatchSuccess(context, response); -}; - -void MTRDiagnosticLogsClusterRetrieveLogsResponseCallbackBridge::OnSuccessFn(void * context, const chip::app::Clusters::DiagnosticLogs::Commands::RetrieveLogsResponse::DecodableType & data) -{ - auto * response = [MTRDiagnosticLogsClusterRetrieveLogsResponseParams new]; - CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; - if (err != CHIP_NO_ERROR) { - OnFailureFn(context, err); - return; - } - SetAttestationChallengeIfNeeded(context, response); - DispatchSuccess(context, response); -}; - -void MTRTimeSynchronizationClusterSetTimeZoneResponseCallbackBridge::OnSuccessFn(void * context, const chip::app::Clusters::TimeSynchronization::Commands::SetTimeZoneResponse::DecodableType & data) -{ - auto * response = [MTRTimeSynchronizationClusterSetTimeZoneResponseParams new]; - CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; - if (err != CHIP_NO_ERROR) { - OnFailureFn(context, err); - return; - } - SetAttestationChallengeIfNeeded(context, response); - DispatchSuccess(context, response); -}; - -void MTROperationalCredentialsClusterAttestationResponseCallbackBridge::OnSuccessFn(void * context, const chip::app::Clusters::OperationalCredentials::Commands::AttestationResponse::DecodableType & data) -{ - auto * response = [MTROperationalCredentialsClusterAttestationResponseParams new]; - CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; - if (err != CHIP_NO_ERROR) { - OnFailureFn(context, err); - return; - } - SetAttestationChallengeIfNeeded(context, response); - DispatchSuccess(context, response); -}; - -void MTROperationalCredentialsClusterCertificateChainResponseCallbackBridge::OnSuccessFn(void * context, const chip::app::Clusters::OperationalCredentials::Commands::CertificateChainResponse::DecodableType & data) -{ - auto * response = [MTROperationalCredentialsClusterCertificateChainResponseParams new]; - CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; - if (err != CHIP_NO_ERROR) { - OnFailureFn(context, err); - return; - } - SetAttestationChallengeIfNeeded(context, response); - DispatchSuccess(context, response); -}; - -void MTROperationalCredentialsClusterCSRResponseCallbackBridge::OnSuccessFn(void * context, const chip::app::Clusters::OperationalCredentials::Commands::CSRResponse::DecodableType & data) -{ - auto * response = [MTROperationalCredentialsClusterCSRResponseParams new]; - CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; - if (err != CHIP_NO_ERROR) { - OnFailureFn(context, err); - return; - } - SetAttestationChallengeIfNeeded(context, response); - DispatchSuccess(context, response); -}; - -void MTROperationalCredentialsClusterNOCResponseCallbackBridge::OnSuccessFn(void * context, const chip::app::Clusters::OperationalCredentials::Commands::NOCResponse::DecodableType & data) -{ - auto * response = [MTROperationalCredentialsClusterNOCResponseParams new]; - CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; - if (err != CHIP_NO_ERROR) { - OnFailureFn(context, err); - return; - } - SetAttestationChallengeIfNeeded(context, response); - DispatchSuccess(context, response); -}; - -void MTRGroupKeyManagementClusterKeySetReadResponseCallbackBridge::OnSuccessFn(void * context, const chip::app::Clusters::GroupKeyManagement::Commands::KeySetReadResponse::DecodableType & data) -{ - auto * response = [MTRGroupKeyManagementClusterKeySetReadResponseParams new]; - CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; - if (err != CHIP_NO_ERROR) { - OnFailureFn(context, err); - return; - } - SetAttestationChallengeIfNeeded(context, response); - DispatchSuccess(context, response); -}; - -void MTRGroupKeyManagementClusterKeySetReadAllIndicesResponseCallbackBridge::OnSuccessFn(void * context, const chip::app::Clusters::GroupKeyManagement::Commands::KeySetReadAllIndicesResponse::DecodableType & data) -{ - auto * response = [MTRGroupKeyManagementClusterKeySetReadAllIndicesResponseParams new]; - CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; - if (err != CHIP_NO_ERROR) { - OnFailureFn(context, err); - return; - } - SetAttestationChallengeIfNeeded(context, response); - DispatchSuccess(context, response); -}; - -void MTRICDManagementClusterRegisterClientResponseCallbackBridge::OnSuccessFn(void * context, const chip::app::Clusters::IcdManagement::Commands::RegisterClientResponse::DecodableType & data) -{ - auto * response = [MTRICDManagementClusterRegisterClientResponseParams new]; - CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; - if (err != CHIP_NO_ERROR) { - OnFailureFn(context, err); - return; - } - SetAttestationChallengeIfNeeded(context, response); - DispatchSuccess(context, response); -}; - -void MTRLaundryWasherModeClusterChangeToModeResponseCallbackBridge::OnSuccessFn(void * context, const chip::app::Clusters::LaundryWasherMode::Commands::ChangeToModeResponse::DecodableType & data) -{ - auto * response = [MTRLaundryWasherModeClusterChangeToModeResponseParams new]; - CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; - if (err != CHIP_NO_ERROR) { - OnFailureFn(context, err); - return; - } - SetAttestationChallengeIfNeeded(context, response); - DispatchSuccess(context, response); -}; - -void MTRRefrigeratorAndTemperatureControlledCabinetModeClusterChangeToModeResponseCallbackBridge::OnSuccessFn(void * context, const chip::app::Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Commands::ChangeToModeResponse::DecodableType & data) -{ - auto * response = [MTRRefrigeratorAndTemperatureControlledCabinetModeClusterChangeToModeResponseParams new]; - CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; - if (err != CHIP_NO_ERROR) { - OnFailureFn(context, err); - return; - } - SetAttestationChallengeIfNeeded(context, response); - DispatchSuccess(context, response); -}; - -void MTRRVCRunModeClusterChangeToModeResponseCallbackBridge::OnSuccessFn(void * context, const chip::app::Clusters::RvcRunMode::Commands::ChangeToModeResponse::DecodableType & data) -{ - auto * response = [MTRRVCRunModeClusterChangeToModeResponseParams new]; - CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; - if (err != CHIP_NO_ERROR) { - OnFailureFn(context, err); - return; - } - SetAttestationChallengeIfNeeded(context, response); - DispatchSuccess(context, response); -}; - -void MTRRVCCleanModeClusterChangeToModeResponseCallbackBridge::OnSuccessFn(void * context, const chip::app::Clusters::RvcCleanMode::Commands::ChangeToModeResponse::DecodableType & data) -{ - auto * response = [MTRRVCCleanModeClusterChangeToModeResponseParams new]; - CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; - if (err != CHIP_NO_ERROR) { - OnFailureFn(context, err); - return; - } - SetAttestationChallengeIfNeeded(context, response); - DispatchSuccess(context, response); -}; - -void MTRDishwasherModeClusterChangeToModeResponseCallbackBridge::OnSuccessFn(void * context, const chip::app::Clusters::DishwasherMode::Commands::ChangeToModeResponse::DecodableType & data) -{ - auto * response = [MTRDishwasherModeClusterChangeToModeResponseParams new]; - CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; - if (err != CHIP_NO_ERROR) { - OnFailureFn(context, err); - return; - } - SetAttestationChallengeIfNeeded(context, response); - DispatchSuccess(context, response); -}; - -void MTROperationalStateClusterOperationalCommandResponseCallbackBridge::OnSuccessFn(void * context, const chip::app::Clusters::OperationalState::Commands::OperationalCommandResponse::DecodableType & data) -{ - auto * response = [MTROperationalStateClusterOperationalCommandResponseParams new]; - CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; - if (err != CHIP_NO_ERROR) { - OnFailureFn(context, err); - return; - } - SetAttestationChallengeIfNeeded(context, response); - DispatchSuccess(context, response); -}; - -void MTRRVCOperationalStateClusterOperationalCommandResponseCallbackBridge::OnSuccessFn(void * context, const chip::app::Clusters::RvcOperationalState::Commands::OperationalCommandResponse::DecodableType & data) -{ - auto * response = [MTRRVCOperationalStateClusterOperationalCommandResponseParams new]; - CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; - if (err != CHIP_NO_ERROR) { - OnFailureFn(context, err); - return; - } - SetAttestationChallengeIfNeeded(context, response); - DispatchSuccess(context, response); -}; - -void MTRDoorLockClusterGetWeekDayScheduleResponseCallbackBridge::OnSuccessFn(void * context, const chip::app::Clusters::DoorLock::Commands::GetWeekDayScheduleResponse::DecodableType & data) -{ - auto * response = [MTRDoorLockClusterGetWeekDayScheduleResponseParams new]; - CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; - if (err != CHIP_NO_ERROR) { - OnFailureFn(context, err); - return; - } - SetAttestationChallengeIfNeeded(context, response); - DispatchSuccess(context, response); -}; - -void MTRDoorLockClusterGetYearDayScheduleResponseCallbackBridge::OnSuccessFn(void * context, const chip::app::Clusters::DoorLock::Commands::GetYearDayScheduleResponse::DecodableType & data) -{ - auto * response = [MTRDoorLockClusterGetYearDayScheduleResponseParams new]; - CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; - if (err != CHIP_NO_ERROR) { - OnFailureFn(context, err); - return; - } - SetAttestationChallengeIfNeeded(context, response); - DispatchSuccess(context, response); -}; - -void MTRDoorLockClusterGetHolidayScheduleResponseCallbackBridge::OnSuccessFn(void * context, const chip::app::Clusters::DoorLock::Commands::GetHolidayScheduleResponse::DecodableType & data) -{ - auto * response = [MTRDoorLockClusterGetHolidayScheduleResponseParams new]; - CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; - if (err != CHIP_NO_ERROR) { - OnFailureFn(context, err); - return; - } - SetAttestationChallengeIfNeeded(context, response); - DispatchSuccess(context, response); -}; - -void MTRDoorLockClusterGetUserResponseCallbackBridge::OnSuccessFn(void * context, const chip::app::Clusters::DoorLock::Commands::GetUserResponse::DecodableType & data) -{ - auto * response = [MTRDoorLockClusterGetUserResponseParams new]; - CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; - if (err != CHIP_NO_ERROR) { - OnFailureFn(context, err); - return; - } - SetAttestationChallengeIfNeeded(context, response); - DispatchSuccess(context, response); -}; - -void MTRDoorLockClusterSetCredentialResponseCallbackBridge::OnSuccessFn(void * context, const chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType & data) -{ - auto * response = [MTRDoorLockClusterSetCredentialResponseParams new]; - CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; - if (err != CHIP_NO_ERROR) { - OnFailureFn(context, err); - return; - } - SetAttestationChallengeIfNeeded(context, response); - DispatchSuccess(context, response); -}; - -void MTRDoorLockClusterGetCredentialStatusResponseCallbackBridge::OnSuccessFn(void * context, const chip::app::Clusters::DoorLock::Commands::GetCredentialStatusResponse::DecodableType & data) -{ - auto * response = [MTRDoorLockClusterGetCredentialStatusResponseParams new]; - CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; - if (err != CHIP_NO_ERROR) { - OnFailureFn(context, err); - return; - } - SetAttestationChallengeIfNeeded(context, response); - DispatchSuccess(context, response); -}; - -void MTRThermostatClusterGetWeeklyScheduleResponseCallbackBridge::OnSuccessFn(void * context, const chip::app::Clusters::Thermostat::Commands::GetWeeklyScheduleResponse::DecodableType & data) -{ - auto * response = [MTRThermostatClusterGetWeeklyScheduleResponseParams new]; - CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; - if (err != CHIP_NO_ERROR) { - OnFailureFn(context, err); - return; - } - SetAttestationChallengeIfNeeded(context, response); - DispatchSuccess(context, response); -}; - -void MTRChannelClusterChangeChannelResponseCallbackBridge::OnSuccessFn(void * context, const chip::app::Clusters::Channel::Commands::ChangeChannelResponse::DecodableType & data) -{ - auto * response = [MTRChannelClusterChangeChannelResponseParams new]; - CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; - if (err != CHIP_NO_ERROR) { - OnFailureFn(context, err); - return; - } - SetAttestationChallengeIfNeeded(context, response); - DispatchSuccess(context, response); -}; - -void MTRTargetNavigatorClusterNavigateTargetResponseCallbackBridge::OnSuccessFn(void * context, const chip::app::Clusters::TargetNavigator::Commands::NavigateTargetResponse::DecodableType & data) -{ - auto * response = [MTRTargetNavigatorClusterNavigateTargetResponseParams new]; - CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; - if (err != CHIP_NO_ERROR) { - OnFailureFn(context, err); - return; - } - SetAttestationChallengeIfNeeded(context, response); - DispatchSuccess(context, response); -}; - -void MTRMediaPlaybackClusterPlaybackResponseCallbackBridge::OnSuccessFn(void * context, const chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::DecodableType & data) -{ - auto * response = [MTRMediaPlaybackClusterPlaybackResponseParams new]; - CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; - if (err != CHIP_NO_ERROR) { - OnFailureFn(context, err); - return; - } - SetAttestationChallengeIfNeeded(context, response); - DispatchSuccess(context, response); -}; - -void MTRKeypadInputClusterSendKeyResponseCallbackBridge::OnSuccessFn(void * context, const chip::app::Clusters::KeypadInput::Commands::SendKeyResponse::DecodableType & data) -{ - auto * response = [MTRKeypadInputClusterSendKeyResponseParams new]; - CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; - if (err != CHIP_NO_ERROR) { - OnFailureFn(context, err); - return; - } - SetAttestationChallengeIfNeeded(context, response); - DispatchSuccess(context, response); -}; - -void MTRContentLauncherClusterLauncherResponseCallbackBridge::OnSuccessFn(void * context, const chip::app::Clusters::ContentLauncher::Commands::LauncherResponse::DecodableType & data) -{ - auto * response = [MTRContentLauncherClusterLauncherResponseParams new]; - CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; - if (err != CHIP_NO_ERROR) { - OnFailureFn(context, err); - return; - } - SetAttestationChallengeIfNeeded(context, response); - DispatchSuccess(context, response); -}; - -void MTRApplicationLauncherClusterLauncherResponseCallbackBridge::OnSuccessFn(void * context, const chip::app::Clusters::ApplicationLauncher::Commands::LauncherResponse::DecodableType & data) -{ - auto * response = [MTRApplicationLauncherClusterLauncherResponseParams new]; - CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; - if (err != CHIP_NO_ERROR) { - OnFailureFn(context, err); - return; - } - SetAttestationChallengeIfNeeded(context, response); - DispatchSuccess(context, response); -}; - -void MTRAccountLoginClusterGetSetupPINResponseCallbackBridge::OnSuccessFn(void * context, const chip::app::Clusters::AccountLogin::Commands::GetSetupPINResponse::DecodableType & data) -{ - auto * response = [MTRAccountLoginClusterGetSetupPINResponseParams new]; - CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; - if (err != CHIP_NO_ERROR) { - OnFailureFn(context, err); - return; - } - SetAttestationChallengeIfNeeded(context, response); - DispatchSuccess(context, response); -}; - -void MTRUnitTestingClusterTestSpecificResponseCallbackBridge::OnSuccessFn(void * context, const chip::app::Clusters::UnitTesting::Commands::TestSpecificResponse::DecodableType & data) -{ - auto * response = [MTRUnitTestingClusterTestSpecificResponseParams new]; - CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; - if (err != CHIP_NO_ERROR) { - OnFailureFn(context, err); - return; - } - SetAttestationChallengeIfNeeded(context, response); - DispatchSuccess(context, response); -}; - -void MTRUnitTestingClusterTestAddArgumentsResponseCallbackBridge::OnSuccessFn(void * context, const chip::app::Clusters::UnitTesting::Commands::TestAddArgumentsResponse::DecodableType & data) -{ - auto * response = [MTRUnitTestingClusterTestAddArgumentsResponseParams new]; - CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; - if (err != CHIP_NO_ERROR) { - OnFailureFn(context, err); - return; - } - SetAttestationChallengeIfNeeded(context, response); - DispatchSuccess(context, response); -}; - -void MTRUnitTestingClusterTestSimpleArgumentResponseCallbackBridge::OnSuccessFn(void * context, const chip::app::Clusters::UnitTesting::Commands::TestSimpleArgumentResponse::DecodableType & data) -{ - auto * response = [MTRUnitTestingClusterTestSimpleArgumentResponseParams new]; - CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; - if (err != CHIP_NO_ERROR) { - OnFailureFn(context, err); - return; - } - SetAttestationChallengeIfNeeded(context, response); - DispatchSuccess(context, response); -}; - -void MTRUnitTestingClusterTestStructArrayArgumentResponseCallbackBridge::OnSuccessFn(void * context, const chip::app::Clusters::UnitTesting::Commands::TestStructArrayArgumentResponse::DecodableType & data) -{ - auto * response = [MTRUnitTestingClusterTestStructArrayArgumentResponseParams new]; - CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; - if (err != CHIP_NO_ERROR) { - OnFailureFn(context, err); - return; - } - SetAttestationChallengeIfNeeded(context, response); - DispatchSuccess(context, response); -}; - -void MTRUnitTestingClusterTestListInt8UReverseResponseCallbackBridge::OnSuccessFn(void * context, const chip::app::Clusters::UnitTesting::Commands::TestListInt8UReverseResponse::DecodableType & data) -{ - auto * response = [MTRUnitTestingClusterTestListInt8UReverseResponseParams new]; - CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; - if (err != CHIP_NO_ERROR) { - OnFailureFn(context, err); - return; - } - SetAttestationChallengeIfNeeded(context, response); - DispatchSuccess(context, response); -}; - -void MTRUnitTestingClusterTestEnumsResponseCallbackBridge::OnSuccessFn(void * context, const chip::app::Clusters::UnitTesting::Commands::TestEnumsResponse::DecodableType & data) -{ - auto * response = [MTRUnitTestingClusterTestEnumsResponseParams new]; - CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; - if (err != CHIP_NO_ERROR) { - OnFailureFn(context, err); - return; - } - SetAttestationChallengeIfNeeded(context, response); - DispatchSuccess(context, response); -}; - -void MTRUnitTestingClusterTestNullableOptionalResponseCallbackBridge::OnSuccessFn(void * context, const chip::app::Clusters::UnitTesting::Commands::TestNullableOptionalResponse::DecodableType & data) -{ - auto * response = [MTRUnitTestingClusterTestNullableOptionalResponseParams new]; - CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; - if (err != CHIP_NO_ERROR) { - OnFailureFn(context, err); - return; - } - SetAttestationChallengeIfNeeded(context, response); - DispatchSuccess(context, response); -}; - -void MTRUnitTestingClusterTestComplexNullableOptionalResponseCallbackBridge::OnSuccessFn(void * context, const chip::app::Clusters::UnitTesting::Commands::TestComplexNullableOptionalResponse::DecodableType & data) -{ - auto * response = [MTRUnitTestingClusterTestComplexNullableOptionalResponseParams new]; - CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; - if (err != CHIP_NO_ERROR) { - OnFailureFn(context, err); - return; - } - SetAttestationChallengeIfNeeded(context, response); - DispatchSuccess(context, response); -}; - -void MTRUnitTestingClusterBooleanResponseCallbackBridge::OnSuccessFn(void * context, const chip::app::Clusters::UnitTesting::Commands::BooleanResponse::DecodableType & data) -{ - auto * response = [MTRUnitTestingClusterBooleanResponseParams new]; - CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; - if (err != CHIP_NO_ERROR) { - OnFailureFn(context, err); - return; - } - SetAttestationChallengeIfNeeded(context, response); - DispatchSuccess(context, response); -}; - -void MTRUnitTestingClusterSimpleStructResponseCallbackBridge::OnSuccessFn(void * context, const chip::app::Clusters::UnitTesting::Commands::SimpleStructResponse::DecodableType & data) -{ - auto * response = [MTRUnitTestingClusterSimpleStructResponseParams new]; - CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; - if (err != CHIP_NO_ERROR) { - OnFailureFn(context, err); - return; - } - SetAttestationChallengeIfNeeded(context, response); - DispatchSuccess(context, response); -}; - -void MTRUnitTestingClusterTestEmitTestEventResponseCallbackBridge::OnSuccessFn(void * context, const chip::app::Clusters::UnitTesting::Commands::TestEmitTestEventResponse::DecodableType & data) -{ - auto * response = [MTRUnitTestingClusterTestEmitTestEventResponseParams new]; - CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; - if (err != CHIP_NO_ERROR) { - OnFailureFn(context, err); - return; - } - SetAttestationChallengeIfNeeded(context, response); - DispatchSuccess(context, response); -}; - -void MTRUnitTestingClusterTestEmitTestFabricScopedEventResponseCallbackBridge::OnSuccessFn(void * context, const chip::app::Clusters::UnitTesting::Commands::TestEmitTestFabricScopedEventResponse::DecodableType & data) -{ - auto * response = [MTRUnitTestingClusterTestEmitTestFabricScopedEventResponseParams new]; - CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; - if (err != CHIP_NO_ERROR) { - OnFailureFn(context, err); - return; - } - SetAttestationChallengeIfNeeded(context, response); - DispatchSuccess(context, response); -}; - -void MTRSampleMEIClusterAddArgumentsResponseCallbackBridge::OnSuccessFn(void * context, const chip::app::Clusters::SampleMei::Commands::AddArgumentsResponse::DecodableType & data) -{ - auto * response = [MTRSampleMEIClusterAddArgumentsResponseParams new]; - CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; - if (err != CHIP_NO_ERROR) { - OnFailureFn(context, err); - return; - } - SetAttestationChallengeIfNeeded(context, response); - DispatchSuccess(context, response); -}; - void MTRIdentifyClusterEffectIdentifierEnumAttributeCallbackBridge::OnSuccessFn(void * context, chip::app::Clusters::Identify::EffectIdentifierEnum value) { NSNumber * _Nonnull objCValue; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm index cc99b43359f5f3..bb7332dd6cd348 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm @@ -26,7 +26,9 @@ #import "MTRLogging_Internal.h" #import "MTRStructsObjc.h" +#include #include + #include using chip::Callback::Callback; @@ -66,9 +68,10 @@ - (void)identifyWithParams:(MTRIdentifyClusterIdentifyParams *)params expectedVa auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = Identify::Commands::Identify::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeIdentifyID) - commandID:@(MTRCommandIDTypeClusterIdentifyCommandIdentifyID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -92,9 +95,10 @@ - (void)triggerEffectWithParams:(MTRIdentifyClusterTriggerEffectParams *)params auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = Identify::Commands::TriggerEffect::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeIdentifyID) - commandID:@(MTRCommandIDTypeClusterIdentifyCommandTriggerEffectID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -204,9 +208,10 @@ - (void)addGroupWithParams:(MTRGroupsClusterAddGroupParams *)params expectedValu auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = Groups::Commands::AddGroup::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeGroupsID) - commandID:@(MTRCommandIDTypeClusterGroupsCommandAddGroupID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -230,9 +235,10 @@ - (void)viewGroupWithParams:(MTRGroupsClusterViewGroupParams *)params expectedVa auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = Groups::Commands::ViewGroup::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeGroupsID) - commandID:@(MTRCommandIDTypeClusterGroupsCommandViewGroupID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -256,9 +262,10 @@ - (void)getGroupMembershipWithParams:(MTRGroupsClusterGetGroupMembershipParams * auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = Groups::Commands::GetGroupMembership::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeGroupsID) - commandID:@(MTRCommandIDTypeClusterGroupsCommandGetGroupMembershipID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -282,9 +289,10 @@ - (void)removeGroupWithParams:(MTRGroupsClusterRemoveGroupParams *)params expect auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = Groups::Commands::RemoveGroup::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeGroupsID) - commandID:@(MTRCommandIDTypeClusterGroupsCommandRemoveGroupID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -312,9 +320,10 @@ - (void)removeAllGroupsWithParams:(MTRGroupsClusterRemoveAllGroupsParams * _Null auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = Groups::Commands::RemoveAllGroups::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeGroupsID) - commandID:@(MTRCommandIDTypeClusterGroupsCommandRemoveAllGroupsID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -338,9 +347,10 @@ - (void)addGroupIfIdentifyingWithParams:(MTRGroupsClusterAddGroupIfIdentifyingPa auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = Groups::Commands::AddGroupIfIdentifying::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeGroupsID) - commandID:@(MTRCommandIDTypeClusterGroupsCommandAddGroupIfIdentifyingID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -470,9 +480,10 @@ - (void)addSceneWithParams:(MTRScenesClusterAddSceneParams *)params expectedValu auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = Scenes::Commands::AddScene::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeScenesID) - commandID:@(MTRCommandIDTypeClusterScenesCommandAddSceneID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -496,9 +507,10 @@ - (void)viewSceneWithParams:(MTRScenesClusterViewSceneParams *)params expectedVa auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = Scenes::Commands::ViewScene::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeScenesID) - commandID:@(MTRCommandIDTypeClusterScenesCommandViewSceneID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -522,9 +534,10 @@ - (void)removeSceneWithParams:(MTRScenesClusterRemoveSceneParams *)params expect auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = Scenes::Commands::RemoveScene::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeScenesID) - commandID:@(MTRCommandIDTypeClusterScenesCommandRemoveSceneID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -548,9 +561,10 @@ - (void)removeAllScenesWithParams:(MTRScenesClusterRemoveAllScenesParams *)param auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = Scenes::Commands::RemoveAllScenes::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeScenesID) - commandID:@(MTRCommandIDTypeClusterScenesCommandRemoveAllScenesID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -574,9 +588,10 @@ - (void)storeSceneWithParams:(MTRScenesClusterStoreSceneParams *)params expected auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = Scenes::Commands::StoreScene::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeScenesID) - commandID:@(MTRCommandIDTypeClusterScenesCommandStoreSceneID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -600,9 +615,10 @@ - (void)recallSceneWithParams:(MTRScenesClusterRecallSceneParams *)params expect auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = Scenes::Commands::RecallScene::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeScenesID) - commandID:@(MTRCommandIDTypeClusterScenesCommandRecallSceneID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -626,9 +642,10 @@ - (void)getSceneMembershipWithParams:(MTRScenesClusterGetSceneMembershipParams * auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = Scenes::Commands::GetSceneMembership::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeScenesID) - commandID:@(MTRCommandIDTypeClusterScenesCommandGetSceneMembershipID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -652,9 +669,10 @@ - (void)enhancedAddSceneWithParams:(MTRScenesClusterEnhancedAddSceneParams *)par auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = Scenes::Commands::EnhancedAddScene::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeScenesID) - commandID:@(MTRCommandIDTypeClusterScenesCommandEnhancedAddSceneID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -678,9 +696,10 @@ - (void)enhancedViewSceneWithParams:(MTRScenesClusterEnhancedViewSceneParams *)p auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = Scenes::Commands::EnhancedViewScene::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeScenesID) - commandID:@(MTRCommandIDTypeClusterScenesCommandEnhancedViewSceneID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -704,9 +723,10 @@ - (void)copySceneWithParams:(MTRScenesClusterCopySceneParams *)params expectedVa auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = Scenes::Commands::CopyScene::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeScenesID) - commandID:@(MTRCommandIDTypeClusterScenesCommandCopySceneID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -906,9 +926,10 @@ - (void)offWithParams:(MTROnOffClusterOffParams * _Nullable)params expectedValue auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = OnOff::Commands::Off::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeOnOffID) - commandID:@(MTRCommandIDTypeClusterOnOffCommandOffID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -936,9 +957,10 @@ - (void)onWithParams:(MTROnOffClusterOnParams * _Nullable)params expectedValues: auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = OnOff::Commands::On::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeOnOffID) - commandID:@(MTRCommandIDTypeClusterOnOffCommandOnID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -966,9 +988,10 @@ - (void)toggleWithParams:(MTROnOffClusterToggleParams * _Nullable)params expecte auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = OnOff::Commands::Toggle::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeOnOffID) - commandID:@(MTRCommandIDTypeClusterOnOffCommandToggleID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -992,9 +1015,10 @@ - (void)offWithEffectWithParams:(MTROnOffClusterOffWithEffectParams *)params exp auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = OnOff::Commands::OffWithEffect::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeOnOffID) - commandID:@(MTRCommandIDTypeClusterOnOffCommandOffWithEffectID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -1022,9 +1046,10 @@ - (void)onWithRecallGlobalSceneWithParams:(MTROnOffClusterOnWithRecallGlobalScen auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = OnOff::Commands::OnWithRecallGlobalScene::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeOnOffID) - commandID:@(MTRCommandIDTypeClusterOnOffCommandOnWithRecallGlobalSceneID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -1048,9 +1073,10 @@ - (void)onWithTimedOffWithParams:(MTROnOffClusterOnWithTimedOffParams *)params e auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = OnOff::Commands::OnWithTimedOff::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeOnOffID) - commandID:@(MTRCommandIDTypeClusterOnOffCommandOnWithTimedOffID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -1309,9 +1335,10 @@ - (void)moveToLevelWithParams:(MTRLevelControlClusterMoveToLevelParams *)params auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = LevelControl::Commands::MoveToLevel::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeLevelControlID) - commandID:@(MTRCommandIDTypeClusterLevelControlCommandMoveToLevelID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -1335,9 +1362,10 @@ - (void)moveWithParams:(MTRLevelControlClusterMoveParams *)params expectedValues auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = LevelControl::Commands::Move::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeLevelControlID) - commandID:@(MTRCommandIDTypeClusterLevelControlCommandMoveID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -1361,9 +1389,10 @@ - (void)stepWithParams:(MTRLevelControlClusterStepParams *)params expectedValues auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = LevelControl::Commands::Step::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeLevelControlID) - commandID:@(MTRCommandIDTypeClusterLevelControlCommandStepID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -1387,9 +1416,10 @@ - (void)stopWithParams:(MTRLevelControlClusterStopParams *)params expectedValues auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = LevelControl::Commands::Stop::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeLevelControlID) - commandID:@(MTRCommandIDTypeClusterLevelControlCommandStopID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -1413,9 +1443,10 @@ - (void)moveToLevelWithOnOffWithParams:(MTRLevelControlClusterMoveToLevelWithOnO auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = LevelControl::Commands::MoveToLevelWithOnOff::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeLevelControlID) - commandID:@(MTRCommandIDTypeClusterLevelControlCommandMoveToLevelWithOnOffID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -1439,9 +1470,10 @@ - (void)moveWithOnOffWithParams:(MTRLevelControlClusterMoveWithOnOffParams *)par auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = LevelControl::Commands::MoveWithOnOff::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeLevelControlID) - commandID:@(MTRCommandIDTypeClusterLevelControlCommandMoveWithOnOffID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -1465,9 +1497,10 @@ - (void)stepWithOnOffWithParams:(MTRLevelControlClusterStepWithOnOffParams *)par auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = LevelControl::Commands::StepWithOnOff::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeLevelControlID) - commandID:@(MTRCommandIDTypeClusterLevelControlCommandStepWithOnOffID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -1491,9 +1524,10 @@ - (void)stopWithOnOffWithParams:(MTRLevelControlClusterStopWithOnOffParams *)par auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = LevelControl::Commands::StopWithOnOff::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeLevelControlID) - commandID:@(MTRCommandIDTypeClusterLevelControlCommandStopWithOnOffID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -1517,9 +1551,10 @@ - (void)moveToClosestFrequencyWithParams:(MTRLevelControlClusterMoveToClosestFre auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = LevelControl::Commands::MoveToClosestFrequency::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeLevelControlID) - commandID:@(MTRCommandIDTypeClusterLevelControlCommandMoveToClosestFrequencyID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -2271,9 +2306,10 @@ - (void)instantActionWithParams:(MTRActionsClusterInstantActionParams *)params e auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = Actions::Commands::InstantAction::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeActionsID) - commandID:@(MTRCommandIDTypeClusterActionsCommandInstantActionID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -2297,9 +2333,10 @@ - (void)instantActionWithTransitionWithParams:(MTRActionsClusterInstantActionWit auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = Actions::Commands::InstantActionWithTransition::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeActionsID) - commandID:@(MTRCommandIDTypeClusterActionsCommandInstantActionWithTransitionID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -2323,9 +2360,10 @@ - (void)startActionWithParams:(MTRActionsClusterStartActionParams *)params expec auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = Actions::Commands::StartAction::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeActionsID) - commandID:@(MTRCommandIDTypeClusterActionsCommandStartActionID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -2349,9 +2387,10 @@ - (void)startActionWithDurationWithParams:(MTRActionsClusterStartActionWithDurat auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = Actions::Commands::StartActionWithDuration::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeActionsID) - commandID:@(MTRCommandIDTypeClusterActionsCommandStartActionWithDurationID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -2375,9 +2414,10 @@ - (void)stopActionWithParams:(MTRActionsClusterStopActionParams *)params expecte auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = Actions::Commands::StopAction::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeActionsID) - commandID:@(MTRCommandIDTypeClusterActionsCommandStopActionID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -2401,9 +2441,10 @@ - (void)pauseActionWithParams:(MTRActionsClusterPauseActionParams *)params expec auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = Actions::Commands::PauseAction::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeActionsID) - commandID:@(MTRCommandIDTypeClusterActionsCommandPauseActionID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -2427,9 +2468,10 @@ - (void)pauseActionWithDurationWithParams:(MTRActionsClusterPauseActionWithDurat auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = Actions::Commands::PauseActionWithDuration::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeActionsID) - commandID:@(MTRCommandIDTypeClusterActionsCommandPauseActionWithDurationID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -2453,9 +2495,10 @@ - (void)resumeActionWithParams:(MTRActionsClusterResumeActionParams *)params exp auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = Actions::Commands::ResumeAction::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeActionsID) - commandID:@(MTRCommandIDTypeClusterActionsCommandResumeActionID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -2479,9 +2522,10 @@ - (void)enableActionWithParams:(MTRActionsClusterEnableActionParams *)params exp auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = Actions::Commands::EnableAction::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeActionsID) - commandID:@(MTRCommandIDTypeClusterActionsCommandEnableActionID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -2505,9 +2549,10 @@ - (void)enableActionWithDurationWithParams:(MTRActionsClusterEnableActionWithDur auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = Actions::Commands::EnableActionWithDuration::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeActionsID) - commandID:@(MTRCommandIDTypeClusterActionsCommandEnableActionWithDurationID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -2531,9 +2576,10 @@ - (void)disableActionWithParams:(MTRActionsClusterDisableActionParams *)params e auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = Actions::Commands::DisableAction::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeActionsID) - commandID:@(MTRCommandIDTypeClusterActionsCommandDisableActionID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -2557,9 +2603,10 @@ - (void)disableActionWithDurationWithParams:(MTRActionsClusterDisableActionWithD auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = Actions::Commands::DisableActionWithDuration::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeActionsID) - commandID:@(MTRCommandIDTypeClusterActionsCommandDisableActionWithDurationID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -2717,9 +2764,10 @@ - (void)mfgSpecificPingWithParams:(MTRBasicClusterMfgSpecificPingParams * _Nulla auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = BasicInformation::Commands::MfgSpecificPing::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(0x00000028) - commandID:@(0x10020000) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -2947,9 +2995,10 @@ - (void)queryImageWithParams:(MTROTASoftwareUpdateProviderClusterQueryImageParam auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = OtaSoftwareUpdateProvider::Commands::QueryImage::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeOTASoftwareUpdateProviderID) - commandID:@(MTRCommandIDTypeClusterOTASoftwareUpdateProviderCommandQueryImageID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -2973,9 +3022,10 @@ - (void)applyUpdateRequestWithParams:(MTROTASoftwareUpdateProviderClusterApplyUp auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = OtaSoftwareUpdateProvider::Commands::ApplyUpdateRequest::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeOTASoftwareUpdateProviderID) - commandID:@(MTRCommandIDTypeClusterOTASoftwareUpdateProviderCommandApplyUpdateRequestID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -2999,9 +3049,10 @@ - (void)notifyUpdateAppliedWithParams:(MTROTASoftwareUpdateProviderClusterNotify auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = OtaSoftwareUpdateProvider::Commands::NotifyUpdateApplied::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeOTASoftwareUpdateProviderID) - commandID:@(MTRCommandIDTypeClusterOTASoftwareUpdateProviderCommandNotifyUpdateAppliedID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -3103,9 +3154,10 @@ - (void)announceOTAProviderWithParams:(MTROTASoftwareUpdateRequestorClusterAnnou auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = OtaSoftwareUpdateRequestor::Commands::AnnounceOTAProvider::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeOTASoftwareUpdateRequestorID) - commandID:@(MTRCommandIDTypeClusterOTASoftwareUpdateRequestorCommandAnnounceOTAProviderID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -3748,9 +3800,10 @@ - (void)armFailSafeWithParams:(MTRGeneralCommissioningClusterArmFailSafeParams * auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = GeneralCommissioning::Commands::ArmFailSafe::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeGeneralCommissioningID) - commandID:@(MTRCommandIDTypeClusterGeneralCommissioningCommandArmFailSafeID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -3774,9 +3827,10 @@ - (void)setRegulatoryConfigWithParams:(MTRGeneralCommissioningClusterSetRegulato auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = GeneralCommissioning::Commands::SetRegulatoryConfig::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeGeneralCommissioningID) - commandID:@(MTRCommandIDTypeClusterGeneralCommissioningCommandSetRegulatoryConfigID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -3804,9 +3858,10 @@ - (void)commissioningCompleteWithParams:(MTRGeneralCommissioningClusterCommissio auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = GeneralCommissioning::Commands::CommissioningComplete::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeGeneralCommissioningID) - commandID:@(MTRCommandIDTypeClusterGeneralCommissioningCommandCommissioningCompleteID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -3949,9 +4004,10 @@ - (void)scanNetworksWithParams:(MTRNetworkCommissioningClusterScanNetworksParams auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = NetworkCommissioning::Commands::ScanNetworks::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeNetworkCommissioningID) - commandID:@(MTRCommandIDTypeClusterNetworkCommissioningCommandScanNetworksID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -3975,9 +4031,10 @@ - (void)addOrUpdateWiFiNetworkWithParams:(MTRNetworkCommissioningClusterAddOrUpd auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = NetworkCommissioning::Commands::AddOrUpdateWiFiNetwork::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeNetworkCommissioningID) - commandID:@(MTRCommandIDTypeClusterNetworkCommissioningCommandAddOrUpdateWiFiNetworkID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -4001,9 +4058,10 @@ - (void)addOrUpdateThreadNetworkWithParams:(MTRNetworkCommissioningClusterAddOrU auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = NetworkCommissioning::Commands::AddOrUpdateThreadNetwork::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeNetworkCommissioningID) - commandID:@(MTRCommandIDTypeClusterNetworkCommissioningCommandAddOrUpdateThreadNetworkID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -4027,9 +4085,10 @@ - (void)removeNetworkWithParams:(MTRNetworkCommissioningClusterRemoveNetworkPara auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = NetworkCommissioning::Commands::RemoveNetwork::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeNetworkCommissioningID) - commandID:@(MTRCommandIDTypeClusterNetworkCommissioningCommandRemoveNetworkID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -4053,9 +4112,10 @@ - (void)connectNetworkWithParams:(MTRNetworkCommissioningClusterConnectNetworkPa auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = NetworkCommissioning::Commands::ConnectNetwork::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeNetworkCommissioningID) - commandID:@(MTRCommandIDTypeClusterNetworkCommissioningCommandConnectNetworkID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -4079,9 +4139,10 @@ - (void)reorderNetworkWithParams:(MTRNetworkCommissioningClusterReorderNetworkPa auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = NetworkCommissioning::Commands::ReorderNetwork::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeNetworkCommissioningID) - commandID:@(MTRCommandIDTypeClusterNetworkCommissioningCommandReorderNetworkID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -4259,9 +4320,10 @@ - (void)retrieveLogsRequestWithParams:(MTRDiagnosticLogsClusterRetrieveLogsReque auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = DiagnosticLogs::Commands::RetrieveLogsRequest::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeDiagnosticLogsID) - commandID:@(MTRCommandIDTypeClusterDiagnosticLogsCommandRetrieveLogsRequestID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -4348,9 +4410,10 @@ - (void)testEventTriggerWithParams:(MTRGeneralDiagnosticsClusterTestEventTrigger auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = GeneralDiagnostics::Commands::TestEventTrigger::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeGeneralDiagnosticsID) - commandID:@(MTRCommandIDTypeClusterGeneralDiagnosticsCommandTestEventTriggerID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -4492,9 +4555,10 @@ - (void)resetWatermarksWithParams:(MTRSoftwareDiagnosticsClusterResetWatermarksP auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = SoftwareDiagnostics::Commands::ResetWatermarks::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeSoftwareDiagnosticsID) - commandID:@(MTRCommandIDTypeClusterSoftwareDiagnosticsCommandResetWatermarksID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -4606,9 +4670,10 @@ - (void)resetCountsWithParams:(MTRThreadNetworkDiagnosticsClusterResetCountsPara auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = ThreadNetworkDiagnostics::Commands::ResetCounts::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeThreadNetworkDiagnosticsID) - commandID:@(MTRCommandIDTypeClusterThreadNetworkDiagnosticsCommandResetCountsID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -5023,9 +5088,10 @@ - (void)resetCountsWithParams:(MTRWiFiNetworkDiagnosticsClusterResetCountsParams auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = WiFiNetworkDiagnostics::Commands::ResetCounts::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeWiFiNetworkDiagnosticsID) - commandID:@(MTRCommandIDTypeClusterWiFiNetworkDiagnosticsCommandResetCountsID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -5190,9 +5256,10 @@ - (void)resetCountsWithParams:(MTREthernetNetworkDiagnosticsClusterResetCountsPa auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = EthernetNetworkDiagnostics::Commands::ResetCounts::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeEthernetNetworkDiagnosticsID) - commandID:@(MTRCommandIDTypeClusterEthernetNetworkDiagnosticsCommandResetCountsID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -5325,9 +5392,10 @@ - (void)setUTCTimeWithParams:(MTRTimeSynchronizationClusterSetUTCTimeParams *)pa auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = TimeSynchronization::Commands::SetUTCTime::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeTimeSynchronizationID) - commandID:@(MTRCommandIDTypeClusterTimeSynchronizationCommandSetUTCTimeID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -5351,9 +5419,10 @@ - (void)setTrustedTimeSourceWithParams:(MTRTimeSynchronizationClusterSetTrustedT auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = TimeSynchronization::Commands::SetTrustedTimeSource::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeTimeSynchronizationID) - commandID:@(MTRCommandIDTypeClusterTimeSynchronizationCommandSetTrustedTimeSourceID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -5377,9 +5446,10 @@ - (void)setTimeZoneWithParams:(MTRTimeSynchronizationClusterSetTimeZoneParams *) auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = TimeSynchronization::Commands::SetTimeZone::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeTimeSynchronizationID) - commandID:@(MTRCommandIDTypeClusterTimeSynchronizationCommandSetTimeZoneID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -5403,9 +5473,10 @@ - (void)setDSTOffsetWithParams:(MTRTimeSynchronizationClusterSetDSTOffsetParams auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = TimeSynchronization::Commands::SetDSTOffset::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeTimeSynchronizationID) - commandID:@(MTRCommandIDTypeClusterTimeSynchronizationCommandSetDSTOffsetID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -5429,9 +5500,10 @@ - (void)setDefaultNTPWithParams:(MTRTimeSynchronizationClusterSetDefaultNTPParam auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = TimeSynchronization::Commands::SetDefaultNTP::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeTimeSynchronizationID) - commandID:@(MTRCommandIDTypeClusterTimeSynchronizationCommandSetDefaultNTPID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -5787,9 +5859,10 @@ - (void)openCommissioningWindowWithParams:(MTRAdministratorCommissioningClusterO timedInvokeTimeoutMs = @(10000); } + using RequestType = AdministratorCommissioning::Commands::OpenCommissioningWindow::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeAdministratorCommissioningID) - commandID:@(MTRCommandIDTypeClusterAdministratorCommissioningCommandOpenCommissioningWindowID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -5816,9 +5889,10 @@ - (void)openBasicCommissioningWindowWithParams:(MTRAdministratorCommissioningClu timedInvokeTimeoutMs = @(10000); } + using RequestType = AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeAdministratorCommissioningID) - commandID:@(MTRCommandIDTypeClusterAdministratorCommissioningCommandOpenBasicCommissioningWindowID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -5849,9 +5923,10 @@ - (void)revokeCommissioningWithParams:(MTRAdministratorCommissioningClusterRevok timedInvokeTimeoutMs = @(10000); } + using RequestType = AdministratorCommissioning::Commands::RevokeCommissioning::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeAdministratorCommissioningID) - commandID:@(MTRCommandIDTypeClusterAdministratorCommissioningCommandRevokeCommissioningID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -5964,9 +6039,10 @@ - (void)attestationRequestWithParams:(MTROperationalCredentialsClusterAttestatio auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = OperationalCredentials::Commands::AttestationRequest::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeOperationalCredentialsID) - commandID:@(MTRCommandIDTypeClusterOperationalCredentialsCommandAttestationRequestID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -5990,9 +6066,10 @@ - (void)certificateChainRequestWithParams:(MTROperationalCredentialsClusterCerti auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = OperationalCredentials::Commands::CertificateChainRequest::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeOperationalCredentialsID) - commandID:@(MTRCommandIDTypeClusterOperationalCredentialsCommandCertificateChainRequestID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -6016,9 +6093,10 @@ - (void)CSRRequestWithParams:(MTROperationalCredentialsClusterCSRRequestParams * auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = OperationalCredentials::Commands::CSRRequest::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeOperationalCredentialsID) - commandID:@(MTRCommandIDTypeClusterOperationalCredentialsCommandCSRRequestID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -6042,9 +6120,10 @@ - (void)addNOCWithParams:(MTROperationalCredentialsClusterAddNOCParams *)params auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = OperationalCredentials::Commands::AddNOC::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeOperationalCredentialsID) - commandID:@(MTRCommandIDTypeClusterOperationalCredentialsCommandAddNOCID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -6068,9 +6147,10 @@ - (void)updateNOCWithParams:(MTROperationalCredentialsClusterUpdateNOCParams *)p auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = OperationalCredentials::Commands::UpdateNOC::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeOperationalCredentialsID) - commandID:@(MTRCommandIDTypeClusterOperationalCredentialsCommandUpdateNOCID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -6094,9 +6174,10 @@ - (void)updateFabricLabelWithParams:(MTROperationalCredentialsClusterUpdateFabri auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = OperationalCredentials::Commands::UpdateFabricLabel::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeOperationalCredentialsID) - commandID:@(MTRCommandIDTypeClusterOperationalCredentialsCommandUpdateFabricLabelID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -6120,9 +6201,10 @@ - (void)removeFabricWithParams:(MTROperationalCredentialsClusterRemoveFabricPara auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = OperationalCredentials::Commands::RemoveFabric::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeOperationalCredentialsID) - commandID:@(MTRCommandIDTypeClusterOperationalCredentialsCommandRemoveFabricID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -6146,9 +6228,10 @@ - (void)addTrustedRootCertificateWithParams:(MTROperationalCredentialsClusterAdd auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = OperationalCredentials::Commands::AddTrustedRootCertificate::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeOperationalCredentialsID) - commandID:@(MTRCommandIDTypeClusterOperationalCredentialsCommandAddTrustedRootCertificateID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -6318,9 +6401,10 @@ - (void)keySetWriteWithParams:(MTRGroupKeyManagementClusterKeySetWriteParams *)p auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = GroupKeyManagement::Commands::KeySetWrite::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeGroupKeyManagementID) - commandID:@(MTRCommandIDTypeClusterGroupKeyManagementCommandKeySetWriteID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -6344,9 +6428,10 @@ - (void)keySetReadWithParams:(MTRGroupKeyManagementClusterKeySetReadParams *)par auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = GroupKeyManagement::Commands::KeySetRead::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeGroupKeyManagementID) - commandID:@(MTRCommandIDTypeClusterGroupKeyManagementCommandKeySetReadID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -6370,9 +6455,10 @@ - (void)keySetRemoveWithParams:(MTRGroupKeyManagementClusterKeySetRemoveParams * auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = GroupKeyManagement::Commands::KeySetRemove::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeGroupKeyManagementID) - commandID:@(MTRCommandIDTypeClusterGroupKeyManagementCommandKeySetRemoveID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -6400,9 +6486,10 @@ - (void)keySetReadAllIndicesWithParams:(MTRGroupKeyManagementClusterKeySetReadAl auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = GroupKeyManagement::Commands::KeySetReadAllIndices::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeGroupKeyManagementID) - commandID:@(MTRCommandIDTypeClusterGroupKeyManagementCommandKeySetReadAllIndicesID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -6729,9 +6816,10 @@ - (void)registerClientWithParams:(MTRICDManagementClusterRegisterClientParams *) auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = IcdManagement::Commands::RegisterClient::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeICDManagementID) - commandID:@(MTRCommandIDTypeClusterICDManagementCommandRegisterClientID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -6755,9 +6843,10 @@ - (void)unregisterClientWithParams:(MTRICDManagementClusterUnregisterClientParam auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = IcdManagement::Commands::UnregisterClient::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeICDManagementID) - commandID:@(MTRCommandIDTypeClusterICDManagementCommandUnregisterClientID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -6785,9 +6874,10 @@ - (void)stayActiveRequestWithParams:(MTRICDManagementClusterStayActiveRequestPar auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = IcdManagement::Commands::StayActiveRequest::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeICDManagementID) - commandID:@(MTRCommandIDTypeClusterICDManagementCommandStayActiveRequestID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -6887,9 +6977,10 @@ - (void)changeToModeWithParams:(MTRModeSelectClusterChangeToModeParams *)params auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = ModeSelect::Commands::ChangeToMode::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeModeSelectID) - commandID:@(MTRCommandIDTypeClusterModeSelectCommandChangeToModeID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -7025,9 +7116,10 @@ - (void)changeToModeWithParams:(MTRLaundryWasherModeClusterChangeToModeParams *) auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = LaundryWasherMode::Commands::ChangeToMode::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeLaundryWasherModeID) - commandID:@(MTRCommandIDTypeClusterLaundryWasherModeCommandChangeToModeID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -7139,9 +7231,10 @@ - (void)changeToModeWithParams:(MTRRefrigeratorAndTemperatureControlledCabinetMo auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = RefrigeratorAndTemperatureControlledCabinetMode::Commands::ChangeToMode::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeRefrigeratorAndTemperatureControlledCabinetModeID) - commandID:@(MTRCommandIDTypeClusterRefrigeratorAndTemperatureControlledCabinetModeCommandChangeToModeID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -7341,9 +7434,10 @@ - (void)changeToModeWithParams:(MTRRVCRunModeClusterChangeToModeParams *)params auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = RvcRunMode::Commands::ChangeToMode::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeRVCRunModeID) - commandID:@(MTRCommandIDTypeClusterRVCRunModeCommandChangeToModeID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -7455,9 +7549,10 @@ - (void)changeToModeWithParams:(MTRRVCCleanModeClusterChangeToModeParams *)param auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = RvcCleanMode::Commands::ChangeToMode::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeRVCCleanModeID) - commandID:@(MTRCommandIDTypeClusterRVCCleanModeCommandChangeToModeID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -7569,9 +7664,10 @@ - (void)setTemperatureWithParams:(MTRTemperatureControlClusterSetTemperaturePara auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = TemperatureControl::Commands::SetTemperature::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeTemperatureControlID) - commandID:@(MTRCommandIDTypeClusterTemperatureControlCommandSetTemperatureID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -7732,9 +7828,10 @@ - (void)changeToModeWithParams:(MTRDishwasherModeClusterChangeToModeParams *)par auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = DishwasherMode::Commands::ChangeToMode::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeDishwasherModeID) - commandID:@(MTRCommandIDTypeClusterDishwasherModeCommandChangeToModeID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -7901,9 +7998,10 @@ - (void)selfTestRequestWithParams:(MTRSmokeCOAlarmClusterSelfTestRequestParams * auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = SmokeCoAlarm::Commands::SelfTestRequest::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeSmokeCOAlarmID) - commandID:@(MTRCommandIDTypeClusterSmokeCOAlarmCommandSelfTestRequestID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -8049,9 +8147,10 @@ - (void)resetWithParams:(MTRDishwasherAlarmClusterResetParams *)params expectedV auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = DishwasherAlarm::Commands::Reset::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeDishwasherAlarmID) - commandID:@(MTRCommandIDTypeClusterDishwasherAlarmCommandResetID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -8075,9 +8174,10 @@ - (void)modifyEnabledAlarmsWithParams:(MTRDishwasherAlarmClusterModifyEnabledAla auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = DishwasherAlarm::Commands::ModifyEnabledAlarms::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeDishwasherAlarmID) - commandID:@(MTRCommandIDTypeClusterDishwasherAlarmCommandModifyEnabledAlarmsID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -8171,9 +8271,10 @@ - (void)pauseWithParams:(MTROperationalStateClusterPauseParams * _Nullable)param auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = OperationalState::Commands::Pause::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeOperationalStateID) - commandID:@(MTRCommandIDTypeClusterOperationalStateCommandPauseID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -8201,9 +8302,10 @@ - (void)stopWithParams:(MTROperationalStateClusterStopParams * _Nullable)params auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = OperationalState::Commands::Stop::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeOperationalStateID) - commandID:@(MTRCommandIDTypeClusterOperationalStateCommandStopID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -8231,9 +8333,10 @@ - (void)startWithParams:(MTROperationalStateClusterStartParams * _Nullable)param auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = OperationalState::Commands::Start::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeOperationalStateID) - commandID:@(MTRCommandIDTypeClusterOperationalStateCommandStartID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -8261,9 +8364,10 @@ - (void)resumeWithParams:(MTROperationalStateClusterResumeParams * _Nullable)par auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = OperationalState::Commands::Resume::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeOperationalStateID) - commandID:@(MTRCommandIDTypeClusterOperationalStateCommandResumeID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -8367,9 +8471,10 @@ - (void)pauseWithParams:(MTRRVCOperationalStateClusterPauseParams * _Nullable)pa auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = RvcOperationalState::Commands::Pause::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeRVCOperationalStateID) - commandID:@(MTRCommandIDTypeClusterRVCOperationalStateCommandPauseID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -8397,9 +8502,10 @@ - (void)stopWithParams:(MTRRVCOperationalStateClusterStopParams * _Nullable)para auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = RvcOperationalState::Commands::Stop::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeRVCOperationalStateID) - commandID:@(MTRCommandIDTypeClusterRVCOperationalStateCommandStopID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -8427,9 +8533,10 @@ - (void)startWithParams:(MTRRVCOperationalStateClusterStartParams * _Nullable)pa auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = RvcOperationalState::Commands::Start::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeRVCOperationalStateID) - commandID:@(MTRCommandIDTypeClusterRVCOperationalStateCommandStartID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -8457,9 +8564,10 @@ - (void)resumeWithParams:(MTRRVCOperationalStateClusterResumeParams * _Nullable) auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = RvcOperationalState::Commands::Resume::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeRVCOperationalStateID) - commandID:@(MTRCommandIDTypeClusterRVCOperationalStateCommandResumeID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -8563,9 +8671,10 @@ - (void)resetConditionWithParams:(MTRHEPAFilterMonitoringClusterResetConditionPa auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = HepaFilterMonitoring::Commands::ResetCondition::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeHEPAFilterMonitoringID) - commandID:@(MTRCommandIDTypeClusterHEPAFilterMonitoringCommandResetConditionID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -8680,9 +8789,10 @@ - (void)resetConditionWithParams:(MTRActivatedCarbonFilterMonitoringClusterReset auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = ActivatedCarbonFilterMonitoring::Commands::ResetCondition::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeActivatedCarbonFilterMonitoringID) - commandID:@(MTRCommandIDTypeClusterActivatedCarbonFilterMonitoringCommandResetConditionID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -8796,9 +8906,10 @@ - (void)lockDoorWithParams:(MTRDoorLockClusterLockDoorParams * _Nullable)params timedInvokeTimeoutMs = @(10000); } + using RequestType = DoorLock::Commands::LockDoor::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeDoorLockID) - commandID:@(MTRCommandIDTypeClusterDoorLockCommandLockDoorID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -8825,9 +8936,10 @@ - (void)unlockDoorWithParams:(MTRDoorLockClusterUnlockDoorParams * _Nullable)par timedInvokeTimeoutMs = @(10000); } + using RequestType = DoorLock::Commands::UnlockDoor::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeDoorLockID) - commandID:@(MTRCommandIDTypeClusterDoorLockCommandUnlockDoorID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -8854,9 +8966,10 @@ - (void)unlockWithTimeoutWithParams:(MTRDoorLockClusterUnlockWithTimeoutParams * timedInvokeTimeoutMs = @(10000); } + using RequestType = DoorLock::Commands::UnlockWithTimeout::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeDoorLockID) - commandID:@(MTRCommandIDTypeClusterDoorLockCommandUnlockWithTimeoutID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -8880,9 +8993,10 @@ - (void)setWeekDayScheduleWithParams:(MTRDoorLockClusterSetWeekDayScheduleParams auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = DoorLock::Commands::SetWeekDaySchedule::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeDoorLockID) - commandID:@(MTRCommandIDTypeClusterDoorLockCommandSetWeekDayScheduleID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -8906,9 +9020,10 @@ - (void)getWeekDayScheduleWithParams:(MTRDoorLockClusterGetWeekDayScheduleParams auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = DoorLock::Commands::GetWeekDaySchedule::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeDoorLockID) - commandID:@(MTRCommandIDTypeClusterDoorLockCommandGetWeekDayScheduleID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -8932,9 +9047,10 @@ - (void)clearWeekDayScheduleWithParams:(MTRDoorLockClusterClearWeekDaySchedulePa auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = DoorLock::Commands::ClearWeekDaySchedule::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeDoorLockID) - commandID:@(MTRCommandIDTypeClusterDoorLockCommandClearWeekDayScheduleID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -8958,9 +9074,10 @@ - (void)setYearDayScheduleWithParams:(MTRDoorLockClusterSetYearDayScheduleParams auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = DoorLock::Commands::SetYearDaySchedule::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeDoorLockID) - commandID:@(MTRCommandIDTypeClusterDoorLockCommandSetYearDayScheduleID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -8984,9 +9101,10 @@ - (void)getYearDayScheduleWithParams:(MTRDoorLockClusterGetYearDayScheduleParams auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = DoorLock::Commands::GetYearDaySchedule::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeDoorLockID) - commandID:@(MTRCommandIDTypeClusterDoorLockCommandGetYearDayScheduleID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -9010,9 +9128,10 @@ - (void)clearYearDayScheduleWithParams:(MTRDoorLockClusterClearYearDaySchedulePa auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = DoorLock::Commands::ClearYearDaySchedule::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeDoorLockID) - commandID:@(MTRCommandIDTypeClusterDoorLockCommandClearYearDayScheduleID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -9036,9 +9155,10 @@ - (void)setHolidayScheduleWithParams:(MTRDoorLockClusterSetHolidayScheduleParams auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = DoorLock::Commands::SetHolidaySchedule::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeDoorLockID) - commandID:@(MTRCommandIDTypeClusterDoorLockCommandSetHolidayScheduleID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -9062,9 +9182,10 @@ - (void)getHolidayScheduleWithParams:(MTRDoorLockClusterGetHolidayScheduleParams auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = DoorLock::Commands::GetHolidaySchedule::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeDoorLockID) - commandID:@(MTRCommandIDTypeClusterDoorLockCommandGetHolidayScheduleID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -9088,9 +9209,10 @@ - (void)clearHolidayScheduleWithParams:(MTRDoorLockClusterClearHolidaySchedulePa auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = DoorLock::Commands::ClearHolidaySchedule::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeDoorLockID) - commandID:@(MTRCommandIDTypeClusterDoorLockCommandClearHolidayScheduleID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -9117,9 +9239,10 @@ - (void)setUserWithParams:(MTRDoorLockClusterSetUserParams *)params expectedValu timedInvokeTimeoutMs = @(10000); } + using RequestType = DoorLock::Commands::SetUser::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeDoorLockID) - commandID:@(MTRCommandIDTypeClusterDoorLockCommandSetUserID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -9143,9 +9266,10 @@ - (void)getUserWithParams:(MTRDoorLockClusterGetUserParams *)params expectedValu auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = DoorLock::Commands::GetUser::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeDoorLockID) - commandID:@(MTRCommandIDTypeClusterDoorLockCommandGetUserID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -9172,9 +9296,10 @@ - (void)clearUserWithParams:(MTRDoorLockClusterClearUserParams *)params expected timedInvokeTimeoutMs = @(10000); } + using RequestType = DoorLock::Commands::ClearUser::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeDoorLockID) - commandID:@(MTRCommandIDTypeClusterDoorLockCommandClearUserID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -9201,9 +9326,10 @@ - (void)setCredentialWithParams:(MTRDoorLockClusterSetCredentialParams *)params timedInvokeTimeoutMs = @(10000); } + using RequestType = DoorLock::Commands::SetCredential::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeDoorLockID) - commandID:@(MTRCommandIDTypeClusterDoorLockCommandSetCredentialID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -9227,9 +9353,10 @@ - (void)getCredentialStatusWithParams:(MTRDoorLockClusterGetCredentialStatusPara auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = DoorLock::Commands::GetCredentialStatus::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeDoorLockID) - commandID:@(MTRCommandIDTypeClusterDoorLockCommandGetCredentialStatusID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -9256,9 +9383,10 @@ - (void)clearCredentialWithParams:(MTRDoorLockClusterClearCredentialParams *)par timedInvokeTimeoutMs = @(10000); } + using RequestType = DoorLock::Commands::ClearCredential::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeDoorLockID) - commandID:@(MTRCommandIDTypeClusterDoorLockCommandClearCredentialID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -9285,9 +9413,10 @@ - (void)unboltDoorWithParams:(MTRDoorLockClusterUnboltDoorParams * _Nullable)par timedInvokeTimeoutMs = @(10000); } + using RequestType = DoorLock::Commands::UnboltDoor::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeDoorLockID) - commandID:@(MTRCommandIDTypeClusterDoorLockCommandUnboltDoorID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -9856,9 +9985,10 @@ - (void)upOrOpenWithParams:(MTRWindowCoveringClusterUpOrOpenParams * _Nullable)p auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = WindowCovering::Commands::UpOrOpen::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeWindowCoveringID) - commandID:@(MTRCommandIDTypeClusterWindowCoveringCommandUpOrOpenID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -9886,9 +10016,10 @@ - (void)downOrCloseWithParams:(MTRWindowCoveringClusterDownOrCloseParams * _Null auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = WindowCovering::Commands::DownOrClose::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeWindowCoveringID) - commandID:@(MTRCommandIDTypeClusterWindowCoveringCommandDownOrCloseID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -9916,9 +10047,10 @@ - (void)stopMotionWithParams:(MTRWindowCoveringClusterStopMotionParams * _Nullab auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = WindowCovering::Commands::StopMotion::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeWindowCoveringID) - commandID:@(MTRCommandIDTypeClusterWindowCoveringCommandStopMotionID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -9942,9 +10074,10 @@ - (void)goToLiftValueWithParams:(MTRWindowCoveringClusterGoToLiftValueParams *)p auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = WindowCovering::Commands::GoToLiftValue::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeWindowCoveringID) - commandID:@(MTRCommandIDTypeClusterWindowCoveringCommandGoToLiftValueID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -9968,9 +10101,10 @@ - (void)goToLiftPercentageWithParams:(MTRWindowCoveringClusterGoToLiftPercentage auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = WindowCovering::Commands::GoToLiftPercentage::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeWindowCoveringID) - commandID:@(MTRCommandIDTypeClusterWindowCoveringCommandGoToLiftPercentageID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -9994,9 +10128,10 @@ - (void)goToTiltValueWithParams:(MTRWindowCoveringClusterGoToTiltValueParams *)p auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = WindowCovering::Commands::GoToTiltValue::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeWindowCoveringID) - commandID:@(MTRCommandIDTypeClusterWindowCoveringCommandGoToTiltValueID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -10020,9 +10155,10 @@ - (void)goToTiltPercentageWithParams:(MTRWindowCoveringClusterGoToTiltPercentage auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = WindowCovering::Commands::GoToTiltPercentage::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeWindowCoveringID) - commandID:@(MTRCommandIDTypeClusterWindowCoveringCommandGoToTiltPercentageID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -10269,9 +10405,10 @@ - (void)barrierControlGoToPercentWithParams:(MTRBarrierControlClusterBarrierCont auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = BarrierControl::Commands::BarrierControlGoToPercent::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeBarrierControlID) - commandID:@(MTRCommandIDTypeClusterBarrierControlCommandBarrierControlGoToPercentID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -10299,9 +10436,10 @@ - (void)barrierControlStopWithParams:(MTRBarrierControlClusterBarrierControlStop auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = BarrierControl::Commands::BarrierControlStop::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeBarrierControlID) - commandID:@(MTRCommandIDTypeClusterBarrierControlCommandBarrierControlStopID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -10724,9 +10862,10 @@ - (void)setpointRaiseLowerWithParams:(MTRThermostatClusterSetpointRaiseLowerPara auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = Thermostat::Commands::SetpointRaiseLower::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeThermostatID) - commandID:@(MTRCommandIDTypeClusterThermostatCommandSetpointRaiseLowerID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -10750,9 +10889,10 @@ - (void)setWeeklyScheduleWithParams:(MTRThermostatClusterSetWeeklyScheduleParams auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = Thermostat::Commands::SetWeeklySchedule::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeThermostatID) - commandID:@(MTRCommandIDTypeClusterThermostatCommandSetWeeklyScheduleID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -10776,9 +10916,10 @@ - (void)getWeeklyScheduleWithParams:(MTRThermostatClusterGetWeeklyScheduleParams auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = Thermostat::Commands::GetWeeklySchedule::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeThermostatID) - commandID:@(MTRCommandIDTypeClusterThermostatCommandGetWeeklyScheduleID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -10806,9 +10947,10 @@ - (void)clearWeeklyScheduleWithParams:(MTRThermostatClusterClearWeeklySchedulePa auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = Thermostat::Commands::ClearWeeklySchedule::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeThermostatID) - commandID:@(MTRCommandIDTypeClusterThermostatCommandClearWeeklyScheduleID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -11456,9 +11598,10 @@ - (void)stepWithParams:(MTRFanControlClusterStepParams *)params expectedValues:( auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = FanControl::Commands::Step::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeFanControlID) - commandID:@(MTRCommandIDTypeClusterFanControlCommandStepID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -11777,9 +11920,10 @@ - (void)moveToHueWithParams:(MTRColorControlClusterMoveToHueParams *)params expe auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = ColorControl::Commands::MoveToHue::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeColorControlID) - commandID:@(MTRCommandIDTypeClusterColorControlCommandMoveToHueID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -11803,9 +11947,10 @@ - (void)moveHueWithParams:(MTRColorControlClusterMoveHueParams *)params expected auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = ColorControl::Commands::MoveHue::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeColorControlID) - commandID:@(MTRCommandIDTypeClusterColorControlCommandMoveHueID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -11829,9 +11974,10 @@ - (void)stepHueWithParams:(MTRColorControlClusterStepHueParams *)params expected auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = ColorControl::Commands::StepHue::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeColorControlID) - commandID:@(MTRCommandIDTypeClusterColorControlCommandStepHueID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -11855,9 +12001,10 @@ - (void)moveToSaturationWithParams:(MTRColorControlClusterMoveToSaturationParams auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = ColorControl::Commands::MoveToSaturation::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeColorControlID) - commandID:@(MTRCommandIDTypeClusterColorControlCommandMoveToSaturationID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -11881,9 +12028,10 @@ - (void)moveSaturationWithParams:(MTRColorControlClusterMoveSaturationParams *)p auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = ColorControl::Commands::MoveSaturation::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeColorControlID) - commandID:@(MTRCommandIDTypeClusterColorControlCommandMoveSaturationID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -11907,9 +12055,10 @@ - (void)stepSaturationWithParams:(MTRColorControlClusterStepSaturationParams *)p auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = ColorControl::Commands::StepSaturation::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeColorControlID) - commandID:@(MTRCommandIDTypeClusterColorControlCommandStepSaturationID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -11933,9 +12082,10 @@ - (void)moveToHueAndSaturationWithParams:(MTRColorControlClusterMoveToHueAndSatu auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = ColorControl::Commands::MoveToHueAndSaturation::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeColorControlID) - commandID:@(MTRCommandIDTypeClusterColorControlCommandMoveToHueAndSaturationID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -11959,9 +12109,10 @@ - (void)moveToColorWithParams:(MTRColorControlClusterMoveToColorParams *)params auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = ColorControl::Commands::MoveToColor::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeColorControlID) - commandID:@(MTRCommandIDTypeClusterColorControlCommandMoveToColorID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -11985,9 +12136,10 @@ - (void)moveColorWithParams:(MTRColorControlClusterMoveColorParams *)params expe auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = ColorControl::Commands::MoveColor::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeColorControlID) - commandID:@(MTRCommandIDTypeClusterColorControlCommandMoveColorID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -12011,9 +12163,10 @@ - (void)stepColorWithParams:(MTRColorControlClusterStepColorParams *)params expe auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = ColorControl::Commands::StepColor::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeColorControlID) - commandID:@(MTRCommandIDTypeClusterColorControlCommandStepColorID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -12037,9 +12190,10 @@ - (void)moveToColorTemperatureWithParams:(MTRColorControlClusterMoveToColorTempe auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = ColorControl::Commands::MoveToColorTemperature::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeColorControlID) - commandID:@(MTRCommandIDTypeClusterColorControlCommandMoveToColorTemperatureID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -12063,9 +12217,10 @@ - (void)enhancedMoveToHueWithParams:(MTRColorControlClusterEnhancedMoveToHuePara auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = ColorControl::Commands::EnhancedMoveToHue::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeColorControlID) - commandID:@(MTRCommandIDTypeClusterColorControlCommandEnhancedMoveToHueID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -12089,9 +12244,10 @@ - (void)enhancedMoveHueWithParams:(MTRColorControlClusterEnhancedMoveHueParams * auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = ColorControl::Commands::EnhancedMoveHue::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeColorControlID) - commandID:@(MTRCommandIDTypeClusterColorControlCommandEnhancedMoveHueID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -12115,9 +12271,10 @@ - (void)enhancedStepHueWithParams:(MTRColorControlClusterEnhancedStepHueParams * auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = ColorControl::Commands::EnhancedStepHue::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeColorControlID) - commandID:@(MTRCommandIDTypeClusterColorControlCommandEnhancedStepHueID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -12141,9 +12298,10 @@ - (void)enhancedMoveToHueAndSaturationWithParams:(MTRColorControlClusterEnhanced auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = ColorControl::Commands::EnhancedMoveToHueAndSaturation::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeColorControlID) - commandID:@(MTRCommandIDTypeClusterColorControlCommandEnhancedMoveToHueAndSaturationID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -12167,9 +12325,10 @@ - (void)colorLoopSetWithParams:(MTRColorControlClusterColorLoopSetParams *)param auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = ColorControl::Commands::ColorLoopSet::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeColorControlID) - commandID:@(MTRCommandIDTypeClusterColorControlCommandColorLoopSetID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -12193,9 +12352,10 @@ - (void)stopMoveStepWithParams:(MTRColorControlClusterStopMoveStepParams *)param auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = ColorControl::Commands::StopMoveStep::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeColorControlID) - commandID:@(MTRCommandIDTypeClusterColorControlCommandStopMoveStepID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -12219,9 +12379,10 @@ - (void)moveColorTemperatureWithParams:(MTRColorControlClusterMoveColorTemperatu auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = ColorControl::Commands::MoveColorTemperature::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeColorControlID) - commandID:@(MTRCommandIDTypeClusterColorControlCommandMoveColorTemperatureID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -12245,9 +12406,10 @@ - (void)stepColorTemperatureWithParams:(MTRColorControlClusterStepColorTemperatu auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = ColorControl::Commands::StepColorTemperature::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeColorControlID) - commandID:@(MTRCommandIDTypeClusterColorControlCommandStepColorTemperatureID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -14798,9 +14960,10 @@ - (void)changeChannelWithParams:(MTRChannelClusterChangeChannelParams *)params e auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = Channel::Commands::ChangeChannel::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeChannelID) - commandID:@(MTRCommandIDTypeClusterChannelCommandChangeChannelID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -14824,9 +14987,10 @@ - (void)changeChannelByNumberWithParams:(MTRChannelClusterChangeChannelByNumberP auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = Channel::Commands::ChangeChannelByNumber::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeChannelID) - commandID:@(MTRCommandIDTypeClusterChannelCommandChangeChannelByNumberID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -14850,9 +15014,10 @@ - (void)skipChannelWithParams:(MTRChannelClusterSkipChannelParams *)params expec auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = Channel::Commands::SkipChannel::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeChannelID) - commandID:@(MTRCommandIDTypeClusterChannelCommandSkipChannelID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -14964,9 +15129,10 @@ - (void)navigateTargetWithParams:(MTRTargetNavigatorClusterNavigateTargetParams auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = TargetNavigator::Commands::NavigateTarget::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeTargetNavigatorID) - commandID:@(MTRCommandIDTypeClusterTargetNavigatorCommandNavigateTargetID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -15067,9 +15233,10 @@ - (void)playWithParams:(MTRMediaPlaybackClusterPlayParams * _Nullable)params exp auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = MediaPlayback::Commands::Play::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeMediaPlaybackID) - commandID:@(MTRCommandIDTypeClusterMediaPlaybackCommandPlayID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -15097,9 +15264,10 @@ - (void)pauseWithParams:(MTRMediaPlaybackClusterPauseParams * _Nullable)params e auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = MediaPlayback::Commands::Pause::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeMediaPlaybackID) - commandID:@(MTRCommandIDTypeClusterMediaPlaybackCommandPauseID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -15127,9 +15295,10 @@ - (void)stopWithParams:(MTRMediaPlaybackClusterStopParams * _Nullable)params exp auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = MediaPlayback::Commands::Stop::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeMediaPlaybackID) - commandID:@(MTRCommandIDTypeClusterMediaPlaybackCommandStopID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -15157,9 +15326,10 @@ - (void)startOverWithParams:(MTRMediaPlaybackClusterStartOverParams * _Nullable) auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = MediaPlayback::Commands::StartOver::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeMediaPlaybackID) - commandID:@(MTRCommandIDTypeClusterMediaPlaybackCommandStartOverID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -15187,9 +15357,10 @@ - (void)previousWithParams:(MTRMediaPlaybackClusterPreviousParams * _Nullable)pa auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = MediaPlayback::Commands::Previous::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeMediaPlaybackID) - commandID:@(MTRCommandIDTypeClusterMediaPlaybackCommandPreviousID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -15217,9 +15388,10 @@ - (void)nextWithParams:(MTRMediaPlaybackClusterNextParams * _Nullable)params exp auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = MediaPlayback::Commands::Next::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeMediaPlaybackID) - commandID:@(MTRCommandIDTypeClusterMediaPlaybackCommandNextID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -15247,9 +15419,10 @@ - (void)rewindWithParams:(MTRMediaPlaybackClusterRewindParams * _Nullable)params auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = MediaPlayback::Commands::Rewind::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeMediaPlaybackID) - commandID:@(MTRCommandIDTypeClusterMediaPlaybackCommandRewindID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -15277,9 +15450,10 @@ - (void)fastForwardWithParams:(MTRMediaPlaybackClusterFastForwardParams * _Nulla auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = MediaPlayback::Commands::FastForward::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeMediaPlaybackID) - commandID:@(MTRCommandIDTypeClusterMediaPlaybackCommandFastForwardID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -15303,9 +15477,10 @@ - (void)skipForwardWithParams:(MTRMediaPlaybackClusterSkipForwardParams *)params auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = MediaPlayback::Commands::SkipForward::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeMediaPlaybackID) - commandID:@(MTRCommandIDTypeClusterMediaPlaybackCommandSkipForwardID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -15329,9 +15504,10 @@ - (void)skipBackwardWithParams:(MTRMediaPlaybackClusterSkipBackwardParams *)para auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = MediaPlayback::Commands::SkipBackward::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeMediaPlaybackID) - commandID:@(MTRCommandIDTypeClusterMediaPlaybackCommandSkipBackwardID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -15355,9 +15531,10 @@ - (void)seekWithParams:(MTRMediaPlaybackClusterSeekParams *)params expectedValue auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = MediaPlayback::Commands::Seek::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeMediaPlaybackID) - commandID:@(MTRCommandIDTypeClusterMediaPlaybackCommandSeekID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -15591,9 +15768,10 @@ - (void)selectInputWithParams:(MTRMediaInputClusterSelectInputParams *)params ex auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = MediaInput::Commands::SelectInput::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeMediaInputID) - commandID:@(MTRCommandIDTypeClusterMediaInputCommandSelectInputID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -15621,9 +15799,10 @@ - (void)showInputStatusWithParams:(MTRMediaInputClusterShowInputStatusParams * _ auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = MediaInput::Commands::ShowInputStatus::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeMediaInputID) - commandID:@(MTRCommandIDTypeClusterMediaInputCommandShowInputStatusID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -15651,9 +15830,10 @@ - (void)hideInputStatusWithParams:(MTRMediaInputClusterHideInputStatusParams * _ auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = MediaInput::Commands::HideInputStatus::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeMediaInputID) - commandID:@(MTRCommandIDTypeClusterMediaInputCommandHideInputStatusID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -15677,9 +15857,10 @@ - (void)renameInputWithParams:(MTRMediaInputClusterRenameInputParams *)params ex auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = MediaInput::Commands::RenameInput::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeMediaInputID) - commandID:@(MTRCommandIDTypeClusterMediaInputCommandRenameInputID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -15800,9 +15981,10 @@ - (void)sleepWithParams:(MTRLowPowerClusterSleepParams * _Nullable)params expect auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = LowPower::Commands::Sleep::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeLowPowerID) - commandID:@(MTRCommandIDTypeClusterLowPowerCommandSleepID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -15890,9 +16072,10 @@ - (void)sendKeyWithParams:(MTRKeypadInputClusterSendKeyParams *)params expectedV auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = KeypadInput::Commands::SendKey::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeKeypadInputID) - commandID:@(MTRCommandIDTypeClusterKeypadInputCommandSendKeyID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -15979,9 +16162,10 @@ - (void)launchContentWithParams:(MTRContentLauncherClusterLaunchContentParams *) auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = ContentLauncher::Commands::LaunchContent::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeContentLauncherID) - commandID:@(MTRCommandIDTypeClusterContentLauncherCommandLaunchContentID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -16005,9 +16189,10 @@ - (void)launchURLWithParams:(MTRContentLauncherClusterLaunchURLParams *)params e auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = ContentLauncher::Commands::LaunchURL::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeContentLauncherID) - commandID:@(MTRCommandIDTypeClusterContentLauncherCommandLaunchURLID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -16123,9 +16308,10 @@ - (void)selectOutputWithParams:(MTRAudioOutputClusterSelectOutputParams *)params auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = AudioOutput::Commands::SelectOutput::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeAudioOutputID) - commandID:@(MTRCommandIDTypeClusterAudioOutputCommandSelectOutputID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -16149,9 +16335,10 @@ - (void)renameOutputWithParams:(MTRAudioOutputClusterRenameOutputParams *)params auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = AudioOutput::Commands::RenameOutput::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeAudioOutputID) - commandID:@(MTRCommandIDTypeClusterAudioOutputCommandRenameOutputID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -16250,9 +16437,10 @@ - (void)launchAppWithParams:(MTRApplicationLauncherClusterLaunchAppParams * _Nul auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = ApplicationLauncher::Commands::LaunchApp::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeApplicationLauncherID) - commandID:@(MTRCommandIDTypeClusterApplicationLauncherCommandLaunchAppID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -16276,9 +16464,10 @@ - (void)stopAppWithParams:(MTRApplicationLauncherClusterStopAppParams * _Nullabl auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = ApplicationLauncher::Commands::StopApp::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeApplicationLauncherID) - commandID:@(MTRCommandIDTypeClusterApplicationLauncherCommandStopAppID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -16302,9 +16491,10 @@ - (void)hideAppWithParams:(MTRApplicationLauncherClusterHideAppParams * _Nullabl auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = ApplicationLauncher::Commands::HideApp::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeApplicationLauncherID) - commandID:@(MTRCommandIDTypeClusterApplicationLauncherCommandHideAppID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -16526,9 +16716,10 @@ - (void)getSetupPINWithParams:(MTRAccountLoginClusterGetSetupPINParams *)params timedInvokeTimeoutMs = @(10000); } + using RequestType = AccountLogin::Commands::GetSetupPIN::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeAccountLoginID) - commandID:@(MTRCommandIDTypeClusterAccountLoginCommandGetSetupPINID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -16555,9 +16746,10 @@ - (void)loginWithParams:(MTRAccountLoginClusterLoginParams *)params expectedValu timedInvokeTimeoutMs = @(10000); } + using RequestType = AccountLogin::Commands::Login::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeAccountLoginID) - commandID:@(MTRCommandIDTypeClusterAccountLoginCommandLoginID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -16588,9 +16780,10 @@ - (void)logoutWithParams:(MTRAccountLoginClusterLogoutParams * _Nullable)params timedInvokeTimeoutMs = @(10000); } + using RequestType = AccountLogin::Commands::Logout::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeAccountLoginID) - commandID:@(MTRCommandIDTypeClusterAccountLoginCommandLogoutID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -16695,9 +16888,10 @@ - (void)getProfileInfoCommandWithParams:(MTRElectricalMeasurementClusterGetProfi auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = ElectricalMeasurement::Commands::GetProfileInfoCommand::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeElectricalMeasurementID) - commandID:@(MTRCommandIDTypeClusterElectricalMeasurementCommandGetProfileInfoCommandID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -16721,9 +16915,10 @@ - (void)getMeasurementProfileCommandWithParams:(MTRElectricalMeasurementClusterG auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = ElectricalMeasurement::Commands::GetMeasurementProfileCommand::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeElectricalMeasurementID) - commandID:@(MTRCommandIDTypeClusterElectricalMeasurementCommandGetMeasurementProfileCommandID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -17548,9 +17743,10 @@ - (void)testWithParams:(MTRUnitTestingClusterTestParams * _Nullable)params expec auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = UnitTesting::Commands::Test::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeUnitTestingID) - commandID:@(MTRCommandIDTypeClusterUnitTestingCommandTestID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -17578,9 +17774,10 @@ - (void)testNotHandledWithParams:(MTRUnitTestingClusterTestNotHandledParams * _N auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = UnitTesting::Commands::TestNotHandled::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeUnitTestingID) - commandID:@(MTRCommandIDTypeClusterUnitTestingCommandTestNotHandledID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -17608,9 +17805,10 @@ - (void)testSpecificWithParams:(MTRUnitTestingClusterTestSpecificParams * _Nulla auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = UnitTesting::Commands::TestSpecific::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeUnitTestingID) - commandID:@(MTRCommandIDTypeClusterUnitTestingCommandTestSpecificID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -17638,9 +17836,10 @@ - (void)testUnknownCommandWithParams:(MTRUnitTestingClusterTestUnknownCommandPar auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = UnitTesting::Commands::TestUnknownCommand::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeUnitTestingID) - commandID:@(MTRCommandIDTypeClusterUnitTestingCommandTestUnknownCommandID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -17664,9 +17863,10 @@ - (void)testAddArgumentsWithParams:(MTRUnitTestingClusterTestAddArgumentsParams auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = UnitTesting::Commands::TestAddArguments::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeUnitTestingID) - commandID:@(MTRCommandIDTypeClusterUnitTestingCommandTestAddArgumentsID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -17690,9 +17890,10 @@ - (void)testSimpleArgumentRequestWithParams:(MTRUnitTestingClusterTestSimpleArgu auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = UnitTesting::Commands::TestSimpleArgumentRequest::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeUnitTestingID) - commandID:@(MTRCommandIDTypeClusterUnitTestingCommandTestSimpleArgumentRequestID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -17716,9 +17917,10 @@ - (void)testStructArrayArgumentRequestWithParams:(MTRUnitTestingClusterTestStruc auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = UnitTesting::Commands::TestStructArrayArgumentRequest::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeUnitTestingID) - commandID:@(MTRCommandIDTypeClusterUnitTestingCommandTestStructArrayArgumentRequestID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -17742,9 +17944,10 @@ - (void)testStructArgumentRequestWithParams:(MTRUnitTestingClusterTestStructArgu auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = UnitTesting::Commands::TestStructArgumentRequest::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeUnitTestingID) - commandID:@(MTRCommandIDTypeClusterUnitTestingCommandTestStructArgumentRequestID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -17768,9 +17971,10 @@ - (void)testNestedStructArgumentRequestWithParams:(MTRUnitTestingClusterTestNest auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = UnitTesting::Commands::TestNestedStructArgumentRequest::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeUnitTestingID) - commandID:@(MTRCommandIDTypeClusterUnitTestingCommandTestNestedStructArgumentRequestID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -17794,9 +17998,10 @@ - (void)testListStructArgumentRequestWithParams:(MTRUnitTestingClusterTestListSt auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = UnitTesting::Commands::TestListStructArgumentRequest::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeUnitTestingID) - commandID:@(MTRCommandIDTypeClusterUnitTestingCommandTestListStructArgumentRequestID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -17820,9 +18025,10 @@ - (void)testListInt8UArgumentRequestWithParams:(MTRUnitTestingClusterTestListInt auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = UnitTesting::Commands::TestListInt8UArgumentRequest::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeUnitTestingID) - commandID:@(MTRCommandIDTypeClusterUnitTestingCommandTestListInt8UArgumentRequestID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -17846,9 +18052,10 @@ - (void)testNestedStructListArgumentRequestWithParams:(MTRUnitTestingClusterTest auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = UnitTesting::Commands::TestNestedStructListArgumentRequest::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeUnitTestingID) - commandID:@(MTRCommandIDTypeClusterUnitTestingCommandTestNestedStructListArgumentRequestID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -17872,9 +18079,10 @@ - (void)testListNestedStructListArgumentRequestWithParams:(MTRUnitTestingCluster auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = UnitTesting::Commands::TestListNestedStructListArgumentRequest::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeUnitTestingID) - commandID:@(MTRCommandIDTypeClusterUnitTestingCommandTestListNestedStructListArgumentRequestID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -17898,9 +18106,10 @@ - (void)testListInt8UReverseRequestWithParams:(MTRUnitTestingClusterTestListInt8 auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = UnitTesting::Commands::TestListInt8UReverseRequest::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeUnitTestingID) - commandID:@(MTRCommandIDTypeClusterUnitTestingCommandTestListInt8UReverseRequestID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -17924,9 +18133,10 @@ - (void)testEnumsRequestWithParams:(MTRUnitTestingClusterTestEnumsRequestParams auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = UnitTesting::Commands::TestEnumsRequest::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeUnitTestingID) - commandID:@(MTRCommandIDTypeClusterUnitTestingCommandTestEnumsRequestID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -17950,9 +18160,10 @@ - (void)testNullableOptionalRequestWithParams:(MTRUnitTestingClusterTestNullable auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = UnitTesting::Commands::TestNullableOptionalRequest::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeUnitTestingID) - commandID:@(MTRCommandIDTypeClusterUnitTestingCommandTestNullableOptionalRequestID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -17976,9 +18187,10 @@ - (void)testComplexNullableOptionalRequestWithParams:(MTRUnitTestingClusterTestC auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = UnitTesting::Commands::TestComplexNullableOptionalRequest::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeUnitTestingID) - commandID:@(MTRCommandIDTypeClusterUnitTestingCommandTestComplexNullableOptionalRequestID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -18002,9 +18214,10 @@ - (void)simpleStructEchoRequestWithParams:(MTRUnitTestingClusterSimpleStructEcho auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = UnitTesting::Commands::SimpleStructEchoRequest::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeUnitTestingID) - commandID:@(MTRCommandIDTypeClusterUnitTestingCommandSimpleStructEchoRequestID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -18035,9 +18248,10 @@ - (void)timedInvokeRequestWithParams:(MTRUnitTestingClusterTimedInvokeRequestPar timedInvokeTimeoutMs = @(10000); } + using RequestType = UnitTesting::Commands::TimedInvokeRequest::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeUnitTestingID) - commandID:@(MTRCommandIDTypeClusterUnitTestingCommandTimedInvokeRequestID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -18061,9 +18275,10 @@ - (void)testSimpleOptionalArgumentRequestWithParams:(MTRUnitTestingClusterTestSi auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = UnitTesting::Commands::TestSimpleOptionalArgumentRequest::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeUnitTestingID) - commandID:@(MTRCommandIDTypeClusterUnitTestingCommandTestSimpleOptionalArgumentRequestID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -18087,9 +18302,10 @@ - (void)testEmitTestEventRequestWithParams:(MTRUnitTestingClusterTestEmitTestEve auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = UnitTesting::Commands::TestEmitTestEventRequest::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeUnitTestingID) - commandID:@(MTRCommandIDTypeClusterUnitTestingCommandTestEmitTestEventRequestID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -18113,9 +18329,10 @@ - (void)testEmitTestFabricScopedEventRequestWithParams:(MTRUnitTestingClusterTes auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = UnitTesting::Commands::TestEmitTestFabricScopedEventRequest::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeUnitTestingID) - commandID:@(MTRCommandIDTypeClusterUnitTestingCommandTestEmitTestFabricScopedEventRequestID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -19696,9 +19913,10 @@ - (void)pingWithParams:(MTRSampleMEIClusterPingParams * _Nullable)params expecte auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = SampleMei::Commands::Ping::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeSampleMEIID) - commandID:@(MTRCommandIDTypeClusterSampleMEICommandPingID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs @@ -19722,9 +19940,10 @@ - (void)addArgumentsWithParams:(MTRSampleMEIClusterAddArgumentsParams *)params e auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + using RequestType = SampleMei::Commands::AddArguments::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(MTRClusterIDTypeSampleMEIID) - commandID:@(MTRCommandIDTypeClusterSampleMEICommandAddArgumentsID) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) commandPayload:params expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs