@@ -223,29 +223,14 @@ public:
223
223
params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil;
224
224
params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil;
225
225
{{#if_chip_complex}}
226
- {{asObjectiveCType type parent.name}} value;
227
- {{>decodable_value target="value" source="mValue" cluster=parent.name errorCode="return err;" depth=0}}
226
+ {{asObjectiveCType type parent.name}} value;
227
+ {{>decodable_value target="value" source="mValue" cluster=parent.name errorCode="return err;" depth=0}}
228
+ {{else if isNullable}}
229
+ {{asObjectiveCType type parent.name}} value;
230
+ {{>decodable_value target="value" source="mValue" cluster=parent.name isOptional=false isArray=false errorCode="return err;" depth=0}}
228
231
{{else}}
229
- {{#if isNullable}}
230
- {{asObjectiveCType type parent.name}} value = nil;
231
- if (!mValue.IsNull()) {
232
- {{#if (isOctetString type)}}
233
- value = [[NSData alloc] initWithBytes:mValue.Value().data() length:mValue.Value().size()];
234
- {{else if (isString type)}}
235
- value = [[NSString alloc] initWithBytes:mValue.Value().data() length:mValue.Value().size() encoding:NSUTF8StringEncoding];
236
- {{else}}
237
- value = [NSNumber numberWith{{asObjectiveCNumberType "" type false}}:mValue.Value()];
238
- {{/if}}
239
- }
240
- {{else}}
241
- {{#if (isOctetString type)}}
242
- {{asObjectiveCType type parent.name}} value = [[NSData alloc] initWithBytes:mValue.data() length:mValue.size()];
243
- {{else if (isString type)}}
244
- {{asObjectiveCType type parent.name}} value = [[NSString alloc] initWithBytes:mValue.data() length:mValue.size() encoding:NSUTF8StringEncoding];
245
- {{else}}
246
- {{asObjectiveCType type parent.name}} value = [NSNumber numberWith{{asObjectiveCNumberType "" type false}}:mValue{{#if isNullable}}.Value(){{/if}}];
247
- {{/if}}
248
- {{/if}}
232
+ {{asObjectiveCType type parent.name}}
233
+ {{>decodable_value target="value" source="mValue" cluster=parent.name isOptional=false isArray=false errorCode="return err;" depth=0}}
249
234
{{/if_chip_complex}}
250
235
251
236
[cluster write{{>attribute}}WithValue:value params:params completion:^(NSError * _Nullable error) {
0 commit comments