diff --git a/examples/chip-tool-darwin/templates/commands.zapt b/examples/chip-tool-darwin/templates/commands.zapt index f883d41b8342b3..b1f8d013d227b5 100644 --- a/examples/chip-tool-darwin/templates/commands.zapt +++ b/examples/chip-tool-darwin/templates/commands.zapt @@ -54,12 +54,30 @@ public: {{#chip_cluster_command_arguments}} {{#if_chip_complex}} {{>decodable_value target=(concat "params." (asStructPropertyName label)) source=(concat "mRequest." (asStructPropertyName label)) cluster=parent.clusterName type=type depth=0}} - {{else if (isOctetString type)}} - params.{{asStructPropertyName label}} = [[NSData alloc] initWithBytes:m{{asUpperCamelCase label}}.data() length:m{{asUpperCamelCase label}}.size()]; + {{else if (isOctetString type)}} + {{#if isOptional}} + if (m{{asUpperCamelCase label}}.HasValue()) { + {{/if}} + params.{{asStructPropertyName label}} = [[NSData alloc] initWithBytes:m{{asUpperCamelCase label}}{{#if isOptional}}.Value(){{/if}}.data() length:m{{asUpperCamelCase label}}{{#if isOptional}}.Value(){{/if}}.size()]; + {{#if isOptional}} + } + {{/if}} {{else if (isString type)}} - params.{{asStructPropertyName label}} = [[NSString alloc] initWithBytes:m{{asUpperCamelCase label}}.data() length:m{{asUpperCamelCase label}}.size() encoding:NSUTF8StringEncoding]; + {{#if isOptional}} + if (m{{asUpperCamelCase label}}.HasValue()) { + {{/if}} + params.{{asStructPropertyName label}} = [[NSString alloc] initWithBytes:m{{asUpperCamelCase label}}{{#if isOptional}}.Value(){{/if}}.data() length:m{{asUpperCamelCase label}}{{#if isOptional}}.Value(){{/if}}.size() encoding:NSUTF8StringEncoding]; + {{#if isOptional}} + } + {{/if}} {{else}} - params.{{asStructPropertyName label}} = [NSNumber numberWith{{asObjectiveCNumberType "" type false}}:m{{asUpperCamelCase label}}]; + {{#if isOptional}} + if (m{{asUpperCamelCase label}}.HasValue()) { + {{/if}} + params.{{asStructPropertyName label}} = [NSNumber numberWith{{asObjectiveCNumberType "" type false}}:m{{asUpperCamelCase label}}{{#if isOptional}}.Value(){{/if}}]; + {{#if isOptional}} + } + {{/if}} {{/if_chip_complex}} {{/chip_cluster_command_arguments}} uint16_t repeatCount = mRepeatCount.ValueOr(1); @@ -92,12 +110,10 @@ private: {{#if_chip_complex}} chip::app::Clusters::{{asUpperCamelCase parent.clusterName}}::Commands::{{asUpperCamelCase parent.name}}::Type mRequest; TypedComplexArgument<{{zapTypeToEncodableClusterObjectType type ns=parent.parent.name}}> mComplex_{{asUpperCamelCase label}}; - {{else if (isOctetString type)}} - chip::ByteSpan m{{asUpperCamelCase label}}; - {{else if (isCharString type)}} - chip::ByteSpan m{{asUpperCamelCase label}}; + {{else if (isString type)}} + {{#if isOptional}}chip::Optional{{else}}chip::ByteSpan{{/if}} m{{asUpperCamelCase label}}; {{else}} - {{chipType}} m{{asUpperCamelCase label}}; + {{#if isOptional}}chip::Optional<{{chipType}}>{{else}}{{chipType}}{{/if}} m{{asUpperCamelCase label}}; {{/if_chip_complex}} {{/chip_cluster_command_arguments}} }; diff --git a/zzz_generated/chip-tool-darwin/zap-generated/cluster/Commands.h b/zzz_generated/chip-tool-darwin/zap-generated/cluster/Commands.h index a3751e9eeaadd7..f79f8005191590 100644 --- a/zzz_generated/chip-tool-darwin/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool-darwin/zap-generated/cluster/Commands.h @@ -3141,7 +3141,9 @@ class ApplicationLauncherLaunchApp : public ClusterCommand { params.application.applicationId = [[NSString alloc] initWithBytes:mRequest.application.applicationId.data() length:mRequest.application.applicationId.size() encoding:NSUTF8StringEncoding]; - params.data = [[NSData alloc] initWithBytes:mData.data() length:mData.size()]; + if (mData.HasValue()) { + params.data = [[NSData alloc] initWithBytes:mData.Value().data() length:mData.Value().size()]; + } uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { @@ -3166,7 +3168,7 @@ class ApplicationLauncherLaunchApp : public ClusterCommand { private: chip::app::Clusters::ApplicationLauncher::Commands::LaunchApp::Type mRequest; TypedComplexArgument mComplex_Application; - chip::ByteSpan mData; + chip::Optional mData; }; /* @@ -8290,7 +8292,9 @@ class BridgedActionsDisableAction : public ClusterCommand { params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.actionID = [NSNumber numberWithUnsignedShort:mActionID]; - params.invokeID = [NSNumber numberWithUnsignedInt:mInvokeID]; + if (mInvokeID.HasValue()) { + params.invokeID = [NSNumber numberWithUnsignedInt:mInvokeID.Value()]; + } uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { @@ -8312,7 +8316,7 @@ class BridgedActionsDisableAction : public ClusterCommand { private: uint16_t mActionID; - uint32_t mInvokeID; + chip::Optional mInvokeID; }; /* @@ -8340,7 +8344,9 @@ class BridgedActionsDisableActionWithDuration : public ClusterCommand { params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.actionID = [NSNumber numberWithUnsignedShort:mActionID]; - params.invokeID = [NSNumber numberWithUnsignedInt:mInvokeID]; + if (mInvokeID.HasValue()) { + params.invokeID = [NSNumber numberWithUnsignedInt:mInvokeID.Value()]; + } params.duration = [NSNumber numberWithUnsignedInt:mDuration]; uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; @@ -8363,7 +8369,7 @@ class BridgedActionsDisableActionWithDuration : public ClusterCommand { private: uint16_t mActionID; - uint32_t mInvokeID; + chip::Optional mInvokeID; uint32_t mDuration; }; @@ -8391,7 +8397,9 @@ class BridgedActionsEnableAction : public ClusterCommand { params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.actionID = [NSNumber numberWithUnsignedShort:mActionID]; - params.invokeID = [NSNumber numberWithUnsignedInt:mInvokeID]; + if (mInvokeID.HasValue()) { + params.invokeID = [NSNumber numberWithUnsignedInt:mInvokeID.Value()]; + } uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { @@ -8413,7 +8421,7 @@ class BridgedActionsEnableAction : public ClusterCommand { private: uint16_t mActionID; - uint32_t mInvokeID; + chip::Optional mInvokeID; }; /* @@ -8441,7 +8449,9 @@ class BridgedActionsEnableActionWithDuration : public ClusterCommand { params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.actionID = [NSNumber numberWithUnsignedShort:mActionID]; - params.invokeID = [NSNumber numberWithUnsignedInt:mInvokeID]; + if (mInvokeID.HasValue()) { + params.invokeID = [NSNumber numberWithUnsignedInt:mInvokeID.Value()]; + } params.duration = [NSNumber numberWithUnsignedInt:mDuration]; uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; @@ -8464,7 +8474,7 @@ class BridgedActionsEnableActionWithDuration : public ClusterCommand { private: uint16_t mActionID; - uint32_t mInvokeID; + chip::Optional mInvokeID; uint32_t mDuration; }; @@ -8492,7 +8502,9 @@ class BridgedActionsInstantAction : public ClusterCommand { params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.actionID = [NSNumber numberWithUnsignedShort:mActionID]; - params.invokeID = [NSNumber numberWithUnsignedInt:mInvokeID]; + if (mInvokeID.HasValue()) { + params.invokeID = [NSNumber numberWithUnsignedInt:mInvokeID.Value()]; + } uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { @@ -8514,7 +8526,7 @@ class BridgedActionsInstantAction : public ClusterCommand { private: uint16_t mActionID; - uint32_t mInvokeID; + chip::Optional mInvokeID; }; /* @@ -8542,7 +8554,9 @@ class BridgedActionsInstantActionWithTransition : public ClusterCommand { params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.actionID = [NSNumber numberWithUnsignedShort:mActionID]; - params.invokeID = [NSNumber numberWithUnsignedInt:mInvokeID]; + if (mInvokeID.HasValue()) { + params.invokeID = [NSNumber numberWithUnsignedInt:mInvokeID.Value()]; + } params.transitionTime = [NSNumber numberWithUnsignedShort:mTransitionTime]; uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; @@ -8565,7 +8579,7 @@ class BridgedActionsInstantActionWithTransition : public ClusterCommand { private: uint16_t mActionID; - uint32_t mInvokeID; + chip::Optional mInvokeID; uint16_t mTransitionTime; }; @@ -8593,7 +8607,9 @@ class BridgedActionsPauseAction : public ClusterCommand { params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.actionID = [NSNumber numberWithUnsignedShort:mActionID]; - params.invokeID = [NSNumber numberWithUnsignedInt:mInvokeID]; + if (mInvokeID.HasValue()) { + params.invokeID = [NSNumber numberWithUnsignedInt:mInvokeID.Value()]; + } uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { @@ -8615,7 +8631,7 @@ class BridgedActionsPauseAction : public ClusterCommand { private: uint16_t mActionID; - uint32_t mInvokeID; + chip::Optional mInvokeID; }; /* @@ -8643,7 +8659,9 @@ class BridgedActionsPauseActionWithDuration : public ClusterCommand { params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.actionID = [NSNumber numberWithUnsignedShort:mActionID]; - params.invokeID = [NSNumber numberWithUnsignedInt:mInvokeID]; + if (mInvokeID.HasValue()) { + params.invokeID = [NSNumber numberWithUnsignedInt:mInvokeID.Value()]; + } params.duration = [NSNumber numberWithUnsignedInt:mDuration]; uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; @@ -8666,7 +8684,7 @@ class BridgedActionsPauseActionWithDuration : public ClusterCommand { private: uint16_t mActionID; - uint32_t mInvokeID; + chip::Optional mInvokeID; uint32_t mDuration; }; @@ -8694,7 +8712,9 @@ class BridgedActionsResumeAction : public ClusterCommand { params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.actionID = [NSNumber numberWithUnsignedShort:mActionID]; - params.invokeID = [NSNumber numberWithUnsignedInt:mInvokeID]; + if (mInvokeID.HasValue()) { + params.invokeID = [NSNumber numberWithUnsignedInt:mInvokeID.Value()]; + } uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { @@ -8716,7 +8736,7 @@ class BridgedActionsResumeAction : public ClusterCommand { private: uint16_t mActionID; - uint32_t mInvokeID; + chip::Optional mInvokeID; }; /* @@ -8743,7 +8763,9 @@ class BridgedActionsStartAction : public ClusterCommand { params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.actionID = [NSNumber numberWithUnsignedShort:mActionID]; - params.invokeID = [NSNumber numberWithUnsignedInt:mInvokeID]; + if (mInvokeID.HasValue()) { + params.invokeID = [NSNumber numberWithUnsignedInt:mInvokeID.Value()]; + } uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { @@ -8765,7 +8787,7 @@ class BridgedActionsStartAction : public ClusterCommand { private: uint16_t mActionID; - uint32_t mInvokeID; + chip::Optional mInvokeID; }; /* @@ -8793,7 +8815,9 @@ class BridgedActionsStartActionWithDuration : public ClusterCommand { params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.actionID = [NSNumber numberWithUnsignedShort:mActionID]; - params.invokeID = [NSNumber numberWithUnsignedInt:mInvokeID]; + if (mInvokeID.HasValue()) { + params.invokeID = [NSNumber numberWithUnsignedInt:mInvokeID.Value()]; + } params.duration = [NSNumber numberWithUnsignedInt:mDuration]; uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; @@ -8816,7 +8840,7 @@ class BridgedActionsStartActionWithDuration : public ClusterCommand { private: uint16_t mActionID; - uint32_t mInvokeID; + chip::Optional mInvokeID; uint32_t mDuration; }; @@ -8844,7 +8868,9 @@ class BridgedActionsStopAction : public ClusterCommand { params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.actionID = [NSNumber numberWithUnsignedShort:mActionID]; - params.invokeID = [NSNumber numberWithUnsignedInt:mInvokeID]; + if (mInvokeID.HasValue()) { + params.invokeID = [NSNumber numberWithUnsignedInt:mInvokeID.Value()]; + } uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { @@ -8866,7 +8892,7 @@ class BridgedActionsStopAction : public ClusterCommand { private: uint16_t mActionID; - uint32_t mInvokeID; + chip::Optional mInvokeID; }; /* @@ -17232,7 +17258,11 @@ class ContentLauncherLaunchContent : public ClusterCommand { params.search.parameterList = array_1; } params.autoPlay = [NSNumber numberWithBool:mAutoPlay]; - params.data = [[NSString alloc] initWithBytes:mData.data() length:mData.size() encoding:NSUTF8StringEncoding]; + if (mData.HasValue()) { + params.data = [[NSString alloc] initWithBytes:mData.Value().data() + length:mData.Value().size() + encoding:NSUTF8StringEncoding]; + } uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { @@ -17258,7 +17288,7 @@ class ContentLauncherLaunchContent : public ClusterCommand { chip::app::Clusters::ContentLauncher::Commands::LaunchContent::Type mRequest; TypedComplexArgument mComplex_Search; bool mAutoPlay; - chip::ByteSpan mData; + chip::Optional mData; }; /* @@ -17289,9 +17319,11 @@ class ContentLauncherLaunchURL : public ClusterCommand { params.contentURL = [[NSString alloc] initWithBytes:mContentURL.data() length:mContentURL.size() encoding:NSUTF8StringEncoding]; - params.displayString = [[NSString alloc] initWithBytes:mDisplayString.data() - length:mDisplayString.size() - encoding:NSUTF8StringEncoding]; + if (mDisplayString.HasValue()) { + params.displayString = [[NSString alloc] initWithBytes:mDisplayString.Value().data() + length:mDisplayString.Value().size() + encoding:NSUTF8StringEncoding]; + } if (mRequest.brandingInformation.HasValue()) { params.brandingInformation = [CHIPContentLauncherClusterBrandingInformation new]; params.brandingInformation.providerName = @@ -17489,7 +17521,7 @@ class ContentLauncherLaunchURL : public ClusterCommand { private: chip::ByteSpan mContentURL; - chip::ByteSpan mDisplayString; + chip::Optional mDisplayString; chip::app::Clusters::ContentLauncher::Commands::LaunchURL::Type mRequest; TypedComplexArgument> mComplex_BrandingInformation; @@ -19439,7 +19471,9 @@ class DoorLockLockDoor : public ClusterCommand { __auto_type * params = [[CHIPDoorLockClusterLockDoorParams alloc] init]; params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.pinCode = [[NSData alloc] initWithBytes:mPinCode.data() length:mPinCode.size()]; + if (mPinCode.HasValue()) { + params.pinCode = [[NSData alloc] initWithBytes:mPinCode.Value().data() length:mPinCode.Value().size()]; + } uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { @@ -19460,7 +19494,7 @@ class DoorLockLockDoor : public ClusterCommand { } private: - chip::ByteSpan mPinCode; + chip::Optional mPinCode; }; /* @@ -19791,7 +19825,9 @@ class DoorLockUnlockDoor : public ClusterCommand { __auto_type * params = [[CHIPDoorLockClusterUnlockDoorParams alloc] init]; params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.pinCode = [[NSData alloc] initWithBytes:mPinCode.data() length:mPinCode.size()]; + if (mPinCode.HasValue()) { + params.pinCode = [[NSData alloc] initWithBytes:mPinCode.Value().data() length:mPinCode.Value().size()]; + } uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { @@ -19812,7 +19848,7 @@ class DoorLockUnlockDoor : public ClusterCommand { } private: - chip::ByteSpan mPinCode; + chip::Optional mPinCode; }; /* @@ -19839,7 +19875,9 @@ class DoorLockUnlockWithTimeout : public ClusterCommand { params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.timeout = [NSNumber numberWithUnsignedShort:mTimeout]; - params.pinCode = [[NSData alloc] initWithBytes:mPinCode.data() length:mPinCode.size()]; + if (mPinCode.HasValue()) { + params.pinCode = [[NSData alloc] initWithBytes:mPinCode.Value().data() length:mPinCode.Value().size()]; + } uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { @@ -19861,7 +19899,7 @@ class DoorLockUnlockWithTimeout : public ClusterCommand { private: uint16_t mTimeout; - chip::ByteSpan mPinCode; + chip::Optional mPinCode; }; /* @@ -37726,7 +37764,9 @@ class NetworkCommissioningAddOrUpdateThreadNetwork : public ClusterCommand { params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.operationalDataset = [[NSData alloc] initWithBytes:mOperationalDataset.data() length:mOperationalDataset.size()]; - params.breadcrumb = [NSNumber numberWithUnsignedLongLong:mBreadcrumb]; + if (mBreadcrumb.HasValue()) { + params.breadcrumb = [NSNumber numberWithUnsignedLongLong:mBreadcrumb.Value()]; + } uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { @@ -37751,7 +37791,7 @@ class NetworkCommissioningAddOrUpdateThreadNetwork : public ClusterCommand { private: chip::ByteSpan mOperationalDataset; - uint64_t mBreadcrumb; + chip::Optional mBreadcrumb; }; /* @@ -37782,7 +37822,9 @@ class NetworkCommissioningAddOrUpdateWiFiNetwork : public ClusterCommand { = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.ssid = [[NSData alloc] initWithBytes:mSsid.data() length:mSsid.size()]; params.credentials = [[NSData alloc] initWithBytes:mCredentials.data() length:mCredentials.size()]; - params.breadcrumb = [NSNumber numberWithUnsignedLongLong:mBreadcrumb]; + if (mBreadcrumb.HasValue()) { + params.breadcrumb = [NSNumber numberWithUnsignedLongLong:mBreadcrumb.Value()]; + } uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { @@ -37808,7 +37850,7 @@ class NetworkCommissioningAddOrUpdateWiFiNetwork : public ClusterCommand { private: chip::ByteSpan mSsid; chip::ByteSpan mCredentials; - uint64_t mBreadcrumb; + chip::Optional mBreadcrumb; }; /* @@ -37837,7 +37879,9 @@ class NetworkCommissioningConnectNetwork : public ClusterCommand { params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.networkID = [[NSData alloc] initWithBytes:mNetworkID.data() length:mNetworkID.size()]; - params.breadcrumb = [NSNumber numberWithUnsignedLongLong:mBreadcrumb]; + if (mBreadcrumb.HasValue()) { + params.breadcrumb = [NSNumber numberWithUnsignedLongLong:mBreadcrumb.Value()]; + } uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { @@ -37861,7 +37905,7 @@ class NetworkCommissioningConnectNetwork : public ClusterCommand { private: chip::ByteSpan mNetworkID; - uint64_t mBreadcrumb; + chip::Optional mBreadcrumb; }; /* @@ -37890,7 +37934,9 @@ class NetworkCommissioningRemoveNetwork : public ClusterCommand { params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.networkID = [[NSData alloc] initWithBytes:mNetworkID.data() length:mNetworkID.size()]; - params.breadcrumb = [NSNumber numberWithUnsignedLongLong:mBreadcrumb]; + if (mBreadcrumb.HasValue()) { + params.breadcrumb = [NSNumber numberWithUnsignedLongLong:mBreadcrumb.Value()]; + } uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { @@ -37914,7 +37960,7 @@ class NetworkCommissioningRemoveNetwork : public ClusterCommand { private: chip::ByteSpan mNetworkID; - uint64_t mBreadcrumb; + chip::Optional mBreadcrumb; }; /* @@ -37945,7 +37991,9 @@ class NetworkCommissioningReorderNetwork : public ClusterCommand { = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.networkID = [[NSData alloc] initWithBytes:mNetworkID.data() length:mNetworkID.size()]; params.networkIndex = [NSNumber numberWithUnsignedChar:mNetworkIndex]; - params.breadcrumb = [NSNumber numberWithUnsignedLongLong:mBreadcrumb]; + if (mBreadcrumb.HasValue()) { + params.breadcrumb = [NSNumber numberWithUnsignedLongLong:mBreadcrumb.Value()]; + } uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { @@ -37970,7 +38018,7 @@ class NetworkCommissioningReorderNetwork : public ClusterCommand { private: chip::ByteSpan mNetworkID; uint8_t mNetworkIndex; - uint64_t mBreadcrumb; + chip::Optional mBreadcrumb; }; /* @@ -37998,8 +38046,12 @@ class NetworkCommissioningScanNetworks : public ClusterCommand { __auto_type * params = [[CHIPNetworkCommissioningClusterScanNetworksParams alloc] init]; params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.ssid = [[NSData alloc] initWithBytes:mSsid.data() length:mSsid.size()]; - params.breadcrumb = [NSNumber numberWithUnsignedLongLong:mBreadcrumb]; + if (mSsid.HasValue()) { + params.ssid = [[NSData alloc] initWithBytes:mSsid.Value().data() length:mSsid.Value().size()]; + } + if (mBreadcrumb.HasValue()) { + params.breadcrumb = [NSNumber numberWithUnsignedLongLong:mBreadcrumb.Value()]; + } uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { @@ -38022,8 +38074,8 @@ class NetworkCommissioningScanNetworks : public ClusterCommand { } private: - chip::ByteSpan mSsid; - uint64_t mBreadcrumb; + chip::Optional mSsid; + chip::Optional mBreadcrumb; }; /* @@ -39131,10 +39183,21 @@ class OtaSoftwareUpdateProviderQueryImage : public ClusterCommand { } params.protocolsSupported = array_0; } - params.hardwareVersion = [NSNumber numberWithUnsignedShort:mHardwareVersion]; - params.location = [[NSString alloc] initWithBytes:mLocation.data() length:mLocation.size() encoding:NSUTF8StringEncoding]; - params.requestorCanConsent = [NSNumber numberWithBool:mRequestorCanConsent]; - params.metadataForProvider = [[NSData alloc] initWithBytes:mMetadataForProvider.data() length:mMetadataForProvider.size()]; + if (mHardwareVersion.HasValue()) { + params.hardwareVersion = [NSNumber numberWithUnsignedShort:mHardwareVersion.Value()]; + } + if (mLocation.HasValue()) { + params.location = [[NSString alloc] initWithBytes:mLocation.Value().data() + length:mLocation.Value().size() + encoding:NSUTF8StringEncoding]; + } + if (mRequestorCanConsent.HasValue()) { + params.requestorCanConsent = [NSNumber numberWithBool:mRequestorCanConsent.Value()]; + } + if (mMetadataForProvider.HasValue()) { + params.metadataForProvider = [[NSData alloc] initWithBytes:mMetadataForProvider.Value().data() + length:mMetadataForProvider.Value().size()]; + } uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { @@ -39163,10 +39226,10 @@ class OtaSoftwareUpdateProviderQueryImage : public ClusterCommand { chip::app::Clusters::OtaSoftwareUpdateProvider::Commands::QueryImage::Type mRequest; TypedComplexArgument> mComplex_ProtocolsSupported; - uint16_t mHardwareVersion; - chip::ByteSpan mLocation; - bool mRequestorCanConsent; - chip::ByteSpan mMetadataForProvider; + chip::Optional mHardwareVersion; + chip::Optional mLocation; + chip::Optional mRequestorCanConsent; + chip::Optional mMetadataForProvider; }; /* @@ -39373,7 +39436,10 @@ class OtaSoftwareUpdateRequestorAnnounceOtaProvider : public ClusterCommand { params.providerNodeId = [NSNumber numberWithUnsignedLongLong:mProviderNodeId]; params.vendorId = [NSNumber numberWithUnsignedShort:mVendorId]; params.announcementReason = [NSNumber numberWithUnsignedChar:mAnnouncementReason]; - params.metadataForNode = [[NSData alloc] initWithBytes:mMetadataForNode.data() length:mMetadataForNode.size()]; + if (mMetadataForNode.HasValue()) { + params.metadataForNode = [[NSData alloc] initWithBytes:mMetadataForNode.Value().data() + length:mMetadataForNode.Value().size()]; + } params.endpoint = [NSNumber numberWithUnsignedShort:mEndpoint]; uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; @@ -39398,7 +39464,7 @@ class OtaSoftwareUpdateRequestorAnnounceOtaProvider : public ClusterCommand { chip::NodeId mProviderNodeId; chip::VendorId mVendorId; uint8_t mAnnouncementReason; - chip::ByteSpan mMetadataForNode; + chip::Optional mMetadataForNode; chip::EndpointId mEndpoint; }; @@ -42146,7 +42212,9 @@ class OperationalCredentialsAddNOC : public ClusterCommand { params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.nocValue = [[NSData alloc] initWithBytes:mNOCValue.data() length:mNOCValue.size()]; - params.icacValue = [[NSData alloc] initWithBytes:mICACValue.data() length:mICACValue.size()]; + if (mICACValue.HasValue()) { + params.icacValue = [[NSData alloc] initWithBytes:mICACValue.Value().data() length:mICACValue.Value().size()]; + } params.ipkValue = [[NSData alloc] initWithBytes:mIPKValue.data() length:mIPKValue.size()]; params.caseAdminNode = [NSNumber numberWithUnsignedLongLong:mCaseAdminNode]; params.adminVendorId = [NSNumber numberWithUnsignedShort:mAdminVendorId]; @@ -42173,7 +42241,7 @@ class OperationalCredentialsAddNOC : public ClusterCommand { private: chip::ByteSpan mNOCValue; - chip::ByteSpan mICACValue; + chip::Optional mICACValue; chip::ByteSpan mIPKValue; chip::NodeId mCaseAdminNode; uint16_t mAdminVendorId; @@ -42553,7 +42621,9 @@ class OperationalCredentialsUpdateNOC : public ClusterCommand { params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.nocValue = [[NSData alloc] initWithBytes:mNOCValue.data() length:mNOCValue.size()]; - params.icacValue = [[NSData alloc] initWithBytes:mICACValue.data() length:mICACValue.size()]; + if (mICACValue.HasValue()) { + params.icacValue = [[NSData alloc] initWithBytes:mICACValue.Value().data() length:mICACValue.Value().size()]; + } uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { @@ -42577,7 +42647,7 @@ class OperationalCredentialsUpdateNOC : public ClusterCommand { private: chip::ByteSpan mNOCValue; - chip::ByteSpan mICACValue; + chip::Optional mICACValue; }; /* @@ -50572,7 +50642,11 @@ class TargetNavigatorNavigateTarget : public ClusterCommand { params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.target = [NSNumber numberWithUnsignedChar:mTarget]; - params.data = [[NSString alloc] initWithBytes:mData.data() length:mData.size() encoding:NSUTF8StringEncoding]; + if (mData.HasValue()) { + params.data = [[NSString alloc] initWithBytes:mData.Value().data() + length:mData.Value().size() + encoding:NSUTF8StringEncoding]; + } uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { @@ -50596,7 +50670,7 @@ class TargetNavigatorNavigateTarget : public ClusterCommand { private: uint8_t mTarget; - chip::ByteSpan mData; + chip::Optional mData; }; /* @@ -52408,7 +52482,9 @@ class TestClusterTestNullableOptionalRequest : public ClusterCommand { __auto_type * params = [[CHIPTestClusterClusterTestNullableOptionalRequestParams alloc] init]; params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.arg1 = [NSNumber numberWithUnsignedChar:mArg1]; + if (mArg1.HasValue()) { + params.arg1 = [NSNumber numberWithUnsignedChar:mArg1.Value()]; + } uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { @@ -52432,7 +52508,7 @@ class TestClusterTestNullableOptionalRequest : public ClusterCommand { } private: - uint8_t mArg1; + chip::Optional mArg1; }; /* @@ -52457,7 +52533,9 @@ class TestClusterTestSimpleOptionalArgumentRequest : public ClusterCommand { __auto_type * params = [[CHIPTestClusterClusterTestSimpleOptionalArgumentRequestParams alloc] init]; params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.arg1 = [NSNumber numberWithBool:mArg1]; + if (mArg1.HasValue()) { + params.arg1 = [NSNumber numberWithBool:mArg1.Value()]; + } uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { @@ -52478,7 +52556,7 @@ class TestClusterTestSimpleOptionalArgumentRequest : public ClusterCommand { } private: - bool mArg1; + chip::Optional mArg1; }; /* @@ -73345,7 +73423,9 @@ class WindowCoveringGoToLiftPercentage : public ClusterCommand { params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.liftPercentageValue = [NSNumber numberWithUnsignedChar:mLiftPercentageValue]; - params.liftPercent100thsValue = [NSNumber numberWithUnsignedShort:mLiftPercent100thsValue]; + if (mLiftPercent100thsValue.HasValue()) { + params.liftPercent100thsValue = [NSNumber numberWithUnsignedShort:mLiftPercent100thsValue.Value()]; + } uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { @@ -73367,7 +73447,7 @@ class WindowCoveringGoToLiftPercentage : public ClusterCommand { private: chip::Percent mLiftPercentageValue; - chip::Percent100ths mLiftPercent100thsValue; + chip::Optional mLiftPercent100thsValue; }; /* @@ -73440,7 +73520,9 @@ class WindowCoveringGoToTiltPercentage : public ClusterCommand { params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.tiltPercentageValue = [NSNumber numberWithUnsignedChar:mTiltPercentageValue]; - params.tiltPercent100thsValue = [NSNumber numberWithUnsignedShort:mTiltPercent100thsValue]; + if (mTiltPercent100thsValue.HasValue()) { + params.tiltPercent100thsValue = [NSNumber numberWithUnsignedShort:mTiltPercent100thsValue.Value()]; + } uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { @@ -73462,7 +73544,7 @@ class WindowCoveringGoToTiltPercentage : public ClusterCommand { private: chip::Percent mTiltPercentageValue; - chip::Percent100ths mTiltPercent100thsValue; + chip::Optional mTiltPercent100thsValue; }; /*