From 61d1605479d63195364fd87281f09a0fc658f0b8 Mon Sep 17 00:00:00 2001 From: marcos <15697303+gmarcosb@users.noreply.github.com> Date: Thu, 17 Oct 2024 10:18:58 -0600 Subject: [PATCH 01/20] Update zapt templates to handle typedef --- .../templates/partials/decodable_value.zapt | 28 +++--- .../data_model_xml/handlers/handlers.py | 26 +++++- .../matter_idl/generators/idl/MatterIdl.jinja | 3 + .../matter_idl/generators/java/__init__.py | 21 +++-- .../matter_idl/generators/kotlin/__init__.py | 4 +- .../matter_idl/generators/type_definitions.py | 47 +++++++++- .../matter_idl/matter_grammar.lark | 5 +- .../matter_idl/matter_idl_parser.py | 28 +++++- .../matter_idl/matter_idl_types.py | 9 ++ .../matter_idl/test_matter_idl_parser.py | 14 +++ .../matter_idl/zapxml/handlers/handlers.py | 41 ++++++++- scripts/tools/zap_regen_all.py | 2 + .../partials/idl/cluster_definition.zapt | 4 + .../partials/idl/global_types.zapt | 6 ++ .../templates/app/cluster-typedefs-check.zapt | 29 ++++++ .../templates/app/cluster-typedefs.zapt | 53 +++++++++++ .../zcl/zcl-with-test-extensions.json | 2 +- src/app/zap-templates/zcl/zcl.json | 2 +- .../java/templates/partials/decode_value.zapt | 91 ++++++++++--------- src/controller/java/templates/templates.json | 4 - .../templates/partials/typedef_def.zapt | 1 + .../templates/python-CHIPClusters-py.zapt | 6 +- .../templates/python-cluster-Objects-py.zapt | 16 +++- .../python/templates/templates.json | 4 + .../CHIP/templates/partials/decode_value.zapt | 54 ++++++----- .../CHIP/templates/partials/encode_value.zapt | 32 ++++--- .../CHIP/templates/partials/typedef_decl.zapt | 2 + .../Framework/CHIP/templates/templates.json | 4 + 28 files changed, 419 insertions(+), 119 deletions(-) create mode 100644 src/app/zap-templates/templates/app/cluster-typedefs-check.zapt create mode 100644 src/app/zap-templates/templates/app/cluster-typedefs.zapt create mode 100644 src/controller/python/templates/partials/typedef_def.zapt create mode 100644 src/darwin/Framework/CHIP/templates/partials/typedef_decl.zapt diff --git a/examples/darwin-framework-tool/templates/partials/decodable_value.zapt b/examples/darwin-framework-tool/templates/partials/decodable_value.zapt index 8d0442000a070c..07e791dcafa2a1 100644 --- a/examples/darwin-framework-tool/templates/partials/decodable_value.zapt +++ b/examples/darwin-framework-tool/templates/partials/decodable_value.zapt @@ -27,18 +27,24 @@ {{>decodable_value target=(concat ../target "." (asStructPropertyName label)) source=(concat ../source "." (asLowerCamelCase label)) cluster=../cluster depth=(incrementDepth ../depth) }} {{/zcl_struct_items_by_struct_and_cluster_name}} {{else}} - {{#if_is_strongly_typed_chip_enum type}} - {{target}} = [NSNumber numberWith{{asObjectiveCNumberType "" type false}}:chip::to_underlying({{source}})]; + {{#if_is_typedef type}} + {{#zcl_typedef_by_typedef_and_cluster_name type cluster}} + {{>decodable_value type=typeId target=target source=source errorCode=errorCode depth=(incrementDepth ../depth) }} + {{/zcl_typedef_by_typedef_and_cluster_name}} {{else}} - {{#if_is_strongly_typed_bitmap type}} - {{target}} = [NSNumber numberWith{{asObjectiveCNumberType "" type false}}:{{source}}.Raw()]; - {{else if (isOctetString type)}} - {{target}} = [NSData dataWithBytes:{{source}}.data() length:{{source}}.size()]; - {{else if (isCharString type)}} - {{target}} = [[NSString alloc] initWithBytes:{{source}}.data() length:{{source}}.size() encoding:NSUTF8StringEncoding]; + {{#if_is_strongly_typed_chip_enum type}} + {{target}} = [NSNumber numberWith{{asObjectiveCNumberType "" type false}}:chip::to_underlying({{source}})]; {{else}} - {{target}} = [NSNumber numberWith{{asObjectiveCNumberType "" type false}}:{{source}}]; - {{/if_is_strongly_typed_bitmap}} - {{/if_is_strongly_typed_chip_enum}} + {{#if_is_strongly_typed_bitmap type}} + {{target}} = [NSNumber numberWith{{asObjectiveCNumberType "" type false}}:{{source}}.Raw()]; + {{else if (isOctetString type)}} + {{target}} = [NSData dataWithBytes:{{source}}.data() length:{{source}}.size()]; + {{else if (isCharString type)}} + {{target}} = [[NSString alloc] initWithBytes:{{source}}.data() length:{{source}}.size() encoding:NSUTF8StringEncoding]; + {{else}} + {{target}} = [NSNumber numberWith{{asObjectiveCNumberType "" type false}}:{{source}}]; + {{/if_is_strongly_typed_bitmap}} + {{/if_is_strongly_typed_chip_enum}} + {{/if_is_typedef}} {{/if_is_struct}} {{/if}} diff --git a/scripts/py_matter_idl/matter_idl/data_model_xml/handlers/handlers.py b/scripts/py_matter_idl/matter_idl/data_model_xml/handlers/handlers.py index 2a909bbbfb4d23..00f667852da5cf 100644 --- a/scripts/py_matter_idl/matter_idl/data_model_xml/handlers/handlers.py +++ b/scripts/py_matter_idl/matter_idl/data_model_xml/handlers/handlers.py @@ -18,7 +18,7 @@ from xml.sax.xmlreader import AttributesImpl from matter_idl.matter_idl_types import (ApiMaturity, Attribute, AttributeQuality, Bitmap, Cluster, Command, CommandQuality, - ConstantEntry, DataType, Enum, Field, FieldQuality, Idl, Struct, StructTag) + ConstantEntry, DataType, Enum, Field, FieldQuality, Idl, Struct, StructTag, Typedef) from .base import BaseHandler, HandledDepth from .context import Context @@ -178,6 +178,10 @@ def GetNextProcessor(self, name: str, attrs: AttributesImpl): self._field.data_type.name = NormalizeDataType(attrs["type"]) return BaseHandler(self.context, handled=HandledDepth.SINGLE_TAG) + elif name == "typedef": + LOGGER.warning( + f"Anonymous typedef not supported when handling field {self._field.name}") + return BaseHandler(self.context, handled=HandledDepth.ENTIRE_TREE) else: return BaseHandler(self.context) @@ -281,6 +285,24 @@ def GetNextProcessor(self, name: str, attrs: AttributesImpl): else: return BaseHandler(self.context) +class TypedefHandler(BaseHandler): + def __init__(self, context: Context, cluster: Cluster, attrs: AttributesImpl): + super().__init__(context, handled=HandledDepth.SINGLE_TAG) + self._cluster = cluster + + # TODO: base type is GUESSED here because xml does not contain it + self._typedef = Typedef(name=NormalizeName( + attrs["name"]), base_type="UNKNOWN") + + def EndProcessing(self): + self._cluster.typedefs.append(self._typedef) + + def GetNextProcessor(self, name: str, attrs: AttributesImpl): + if name == "section": + # Documentation data, skipped + return BaseHandler(self.context, handled=HandledDepth.ENTIRE_TREE) + else: + return BaseHandler(self.context) class EventsHandler(BaseHandler): def __init__(self, context: Context, cluster: Cluster): @@ -551,6 +573,8 @@ def GetNextProcessor(self, name: str, attrs: AttributesImpl): return BitmapHandler(self.context, self._cluster, attrs) elif name == "struct": return StructHandler(self.context, self._cluster, attrs) + elif name == "typedef": + return TypedefHandler(self.context, self._cluster, attrs) else: return BaseHandler(self.context) diff --git a/scripts/py_matter_idl/matter_idl/generators/idl/MatterIdl.jinja b/scripts/py_matter_idl/matter_idl/generators/idl/MatterIdl.jinja index 0e132e581b7712..a7a83745693229 100644 --- a/scripts/py_matter_idl/matter_idl/generators/idl/MatterIdl.jinja +++ b/scripts/py_matter_idl/matter_idl/generators/idl/MatterIdl.jinja @@ -55,6 +55,9 @@ bitmap {{bitmap.name}} : {{ bitmap.base_type}} { {% endfor %} +{% for typedef in idl.global_typedefs %} +typedef {{typedef.name}} : {{ typedef.base_type}}; + {%- for cluster in idl.clusters %} {% if cluster.description %}/** {{cluster.description}} */ {% endif %} diff --git a/scripts/py_matter_idl/matter_idl/generators/java/__init__.py b/scripts/py_matter_idl/matter_idl/generators/java/__init__.py index d21107653dfb46..fd61e38bde2905 100644 --- a/scripts/py_matter_idl/matter_idl/generators/java/__init__.py +++ b/scripts/py_matter_idl/matter_idl/generators/java/__init__.py @@ -59,7 +59,7 @@ class GlobalType: def _UnderlyingType(field: Field, context: TypeLookupContext) -> Optional[str]: - actual = ParseDataType(field.data_type, context) + actual = ParseDataType(field.data_type, context, desugar_typedef = True) if isinstance(actual, (IdlEnumType, IdlBitmapType)): actual = actual.base_type @@ -132,7 +132,7 @@ def _CppType(field: Field, context: TypeLookupContext) -> str: if field.data_type.name.lower() in _KNOWN_DECODABLE_TYPES: return _KNOWN_DECODABLE_TYPES[field.data_type.name.lower()] - actual = ParseDataType(field.data_type, context) + actual = ParseDataType(field.data_type, context, desugar_typedef = True) if isinstance(actual, BasicString): if actual.is_binary: return 'chip::ByteSpan' @@ -278,7 +278,7 @@ def attributesWithSupportedCallback(attrs, context: TypeLookupContext): # Attributes will be generated for all types # except non-list structures if not attr.definition.is_list: - underlying = ParseDataType(attr.definition.data_type, context) + underlying = ParseDataType(attr.definition.data_type, context, desugar_typedef = True) if isinstance(underlying, IdlType): continue @@ -420,6 +420,10 @@ def is_bitmap(self): def is_untyped_bitmap(self): return self.context.is_untyped_bitmap_type(self.data_type.name) + @property + def is_typedef(self): + return self.context.is_typedef_type(self.data_type.name) + def clone(self): return EncodableValue(self.context, self.data_type, self.attrs) @@ -469,7 +473,7 @@ def jni_fundamental_type(self): @property def boxed_java_type(self): - t = ParseDataType(self.data_type, self.context) + t = ParseDataType(self.data_type, self.context, desugar_typedef = True) if isinstance(t, FundamentalType): if t == FundamentalType.BOOL: @@ -506,7 +510,7 @@ def boxed_java_type(self): @property def java_tlv_type(self): - t = ParseDataType(self.data_type, self.context) + t = ParseDataType(self.data_type, self.context, desugar_typedef = True) if isinstance(t, FundamentalType): if t == FundamentalType.BOOL: @@ -537,7 +541,8 @@ def java_tlv_type(self): @property def kotlin_type(self): - t = ParseDataType(self.data_type, self.context) + # TODO: Use inline value class where possible (types not defined in java) + t = ParseDataType(self.data_type, self.context, desugar_typedef = True) if isinstance(t, FundamentalType): if t == FundamentalType.BOOL: @@ -583,7 +588,7 @@ def unboxed_java_signature(self): if self.is_optional or self.is_list: raise Exception("Not a basic type: %r" % self) - t = ParseDataType(self.data_type, self.context) + t = ParseDataType(self.data_type, self.context, desugar_typedef = True) if isinstance(t, FundamentalType): if t == FundamentalType.BOOL: @@ -611,7 +616,7 @@ def boxed_java_signature(self): if self.is_list: return "Ljava/util/ArrayList;" - t = ParseDataType(self.data_type, self.context) + t = ParseDataType(self.data_type, self.context, desugar_typedef = True) if isinstance(t, FundamentalType): if t == FundamentalType.BOOL: diff --git a/scripts/py_matter_idl/matter_idl/generators/kotlin/__init__.py b/scripts/py_matter_idl/matter_idl/generators/kotlin/__init__.py index 405f505a0980d3..b7349f89100a19 100644 --- a/scripts/py_matter_idl/matter_idl/generators/kotlin/__init__.py +++ b/scripts/py_matter_idl/matter_idl/generators/kotlin/__init__.py @@ -471,6 +471,8 @@ def kotlin_type(self): return "UInt" else: return "ULong" + elif isinstance(t, IdlTypedefType): + return self.data_type.name else: return "Any" @@ -507,7 +509,7 @@ def boxed_java_signature(self): if self.is_list: return "Ljava/util/ArrayList;" - t = ParseDataType(self.data_type, self.context) + t = ParseDataType(self.data_type, self.context, desugar_typedef = True) if isinstance(t, FundamentalType): if t == FundamentalType.BOOL: diff --git a/scripts/py_matter_idl/matter_idl/generators/type_definitions.py b/scripts/py_matter_idl/matter_idl/generators/type_definitions.py index 4f9fa56779042b..44435eb4600391 100644 --- a/scripts/py_matter_idl/matter_idl/generators/type_definitions.py +++ b/scripts/py_matter_idl/matter_idl/generators/type_definitions.py @@ -161,6 +161,15 @@ def is_struct(self) -> bool: return self.item_type == IdlItemType.STRUCT +@dataclass +class IdlTypedefType: + """ + A typedef (concrete type that aliases another type) + """ + idl_name: str + base_type: Union[BasicInteger, BasicString, FundamentalType, IdlType, IdlEnumType, IdlBitmapType] + + # Data types, held by ZAP in chip-types.xml and generally by the spec. __CHIP_SIZED_TYPES__ = { "bitmap16": BasicInteger(idl_name="bitmap16", byte_count=2, is_signed=False), @@ -295,6 +304,13 @@ def find_bitmap(self, name) -> Optional[matter_idl_types.Bitmap]: return None + def find_typedef(self, name) -> Optional[matter_idl_types.Typedef]: + for s in self.all_typedefs: + if s.name == name: + return s + + return None + @property def all_enums(self): """ @@ -330,6 +346,18 @@ def all_structs(self): for e in self.cluster.structs: yield e + @property + def all_typedefs(self): + """ + All typedefs defined within this lookup context. + + typedefs are only defined at cluster level. If lookup context does not + include a typedef, the typedef list will be empty. + """ + if self.cluster: + for t in self.cluster.typedefs: + yield t + def is_enum_type(self, name: str): """ Determine if the given type name is an enumeration. @@ -347,6 +375,12 @@ def is_struct_type(self, name: str): """ return any(map(lambda s: s.name == name, self.all_structs)) + def is_typedef_type(self, name: str): + """ + Determine if the given type name is type that is known to be a typedef + """ + return any(map(lambda s: s.name == name, self.all_typedefs)) + def is_untyped_bitmap_type(self, name: str): """Determine if the given type is a untyped bitmap (just an interger size).""" return name.lower() in {"bitmap8", "bitmap16", "bitmap32", "bitmap64"} @@ -364,7 +398,7 @@ def is_bitmap_type(self, name: str): return any(map(lambda s: s.name == name, self.all_bitmaps)) -def ParseDataType(data_type: DataType, lookup: TypeLookupContext) -> Union[BasicInteger, BasicString, FundamentalType, IdlType, IdlEnumType, IdlBitmapType]: +def ParseDataType(data_type: DataType, lookup: TypeLookupContext, desugar_typedef: bool = False) -> Union[BasicInteger, BasicString, FundamentalType, IdlType, IdlEnumType, IdlBitmapType, IdlTypedefType]: """ Given a AST data type and a lookup context, match it to a type that can be later be used for generation. @@ -404,9 +438,18 @@ def ParseDataType(data_type: DataType, lookup: TypeLookupContext) -> Union[Basic b = lookup.find_bitmap(data_type.name) if b: - # Valid enum found. it MUST be based on a valid data type + # Valid bitmap found. it MUST be based on a valid data type return IdlBitmapType(idl_name=data_type.name, base_type=__CHIP_SIZED_TYPES__[b.base_type.lower()]) + t = lookup.find_typedef(data_type.name) + if t: + # Valid typedef found. it MUST be based on a valid data type + typedef_base_type = ParseDataType(DataType(name=t.base_type), lookup) + if desugar_typedef: + return typedef_base_type + else: + return IdlTypedefType(idl_name=data_type.name, base_type=typedef_base_type) + result = IdlType(idl_name=data_type.name, item_type=IdlItemType.UNKNOWN) if lookup.find_struct(data_type.name): result.item_type = IdlItemType.STRUCT diff --git a/scripts/py_matter_idl/matter_idl/matter_grammar.lark b/scripts/py_matter_idl/matter_idl/matter_grammar.lark index 4013c51bb52a59..befad5f8e97bdd 100644 --- a/scripts/py_matter_idl/matter_idl/matter_grammar.lark +++ b/scripts/py_matter_idl/matter_idl/matter_grammar.lark @@ -12,6 +12,7 @@ struct_qualities: struct_quality* enum: "enum"i id ":" type "{" constant_entry* "}" bitmap: "bitmap"i id ":" type "{" constant_entry* "}" +typedef: "typedef"i id ":" type ";" ?access_privilege: "view"i -> view_privilege | "operate"i -> operate_privilege @@ -68,7 +69,7 @@ cluster_revision: "revision"i positive_integer ";" // no direct meaning currently cluster: [maturity] ( "client" | "server" )? "cluster"i id "=" positive_integer "{" [cluster_revision] cluster_content* "}" -?cluster_content: [maturity] (enum|bitmap|event|attribute|struct|request_struct|response_struct|command) +?cluster_content: [maturity] (enum|bitmap|event|attribute|struct|request_struct|response_struct|command|typedef) endpoint: "endpoint"i positive_integer "{" endpoint_content* "}" ?endpoint_content: endpoint_cluster_binding | endpoint_server_cluster | endpoint_device_type @@ -116,7 +117,7 @@ POSITIVE_INTEGER: /\d+/ HEX_INTEGER: /0x[A-Fa-f0-9]+/ ID: /[a-zA-Z_][a-zA-Z0-9_]*/ -idl: (struct|enum|bitmap|cluster|endpoint)* +idl: (struct|enum|bitmap|cluster|endpoint|typedef)* %import common.ESCAPED_STRING %import common.WS diff --git a/scripts/py_matter_idl/matter_idl/matter_idl_parser.py b/scripts/py_matter_idl/matter_idl/matter_idl_parser.py index e071d008d1d726..20add72cf0bccd 100755 --- a/scripts/py_matter_idl/matter_idl/matter_idl_parser.py +++ b/scripts/py_matter_idl/matter_idl/matter_idl_parser.py @@ -23,7 +23,7 @@ AttributeStorage, Bitmap, Cluster, Command, CommandInstantiation, CommandQuality, ConstantEntry, DataType, DeviceType, Endpoint, Enum, Event, EventPriority, EventQuality, Field, FieldQuality, Idl, ParseMetaData, ServerClusterInstantiation, Struct, StructQuality, - StructTag) + StructTag, Typedef) def UnionOfAllFlags(flags_list): @@ -207,6 +207,10 @@ def enum(self, id, type, *entries): def bitmap(self, id, type, *entries): return Bitmap(name=id, base_type=type, entries=list(entries)) + @v_args(inline=True) + def typedef(self, id, type): + return Typedef(name=id, base_type=type) + def field(self, args): data_type, name = args[0], args[1] is_list = (len(args) == 4) @@ -496,6 +500,8 @@ def cluster(self, meta, api_maturity, name, code, revision, *content): result.structs.append(item) elif isinstance(item, Command): result.commands.append(item) + elif isinstance(item, Typedef): + result.typedefs.append(item) else: raise Exception("UNKNOWN cluster content item: %r" % item) @@ -508,6 +514,7 @@ def idl(self, items): global_bitmaps = [] global_enums = [] global_structs = [] + global_typedefs =[] for item in items: if isinstance(item, Cluster): @@ -520,10 +527,12 @@ def idl(self, items): global_bitmaps.append(dataclasses.replace(item, is_global=True)) elif isinstance(item, Struct): global_structs.append(dataclasses.replace(item, is_global=True)) + elif isinstance(item, Typedef): + global_typedefs.append(dataclasses.replace(item, is_global=True)) else: raise Exception("UNKNOWN idl content item: %r" % item) - return Idl(clusters=clusters, endpoints=endpoints, global_bitmaps=global_bitmaps, global_enums=global_enums, global_structs=global_structs) + return Idl(clusters=clusters, endpoints=endpoints, global_bitmaps=global_bitmaps, global_enums=global_enums, global_structs=global_structs, global_typedefs=global_typedefs) def prefix_doc_comment(self): print("TODO: prefix") @@ -563,15 +572,16 @@ def __init__(self, idl: Idl): self.bitmap_map = {b.name: b for b in idl.global_bitmaps} self.enum_map = {e.name: e for e in idl.global_enums} self.struct_map = {s.name: s for s in idl.global_structs} + self.typedef_map = {t.name: t for t in idl.global_typedefs} - self.global_types = set(self.bitmap_map.keys()).union(set(self.enum_map.keys())).union(set(self.struct_map.keys())) + self.global_types = set(self.bitmap_map.keys()).union(set(self.enum_map.keys())).union(set(self.struct_map.keys())).union(set(self.typedef_map.keys())) # Spec does not enforce unique naming in bitmap/enum/struct, however in practice # if we have both enum Foo and bitmap Foo for example, it would be impossible # to disambiguate `attribute Foo foo = 1` for the actual type we want. # # As a result, we do not try to namespace this and just error out - if len(self.global_types) != len(self.bitmap_map) + len(self.enum_map) + len(self.struct_map): + if len(self.global_types) != len(self.bitmap_map) + len(self.enum_map) + len(self.struct_map) + len(self.typedef_map): raise ValueError("Global type names are not unique.") def merge_global_types_into_cluster(self, cluster: Cluster) -> Cluster: @@ -604,6 +614,10 @@ def merge_global_types_into_cluster(self, cluster: Cluster) -> Cluster: global_types_added.add(type_name) changed = True cluster.structs.append(self.struct_map[type_name]) + elif type_name in self.typedef_map: + global_types_added.add(type_name) + changed = True + cluster.typedefs.append(self.typedef_map[type_name]) return cluster @@ -638,7 +652,11 @@ def __init__(self, skip_meta: bool, merge_globals: bool): ) def parse(self, file: str, file_name: Optional[str] = None): - idl = self.transformer.transform(self.parser.parse(file)) + idl = None + try: + idl = self.transformer.transform(self.parser.parse(file)) + except Exception as e: + raise Exception(f"Failed to parse: {file_name}") from e idl.parse_file_name = file_name # ZAP may generate the same definition of clusters several times. diff --git a/scripts/py_matter_idl/matter_idl/matter_idl_types.py b/scripts/py_matter_idl/matter_idl/matter_idl_types.py index d4a2195457ed60..4aee2ef3678441 100644 --- a/scripts/py_matter_idl/matter_idl/matter_idl_types.py +++ b/scripts/py_matter_idl/matter_idl/matter_idl_types.py @@ -206,6 +206,13 @@ class Bitmap: is_global: bool = False +@dataclass +class Typedef: + name: str + base_type: str + api_maturity: ApiMaturity = ApiMaturity.STABLE + is_global: bool = False + @dataclass class Command: name: str @@ -235,6 +242,7 @@ class Cluster: events: List[Event] = field(default_factory=list) attributes: List[Attribute] = field(default_factory=list) structs: List[Struct] = field(default_factory=list) + typedefs: List[Typedef] = field(default_factory=list) commands: List[Command] = field(default_factory=list) description: Optional[str] = None api_maturity: ApiMaturity = ApiMaturity.STABLE @@ -297,6 +305,7 @@ class Idl: global_bitmaps: List[Bitmap] = field(default_factory=list) global_enums: List[Enum] = field(default_factory=list) global_structs: List[Struct] = field(default_factory=list) + global_typedefs: List[Typedef] = field(default_factory=list) # IDL file name is available only if parsing provides a file name parse_file_name: Optional[str] = field(default=None) diff --git a/scripts/py_matter_idl/matter_idl/test_matter_idl_parser.py b/scripts/py_matter_idl/matter_idl/test_matter_idl_parser.py index ab79c279b0697f..319567d7ff6ee8 100755 --- a/scripts/py_matter_idl/matter_idl/test_matter_idl_parser.py +++ b/scripts/py_matter_idl/matter_idl/test_matter_idl_parser.py @@ -336,6 +336,20 @@ def test_cluster_enum(self): )]) self.assertIdlEqual(actual, expected) + def test_cluster_typedef(self): + actual = parseText(""" + client cluster WithTypedefs = 0xab { + typedef TestTypedef : int16u + } + """) + expected = Idl(clusters=[ + Cluster(name="WithTypedefs", + code=0xab, + typedefs=[ + Typedef(name="TestTypedef", base_type="int16u")], + )]) + self.assertIdlEqual(actual, expected) + def test_event_field_api_maturity(self): actual = parseText(""" server cluster MaturityTest = 1 { diff --git a/scripts/py_matter_idl/matter_idl/zapxml/handlers/handlers.py b/scripts/py_matter_idl/matter_idl/zapxml/handlers/handlers.py index cc5ccd9483091d..98c83b80cae71f 100644 --- a/scripts/py_matter_idl/matter_idl/zapxml/handlers/handlers.py +++ b/scripts/py_matter_idl/matter_idl/zapxml/handlers/handlers.py @@ -16,7 +16,7 @@ from typing import Any, Optional from matter_idl.matter_idl_types import (Attribute, Bitmap, Cluster, Command, CommandQuality, ConstantEntry, DataType, Enum, Event, - EventPriority, EventQuality, Field, FieldQuality, Idl, Struct, StructQuality, StructTag) + EventPriority, EventQuality, Field, FieldQuality, Idl, Struct, StructQuality, StructTag, Typedef) from .base import BaseHandler, HandledDepth from .context import Context, IdlPostProcessor @@ -333,6 +333,43 @@ def FinalizeProcessing(self, idl: Idl): def EndProcessing(self): self.context.AddIdlPostProcessor(self) +class TypedefHandler(BaseHandler, IdlPostProcessor): + """ Handling /configurator/typedef elements.""" + + def __init__(self, context: Context, attrs): + super().__init__(context) + + # no cluster codes means global. Note that at the time + # of writing this, no global typedefs were defined in XMLs + self._cluster_codes = set() + self.typedef = Typedef(name=attrs['name'], + base_type=attrs['type']) + + def GetNextProcessor(self, name, attrs): + if name.lower() == 'cluster': + self._cluster_codes.add(ParseInt(attrs['code'])) + return BaseHandler(self.context, handled=HandledDepth.SINGLE_TAG) + else: + return BaseHandler(self.context) + + def FinalizeProcessing(self, idl: Idl): + if not self._cluster_codes: + idl.global_typedefs.append(self._typedef) + return + + found = set() + for c in idl.clusters: + if c.code in self._cluster_codes: + c.typedefs.append(self._typedef) + found.add(c.code) + + if found != self._cluster_codes: + LOGGER.error('Typedef %s could not find its clusters (codes: %r)' % + (self._typedef.name, self._cluster_codes - found)) + + def EndProcessing(self): + self.context.AddIdlPostProcessor(self) + class FeaturesHandler(BaseHandler): """Handles .../features @@ -679,5 +716,7 @@ def GetNextProcessor(self, name: str, attrs): return BaseHandler(self.context, handled=HandledDepth.ENTIRE_TREE) elif name.lower() == 'global': return GlobalHandler(self.context) + elif name.lower() == 'typedef': + return TypedefHandler(self.context, attrs) else: return BaseHandler(self.context) diff --git a/scripts/tools/zap_regen_all.py b/scripts/tools/zap_regen_all.py index afe931fd8609a6..745792e4377ae7 100755 --- a/scripts/tools/zap_regen_all.py +++ b/scripts/tools/zap_regen_all.py @@ -311,6 +311,8 @@ def codeFormat(self): def generate(self) -> TargetRunStats: generate_start = time.time() + logging.info("Executing: %s" % self.command) + subprocess.check_call(self.command) self.codeFormat() diff --git a/src/app/zap-templates/partials/idl/cluster_definition.zapt b/src/app/zap-templates/partials/idl/cluster_definition.zapt index be431ae7d7cc2c..ba78e828d27fdb 100644 --- a/src/app/zap-templates/partials/idl/cluster_definition.zapt +++ b/src/app/zap-templates/partials/idl/cluster_definition.zapt @@ -22,6 +22,10 @@ cluster {{asUpperCamelCase name}} = {{!}} } {{/zcl_enums}} + {{#zcl_typedefs}} + typedef {{asUpperCamelCase name preserveAcronyms=true}} : {{type}}; + + {{/zcl_typedefs}} {{#zcl_bitmaps}} bitmap {{asUpperCamelCase name preserveAcronyms=true}} : bitmap{{multiply size 8}} { {{#zcl_bitmap_items}} diff --git a/src/app/zap-templates/partials/idl/global_types.zapt b/src/app/zap-templates/partials/idl/global_types.zapt index bd72b43b2b36b5..f793ea9cede903 100644 --- a/src/app/zap-templates/partials/idl/global_types.zapt +++ b/src/app/zap-templates/partials/idl/global_types.zapt @@ -8,6 +8,12 @@ enum {{asUpperCamelCase name preserveAcronyms=true}} : enum{{multiply size 8}} { {{/if}} {{/zcl_enums}} +{{#zcl_typedefs}} +{{#if has_no_clusters}} +typedef {{asUpperCamelCase name preserveAcronyms=true}} : {{type}}; + +{{/if}} +{{/zcl_typedefs}} {{#zcl_bitmaps}} {{#if has_no_clusters}} {{#if_is_atomic name}} diff --git a/src/app/zap-templates/templates/app/cluster-typedefs-check.zapt b/src/app/zap-templates/templates/app/cluster-typedefs-check.zapt new file mode 100644 index 00000000000000..a2a3d4ac1e4f4e --- /dev/null +++ b/src/app/zap-templates/templates/app/cluster-typedefs-check.zapt @@ -0,0 +1,29 @@ +{{> header}} + +#pragma once + +#include + +namespace chip { +namespace app { +namespace Clusters { +{{#zcl_typedefs}} +{{#if has_more_than_one_cluster}} +{{> cluster_typedefs_ensure_known_value ns="detail"}} +{{else if has_no_clusters}} +{{> cluster_typedefs_ensure_known_value ns="Globals"}} + +{{/if}} +{{/zcl_typedefs}} + +{{#zcl_clusters}} +{{#zcl_typedefs}} +{{#unless has_more_than_one_cluster}} +{{> cluster_typedefs_ensure_known_value ns=(asUpperCamelCase ../name)}} +{{/unless}} +{{/zcl_typedefs}} + +{{/zcl_clusters}} +} // namespace Clusters +} // namespace app +} // namespace chip diff --git a/src/app/zap-templates/templates/app/cluster-typedefs.zapt b/src/app/zap-templates/templates/app/cluster-typedefs.zapt new file mode 100644 index 00000000000000..18382e0188fdb6 --- /dev/null +++ b/src/app/zap-templates/templates/app/cluster-typedefs.zapt @@ -0,0 +1,53 @@ +{{> header}} + +#pragma once + +#include + + +namespace chip { +namespace app { +namespace Clusters { + +namespace detail { +// typedefs shared across multiple clusters. +{{#zcl_typedefs}} + +{{#if has_more_than_one_cluster}} + +{{> cluster_typedefs_enum ns=""}} + +{{/if}} +{{/zcl_typedefs}} + +} // namespace detail + +namespace Globals { +// Global typedefs. +{{#zcl_typedefs}} + +{{#if has_no_clusters}} + +{{> cluster_typedefs_enum ns=""}} + +{{/if}} +{{/zcl_typedefs}} +} // namespace Globals + +{{#zcl_clusters}} +namespace {{asUpperCamelCase name}} { +{{#zcl_typedefs}} + +{{#if has_more_than_one_cluster}} +using {{asUpperCamelCase name}} = Clusters::detail::{{asUpperCamelCase name}}; +{{else}} +{{> cluster_typedefs_enum ns=(asUpperCamelCase ../name)}} + +{{/if}} +{{/zcl_typedefs}} +} // namespace {{asUpperCamelCase name}} + +{{/zcl_clusters}} +} // namespace Clusters +} // namespace app +} // namespace chip diff --git a/src/app/zap-templates/zcl/zcl-with-test-extensions.json b/src/app/zap-templates/zcl/zcl-with-test-extensions.json index 3ad401afb3e47a..81ec0d01a97cca 100644 --- a/src/app/zap-templates/zcl/zcl-with-test-extensions.json +++ b/src/app/zap-templates/zcl/zcl-with-test-extensions.json @@ -681,7 +681,7 @@ }, "mandatoryDeviceTypes": "0x0016", "defaultReportingPolicy": "mandatory", - "ZCLDataTypes": ["ARRAY", "BITMAP", "ENUM", "NUMBER", "STRING", "STRUCT"], + "ZCLDataTypes": ["ARRAY", "BITMAP", "ENUM", "NUMBER", "STRING", "STRUCT", "TYPEDEF"], "fabricHandling": { "automaticallyCreateFields": true, "indexFieldId": 254, diff --git a/src/app/zap-templates/zcl/zcl.json b/src/app/zap-templates/zcl/zcl.json index c291fc651f6aa0..0f304a61efd70e 100644 --- a/src/app/zap-templates/zcl/zcl.json +++ b/src/app/zap-templates/zcl/zcl.json @@ -675,7 +675,7 @@ }, "mandatoryDeviceTypes": "0x0016", "defaultReportingPolicy": "mandatory", - "ZCLDataTypes": ["ARRAY", "BITMAP", "ENUM", "NUMBER", "STRING", "STRUCT"], + "ZCLDataTypes": ["ARRAY", "BITMAP", "ENUM", "NUMBER", "STRING", "STRUCT", "TYPEDEF"], "fabricHandling": { "automaticallyCreateFields": true, "indexFieldId": 254, diff --git a/src/controller/java/templates/partials/decode_value.zapt b/src/controller/java/templates/partials/decode_value.zapt index 6401ef1c8b7f12..726ab0df3f9a6b 100644 --- a/src/controller/java/templates/partials/decode_value.zapt +++ b/src/controller/java/templates/partials/decode_value.zapt @@ -26,59 +26,64 @@ if ({{source}}.IsNull()) { chip::JniReferences::GetInstance().AddToList({{target}}, newElement_{{depth}}); } {{else}} - {{#if_is_struct type}} - {{#zcl_struct_items_by_struct_and_cluster_name type cluster}} - {{>decode_value target=(concat ../target "_" (asLowerCamelCase label)) source=(concat ../source "." (asLowerCamelCase label)) cluster=../cluster depth=(incrementDepth ../depth) omitDeclaration=false earlyReturn=../earlyReturn}} - {{/zcl_struct_items_by_struct_and_cluster_name}} + {{#if_is_typedef type}} + {{#zcl_typedef_by_typedef_and_cluster_name type cluster}} + {{>decode_value type=typeId target=target source=source errorCode=errorCode depth=(incrementDepth ../depth) isNullable=isNullable omitDeclaration=omitDeclaration earlyReturn=earlyReturn }} + {{/zcl_typedef_by_typedef_and_cluster_name}} + {{else}} + {{#if_is_struct type}} + {{#zcl_struct_items_by_struct_and_cluster_name type cluster}} + {{>decode_value target=(concat ../target "_" (asLowerCamelCase label)) source=(concat ../source "." (asLowerCamelCase label)) cluster=../cluster depth=(incrementDepth ../depth) omitDeclaration=false earlyReturn=../earlyReturn}} + {{/zcl_struct_items_by_struct_and_cluster_name}} - { - jclass {{asLowerCamelCase type}}StructClass_{{depth}}; - err = chip::JniReferences::GetInstance().GetLocalClassRef(env, "chip/devicecontroller/ChipStructs${{asUpperCamelCase cluster}}Cluster{{asUpperCamelCase type}}", {{asLowerCamelCase type}}StructClass_{{depth}}); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs${{asUpperCamelCase cluster}}Cluster{{asUpperCamelCase type}}"); - return {{earlyReturn}}; - } + { + jclass {{asLowerCamelCase type}}StructClass_{{depth}}; + err = chip::JniReferences::GetInstance().GetLocalClassRef(env, "chip/devicecontroller/ChipStructs${{asUpperCamelCase cluster}}Cluster{{asUpperCamelCase type}}", {{asLowerCamelCase type}}StructClass_{{depth}}); + if (err != CHIP_NO_ERROR) { + ChipLogError(Zcl, "Could not find class ChipStructs${{asUpperCamelCase cluster}}Cluster{{asUpperCamelCase type}}"); + return {{earlyReturn}}; + } - jmethodID {{asLowerCamelCase type}}StructCtor_{{depth}}; - err = chip::JniReferences::GetInstance().FindMethod( - env, {{asLowerCamelCase type}}StructClass_{{depth}}, "", - "({{#zcl_struct_items_by_struct_and_cluster_name type cluster}}{{asJniSignature type null (asUpperCamelCase ../cluster) true}}{{/zcl_struct_items_by_struct_and_cluster_name}})V", - &{{asLowerCamelCase type}}StructCtor_{{depth}}); - if (err != CHIP_NO_ERROR || {{asLowerCamelCase type}}StructCtor_{{depth}} == nullptr) { - ChipLogError(Zcl, "Could not find ChipStructs${{asUpperCamelCase cluster}}Cluster{{asUpperCamelCase type}} constructor"); - return {{earlyReturn}}; - } + jmethodID {{asLowerCamelCase type}}StructCtor_{{depth}}; + err = chip::JniReferences::GetInstance().FindMethod( + env, {{asLowerCamelCase type}}StructClass_{{depth}}, "", + "({{#zcl_struct_items_by_struct_and_cluster_name type cluster}}{{asJniSignature type null (asUpperCamelCase ../cluster) true}}{{/zcl_struct_items_by_struct_and_cluster_name}})V", + &{{asLowerCamelCase type}}StructCtor_{{depth}}); + if (err != CHIP_NO_ERROR || {{asLowerCamelCase type}}StructCtor_{{depth}} == nullptr) { + ChipLogError(Zcl, "Could not find ChipStructs${{asUpperCamelCase cluster}}Cluster{{asUpperCamelCase type}} constructor"); + return {{earlyReturn}}; + } {{target}} = env->NewObject({{asLowerCamelCase type}}StructClass_{{depth}}, {{asLowerCamelCase type}}StructCtor_{{depth}} {{#zcl_struct_items_by_struct_and_cluster_name type cluster}} , {{../target}}_{{asLowerCamelCase label}} {{/zcl_struct_items_by_struct_and_cluster_name}} ); - } - {{else}} - {{#if_is_strongly_typed_chip_enum type}} - std::string {{target}}ClassName = "{{asJniClassName type null (asUpperCamelCase cluster)}}"; - std::string {{target}}CtorSignature = "({{asJniSignature type null (asUpperCamelCase cluster) false}})V"; - {{asJniBasicType type false}} jni{{target}} = static_cast<{{asJniBasicType type false}}>({{source}}); - chip::JniReferences::GetInstance().CreateBoxedObject<{{asJniBasicType type false}}>({{target}}ClassName.c_str(), {{target}}CtorSignature.c_str(), jni{{target}}, {{target}}); {{else}} - {{#if (isOctetString type)}} - jbyteArray {{target}}ByteArray = env->NewByteArray(static_cast({{source}}.size())); - env->SetByteArrayRegion({{target}}ByteArray, 0, static_cast({{source}}.size()), reinterpret_cast({{source}}.data())); - {{target}} = {{target}}ByteArray; - {{else if (isCharString type)}} - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF({{source}}, {{target}})); - {{else}} + {{#if_is_strongly_typed_chip_enum type}} std::string {{target}}ClassName = "{{asJniClassName type null (asUpperCamelCase cluster)}}"; std::string {{target}}CtorSignature = "({{asJniSignature type null (asUpperCamelCase cluster) false}})V"; - {{#if_is_strongly_typed_bitmap type}} - {{asJniBasicType type false}} jni{{target}} = static_cast<{{asJniBasicType type false}}>({{source}}.Raw()); - chip::JniReferences::GetInstance().CreateBoxedObject<{{asJniBasicType type false}}>({{target}}ClassName.c_str(), {{target}}CtorSignature.c_str(), jni{{target}}, {{target}}); + {{asJniBasicType type false}} jni{{target}} = static_cast<{{asJniBasicType type false}}>({{source}}); + chip::JniReferences::GetInstance().CreateBoxedObject<{{asJniBasicType type false}}>({{target}}ClassName.c_str(), {{target}}CtorSignature.c_str(), jni{{target}}, {{target}}); + {{else}} + {{#if (isOctetString type)}} + jbyteArray {{target}}ByteArray = env->NewByteArray(static_cast({{source}}.size())); + env->SetByteArrayRegion({{target}}ByteArray, 0, static_cast({{source}}.size()), reinterpret_cast({{source}}.data())); + {{target}} = {{target}}ByteArray; + {{else if (isCharString type)}} + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF({{source}}, {{target}})); {{else}} - {{asJniBasicType type false}} jni{{target}} = static_cast<{{asJniBasicType type false}}>({{source}}); - chip::JniReferences::GetInstance().CreateBoxedObject<{{asJniBasicType type false}}>({{target}}ClassName.c_str(), {{target}}CtorSignature.c_str(), jni{{target}}, {{target}}); - {{/if_is_strongly_typed_bitmap}} - {{/if}} - {{/if_is_strongly_typed_chip_enum}} - {{/if_is_struct}} + std::string {{target}}ClassName = "{{asJniClassName type null (asUpperCamelCase cluster)}}"; + std::string {{target}}CtorSignature = "({{asJniSignature type null (asUpperCamelCase cluster) false}})V"; + {{#if_is_strongly_typed_bitmap type}} + {{asJniBasicType type false}} jni{{target}} = static_cast<{{asJniBasicType type false}}>({{source}}.Raw()); + chip::JniReferences::GetInstance().CreateBoxedObject<{{asJniBasicType type false}}>({{target}}ClassName.c_str(), {{target}}CtorSignature.c_str(), jni{{target}}, {{target}}); + {{else}} + {{asJniBasicType type false}} jni{{target}} = static_cast<{{asJniBasicType type false}}>({{source}}); + chip::JniReferences::GetInstance().CreateBoxedObject<{{asJniBasicType type false}}>({{target}}ClassName.c_str(), {{target}}CtorSignature.c_str(), jni{{target}}, {{target}}); + {{/if_is_strongly_typed_bitmap}} + {{/if}} + {{/if_is_strongly_typed_chip_enum}} + {{/if_is_struct}} + {{/if_is_typedef}} {{/if}} \ No newline at end of file diff --git a/src/controller/java/templates/templates.json b/src/controller/java/templates/templates.json index 5ff5eb7ef0dad5..4a04bec24af685 100644 --- a/src/controller/java/templates/templates.json +++ b/src/controller/java/templates/templates.json @@ -24,10 +24,6 @@ "name": "cluster_header", "path": "../../../app/zap-templates/partials/cluster_header.zapt" }, - { - "name": "encode_value", - "path": "partials/encode_value.zapt" - }, { "name": "decode_value", "path": "partials/decode_value.zapt" diff --git a/src/controller/python/templates/partials/typedef_def.zapt b/src/controller/python/templates/partials/typedef_def.zapt new file mode 100644 index 00000000000000..1a8a953a77b392 --- /dev/null +++ b/src/controller/python/templates/partials/typedef_def.zapt @@ -0,0 +1 @@ + {{asType label}} = '{{zapTypeToPythonClusterObjectType type ns=../cluster}}' diff --git a/src/controller/python/templates/python-CHIPClusters-py.zapt b/src/controller/python/templates/python-CHIPClusters-py.zapt index 284cd650a0a772..8d3ab8bc6b0186 100644 --- a/src/controller/python/templates/python-CHIPClusters-py.zapt +++ b/src/controller/python/templates/python-CHIPClusters-py.zapt @@ -26,8 +26,12 @@ class ChipClusters: {{#zcl_command_arguments}} {{#if_is_struct type}} "{{asLowerCamelCase label}}": "{{type}}", - {{else}} + {{else}} + {{#if_is_typedef type}} + "{{asLowerCamelCase label}}": "{{type}}", + {{else}} "{{asLowerCamelCase label}}": "{{#if (isCharString type)}}str{{else}}{{as_underlying_python_zcl_type type ../../id}}{{/if}}", + {{/if_is_typedef}} {{/if_is_struct}} {{/zcl_command_arguments}} }, diff --git a/src/controller/python/templates/python-cluster-Objects-py.zapt b/src/controller/python/templates/python-cluster-Objects-py.zapt index 3cb973d86dd356..53876a3aa42178 100644 --- a/src/controller/python/templates/python-cluster-Objects-py.zapt +++ b/src/controller/python/templates/python-cluster-Objects-py.zapt @@ -2,7 +2,7 @@ {{> header}} ''' -# This file contains generated struct, enum, command definition. +# This file contains generated struct, enum, typedef, and command definition. # Users are not expected to import this file, instead, users can use import chip.clusters, # which will import all symbols from this file and can get a readable, pretty naming like # clusters.OnOff.commands.OnCommand @@ -54,6 +54,13 @@ class Globals: {{/if}} {{/zcl_structs}} + class Typedefs: +{{#zcl_typedefs}} +{{#if has_no_clusters}} +{{> typedef_def cluster="Globals"}} + +{{/if}} +{{/zcl_typedefs}} {{#zcl_clusters}} @@ -105,6 +112,13 @@ class {{asUpperCamelCase name}}(Cluster): {{> struct_def cluster=(asUpperCamelCase parent.name) }} {{/zcl_structs}} +{{#zcl_typedefs}} +{{#first}} + class Typedefs: +{{/first}} +{{> typedef_def cluster=(asUpperCamelCase parent.name) }} + +{{/zcl_typedefs}} {{#zcl_commands}} {{#first}} class Commands: diff --git a/src/controller/python/templates/templates.json b/src/controller/python/templates/templates.json index ebe67b0f384b22..8b0c0f4b368d2b 100644 --- a/src/controller/python/templates/templates.json +++ b/src/controller/python/templates/templates.json @@ -32,6 +32,10 @@ { "name": "struct_def", "path": "partials/struct_def.zapt" + }, + { + "name": "typedef_def", + "path": "partials/typedef_def.zapt" } ], "templates": [ diff --git a/src/darwin/Framework/CHIP/templates/partials/decode_value.zapt b/src/darwin/Framework/CHIP/templates/partials/decode_value.zapt index 16a9acbc6d4048..ae178118abb36f 100644 --- a/src/darwin/Framework/CHIP/templates/partials/decode_value.zapt +++ b/src/darwin/Framework/CHIP/templates/partials/decode_value.zapt @@ -27,31 +27,37 @@ {{target}} = array_{{depth}}; } {{else}} - {{#if_is_struct type}} - {{target}} = [{{asObjectiveCClass type cluster forceNotList=true}} new]; - {{#zcl_struct_items_by_struct_and_cluster_name type cluster}} - {{#if (isSupported (asUpperCamelCase ../cluster preserveAcronyms=true) struct=(asUpperCamelCase ../type preserveAcronyms=true) structField=(asStructPropertyName label))}} - {{>decode_value target=(concat ../target "." (asStructPropertyName label)) source=(concat ../source "." (asLowerCamelCase label)) cluster=../cluster errorCode=../errorCode depth=(incrementDepth ../depth) }} - {{/if}} - {{/zcl_struct_items_by_struct_and_cluster_name}} + {{#if_is_typedef type}} + {{#zcl_typedef_by_typedef_and_cluster_name type cluster}} + {{>decode_value type=typeId target=target source=source errorCode=errorCode depth=(incrementDepth ../depth) }} + {{/zcl_typedef_by_typedef_and_cluster_name}} {{else}} - {{#if_is_strongly_typed_chip_enum type}} - {{target}} = [NSNumber numberWith{{asObjectiveCNumberType "" type false}}:chip::to_underlying({{source}})]; + {{#if_is_struct type}} + {{target}} = [{{asObjectiveCClass type cluster forceNotList=true}} new]; + {{#zcl_struct_items_by_struct_and_cluster_name type cluster}} + {{#if (isSupported (asUpperCamelCase ../cluster preserveAcronyms=true) struct=(asUpperCamelCase ../type preserveAcronyms=true) structField=(asStructPropertyName label))}} + {{>decode_value target=(concat ../target "." (asStructPropertyName label)) source=(concat ../source "." (asLowerCamelCase label)) cluster=../cluster errorCode=../errorCode depth=(incrementDepth ../depth) }} + {{/if}} + {{/zcl_struct_items_by_struct_and_cluster_name}} {{else}} - {{#if_is_strongly_typed_bitmap type}} - {{target}} = [NSNumber numberWith{{asObjectiveCNumberType "" type false}}:{{source}}.Raw()]; - {{else if (isOctetString type)}} - {{target}} = AsData({{source}}); - {{else if (isCharString type)}} - {{target}} = AsString({{source}}); - if ({{target}} == nil) { - {{! Invalid UTF-8. Just make up an error for now. }} - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - {{errorCode}} - } + {{#if_is_strongly_typed_chip_enum type}} + {{target}} = [NSNumber numberWith{{asObjectiveCNumberType "" type false}}:chip::to_underlying({{source}})]; {{else}} - {{target}} = [NSNumber numberWith{{asObjectiveCNumberType "" type false}}:{{source}}]; - {{/if_is_strongly_typed_bitmap}} - {{/if_is_strongly_typed_chip_enum}} - {{/if_is_struct}} + {{#if_is_strongly_typed_bitmap type}} + {{target}} = [NSNumber numberWith{{asObjectiveCNumberType "" type false}}:{{source}}.Raw()]; + {{else if (isOctetString type)}} + {{target}} = AsData({{source}}); + {{else if (isCharString type)}} + {{target}} = AsString({{source}}); + if ({{target}} == nil) { + {{! Invalid UTF-8. Just make up an error for now. }} + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + {{errorCode}} + } + {{else}} + {{target}} = [NSNumber numberWith{{asObjectiveCNumberType "" type false}}:{{source}}]; + {{/if_is_strongly_typed_bitmap}} + {{/if_is_strongly_typed_chip_enum}} + {{/if_is_struct}} + {{/if_is_typedef}} {{/if}} diff --git a/src/darwin/Framework/CHIP/templates/partials/encode_value.zapt b/src/darwin/Framework/CHIP/templates/partials/encode_value.zapt index f2f4d076b72bfc..4900e74999567c 100644 --- a/src/darwin/Framework/CHIP/templates/partials/encode_value.zapt +++ b/src/darwin/Framework/CHIP/templates/partials/encode_value.zapt @@ -44,21 +44,27 @@ {{else if (isCharString type)}} {{target}} = AsCharSpan({{source}}); {{else}} - {{#if_is_struct type}} - {{#zcl_struct_items_by_struct_and_cluster_name type cluster}} - {{#if (isSupported (asUpperCamelCase ../cluster preserveAcronyms=true) struct=(asUpperCamelCase ../type preserveAcronyms=true) structField=(asStructPropertyName label))}} - {{>encode_value target=(concat ../target "." (asLowerCamelCase label)) source=(concat ../source "." (asStructPropertyName label)) cluster=../cluster errorCode=../errorCode depth=(incrementDepth ../depth)}} - {{/if}} - {{/zcl_struct_items_by_struct_and_cluster_name}} + {{#if_is_typedef type}} + {{#zcl_typedef_by_typedef_and_cluster_name type cluster}} + {{>encode_value type=typeId target=target source=source errorCode=errorCode depth=(incrementDepth ../depth) }} + {{/zcl_typedef_by_typedef_and_cluster_name}} {{else}} - {{#if_is_strongly_typed_chip_enum type}} - {{target}} = static_cast>({{source}}.{{asObjectiveCNumberType source type true}}Value); + {{#if_is_struct type}} + {{#zcl_struct_items_by_struct_and_cluster_name type cluster}} + {{#if (isSupported (asUpperCamelCase ../cluster preserveAcronyms=true) struct=(asUpperCamelCase ../type preserveAcronyms=true) structField=(asStructPropertyName label))}} + {{>encode_value target=(concat ../target "." (asLowerCamelCase label)) source=(concat ../source "." (asStructPropertyName label)) cluster=../cluster errorCode=../errorCode depth=(incrementDepth ../depth)}} + {{/if}} + {{/zcl_struct_items_by_struct_and_cluster_name}} {{else}} - {{#if_is_strongly_typed_bitmap type}} + {{#if_is_strongly_typed_chip_enum type}} {{target}} = static_cast>({{source}}.{{asObjectiveCNumberType source type true}}Value); {{else}} - {{target}} = {{source}}.{{asObjectiveCNumberType source type true}}Value; - {{/if_is_strongly_typed_bitmap}} - {{/if_is_strongly_typed_chip_enum}} - {{/if_is_struct}} + {{#if_is_strongly_typed_bitmap type}} + {{target}} = static_cast>({{source}}.{{asObjectiveCNumberType source type true}}Value); + {{else}} + {{target}} = {{source}}.{{asObjectiveCNumberType source type true}}Value; + {{/if_is_strongly_typed_bitmap}} + {{/if_is_strongly_typed_chip_enum}} + {{/if_is_struct}} + {{/if_is_typedef}} {{/if}} diff --git a/src/darwin/Framework/CHIP/templates/partials/typedef_decl.zapt b/src/darwin/Framework/CHIP/templates/partials/typedef_decl.zapt new file mode 100644 index 00000000000000..86deb02b28dbb6 --- /dev/null +++ b/src/darwin/Framework/CHIP/templates/partials/typedef_decl.zapt @@ -0,0 +1,2 @@ +{{! Arguments: cluster (might be "Globals", is not case-canonicalized), name, typedefLabel }} +typedef {{asObjectiveCType type cluster}} {{asUnderlyingZclType name}}; \ No newline at end of file diff --git a/src/darwin/Framework/CHIP/templates/templates.json b/src/darwin/Framework/CHIP/templates/templates.json index d7e4b2106bc98e..5fffbfd268ba23 100644 --- a/src/darwin/Framework/CHIP/templates/templates.json +++ b/src/darwin/Framework/CHIP/templates/templates.json @@ -56,6 +56,10 @@ "name": "enum_decl", "path": "partials/enum_decl.zapt" }, + { + "name": "typedef_decl", + "path": "partials/typedef_decl.zapt" + }, { "name": "renamed_struct_field_impl", "path": "partials/renamed_struct_field_impl.zapt" From b4ddb04ad7336f45a212e9564aaaf70c50b614f4 Mon Sep 17 00:00:00 2001 From: marcos <15697303+gmarcosb@users.noreply.github.com> Date: Fri, 18 Oct 2024 15:32:08 -0600 Subject: [PATCH 02/20] Update zapt templates to handle typedef --- .../templates/app/cluster-typedefs-check.zapt | 29 ------------------- .../zcl/data-model/chip/global-structs.xml | 1 + .../zcl/data-model/chip/global-typedefs.xml | 29 +++++++++++++++++++ .../zcl/data-model/chip/test-cluster.xml | 24 +++++++++++++++ src/app/zap-templates/zcl/zcl.json | 1 + src/app/zap-templates/zcl/zcl.xsd | 13 ++++++++- .../java/templates/partials/decode_value.zapt | 1 + .../CHIP/templates/MTRBaseClusters.zapt | 11 +++++++ .../CHIP/templates/partials/typedef_decl.zapt | 2 +- 9 files changed, 80 insertions(+), 31 deletions(-) delete mode 100644 src/app/zap-templates/templates/app/cluster-typedefs-check.zapt create mode 100644 src/app/zap-templates/zcl/data-model/chip/global-typedefs.xml diff --git a/src/app/zap-templates/templates/app/cluster-typedefs-check.zapt b/src/app/zap-templates/templates/app/cluster-typedefs-check.zapt deleted file mode 100644 index a2a3d4ac1e4f4e..00000000000000 --- a/src/app/zap-templates/templates/app/cluster-typedefs-check.zapt +++ /dev/null @@ -1,29 +0,0 @@ -{{> header}} - -#pragma once - -#include - -namespace chip { -namespace app { -namespace Clusters { -{{#zcl_typedefs}} -{{#if has_more_than_one_cluster}} -{{> cluster_typedefs_ensure_known_value ns="detail"}} -{{else if has_no_clusters}} -{{> cluster_typedefs_ensure_known_value ns="Globals"}} - -{{/if}} -{{/zcl_typedefs}} - -{{#zcl_clusters}} -{{#zcl_typedefs}} -{{#unless has_more_than_one_cluster}} -{{> cluster_typedefs_ensure_known_value ns=(asUpperCamelCase ../name)}} -{{/unless}} -{{/zcl_typedefs}} - -{{/zcl_clusters}} -} // namespace Clusters -} // namespace app -} // namespace chip diff --git a/src/app/zap-templates/zcl/data-model/chip/global-structs.xml b/src/app/zap-templates/zcl/data-model/chip/global-structs.xml index 743fdf366b724b..00f34435c735cc 100644 --- a/src/app/zap-templates/zcl/data-model/chip/global-structs.xml +++ b/src/app/zap-templates/zcl/data-model/chip/global-structs.xml @@ -38,5 +38,6 @@ limitations under the License. + diff --git a/src/app/zap-templates/zcl/data-model/chip/global-typedefs.xml b/src/app/zap-templates/zcl/data-model/chip/global-typedefs.xml new file mode 100644 index 00000000000000..e9503344a22ada --- /dev/null +++ b/src/app/zap-templates/zcl/data-model/chip/global-typedefs.xml @@ -0,0 +1,29 @@ + + + + + + + + diff --git a/src/app/zap-templates/zcl/data-model/chip/test-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/test-cluster.xml index 258c7cba5106df..8b4e3c5b81fca1 100644 --- a/src/app/zap-templates/zcl/data-model/chip/test-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/test-cluster.xml @@ -59,8 +59,14 @@ limitations under the License. + + + + + + @@ -104,6 +110,10 @@ limitations under the License. + + + @@ -202,6 +212,8 @@ limitations under the License. global_enum global_struct + typedef_attr + global_typedef mei_int8u @@ -310,6 +324,7 @@ limitations under the License. + + + @@ -605,6 +622,12 @@ limitations under the License. + + + + + + @@ -657,6 +680,7 @@ limitations under the License. + diff --git a/src/app/zap-templates/zcl/zcl.json b/src/app/zap-templates/zcl/zcl.json index 0f304a61efd70e..7b9539bec1a045 100644 --- a/src/app/zap-templates/zcl/zcl.json +++ b/src/app/zap-templates/zcl/zcl.json @@ -59,6 +59,7 @@ "global-bitmaps.xml", "global-enums.xml", "global-structs.xml", + "global-typedefs.xml", "groups-cluster.xml", "group-key-mgmt-cluster.xml", "icd-management-cluster.xml", diff --git a/src/app/zap-templates/zcl/zcl.xsd b/src/app/zap-templates/zcl/zcl.xsd index 1f78e6b9e076f0..75ca12447eec0b 100644 --- a/src/app/zap-templates/zcl/zcl.xsd +++ b/src/app/zap-templates/zcl/zcl.xsd @@ -147,6 +147,7 @@ This schema describes the format of the XML files, that describe the ZCL specifi + @@ -157,7 +158,7 @@ This schema describes the format of the XML files, that describe the ZCL specifi - + @@ -391,6 +392,16 @@ This schema describes the format of the XML files, that describe the ZCL specifi + + + + + + + + + + diff --git a/src/controller/java/templates/partials/decode_value.zapt b/src/controller/java/templates/partials/decode_value.zapt index 726ab0df3f9a6b..2a807d418924ff 100644 --- a/src/controller/java/templates/partials/decode_value.zapt +++ b/src/controller/java/templates/partials/decode_value.zapt @@ -59,6 +59,7 @@ if ({{source}}.IsNull()) { , {{../target}}_{{asLowerCamelCase label}} {{/zcl_struct_items_by_struct_and_cluster_name}} ); + } {{else}} {{#if_is_strongly_typed_chip_enum type}} std::string {{target}}ClassName = "{{asJniClassName type null (asUpperCamelCase cluster)}}"; diff --git a/src/darwin/Framework/CHIP/templates/MTRBaseClusters.zapt b/src/darwin/Framework/CHIP/templates/MTRBaseClusters.zapt index 6ca88e84dcad1a..e76a994cdad3bf 100644 --- a/src/darwin/Framework/CHIP/templates/MTRBaseClusters.zapt +++ b/src/darwin/Framework/CHIP/templates/MTRBaseClusters.zapt @@ -114,6 +114,13 @@ subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptio {{/if}} {{/zcl_enums}} +{{#zcl_typedefs}} +{{#if has_no_clusters}} +{{> typedef_decl cluster="Globals" name=name typedefLabel=label}} + +{{/if}} +{{/zcl_typedefs}} + {{#zcl_clusters}} {{#zcl_enums}} {{> enum_decl cluster=../name name=name enumLabel=label}} @@ -167,6 +174,10 @@ typedef NS_OPTIONS({{asUnderlyingZclType name}}, {{objCEnumName clusterName bitm {{/zcl_bitmaps}} +{{#zcl_typedefs}} +{{> typedef_decl cluster=../name name=name typedefLabel=label}} + +{{/zcl_typedefs}} {{/zcl_clusters}} {{#zcl_clusters}} diff --git a/src/darwin/Framework/CHIP/templates/partials/typedef_decl.zapt b/src/darwin/Framework/CHIP/templates/partials/typedef_decl.zapt index 86deb02b28dbb6..fa583cc0bd81fe 100644 --- a/src/darwin/Framework/CHIP/templates/partials/typedef_decl.zapt +++ b/src/darwin/Framework/CHIP/templates/partials/typedef_decl.zapt @@ -1,2 +1,2 @@ {{! Arguments: cluster (might be "Globals", is not case-canonicalized), name, typedefLabel }} -typedef {{asObjectiveCType type cluster}} {{asUnderlyingZclType name}}; \ No newline at end of file +typedef {{asObjectiveCType type cluster}} {{asUpperCamelCase typedefLabel preserveAcronyms=true}}; \ No newline at end of file From 1f62d3b0f40ca85a5c2c5dcf258cebbedd47f52c Mon Sep 17 00:00:00 2001 From: marcos <15697303+gmarcosb@users.noreply.github.com> Date: Thu, 17 Oct 2024 10:18:58 -0600 Subject: [PATCH 03/20] Update zapt templates to handle typedef --- .../templates/partials/decodable_value.zapt | 28 +++--- .../data_model_xml/handlers/handlers.py | 26 +++++- .../matter_idl/generators/idl/MatterIdl.jinja | 3 + .../matter_idl/generators/java/__init__.py | 21 +++-- .../matter_idl/generators/kotlin/__init__.py | 4 +- .../matter_idl/generators/type_definitions.py | 47 +++++++++- .../matter_idl/matter_grammar.lark | 5 +- .../matter_idl/matter_idl_parser.py | 28 +++++- .../matter_idl/matter_idl_types.py | 9 ++ .../matter_idl/test_matter_idl_parser.py | 14 +++ .../matter_idl/zapxml/handlers/handlers.py | 41 ++++++++- scripts/tools/zap_regen_all.py | 2 + .../partials/idl/cluster_definition.zapt | 4 + .../partials/idl/global_types.zapt | 6 ++ .../templates/app/cluster-typedefs-check.zapt | 29 ++++++ .../templates/app/cluster-typedefs.zapt | 53 +++++++++++ .../zcl/zcl-with-test-extensions.json | 2 +- src/app/zap-templates/zcl/zcl.json | 2 +- .../java/templates/partials/decode_value.zapt | 91 ++++++++++--------- src/controller/java/templates/templates.json | 4 - .../templates/partials/typedef_def.zapt | 1 + .../templates/python-CHIPClusters-py.zapt | 6 +- .../templates/python-cluster-Objects-py.zapt | 16 +++- .../python/templates/templates.json | 4 + .../CHIP/templates/partials/decode_value.zapt | 54 ++++++----- .../CHIP/templates/partials/encode_value.zapt | 32 ++++--- .../CHIP/templates/partials/typedef_decl.zapt | 2 + .../Framework/CHIP/templates/templates.json | 4 + 28 files changed, 419 insertions(+), 119 deletions(-) create mode 100644 src/app/zap-templates/templates/app/cluster-typedefs-check.zapt create mode 100644 src/app/zap-templates/templates/app/cluster-typedefs.zapt create mode 100644 src/controller/python/templates/partials/typedef_def.zapt create mode 100644 src/darwin/Framework/CHIP/templates/partials/typedef_decl.zapt diff --git a/examples/darwin-framework-tool/templates/partials/decodable_value.zapt b/examples/darwin-framework-tool/templates/partials/decodable_value.zapt index 8d0442000a070c..07e791dcafa2a1 100644 --- a/examples/darwin-framework-tool/templates/partials/decodable_value.zapt +++ b/examples/darwin-framework-tool/templates/partials/decodable_value.zapt @@ -27,18 +27,24 @@ {{>decodable_value target=(concat ../target "." (asStructPropertyName label)) source=(concat ../source "." (asLowerCamelCase label)) cluster=../cluster depth=(incrementDepth ../depth) }} {{/zcl_struct_items_by_struct_and_cluster_name}} {{else}} - {{#if_is_strongly_typed_chip_enum type}} - {{target}} = [NSNumber numberWith{{asObjectiveCNumberType "" type false}}:chip::to_underlying({{source}})]; + {{#if_is_typedef type}} + {{#zcl_typedef_by_typedef_and_cluster_name type cluster}} + {{>decodable_value type=typeId target=target source=source errorCode=errorCode depth=(incrementDepth ../depth) }} + {{/zcl_typedef_by_typedef_and_cluster_name}} {{else}} - {{#if_is_strongly_typed_bitmap type}} - {{target}} = [NSNumber numberWith{{asObjectiveCNumberType "" type false}}:{{source}}.Raw()]; - {{else if (isOctetString type)}} - {{target}} = [NSData dataWithBytes:{{source}}.data() length:{{source}}.size()]; - {{else if (isCharString type)}} - {{target}} = [[NSString alloc] initWithBytes:{{source}}.data() length:{{source}}.size() encoding:NSUTF8StringEncoding]; + {{#if_is_strongly_typed_chip_enum type}} + {{target}} = [NSNumber numberWith{{asObjectiveCNumberType "" type false}}:chip::to_underlying({{source}})]; {{else}} - {{target}} = [NSNumber numberWith{{asObjectiveCNumberType "" type false}}:{{source}}]; - {{/if_is_strongly_typed_bitmap}} - {{/if_is_strongly_typed_chip_enum}} + {{#if_is_strongly_typed_bitmap type}} + {{target}} = [NSNumber numberWith{{asObjectiveCNumberType "" type false}}:{{source}}.Raw()]; + {{else if (isOctetString type)}} + {{target}} = [NSData dataWithBytes:{{source}}.data() length:{{source}}.size()]; + {{else if (isCharString type)}} + {{target}} = [[NSString alloc] initWithBytes:{{source}}.data() length:{{source}}.size() encoding:NSUTF8StringEncoding]; + {{else}} + {{target}} = [NSNumber numberWith{{asObjectiveCNumberType "" type false}}:{{source}}]; + {{/if_is_strongly_typed_bitmap}} + {{/if_is_strongly_typed_chip_enum}} + {{/if_is_typedef}} {{/if_is_struct}} {{/if}} diff --git a/scripts/py_matter_idl/matter_idl/data_model_xml/handlers/handlers.py b/scripts/py_matter_idl/matter_idl/data_model_xml/handlers/handlers.py index 858ec6a19f6d87..07664912f792c5 100644 --- a/scripts/py_matter_idl/matter_idl/data_model_xml/handlers/handlers.py +++ b/scripts/py_matter_idl/matter_idl/data_model_xml/handlers/handlers.py @@ -18,7 +18,7 @@ from xml.sax.xmlreader import AttributesImpl from matter_idl.matter_idl_types import (ApiMaturity, Attribute, AttributeQuality, Bitmap, Cluster, Command, CommandQuality, - ConstantEntry, DataType, Enum, Field, FieldQuality, Idl, Struct, StructTag) + ConstantEntry, DataType, Enum, Field, FieldQuality, Idl, Struct, StructTag, Typedef) from .base import BaseHandler, HandledDepth from .context import Context @@ -178,6 +178,10 @@ def GetNextProcessor(self, name: str, attrs: AttributesImpl): self._field.data_type.name = NormalizeDataType(attrs["type"]) return BaseHandler(self.context, handled=HandledDepth.SINGLE_TAG) + elif name == "typedef": + LOGGER.warning( + f"Anonymous typedef not supported when handling field {self._field.name}") + return BaseHandler(self.context, handled=HandledDepth.ENTIRE_TREE) else: return BaseHandler(self.context) @@ -281,6 +285,24 @@ def GetNextProcessor(self, name: str, attrs: AttributesImpl): else: return BaseHandler(self.context) +class TypedefHandler(BaseHandler): + def __init__(self, context: Context, cluster: Cluster, attrs: AttributesImpl): + super().__init__(context, handled=HandledDepth.SINGLE_TAG) + self._cluster = cluster + + # TODO: base type is GUESSED here because xml does not contain it + self._typedef = Typedef(name=NormalizeName( + attrs["name"]), base_type="UNKNOWN") + + def EndProcessing(self): + self._cluster.typedefs.append(self._typedef) + + def GetNextProcessor(self, name: str, attrs: AttributesImpl): + if name == "section": + # Documentation data, skipped + return BaseHandler(self.context, handled=HandledDepth.ENTIRE_TREE) + else: + return BaseHandler(self.context) class EventsHandler(BaseHandler): def __init__(self, context: Context, cluster: Cluster): @@ -548,6 +570,8 @@ def GetNextProcessor(self, name: str, attrs: AttributesImpl): return BitmapHandler(self.context, self._cluster, attrs) elif name == "struct": return StructHandler(self.context, self._cluster, attrs) + elif name == "typedef": + return TypedefHandler(self.context, self._cluster, attrs) else: return BaseHandler(self.context) diff --git a/scripts/py_matter_idl/matter_idl/generators/idl/MatterIdl.jinja b/scripts/py_matter_idl/matter_idl/generators/idl/MatterIdl.jinja index 0e132e581b7712..a7a83745693229 100644 --- a/scripts/py_matter_idl/matter_idl/generators/idl/MatterIdl.jinja +++ b/scripts/py_matter_idl/matter_idl/generators/idl/MatterIdl.jinja @@ -55,6 +55,9 @@ bitmap {{bitmap.name}} : {{ bitmap.base_type}} { {% endfor %} +{% for typedef in idl.global_typedefs %} +typedef {{typedef.name}} : {{ typedef.base_type}}; + {%- for cluster in idl.clusters %} {% if cluster.description %}/** {{cluster.description}} */ {% endif %} diff --git a/scripts/py_matter_idl/matter_idl/generators/java/__init__.py b/scripts/py_matter_idl/matter_idl/generators/java/__init__.py index d21107653dfb46..fd61e38bde2905 100644 --- a/scripts/py_matter_idl/matter_idl/generators/java/__init__.py +++ b/scripts/py_matter_idl/matter_idl/generators/java/__init__.py @@ -59,7 +59,7 @@ class GlobalType: def _UnderlyingType(field: Field, context: TypeLookupContext) -> Optional[str]: - actual = ParseDataType(field.data_type, context) + actual = ParseDataType(field.data_type, context, desugar_typedef = True) if isinstance(actual, (IdlEnumType, IdlBitmapType)): actual = actual.base_type @@ -132,7 +132,7 @@ def _CppType(field: Field, context: TypeLookupContext) -> str: if field.data_type.name.lower() in _KNOWN_DECODABLE_TYPES: return _KNOWN_DECODABLE_TYPES[field.data_type.name.lower()] - actual = ParseDataType(field.data_type, context) + actual = ParseDataType(field.data_type, context, desugar_typedef = True) if isinstance(actual, BasicString): if actual.is_binary: return 'chip::ByteSpan' @@ -278,7 +278,7 @@ def attributesWithSupportedCallback(attrs, context: TypeLookupContext): # Attributes will be generated for all types # except non-list structures if not attr.definition.is_list: - underlying = ParseDataType(attr.definition.data_type, context) + underlying = ParseDataType(attr.definition.data_type, context, desugar_typedef = True) if isinstance(underlying, IdlType): continue @@ -420,6 +420,10 @@ def is_bitmap(self): def is_untyped_bitmap(self): return self.context.is_untyped_bitmap_type(self.data_type.name) + @property + def is_typedef(self): + return self.context.is_typedef_type(self.data_type.name) + def clone(self): return EncodableValue(self.context, self.data_type, self.attrs) @@ -469,7 +473,7 @@ def jni_fundamental_type(self): @property def boxed_java_type(self): - t = ParseDataType(self.data_type, self.context) + t = ParseDataType(self.data_type, self.context, desugar_typedef = True) if isinstance(t, FundamentalType): if t == FundamentalType.BOOL: @@ -506,7 +510,7 @@ def boxed_java_type(self): @property def java_tlv_type(self): - t = ParseDataType(self.data_type, self.context) + t = ParseDataType(self.data_type, self.context, desugar_typedef = True) if isinstance(t, FundamentalType): if t == FundamentalType.BOOL: @@ -537,7 +541,8 @@ def java_tlv_type(self): @property def kotlin_type(self): - t = ParseDataType(self.data_type, self.context) + # TODO: Use inline value class where possible (types not defined in java) + t = ParseDataType(self.data_type, self.context, desugar_typedef = True) if isinstance(t, FundamentalType): if t == FundamentalType.BOOL: @@ -583,7 +588,7 @@ def unboxed_java_signature(self): if self.is_optional or self.is_list: raise Exception("Not a basic type: %r" % self) - t = ParseDataType(self.data_type, self.context) + t = ParseDataType(self.data_type, self.context, desugar_typedef = True) if isinstance(t, FundamentalType): if t == FundamentalType.BOOL: @@ -611,7 +616,7 @@ def boxed_java_signature(self): if self.is_list: return "Ljava/util/ArrayList;" - t = ParseDataType(self.data_type, self.context) + t = ParseDataType(self.data_type, self.context, desugar_typedef = True) if isinstance(t, FundamentalType): if t == FundamentalType.BOOL: diff --git a/scripts/py_matter_idl/matter_idl/generators/kotlin/__init__.py b/scripts/py_matter_idl/matter_idl/generators/kotlin/__init__.py index 405f505a0980d3..b7349f89100a19 100644 --- a/scripts/py_matter_idl/matter_idl/generators/kotlin/__init__.py +++ b/scripts/py_matter_idl/matter_idl/generators/kotlin/__init__.py @@ -471,6 +471,8 @@ def kotlin_type(self): return "UInt" else: return "ULong" + elif isinstance(t, IdlTypedefType): + return self.data_type.name else: return "Any" @@ -507,7 +509,7 @@ def boxed_java_signature(self): if self.is_list: return "Ljava/util/ArrayList;" - t = ParseDataType(self.data_type, self.context) + t = ParseDataType(self.data_type, self.context, desugar_typedef = True) if isinstance(t, FundamentalType): if t == FundamentalType.BOOL: diff --git a/scripts/py_matter_idl/matter_idl/generators/type_definitions.py b/scripts/py_matter_idl/matter_idl/generators/type_definitions.py index 4f9fa56779042b..44435eb4600391 100644 --- a/scripts/py_matter_idl/matter_idl/generators/type_definitions.py +++ b/scripts/py_matter_idl/matter_idl/generators/type_definitions.py @@ -161,6 +161,15 @@ def is_struct(self) -> bool: return self.item_type == IdlItemType.STRUCT +@dataclass +class IdlTypedefType: + """ + A typedef (concrete type that aliases another type) + """ + idl_name: str + base_type: Union[BasicInteger, BasicString, FundamentalType, IdlType, IdlEnumType, IdlBitmapType] + + # Data types, held by ZAP in chip-types.xml and generally by the spec. __CHIP_SIZED_TYPES__ = { "bitmap16": BasicInteger(idl_name="bitmap16", byte_count=2, is_signed=False), @@ -295,6 +304,13 @@ def find_bitmap(self, name) -> Optional[matter_idl_types.Bitmap]: return None + def find_typedef(self, name) -> Optional[matter_idl_types.Typedef]: + for s in self.all_typedefs: + if s.name == name: + return s + + return None + @property def all_enums(self): """ @@ -330,6 +346,18 @@ def all_structs(self): for e in self.cluster.structs: yield e + @property + def all_typedefs(self): + """ + All typedefs defined within this lookup context. + + typedefs are only defined at cluster level. If lookup context does not + include a typedef, the typedef list will be empty. + """ + if self.cluster: + for t in self.cluster.typedefs: + yield t + def is_enum_type(self, name: str): """ Determine if the given type name is an enumeration. @@ -347,6 +375,12 @@ def is_struct_type(self, name: str): """ return any(map(lambda s: s.name == name, self.all_structs)) + def is_typedef_type(self, name: str): + """ + Determine if the given type name is type that is known to be a typedef + """ + return any(map(lambda s: s.name == name, self.all_typedefs)) + def is_untyped_bitmap_type(self, name: str): """Determine if the given type is a untyped bitmap (just an interger size).""" return name.lower() in {"bitmap8", "bitmap16", "bitmap32", "bitmap64"} @@ -364,7 +398,7 @@ def is_bitmap_type(self, name: str): return any(map(lambda s: s.name == name, self.all_bitmaps)) -def ParseDataType(data_type: DataType, lookup: TypeLookupContext) -> Union[BasicInteger, BasicString, FundamentalType, IdlType, IdlEnumType, IdlBitmapType]: +def ParseDataType(data_type: DataType, lookup: TypeLookupContext, desugar_typedef: bool = False) -> Union[BasicInteger, BasicString, FundamentalType, IdlType, IdlEnumType, IdlBitmapType, IdlTypedefType]: """ Given a AST data type and a lookup context, match it to a type that can be later be used for generation. @@ -404,9 +438,18 @@ def ParseDataType(data_type: DataType, lookup: TypeLookupContext) -> Union[Basic b = lookup.find_bitmap(data_type.name) if b: - # Valid enum found. it MUST be based on a valid data type + # Valid bitmap found. it MUST be based on a valid data type return IdlBitmapType(idl_name=data_type.name, base_type=__CHIP_SIZED_TYPES__[b.base_type.lower()]) + t = lookup.find_typedef(data_type.name) + if t: + # Valid typedef found. it MUST be based on a valid data type + typedef_base_type = ParseDataType(DataType(name=t.base_type), lookup) + if desugar_typedef: + return typedef_base_type + else: + return IdlTypedefType(idl_name=data_type.name, base_type=typedef_base_type) + result = IdlType(idl_name=data_type.name, item_type=IdlItemType.UNKNOWN) if lookup.find_struct(data_type.name): result.item_type = IdlItemType.STRUCT diff --git a/scripts/py_matter_idl/matter_idl/matter_grammar.lark b/scripts/py_matter_idl/matter_idl/matter_grammar.lark index 4013c51bb52a59..befad5f8e97bdd 100644 --- a/scripts/py_matter_idl/matter_idl/matter_grammar.lark +++ b/scripts/py_matter_idl/matter_idl/matter_grammar.lark @@ -12,6 +12,7 @@ struct_qualities: struct_quality* enum: "enum"i id ":" type "{" constant_entry* "}" bitmap: "bitmap"i id ":" type "{" constant_entry* "}" +typedef: "typedef"i id ":" type ";" ?access_privilege: "view"i -> view_privilege | "operate"i -> operate_privilege @@ -68,7 +69,7 @@ cluster_revision: "revision"i positive_integer ";" // no direct meaning currently cluster: [maturity] ( "client" | "server" )? "cluster"i id "=" positive_integer "{" [cluster_revision] cluster_content* "}" -?cluster_content: [maturity] (enum|bitmap|event|attribute|struct|request_struct|response_struct|command) +?cluster_content: [maturity] (enum|bitmap|event|attribute|struct|request_struct|response_struct|command|typedef) endpoint: "endpoint"i positive_integer "{" endpoint_content* "}" ?endpoint_content: endpoint_cluster_binding | endpoint_server_cluster | endpoint_device_type @@ -116,7 +117,7 @@ POSITIVE_INTEGER: /\d+/ HEX_INTEGER: /0x[A-Fa-f0-9]+/ ID: /[a-zA-Z_][a-zA-Z0-9_]*/ -idl: (struct|enum|bitmap|cluster|endpoint)* +idl: (struct|enum|bitmap|cluster|endpoint|typedef)* %import common.ESCAPED_STRING %import common.WS diff --git a/scripts/py_matter_idl/matter_idl/matter_idl_parser.py b/scripts/py_matter_idl/matter_idl/matter_idl_parser.py index e071d008d1d726..20add72cf0bccd 100755 --- a/scripts/py_matter_idl/matter_idl/matter_idl_parser.py +++ b/scripts/py_matter_idl/matter_idl/matter_idl_parser.py @@ -23,7 +23,7 @@ AttributeStorage, Bitmap, Cluster, Command, CommandInstantiation, CommandQuality, ConstantEntry, DataType, DeviceType, Endpoint, Enum, Event, EventPriority, EventQuality, Field, FieldQuality, Idl, ParseMetaData, ServerClusterInstantiation, Struct, StructQuality, - StructTag) + StructTag, Typedef) def UnionOfAllFlags(flags_list): @@ -207,6 +207,10 @@ def enum(self, id, type, *entries): def bitmap(self, id, type, *entries): return Bitmap(name=id, base_type=type, entries=list(entries)) + @v_args(inline=True) + def typedef(self, id, type): + return Typedef(name=id, base_type=type) + def field(self, args): data_type, name = args[0], args[1] is_list = (len(args) == 4) @@ -496,6 +500,8 @@ def cluster(self, meta, api_maturity, name, code, revision, *content): result.structs.append(item) elif isinstance(item, Command): result.commands.append(item) + elif isinstance(item, Typedef): + result.typedefs.append(item) else: raise Exception("UNKNOWN cluster content item: %r" % item) @@ -508,6 +514,7 @@ def idl(self, items): global_bitmaps = [] global_enums = [] global_structs = [] + global_typedefs =[] for item in items: if isinstance(item, Cluster): @@ -520,10 +527,12 @@ def idl(self, items): global_bitmaps.append(dataclasses.replace(item, is_global=True)) elif isinstance(item, Struct): global_structs.append(dataclasses.replace(item, is_global=True)) + elif isinstance(item, Typedef): + global_typedefs.append(dataclasses.replace(item, is_global=True)) else: raise Exception("UNKNOWN idl content item: %r" % item) - return Idl(clusters=clusters, endpoints=endpoints, global_bitmaps=global_bitmaps, global_enums=global_enums, global_structs=global_structs) + return Idl(clusters=clusters, endpoints=endpoints, global_bitmaps=global_bitmaps, global_enums=global_enums, global_structs=global_structs, global_typedefs=global_typedefs) def prefix_doc_comment(self): print("TODO: prefix") @@ -563,15 +572,16 @@ def __init__(self, idl: Idl): self.bitmap_map = {b.name: b for b in idl.global_bitmaps} self.enum_map = {e.name: e for e in idl.global_enums} self.struct_map = {s.name: s for s in idl.global_structs} + self.typedef_map = {t.name: t for t in idl.global_typedefs} - self.global_types = set(self.bitmap_map.keys()).union(set(self.enum_map.keys())).union(set(self.struct_map.keys())) + self.global_types = set(self.bitmap_map.keys()).union(set(self.enum_map.keys())).union(set(self.struct_map.keys())).union(set(self.typedef_map.keys())) # Spec does not enforce unique naming in bitmap/enum/struct, however in practice # if we have both enum Foo and bitmap Foo for example, it would be impossible # to disambiguate `attribute Foo foo = 1` for the actual type we want. # # As a result, we do not try to namespace this and just error out - if len(self.global_types) != len(self.bitmap_map) + len(self.enum_map) + len(self.struct_map): + if len(self.global_types) != len(self.bitmap_map) + len(self.enum_map) + len(self.struct_map) + len(self.typedef_map): raise ValueError("Global type names are not unique.") def merge_global_types_into_cluster(self, cluster: Cluster) -> Cluster: @@ -604,6 +614,10 @@ def merge_global_types_into_cluster(self, cluster: Cluster) -> Cluster: global_types_added.add(type_name) changed = True cluster.structs.append(self.struct_map[type_name]) + elif type_name in self.typedef_map: + global_types_added.add(type_name) + changed = True + cluster.typedefs.append(self.typedef_map[type_name]) return cluster @@ -638,7 +652,11 @@ def __init__(self, skip_meta: bool, merge_globals: bool): ) def parse(self, file: str, file_name: Optional[str] = None): - idl = self.transformer.transform(self.parser.parse(file)) + idl = None + try: + idl = self.transformer.transform(self.parser.parse(file)) + except Exception as e: + raise Exception(f"Failed to parse: {file_name}") from e idl.parse_file_name = file_name # ZAP may generate the same definition of clusters several times. diff --git a/scripts/py_matter_idl/matter_idl/matter_idl_types.py b/scripts/py_matter_idl/matter_idl/matter_idl_types.py index d4a2195457ed60..4aee2ef3678441 100644 --- a/scripts/py_matter_idl/matter_idl/matter_idl_types.py +++ b/scripts/py_matter_idl/matter_idl/matter_idl_types.py @@ -206,6 +206,13 @@ class Bitmap: is_global: bool = False +@dataclass +class Typedef: + name: str + base_type: str + api_maturity: ApiMaturity = ApiMaturity.STABLE + is_global: bool = False + @dataclass class Command: name: str @@ -235,6 +242,7 @@ class Cluster: events: List[Event] = field(default_factory=list) attributes: List[Attribute] = field(default_factory=list) structs: List[Struct] = field(default_factory=list) + typedefs: List[Typedef] = field(default_factory=list) commands: List[Command] = field(default_factory=list) description: Optional[str] = None api_maturity: ApiMaturity = ApiMaturity.STABLE @@ -297,6 +305,7 @@ class Idl: global_bitmaps: List[Bitmap] = field(default_factory=list) global_enums: List[Enum] = field(default_factory=list) global_structs: List[Struct] = field(default_factory=list) + global_typedefs: List[Typedef] = field(default_factory=list) # IDL file name is available only if parsing provides a file name parse_file_name: Optional[str] = field(default=None) diff --git a/scripts/py_matter_idl/matter_idl/test_matter_idl_parser.py b/scripts/py_matter_idl/matter_idl/test_matter_idl_parser.py index ab79c279b0697f..319567d7ff6ee8 100755 --- a/scripts/py_matter_idl/matter_idl/test_matter_idl_parser.py +++ b/scripts/py_matter_idl/matter_idl/test_matter_idl_parser.py @@ -336,6 +336,20 @@ def test_cluster_enum(self): )]) self.assertIdlEqual(actual, expected) + def test_cluster_typedef(self): + actual = parseText(""" + client cluster WithTypedefs = 0xab { + typedef TestTypedef : int16u + } + """) + expected = Idl(clusters=[ + Cluster(name="WithTypedefs", + code=0xab, + typedefs=[ + Typedef(name="TestTypedef", base_type="int16u")], + )]) + self.assertIdlEqual(actual, expected) + def test_event_field_api_maturity(self): actual = parseText(""" server cluster MaturityTest = 1 { diff --git a/scripts/py_matter_idl/matter_idl/zapxml/handlers/handlers.py b/scripts/py_matter_idl/matter_idl/zapxml/handlers/handlers.py index a303f263f10bc1..0b9700fd9ff2a2 100644 --- a/scripts/py_matter_idl/matter_idl/zapxml/handlers/handlers.py +++ b/scripts/py_matter_idl/matter_idl/zapxml/handlers/handlers.py @@ -16,7 +16,7 @@ from typing import Any, Optional from matter_idl.matter_idl_types import (Attribute, Bitmap, Cluster, Command, CommandQuality, ConstantEntry, DataType, Enum, Event, - EventPriority, EventQuality, Field, FieldQuality, Idl, Struct, StructQuality, StructTag) + EventPriority, EventQuality, Field, FieldQuality, Idl, Struct, StructQuality, StructTag, Typedef) from .base import BaseHandler, HandledDepth from .context import Context, IdlPostProcessor @@ -355,6 +355,43 @@ def FinalizeProcessing(self, idl: Idl): def EndProcessing(self): self.context.AddIdlPostProcessor(self) +class TypedefHandler(BaseHandler, IdlPostProcessor): + """ Handling /configurator/typedef elements.""" + + def __init__(self, context: Context, attrs): + super().__init__(context) + + # no cluster codes means global. Note that at the time + # of writing this, no global typedefs were defined in XMLs + self._cluster_codes = set() + self.typedef = Typedef(name=attrs['name'], + base_type=attrs['type']) + + def GetNextProcessor(self, name, attrs): + if name.lower() == 'cluster': + self._cluster_codes.add(ParseInt(attrs['code'])) + return BaseHandler(self.context, handled=HandledDepth.SINGLE_TAG) + else: + return BaseHandler(self.context) + + def FinalizeProcessing(self, idl: Idl): + if not self._cluster_codes: + idl.global_typedefs.append(self._typedef) + return + + found = set() + for c in idl.clusters: + if c.code in self._cluster_codes: + c.typedefs.append(self._typedef) + found.add(c.code) + + if found != self._cluster_codes: + LOGGER.error('Typedef %s could not find its clusters (codes: %r)' % + (self._typedef.name, self._cluster_codes - found)) + + def EndProcessing(self): + self.context.AddIdlPostProcessor(self) + class FeaturesHandler(BaseHandler): """Handles .../features @@ -704,5 +741,7 @@ def GetNextProcessor(self, name: str, attrs): return BaseHandler(self.context, handled=HandledDepth.ENTIRE_TREE) elif name.lower() == 'global': return GlobalHandler(self.context) + elif name.lower() == 'typedef': + return TypedefHandler(self.context, attrs) else: return BaseHandler(self.context) diff --git a/scripts/tools/zap_regen_all.py b/scripts/tools/zap_regen_all.py index 0284e9eff9dd93..67ae891105bdca 100755 --- a/scripts/tools/zap_regen_all.py +++ b/scripts/tools/zap_regen_all.py @@ -311,6 +311,8 @@ def codeFormat(self): def generate(self) -> TargetRunStats: generate_start = time.time() + logging.info("Executing: %s" % self.command) + subprocess.check_call(self.command) self.codeFormat() diff --git a/src/app/zap-templates/partials/idl/cluster_definition.zapt b/src/app/zap-templates/partials/idl/cluster_definition.zapt index be431ae7d7cc2c..ba78e828d27fdb 100644 --- a/src/app/zap-templates/partials/idl/cluster_definition.zapt +++ b/src/app/zap-templates/partials/idl/cluster_definition.zapt @@ -22,6 +22,10 @@ cluster {{asUpperCamelCase name}} = {{!}} } {{/zcl_enums}} + {{#zcl_typedefs}} + typedef {{asUpperCamelCase name preserveAcronyms=true}} : {{type}}; + + {{/zcl_typedefs}} {{#zcl_bitmaps}} bitmap {{asUpperCamelCase name preserveAcronyms=true}} : bitmap{{multiply size 8}} { {{#zcl_bitmap_items}} diff --git a/src/app/zap-templates/partials/idl/global_types.zapt b/src/app/zap-templates/partials/idl/global_types.zapt index bd72b43b2b36b5..f793ea9cede903 100644 --- a/src/app/zap-templates/partials/idl/global_types.zapt +++ b/src/app/zap-templates/partials/idl/global_types.zapt @@ -8,6 +8,12 @@ enum {{asUpperCamelCase name preserveAcronyms=true}} : enum{{multiply size 8}} { {{/if}} {{/zcl_enums}} +{{#zcl_typedefs}} +{{#if has_no_clusters}} +typedef {{asUpperCamelCase name preserveAcronyms=true}} : {{type}}; + +{{/if}} +{{/zcl_typedefs}} {{#zcl_bitmaps}} {{#if has_no_clusters}} {{#if_is_atomic name}} diff --git a/src/app/zap-templates/templates/app/cluster-typedefs-check.zapt b/src/app/zap-templates/templates/app/cluster-typedefs-check.zapt new file mode 100644 index 00000000000000..a2a3d4ac1e4f4e --- /dev/null +++ b/src/app/zap-templates/templates/app/cluster-typedefs-check.zapt @@ -0,0 +1,29 @@ +{{> header}} + +#pragma once + +#include + +namespace chip { +namespace app { +namespace Clusters { +{{#zcl_typedefs}} +{{#if has_more_than_one_cluster}} +{{> cluster_typedefs_ensure_known_value ns="detail"}} +{{else if has_no_clusters}} +{{> cluster_typedefs_ensure_known_value ns="Globals"}} + +{{/if}} +{{/zcl_typedefs}} + +{{#zcl_clusters}} +{{#zcl_typedefs}} +{{#unless has_more_than_one_cluster}} +{{> cluster_typedefs_ensure_known_value ns=(asUpperCamelCase ../name)}} +{{/unless}} +{{/zcl_typedefs}} + +{{/zcl_clusters}} +} // namespace Clusters +} // namespace app +} // namespace chip diff --git a/src/app/zap-templates/templates/app/cluster-typedefs.zapt b/src/app/zap-templates/templates/app/cluster-typedefs.zapt new file mode 100644 index 00000000000000..18382e0188fdb6 --- /dev/null +++ b/src/app/zap-templates/templates/app/cluster-typedefs.zapt @@ -0,0 +1,53 @@ +{{> header}} + +#pragma once + +#include + + +namespace chip { +namespace app { +namespace Clusters { + +namespace detail { +// typedefs shared across multiple clusters. +{{#zcl_typedefs}} + +{{#if has_more_than_one_cluster}} + +{{> cluster_typedefs_enum ns=""}} + +{{/if}} +{{/zcl_typedefs}} + +} // namespace detail + +namespace Globals { +// Global typedefs. +{{#zcl_typedefs}} + +{{#if has_no_clusters}} + +{{> cluster_typedefs_enum ns=""}} + +{{/if}} +{{/zcl_typedefs}} +} // namespace Globals + +{{#zcl_clusters}} +namespace {{asUpperCamelCase name}} { +{{#zcl_typedefs}} + +{{#if has_more_than_one_cluster}} +using {{asUpperCamelCase name}} = Clusters::detail::{{asUpperCamelCase name}}; +{{else}} +{{> cluster_typedefs_enum ns=(asUpperCamelCase ../name)}} + +{{/if}} +{{/zcl_typedefs}} +} // namespace {{asUpperCamelCase name}} + +{{/zcl_clusters}} +} // namespace Clusters +} // namespace app +} // namespace chip diff --git a/src/app/zap-templates/zcl/zcl-with-test-extensions.json b/src/app/zap-templates/zcl/zcl-with-test-extensions.json index 39301cdc30cecc..faa817ff254cec 100644 --- a/src/app/zap-templates/zcl/zcl-with-test-extensions.json +++ b/src/app/zap-templates/zcl/zcl-with-test-extensions.json @@ -683,7 +683,7 @@ }, "mandatoryDeviceTypes": "0x0016", "defaultReportingPolicy": "mandatory", - "ZCLDataTypes": ["ARRAY", "BITMAP", "ENUM", "NUMBER", "STRING", "STRUCT"], + "ZCLDataTypes": ["ARRAY", "BITMAP", "ENUM", "NUMBER", "STRING", "STRUCT", "TYPEDEF"], "fabricHandling": { "automaticallyCreateFields": true, "indexFieldId": 254, diff --git a/src/app/zap-templates/zcl/zcl.json b/src/app/zap-templates/zcl/zcl.json index c2de6acabf2951..f89f3fb6bb5637 100644 --- a/src/app/zap-templates/zcl/zcl.json +++ b/src/app/zap-templates/zcl/zcl.json @@ -677,7 +677,7 @@ }, "mandatoryDeviceTypes": "0x0016", "defaultReportingPolicy": "mandatory", - "ZCLDataTypes": ["ARRAY", "BITMAP", "ENUM", "NUMBER", "STRING", "STRUCT"], + "ZCLDataTypes": ["ARRAY", "BITMAP", "ENUM", "NUMBER", "STRING", "STRUCT", "TYPEDEF"], "fabricHandling": { "automaticallyCreateFields": true, "indexFieldId": 254, diff --git a/src/controller/java/templates/partials/decode_value.zapt b/src/controller/java/templates/partials/decode_value.zapt index 6401ef1c8b7f12..726ab0df3f9a6b 100644 --- a/src/controller/java/templates/partials/decode_value.zapt +++ b/src/controller/java/templates/partials/decode_value.zapt @@ -26,59 +26,64 @@ if ({{source}}.IsNull()) { chip::JniReferences::GetInstance().AddToList({{target}}, newElement_{{depth}}); } {{else}} - {{#if_is_struct type}} - {{#zcl_struct_items_by_struct_and_cluster_name type cluster}} - {{>decode_value target=(concat ../target "_" (asLowerCamelCase label)) source=(concat ../source "." (asLowerCamelCase label)) cluster=../cluster depth=(incrementDepth ../depth) omitDeclaration=false earlyReturn=../earlyReturn}} - {{/zcl_struct_items_by_struct_and_cluster_name}} + {{#if_is_typedef type}} + {{#zcl_typedef_by_typedef_and_cluster_name type cluster}} + {{>decode_value type=typeId target=target source=source errorCode=errorCode depth=(incrementDepth ../depth) isNullable=isNullable omitDeclaration=omitDeclaration earlyReturn=earlyReturn }} + {{/zcl_typedef_by_typedef_and_cluster_name}} + {{else}} + {{#if_is_struct type}} + {{#zcl_struct_items_by_struct_and_cluster_name type cluster}} + {{>decode_value target=(concat ../target "_" (asLowerCamelCase label)) source=(concat ../source "." (asLowerCamelCase label)) cluster=../cluster depth=(incrementDepth ../depth) omitDeclaration=false earlyReturn=../earlyReturn}} + {{/zcl_struct_items_by_struct_and_cluster_name}} - { - jclass {{asLowerCamelCase type}}StructClass_{{depth}}; - err = chip::JniReferences::GetInstance().GetLocalClassRef(env, "chip/devicecontroller/ChipStructs${{asUpperCamelCase cluster}}Cluster{{asUpperCamelCase type}}", {{asLowerCamelCase type}}StructClass_{{depth}}); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs${{asUpperCamelCase cluster}}Cluster{{asUpperCamelCase type}}"); - return {{earlyReturn}}; - } + { + jclass {{asLowerCamelCase type}}StructClass_{{depth}}; + err = chip::JniReferences::GetInstance().GetLocalClassRef(env, "chip/devicecontroller/ChipStructs${{asUpperCamelCase cluster}}Cluster{{asUpperCamelCase type}}", {{asLowerCamelCase type}}StructClass_{{depth}}); + if (err != CHIP_NO_ERROR) { + ChipLogError(Zcl, "Could not find class ChipStructs${{asUpperCamelCase cluster}}Cluster{{asUpperCamelCase type}}"); + return {{earlyReturn}}; + } - jmethodID {{asLowerCamelCase type}}StructCtor_{{depth}}; - err = chip::JniReferences::GetInstance().FindMethod( - env, {{asLowerCamelCase type}}StructClass_{{depth}}, "", - "({{#zcl_struct_items_by_struct_and_cluster_name type cluster}}{{asJniSignature type null (asUpperCamelCase ../cluster) true}}{{/zcl_struct_items_by_struct_and_cluster_name}})V", - &{{asLowerCamelCase type}}StructCtor_{{depth}}); - if (err != CHIP_NO_ERROR || {{asLowerCamelCase type}}StructCtor_{{depth}} == nullptr) { - ChipLogError(Zcl, "Could not find ChipStructs${{asUpperCamelCase cluster}}Cluster{{asUpperCamelCase type}} constructor"); - return {{earlyReturn}}; - } + jmethodID {{asLowerCamelCase type}}StructCtor_{{depth}}; + err = chip::JniReferences::GetInstance().FindMethod( + env, {{asLowerCamelCase type}}StructClass_{{depth}}, "", + "({{#zcl_struct_items_by_struct_and_cluster_name type cluster}}{{asJniSignature type null (asUpperCamelCase ../cluster) true}}{{/zcl_struct_items_by_struct_and_cluster_name}})V", + &{{asLowerCamelCase type}}StructCtor_{{depth}}); + if (err != CHIP_NO_ERROR || {{asLowerCamelCase type}}StructCtor_{{depth}} == nullptr) { + ChipLogError(Zcl, "Could not find ChipStructs${{asUpperCamelCase cluster}}Cluster{{asUpperCamelCase type}} constructor"); + return {{earlyReturn}}; + } {{target}} = env->NewObject({{asLowerCamelCase type}}StructClass_{{depth}}, {{asLowerCamelCase type}}StructCtor_{{depth}} {{#zcl_struct_items_by_struct_and_cluster_name type cluster}} , {{../target}}_{{asLowerCamelCase label}} {{/zcl_struct_items_by_struct_and_cluster_name}} ); - } - {{else}} - {{#if_is_strongly_typed_chip_enum type}} - std::string {{target}}ClassName = "{{asJniClassName type null (asUpperCamelCase cluster)}}"; - std::string {{target}}CtorSignature = "({{asJniSignature type null (asUpperCamelCase cluster) false}})V"; - {{asJniBasicType type false}} jni{{target}} = static_cast<{{asJniBasicType type false}}>({{source}}); - chip::JniReferences::GetInstance().CreateBoxedObject<{{asJniBasicType type false}}>({{target}}ClassName.c_str(), {{target}}CtorSignature.c_str(), jni{{target}}, {{target}}); {{else}} - {{#if (isOctetString type)}} - jbyteArray {{target}}ByteArray = env->NewByteArray(static_cast({{source}}.size())); - env->SetByteArrayRegion({{target}}ByteArray, 0, static_cast({{source}}.size()), reinterpret_cast({{source}}.data())); - {{target}} = {{target}}ByteArray; - {{else if (isCharString type)}} - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF({{source}}, {{target}})); - {{else}} + {{#if_is_strongly_typed_chip_enum type}} std::string {{target}}ClassName = "{{asJniClassName type null (asUpperCamelCase cluster)}}"; std::string {{target}}CtorSignature = "({{asJniSignature type null (asUpperCamelCase cluster) false}})V"; - {{#if_is_strongly_typed_bitmap type}} - {{asJniBasicType type false}} jni{{target}} = static_cast<{{asJniBasicType type false}}>({{source}}.Raw()); - chip::JniReferences::GetInstance().CreateBoxedObject<{{asJniBasicType type false}}>({{target}}ClassName.c_str(), {{target}}CtorSignature.c_str(), jni{{target}}, {{target}}); + {{asJniBasicType type false}} jni{{target}} = static_cast<{{asJniBasicType type false}}>({{source}}); + chip::JniReferences::GetInstance().CreateBoxedObject<{{asJniBasicType type false}}>({{target}}ClassName.c_str(), {{target}}CtorSignature.c_str(), jni{{target}}, {{target}}); + {{else}} + {{#if (isOctetString type)}} + jbyteArray {{target}}ByteArray = env->NewByteArray(static_cast({{source}}.size())); + env->SetByteArrayRegion({{target}}ByteArray, 0, static_cast({{source}}.size()), reinterpret_cast({{source}}.data())); + {{target}} = {{target}}ByteArray; + {{else if (isCharString type)}} + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF({{source}}, {{target}})); {{else}} - {{asJniBasicType type false}} jni{{target}} = static_cast<{{asJniBasicType type false}}>({{source}}); - chip::JniReferences::GetInstance().CreateBoxedObject<{{asJniBasicType type false}}>({{target}}ClassName.c_str(), {{target}}CtorSignature.c_str(), jni{{target}}, {{target}}); - {{/if_is_strongly_typed_bitmap}} - {{/if}} - {{/if_is_strongly_typed_chip_enum}} - {{/if_is_struct}} + std::string {{target}}ClassName = "{{asJniClassName type null (asUpperCamelCase cluster)}}"; + std::string {{target}}CtorSignature = "({{asJniSignature type null (asUpperCamelCase cluster) false}})V"; + {{#if_is_strongly_typed_bitmap type}} + {{asJniBasicType type false}} jni{{target}} = static_cast<{{asJniBasicType type false}}>({{source}}.Raw()); + chip::JniReferences::GetInstance().CreateBoxedObject<{{asJniBasicType type false}}>({{target}}ClassName.c_str(), {{target}}CtorSignature.c_str(), jni{{target}}, {{target}}); + {{else}} + {{asJniBasicType type false}} jni{{target}} = static_cast<{{asJniBasicType type false}}>({{source}}); + chip::JniReferences::GetInstance().CreateBoxedObject<{{asJniBasicType type false}}>({{target}}ClassName.c_str(), {{target}}CtorSignature.c_str(), jni{{target}}, {{target}}); + {{/if_is_strongly_typed_bitmap}} + {{/if}} + {{/if_is_strongly_typed_chip_enum}} + {{/if_is_struct}} + {{/if_is_typedef}} {{/if}} \ No newline at end of file diff --git a/src/controller/java/templates/templates.json b/src/controller/java/templates/templates.json index 5ff5eb7ef0dad5..4a04bec24af685 100644 --- a/src/controller/java/templates/templates.json +++ b/src/controller/java/templates/templates.json @@ -24,10 +24,6 @@ "name": "cluster_header", "path": "../../../app/zap-templates/partials/cluster_header.zapt" }, - { - "name": "encode_value", - "path": "partials/encode_value.zapt" - }, { "name": "decode_value", "path": "partials/decode_value.zapt" diff --git a/src/controller/python/templates/partials/typedef_def.zapt b/src/controller/python/templates/partials/typedef_def.zapt new file mode 100644 index 00000000000000..1a8a953a77b392 --- /dev/null +++ b/src/controller/python/templates/partials/typedef_def.zapt @@ -0,0 +1 @@ + {{asType label}} = '{{zapTypeToPythonClusterObjectType type ns=../cluster}}' diff --git a/src/controller/python/templates/python-CHIPClusters-py.zapt b/src/controller/python/templates/python-CHIPClusters-py.zapt index 284cd650a0a772..8d3ab8bc6b0186 100644 --- a/src/controller/python/templates/python-CHIPClusters-py.zapt +++ b/src/controller/python/templates/python-CHIPClusters-py.zapt @@ -26,8 +26,12 @@ class ChipClusters: {{#zcl_command_arguments}} {{#if_is_struct type}} "{{asLowerCamelCase label}}": "{{type}}", - {{else}} + {{else}} + {{#if_is_typedef type}} + "{{asLowerCamelCase label}}": "{{type}}", + {{else}} "{{asLowerCamelCase label}}": "{{#if (isCharString type)}}str{{else}}{{as_underlying_python_zcl_type type ../../id}}{{/if}}", + {{/if_is_typedef}} {{/if_is_struct}} {{/zcl_command_arguments}} }, diff --git a/src/controller/python/templates/python-cluster-Objects-py.zapt b/src/controller/python/templates/python-cluster-Objects-py.zapt index 381d266668082a..8689d7e21cf34d 100644 --- a/src/controller/python/templates/python-cluster-Objects-py.zapt +++ b/src/controller/python/templates/python-cluster-Objects-py.zapt @@ -2,7 +2,7 @@ {{> header}} ''' -# This file contains generated struct, enum, command definition. +# This file contains generated struct, enum, typedef, and command definition. # Users are not expected to import this file, instead, users can use import chip.clusters, # which will import all symbols from this file and can get a readable, pretty naming like # clusters.OnOff.commands.OnCommand @@ -55,6 +55,13 @@ class Globals: {{/if}} {{/zcl_structs}} + class Typedefs: +{{#zcl_typedefs}} +{{#if has_no_clusters}} +{{> typedef_def cluster="Globals"}} + +{{/if}} +{{/zcl_typedefs}} {{#zcl_clusters}} @@ -106,6 +113,13 @@ class {{asUpperCamelCase name}}(Cluster): {{> struct_def cluster=(asUpperCamelCase parent.name) }} {{/zcl_structs}} +{{#zcl_typedefs}} +{{#first}} + class Typedefs: +{{/first}} +{{> typedef_def cluster=(asUpperCamelCase parent.name) }} + +{{/zcl_typedefs}} {{#zcl_commands}} {{#first}} class Commands: diff --git a/src/controller/python/templates/templates.json b/src/controller/python/templates/templates.json index ebe67b0f384b22..8b0c0f4b368d2b 100644 --- a/src/controller/python/templates/templates.json +++ b/src/controller/python/templates/templates.json @@ -32,6 +32,10 @@ { "name": "struct_def", "path": "partials/struct_def.zapt" + }, + { + "name": "typedef_def", + "path": "partials/typedef_def.zapt" } ], "templates": [ diff --git a/src/darwin/Framework/CHIP/templates/partials/decode_value.zapt b/src/darwin/Framework/CHIP/templates/partials/decode_value.zapt index 16a9acbc6d4048..ae178118abb36f 100644 --- a/src/darwin/Framework/CHIP/templates/partials/decode_value.zapt +++ b/src/darwin/Framework/CHIP/templates/partials/decode_value.zapt @@ -27,31 +27,37 @@ {{target}} = array_{{depth}}; } {{else}} - {{#if_is_struct type}} - {{target}} = [{{asObjectiveCClass type cluster forceNotList=true}} new]; - {{#zcl_struct_items_by_struct_and_cluster_name type cluster}} - {{#if (isSupported (asUpperCamelCase ../cluster preserveAcronyms=true) struct=(asUpperCamelCase ../type preserveAcronyms=true) structField=(asStructPropertyName label))}} - {{>decode_value target=(concat ../target "." (asStructPropertyName label)) source=(concat ../source "." (asLowerCamelCase label)) cluster=../cluster errorCode=../errorCode depth=(incrementDepth ../depth) }} - {{/if}} - {{/zcl_struct_items_by_struct_and_cluster_name}} + {{#if_is_typedef type}} + {{#zcl_typedef_by_typedef_and_cluster_name type cluster}} + {{>decode_value type=typeId target=target source=source errorCode=errorCode depth=(incrementDepth ../depth) }} + {{/zcl_typedef_by_typedef_and_cluster_name}} {{else}} - {{#if_is_strongly_typed_chip_enum type}} - {{target}} = [NSNumber numberWith{{asObjectiveCNumberType "" type false}}:chip::to_underlying({{source}})]; + {{#if_is_struct type}} + {{target}} = [{{asObjectiveCClass type cluster forceNotList=true}} new]; + {{#zcl_struct_items_by_struct_and_cluster_name type cluster}} + {{#if (isSupported (asUpperCamelCase ../cluster preserveAcronyms=true) struct=(asUpperCamelCase ../type preserveAcronyms=true) structField=(asStructPropertyName label))}} + {{>decode_value target=(concat ../target "." (asStructPropertyName label)) source=(concat ../source "." (asLowerCamelCase label)) cluster=../cluster errorCode=../errorCode depth=(incrementDepth ../depth) }} + {{/if}} + {{/zcl_struct_items_by_struct_and_cluster_name}} {{else}} - {{#if_is_strongly_typed_bitmap type}} - {{target}} = [NSNumber numberWith{{asObjectiveCNumberType "" type false}}:{{source}}.Raw()]; - {{else if (isOctetString type)}} - {{target}} = AsData({{source}}); - {{else if (isCharString type)}} - {{target}} = AsString({{source}}); - if ({{target}} == nil) { - {{! Invalid UTF-8. Just make up an error for now. }} - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - {{errorCode}} - } + {{#if_is_strongly_typed_chip_enum type}} + {{target}} = [NSNumber numberWith{{asObjectiveCNumberType "" type false}}:chip::to_underlying({{source}})]; {{else}} - {{target}} = [NSNumber numberWith{{asObjectiveCNumberType "" type false}}:{{source}}]; - {{/if_is_strongly_typed_bitmap}} - {{/if_is_strongly_typed_chip_enum}} - {{/if_is_struct}} + {{#if_is_strongly_typed_bitmap type}} + {{target}} = [NSNumber numberWith{{asObjectiveCNumberType "" type false}}:{{source}}.Raw()]; + {{else if (isOctetString type)}} + {{target}} = AsData({{source}}); + {{else if (isCharString type)}} + {{target}} = AsString({{source}}); + if ({{target}} == nil) { + {{! Invalid UTF-8. Just make up an error for now. }} + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + {{errorCode}} + } + {{else}} + {{target}} = [NSNumber numberWith{{asObjectiveCNumberType "" type false}}:{{source}}]; + {{/if_is_strongly_typed_bitmap}} + {{/if_is_strongly_typed_chip_enum}} + {{/if_is_struct}} + {{/if_is_typedef}} {{/if}} diff --git a/src/darwin/Framework/CHIP/templates/partials/encode_value.zapt b/src/darwin/Framework/CHIP/templates/partials/encode_value.zapt index f2f4d076b72bfc..4900e74999567c 100644 --- a/src/darwin/Framework/CHIP/templates/partials/encode_value.zapt +++ b/src/darwin/Framework/CHIP/templates/partials/encode_value.zapt @@ -44,21 +44,27 @@ {{else if (isCharString type)}} {{target}} = AsCharSpan({{source}}); {{else}} - {{#if_is_struct type}} - {{#zcl_struct_items_by_struct_and_cluster_name type cluster}} - {{#if (isSupported (asUpperCamelCase ../cluster preserveAcronyms=true) struct=(asUpperCamelCase ../type preserveAcronyms=true) structField=(asStructPropertyName label))}} - {{>encode_value target=(concat ../target "." (asLowerCamelCase label)) source=(concat ../source "." (asStructPropertyName label)) cluster=../cluster errorCode=../errorCode depth=(incrementDepth ../depth)}} - {{/if}} - {{/zcl_struct_items_by_struct_and_cluster_name}} + {{#if_is_typedef type}} + {{#zcl_typedef_by_typedef_and_cluster_name type cluster}} + {{>encode_value type=typeId target=target source=source errorCode=errorCode depth=(incrementDepth ../depth) }} + {{/zcl_typedef_by_typedef_and_cluster_name}} {{else}} - {{#if_is_strongly_typed_chip_enum type}} - {{target}} = static_cast>({{source}}.{{asObjectiveCNumberType source type true}}Value); + {{#if_is_struct type}} + {{#zcl_struct_items_by_struct_and_cluster_name type cluster}} + {{#if (isSupported (asUpperCamelCase ../cluster preserveAcronyms=true) struct=(asUpperCamelCase ../type preserveAcronyms=true) structField=(asStructPropertyName label))}} + {{>encode_value target=(concat ../target "." (asLowerCamelCase label)) source=(concat ../source "." (asStructPropertyName label)) cluster=../cluster errorCode=../errorCode depth=(incrementDepth ../depth)}} + {{/if}} + {{/zcl_struct_items_by_struct_and_cluster_name}} {{else}} - {{#if_is_strongly_typed_bitmap type}} + {{#if_is_strongly_typed_chip_enum type}} {{target}} = static_cast>({{source}}.{{asObjectiveCNumberType source type true}}Value); {{else}} - {{target}} = {{source}}.{{asObjectiveCNumberType source type true}}Value; - {{/if_is_strongly_typed_bitmap}} - {{/if_is_strongly_typed_chip_enum}} - {{/if_is_struct}} + {{#if_is_strongly_typed_bitmap type}} + {{target}} = static_cast>({{source}}.{{asObjectiveCNumberType source type true}}Value); + {{else}} + {{target}} = {{source}}.{{asObjectiveCNumberType source type true}}Value; + {{/if_is_strongly_typed_bitmap}} + {{/if_is_strongly_typed_chip_enum}} + {{/if_is_struct}} + {{/if_is_typedef}} {{/if}} diff --git a/src/darwin/Framework/CHIP/templates/partials/typedef_decl.zapt b/src/darwin/Framework/CHIP/templates/partials/typedef_decl.zapt new file mode 100644 index 00000000000000..86deb02b28dbb6 --- /dev/null +++ b/src/darwin/Framework/CHIP/templates/partials/typedef_decl.zapt @@ -0,0 +1,2 @@ +{{! Arguments: cluster (might be "Globals", is not case-canonicalized), name, typedefLabel }} +typedef {{asObjectiveCType type cluster}} {{asUnderlyingZclType name}}; \ No newline at end of file diff --git a/src/darwin/Framework/CHIP/templates/templates.json b/src/darwin/Framework/CHIP/templates/templates.json index d7e4b2106bc98e..5fffbfd268ba23 100644 --- a/src/darwin/Framework/CHIP/templates/templates.json +++ b/src/darwin/Framework/CHIP/templates/templates.json @@ -56,6 +56,10 @@ "name": "enum_decl", "path": "partials/enum_decl.zapt" }, + { + "name": "typedef_decl", + "path": "partials/typedef_decl.zapt" + }, { "name": "renamed_struct_field_impl", "path": "partials/renamed_struct_field_impl.zapt" From 50988c41ac786ecd9577ca0cd945db284d7da5a0 Mon Sep 17 00:00:00 2001 From: marcos <15697303+gmarcosb@users.noreply.github.com> Date: Fri, 18 Oct 2024 15:32:08 -0600 Subject: [PATCH 04/20] Update zapt templates to handle typedef --- .../templates/app/cluster-typedefs-check.zapt | 29 ------------------- .../zcl/data-model/chip/global-structs.xml | 1 + .../zcl/data-model/chip/global-typedefs.xml | 29 +++++++++++++++++++ .../zcl/data-model/chip/test-cluster.xml | 24 +++++++++++++++ src/app/zap-templates/zcl/zcl.json | 1 + src/app/zap-templates/zcl/zcl.xsd | 13 ++++++++- .../java/templates/partials/decode_value.zapt | 1 + .../CHIP/templates/MTRBaseClusters.zapt | 11 +++++++ .../CHIP/templates/partials/typedef_decl.zapt | 2 +- 9 files changed, 80 insertions(+), 31 deletions(-) delete mode 100644 src/app/zap-templates/templates/app/cluster-typedefs-check.zapt create mode 100644 src/app/zap-templates/zcl/data-model/chip/global-typedefs.xml diff --git a/src/app/zap-templates/templates/app/cluster-typedefs-check.zapt b/src/app/zap-templates/templates/app/cluster-typedefs-check.zapt deleted file mode 100644 index a2a3d4ac1e4f4e..00000000000000 --- a/src/app/zap-templates/templates/app/cluster-typedefs-check.zapt +++ /dev/null @@ -1,29 +0,0 @@ -{{> header}} - -#pragma once - -#include - -namespace chip { -namespace app { -namespace Clusters { -{{#zcl_typedefs}} -{{#if has_more_than_one_cluster}} -{{> cluster_typedefs_ensure_known_value ns="detail"}} -{{else if has_no_clusters}} -{{> cluster_typedefs_ensure_known_value ns="Globals"}} - -{{/if}} -{{/zcl_typedefs}} - -{{#zcl_clusters}} -{{#zcl_typedefs}} -{{#unless has_more_than_one_cluster}} -{{> cluster_typedefs_ensure_known_value ns=(asUpperCamelCase ../name)}} -{{/unless}} -{{/zcl_typedefs}} - -{{/zcl_clusters}} -} // namespace Clusters -} // namespace app -} // namespace chip diff --git a/src/app/zap-templates/zcl/data-model/chip/global-structs.xml b/src/app/zap-templates/zcl/data-model/chip/global-structs.xml index 743fdf366b724b..00f34435c735cc 100644 --- a/src/app/zap-templates/zcl/data-model/chip/global-structs.xml +++ b/src/app/zap-templates/zcl/data-model/chip/global-structs.xml @@ -38,5 +38,6 @@ limitations under the License. + diff --git a/src/app/zap-templates/zcl/data-model/chip/global-typedefs.xml b/src/app/zap-templates/zcl/data-model/chip/global-typedefs.xml new file mode 100644 index 00000000000000..e9503344a22ada --- /dev/null +++ b/src/app/zap-templates/zcl/data-model/chip/global-typedefs.xml @@ -0,0 +1,29 @@ + + + + + + + + diff --git a/src/app/zap-templates/zcl/data-model/chip/test-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/test-cluster.xml index 258c7cba5106df..8b4e3c5b81fca1 100644 --- a/src/app/zap-templates/zcl/data-model/chip/test-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/test-cluster.xml @@ -59,8 +59,14 @@ limitations under the License. + + + + + + @@ -104,6 +110,10 @@ limitations under the License. + + + @@ -202,6 +212,8 @@ limitations under the License. global_enum global_struct + typedef_attr + global_typedef mei_int8u @@ -310,6 +324,7 @@ limitations under the License. + + + @@ -605,6 +622,12 @@ limitations under the License. + + + + + + @@ -657,6 +680,7 @@ limitations under the License. + diff --git a/src/app/zap-templates/zcl/zcl.json b/src/app/zap-templates/zcl/zcl.json index f89f3fb6bb5637..bf3c35c0b8de35 100644 --- a/src/app/zap-templates/zcl/zcl.json +++ b/src/app/zap-templates/zcl/zcl.json @@ -59,6 +59,7 @@ "global-bitmaps.xml", "global-enums.xml", "global-structs.xml", + "global-typedefs.xml", "groups-cluster.xml", "group-key-mgmt-cluster.xml", "icd-management-cluster.xml", diff --git a/src/app/zap-templates/zcl/zcl.xsd b/src/app/zap-templates/zcl/zcl.xsd index 1f78e6b9e076f0..75ca12447eec0b 100644 --- a/src/app/zap-templates/zcl/zcl.xsd +++ b/src/app/zap-templates/zcl/zcl.xsd @@ -147,6 +147,7 @@ This schema describes the format of the XML files, that describe the ZCL specifi + @@ -157,7 +158,7 @@ This schema describes the format of the XML files, that describe the ZCL specifi - + @@ -391,6 +392,16 @@ This schema describes the format of the XML files, that describe the ZCL specifi + + + + + + + + + + diff --git a/src/controller/java/templates/partials/decode_value.zapt b/src/controller/java/templates/partials/decode_value.zapt index 726ab0df3f9a6b..2a807d418924ff 100644 --- a/src/controller/java/templates/partials/decode_value.zapt +++ b/src/controller/java/templates/partials/decode_value.zapt @@ -59,6 +59,7 @@ if ({{source}}.IsNull()) { , {{../target}}_{{asLowerCamelCase label}} {{/zcl_struct_items_by_struct_and_cluster_name}} ); + } {{else}} {{#if_is_strongly_typed_chip_enum type}} std::string {{target}}ClassName = "{{asJniClassName type null (asUpperCamelCase cluster)}}"; diff --git a/src/darwin/Framework/CHIP/templates/MTRBaseClusters.zapt b/src/darwin/Framework/CHIP/templates/MTRBaseClusters.zapt index 6ca88e84dcad1a..e76a994cdad3bf 100644 --- a/src/darwin/Framework/CHIP/templates/MTRBaseClusters.zapt +++ b/src/darwin/Framework/CHIP/templates/MTRBaseClusters.zapt @@ -114,6 +114,13 @@ subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptio {{/if}} {{/zcl_enums}} +{{#zcl_typedefs}} +{{#if has_no_clusters}} +{{> typedef_decl cluster="Globals" name=name typedefLabel=label}} + +{{/if}} +{{/zcl_typedefs}} + {{#zcl_clusters}} {{#zcl_enums}} {{> enum_decl cluster=../name name=name enumLabel=label}} @@ -167,6 +174,10 @@ typedef NS_OPTIONS({{asUnderlyingZclType name}}, {{objCEnumName clusterName bitm {{/zcl_bitmaps}} +{{#zcl_typedefs}} +{{> typedef_decl cluster=../name name=name typedefLabel=label}} + +{{/zcl_typedefs}} {{/zcl_clusters}} {{#zcl_clusters}} diff --git a/src/darwin/Framework/CHIP/templates/partials/typedef_decl.zapt b/src/darwin/Framework/CHIP/templates/partials/typedef_decl.zapt index 86deb02b28dbb6..fa583cc0bd81fe 100644 --- a/src/darwin/Framework/CHIP/templates/partials/typedef_decl.zapt +++ b/src/darwin/Framework/CHIP/templates/partials/typedef_decl.zapt @@ -1,2 +1,2 @@ {{! Arguments: cluster (might be "Globals", is not case-canonicalized), name, typedefLabel }} -typedef {{asObjectiveCType type cluster}} {{asUnderlyingZclType name}}; \ No newline at end of file +typedef {{asObjectiveCType type cluster}} {{asUpperCamelCase typedefLabel preserveAcronyms=true}}; \ No newline at end of file From c27f1d4c8f1f0a9e3c71a51e4913e046f8ba7e51 Mon Sep 17 00:00:00 2001 From: marcos <15697303+gmarcosb@users.noreply.github.com> Date: Tue, 12 Nov 2024 15:17:30 -0700 Subject: [PATCH 05/20] Add global-typedefs.xml reference --- src/app/zap-templates/zcl/zcl-with-test-extensions.json | 1 + 1 file changed, 1 insertion(+) diff --git a/src/app/zap-templates/zcl/zcl-with-test-extensions.json b/src/app/zap-templates/zcl/zcl-with-test-extensions.json index faa817ff254cec..18cb5bb2a6685f 100644 --- a/src/app/zap-templates/zcl/zcl-with-test-extensions.json +++ b/src/app/zap-templates/zcl/zcl-with-test-extensions.json @@ -65,6 +65,7 @@ "global-bitmaps.xml", "global-enums.xml", "global-structs.xml", + "global-typedefs.xml", "groups-cluster.xml", "group-key-mgmt-cluster.xml", "icd-management-cluster.xml", From da0ec127549dcdef5de4c9796f0c274fe0004cbe Mon Sep 17 00:00:00 2001 From: marcos <15697303+gmarcosb@users.noreply.github.com> Date: Thu, 17 Oct 2024 10:18:58 -0600 Subject: [PATCH 06/20] Update zapt templates to handle typedef --- .../templates/partials/decodable_value.zapt | 28 +++--- .../data_model_xml/handlers/handlers.py | 26 +++++- .../matter_idl/generators/idl/MatterIdl.jinja | 3 + .../matter_idl/generators/java/__init__.py | 21 +++-- .../matter_idl/generators/kotlin/__init__.py | 4 +- .../matter_idl/generators/type_definitions.py | 47 +++++++++- .../matter_idl/matter_grammar.lark | 5 +- .../matter_idl/matter_idl_parser.py | 28 +++++- .../matter_idl/matter_idl_types.py | 9 ++ .../matter_idl/test_matter_idl_parser.py | 14 +++ .../matter_idl/zapxml/handlers/handlers.py | 41 ++++++++- scripts/tools/zap_regen_all.py | 2 + .../partials/idl/cluster_definition.zapt | 4 + .../partials/idl/global_types.zapt | 6 ++ .../templates/app/cluster-typedefs-check.zapt | 29 ++++++ .../templates/app/cluster-typedefs.zapt | 53 +++++++++++ .../zcl/zcl-with-test-extensions.json | 2 +- src/app/zap-templates/zcl/zcl.json | 2 +- .../java/templates/partials/decode_value.zapt | 91 ++++++++++--------- src/controller/java/templates/templates.json | 4 - .../templates/partials/typedef_def.zapt | 1 + .../templates/python-CHIPClusters-py.zapt | 6 +- .../templates/python-cluster-Objects-py.zapt | 16 +++- .../python/templates/templates.json | 4 + .../CHIP/templates/partials/decode_value.zapt | 54 ++++++----- .../CHIP/templates/partials/encode_value.zapt | 32 ++++--- .../CHIP/templates/partials/typedef_decl.zapt | 2 + .../Framework/CHIP/templates/templates.json | 4 + 28 files changed, 419 insertions(+), 119 deletions(-) create mode 100644 src/app/zap-templates/templates/app/cluster-typedefs-check.zapt create mode 100644 src/app/zap-templates/templates/app/cluster-typedefs.zapt create mode 100644 src/controller/python/templates/partials/typedef_def.zapt create mode 100644 src/darwin/Framework/CHIP/templates/partials/typedef_decl.zapt diff --git a/examples/darwin-framework-tool/templates/partials/decodable_value.zapt b/examples/darwin-framework-tool/templates/partials/decodable_value.zapt index 8d0442000a070c..07e791dcafa2a1 100644 --- a/examples/darwin-framework-tool/templates/partials/decodable_value.zapt +++ b/examples/darwin-framework-tool/templates/partials/decodable_value.zapt @@ -27,18 +27,24 @@ {{>decodable_value target=(concat ../target "." (asStructPropertyName label)) source=(concat ../source "." (asLowerCamelCase label)) cluster=../cluster depth=(incrementDepth ../depth) }} {{/zcl_struct_items_by_struct_and_cluster_name}} {{else}} - {{#if_is_strongly_typed_chip_enum type}} - {{target}} = [NSNumber numberWith{{asObjectiveCNumberType "" type false}}:chip::to_underlying({{source}})]; + {{#if_is_typedef type}} + {{#zcl_typedef_by_typedef_and_cluster_name type cluster}} + {{>decodable_value type=typeId target=target source=source errorCode=errorCode depth=(incrementDepth ../depth) }} + {{/zcl_typedef_by_typedef_and_cluster_name}} {{else}} - {{#if_is_strongly_typed_bitmap type}} - {{target}} = [NSNumber numberWith{{asObjectiveCNumberType "" type false}}:{{source}}.Raw()]; - {{else if (isOctetString type)}} - {{target}} = [NSData dataWithBytes:{{source}}.data() length:{{source}}.size()]; - {{else if (isCharString type)}} - {{target}} = [[NSString alloc] initWithBytes:{{source}}.data() length:{{source}}.size() encoding:NSUTF8StringEncoding]; + {{#if_is_strongly_typed_chip_enum type}} + {{target}} = [NSNumber numberWith{{asObjectiveCNumberType "" type false}}:chip::to_underlying({{source}})]; {{else}} - {{target}} = [NSNumber numberWith{{asObjectiveCNumberType "" type false}}:{{source}}]; - {{/if_is_strongly_typed_bitmap}} - {{/if_is_strongly_typed_chip_enum}} + {{#if_is_strongly_typed_bitmap type}} + {{target}} = [NSNumber numberWith{{asObjectiveCNumberType "" type false}}:{{source}}.Raw()]; + {{else if (isOctetString type)}} + {{target}} = [NSData dataWithBytes:{{source}}.data() length:{{source}}.size()]; + {{else if (isCharString type)}} + {{target}} = [[NSString alloc] initWithBytes:{{source}}.data() length:{{source}}.size() encoding:NSUTF8StringEncoding]; + {{else}} + {{target}} = [NSNumber numberWith{{asObjectiveCNumberType "" type false}}:{{source}}]; + {{/if_is_strongly_typed_bitmap}} + {{/if_is_strongly_typed_chip_enum}} + {{/if_is_typedef}} {{/if_is_struct}} {{/if}} diff --git a/scripts/py_matter_idl/matter_idl/data_model_xml/handlers/handlers.py b/scripts/py_matter_idl/matter_idl/data_model_xml/handlers/handlers.py index 858ec6a19f6d87..07664912f792c5 100644 --- a/scripts/py_matter_idl/matter_idl/data_model_xml/handlers/handlers.py +++ b/scripts/py_matter_idl/matter_idl/data_model_xml/handlers/handlers.py @@ -18,7 +18,7 @@ from xml.sax.xmlreader import AttributesImpl from matter_idl.matter_idl_types import (ApiMaturity, Attribute, AttributeQuality, Bitmap, Cluster, Command, CommandQuality, - ConstantEntry, DataType, Enum, Field, FieldQuality, Idl, Struct, StructTag) + ConstantEntry, DataType, Enum, Field, FieldQuality, Idl, Struct, StructTag, Typedef) from .base import BaseHandler, HandledDepth from .context import Context @@ -178,6 +178,10 @@ def GetNextProcessor(self, name: str, attrs: AttributesImpl): self._field.data_type.name = NormalizeDataType(attrs["type"]) return BaseHandler(self.context, handled=HandledDepth.SINGLE_TAG) + elif name == "typedef": + LOGGER.warning( + f"Anonymous typedef not supported when handling field {self._field.name}") + return BaseHandler(self.context, handled=HandledDepth.ENTIRE_TREE) else: return BaseHandler(self.context) @@ -281,6 +285,24 @@ def GetNextProcessor(self, name: str, attrs: AttributesImpl): else: return BaseHandler(self.context) +class TypedefHandler(BaseHandler): + def __init__(self, context: Context, cluster: Cluster, attrs: AttributesImpl): + super().__init__(context, handled=HandledDepth.SINGLE_TAG) + self._cluster = cluster + + # TODO: base type is GUESSED here because xml does not contain it + self._typedef = Typedef(name=NormalizeName( + attrs["name"]), base_type="UNKNOWN") + + def EndProcessing(self): + self._cluster.typedefs.append(self._typedef) + + def GetNextProcessor(self, name: str, attrs: AttributesImpl): + if name == "section": + # Documentation data, skipped + return BaseHandler(self.context, handled=HandledDepth.ENTIRE_TREE) + else: + return BaseHandler(self.context) class EventsHandler(BaseHandler): def __init__(self, context: Context, cluster: Cluster): @@ -548,6 +570,8 @@ def GetNextProcessor(self, name: str, attrs: AttributesImpl): return BitmapHandler(self.context, self._cluster, attrs) elif name == "struct": return StructHandler(self.context, self._cluster, attrs) + elif name == "typedef": + return TypedefHandler(self.context, self._cluster, attrs) else: return BaseHandler(self.context) diff --git a/scripts/py_matter_idl/matter_idl/generators/idl/MatterIdl.jinja b/scripts/py_matter_idl/matter_idl/generators/idl/MatterIdl.jinja index 0e132e581b7712..a7a83745693229 100644 --- a/scripts/py_matter_idl/matter_idl/generators/idl/MatterIdl.jinja +++ b/scripts/py_matter_idl/matter_idl/generators/idl/MatterIdl.jinja @@ -55,6 +55,9 @@ bitmap {{bitmap.name}} : {{ bitmap.base_type}} { {% endfor %} +{% for typedef in idl.global_typedefs %} +typedef {{typedef.name}} : {{ typedef.base_type}}; + {%- for cluster in idl.clusters %} {% if cluster.description %}/** {{cluster.description}} */ {% endif %} diff --git a/scripts/py_matter_idl/matter_idl/generators/java/__init__.py b/scripts/py_matter_idl/matter_idl/generators/java/__init__.py index d21107653dfb46..fd61e38bde2905 100644 --- a/scripts/py_matter_idl/matter_idl/generators/java/__init__.py +++ b/scripts/py_matter_idl/matter_idl/generators/java/__init__.py @@ -59,7 +59,7 @@ class GlobalType: def _UnderlyingType(field: Field, context: TypeLookupContext) -> Optional[str]: - actual = ParseDataType(field.data_type, context) + actual = ParseDataType(field.data_type, context, desugar_typedef = True) if isinstance(actual, (IdlEnumType, IdlBitmapType)): actual = actual.base_type @@ -132,7 +132,7 @@ def _CppType(field: Field, context: TypeLookupContext) -> str: if field.data_type.name.lower() in _KNOWN_DECODABLE_TYPES: return _KNOWN_DECODABLE_TYPES[field.data_type.name.lower()] - actual = ParseDataType(field.data_type, context) + actual = ParseDataType(field.data_type, context, desugar_typedef = True) if isinstance(actual, BasicString): if actual.is_binary: return 'chip::ByteSpan' @@ -278,7 +278,7 @@ def attributesWithSupportedCallback(attrs, context: TypeLookupContext): # Attributes will be generated for all types # except non-list structures if not attr.definition.is_list: - underlying = ParseDataType(attr.definition.data_type, context) + underlying = ParseDataType(attr.definition.data_type, context, desugar_typedef = True) if isinstance(underlying, IdlType): continue @@ -420,6 +420,10 @@ def is_bitmap(self): def is_untyped_bitmap(self): return self.context.is_untyped_bitmap_type(self.data_type.name) + @property + def is_typedef(self): + return self.context.is_typedef_type(self.data_type.name) + def clone(self): return EncodableValue(self.context, self.data_type, self.attrs) @@ -469,7 +473,7 @@ def jni_fundamental_type(self): @property def boxed_java_type(self): - t = ParseDataType(self.data_type, self.context) + t = ParseDataType(self.data_type, self.context, desugar_typedef = True) if isinstance(t, FundamentalType): if t == FundamentalType.BOOL: @@ -506,7 +510,7 @@ def boxed_java_type(self): @property def java_tlv_type(self): - t = ParseDataType(self.data_type, self.context) + t = ParseDataType(self.data_type, self.context, desugar_typedef = True) if isinstance(t, FundamentalType): if t == FundamentalType.BOOL: @@ -537,7 +541,8 @@ def java_tlv_type(self): @property def kotlin_type(self): - t = ParseDataType(self.data_type, self.context) + # TODO: Use inline value class where possible (types not defined in java) + t = ParseDataType(self.data_type, self.context, desugar_typedef = True) if isinstance(t, FundamentalType): if t == FundamentalType.BOOL: @@ -583,7 +588,7 @@ def unboxed_java_signature(self): if self.is_optional or self.is_list: raise Exception("Not a basic type: %r" % self) - t = ParseDataType(self.data_type, self.context) + t = ParseDataType(self.data_type, self.context, desugar_typedef = True) if isinstance(t, FundamentalType): if t == FundamentalType.BOOL: @@ -611,7 +616,7 @@ def boxed_java_signature(self): if self.is_list: return "Ljava/util/ArrayList;" - t = ParseDataType(self.data_type, self.context) + t = ParseDataType(self.data_type, self.context, desugar_typedef = True) if isinstance(t, FundamentalType): if t == FundamentalType.BOOL: diff --git a/scripts/py_matter_idl/matter_idl/generators/kotlin/__init__.py b/scripts/py_matter_idl/matter_idl/generators/kotlin/__init__.py index 405f505a0980d3..b7349f89100a19 100644 --- a/scripts/py_matter_idl/matter_idl/generators/kotlin/__init__.py +++ b/scripts/py_matter_idl/matter_idl/generators/kotlin/__init__.py @@ -471,6 +471,8 @@ def kotlin_type(self): return "UInt" else: return "ULong" + elif isinstance(t, IdlTypedefType): + return self.data_type.name else: return "Any" @@ -507,7 +509,7 @@ def boxed_java_signature(self): if self.is_list: return "Ljava/util/ArrayList;" - t = ParseDataType(self.data_type, self.context) + t = ParseDataType(self.data_type, self.context, desugar_typedef = True) if isinstance(t, FundamentalType): if t == FundamentalType.BOOL: diff --git a/scripts/py_matter_idl/matter_idl/generators/type_definitions.py b/scripts/py_matter_idl/matter_idl/generators/type_definitions.py index 4f9fa56779042b..44435eb4600391 100644 --- a/scripts/py_matter_idl/matter_idl/generators/type_definitions.py +++ b/scripts/py_matter_idl/matter_idl/generators/type_definitions.py @@ -161,6 +161,15 @@ def is_struct(self) -> bool: return self.item_type == IdlItemType.STRUCT +@dataclass +class IdlTypedefType: + """ + A typedef (concrete type that aliases another type) + """ + idl_name: str + base_type: Union[BasicInteger, BasicString, FundamentalType, IdlType, IdlEnumType, IdlBitmapType] + + # Data types, held by ZAP in chip-types.xml and generally by the spec. __CHIP_SIZED_TYPES__ = { "bitmap16": BasicInteger(idl_name="bitmap16", byte_count=2, is_signed=False), @@ -295,6 +304,13 @@ def find_bitmap(self, name) -> Optional[matter_idl_types.Bitmap]: return None + def find_typedef(self, name) -> Optional[matter_idl_types.Typedef]: + for s in self.all_typedefs: + if s.name == name: + return s + + return None + @property def all_enums(self): """ @@ -330,6 +346,18 @@ def all_structs(self): for e in self.cluster.structs: yield e + @property + def all_typedefs(self): + """ + All typedefs defined within this lookup context. + + typedefs are only defined at cluster level. If lookup context does not + include a typedef, the typedef list will be empty. + """ + if self.cluster: + for t in self.cluster.typedefs: + yield t + def is_enum_type(self, name: str): """ Determine if the given type name is an enumeration. @@ -347,6 +375,12 @@ def is_struct_type(self, name: str): """ return any(map(lambda s: s.name == name, self.all_structs)) + def is_typedef_type(self, name: str): + """ + Determine if the given type name is type that is known to be a typedef + """ + return any(map(lambda s: s.name == name, self.all_typedefs)) + def is_untyped_bitmap_type(self, name: str): """Determine if the given type is a untyped bitmap (just an interger size).""" return name.lower() in {"bitmap8", "bitmap16", "bitmap32", "bitmap64"} @@ -364,7 +398,7 @@ def is_bitmap_type(self, name: str): return any(map(lambda s: s.name == name, self.all_bitmaps)) -def ParseDataType(data_type: DataType, lookup: TypeLookupContext) -> Union[BasicInteger, BasicString, FundamentalType, IdlType, IdlEnumType, IdlBitmapType]: +def ParseDataType(data_type: DataType, lookup: TypeLookupContext, desugar_typedef: bool = False) -> Union[BasicInteger, BasicString, FundamentalType, IdlType, IdlEnumType, IdlBitmapType, IdlTypedefType]: """ Given a AST data type and a lookup context, match it to a type that can be later be used for generation. @@ -404,9 +438,18 @@ def ParseDataType(data_type: DataType, lookup: TypeLookupContext) -> Union[Basic b = lookup.find_bitmap(data_type.name) if b: - # Valid enum found. it MUST be based on a valid data type + # Valid bitmap found. it MUST be based on a valid data type return IdlBitmapType(idl_name=data_type.name, base_type=__CHIP_SIZED_TYPES__[b.base_type.lower()]) + t = lookup.find_typedef(data_type.name) + if t: + # Valid typedef found. it MUST be based on a valid data type + typedef_base_type = ParseDataType(DataType(name=t.base_type), lookup) + if desugar_typedef: + return typedef_base_type + else: + return IdlTypedefType(idl_name=data_type.name, base_type=typedef_base_type) + result = IdlType(idl_name=data_type.name, item_type=IdlItemType.UNKNOWN) if lookup.find_struct(data_type.name): result.item_type = IdlItemType.STRUCT diff --git a/scripts/py_matter_idl/matter_idl/matter_grammar.lark b/scripts/py_matter_idl/matter_idl/matter_grammar.lark index 4013c51bb52a59..befad5f8e97bdd 100644 --- a/scripts/py_matter_idl/matter_idl/matter_grammar.lark +++ b/scripts/py_matter_idl/matter_idl/matter_grammar.lark @@ -12,6 +12,7 @@ struct_qualities: struct_quality* enum: "enum"i id ":" type "{" constant_entry* "}" bitmap: "bitmap"i id ":" type "{" constant_entry* "}" +typedef: "typedef"i id ":" type ";" ?access_privilege: "view"i -> view_privilege | "operate"i -> operate_privilege @@ -68,7 +69,7 @@ cluster_revision: "revision"i positive_integer ";" // no direct meaning currently cluster: [maturity] ( "client" | "server" )? "cluster"i id "=" positive_integer "{" [cluster_revision] cluster_content* "}" -?cluster_content: [maturity] (enum|bitmap|event|attribute|struct|request_struct|response_struct|command) +?cluster_content: [maturity] (enum|bitmap|event|attribute|struct|request_struct|response_struct|command|typedef) endpoint: "endpoint"i positive_integer "{" endpoint_content* "}" ?endpoint_content: endpoint_cluster_binding | endpoint_server_cluster | endpoint_device_type @@ -116,7 +117,7 @@ POSITIVE_INTEGER: /\d+/ HEX_INTEGER: /0x[A-Fa-f0-9]+/ ID: /[a-zA-Z_][a-zA-Z0-9_]*/ -idl: (struct|enum|bitmap|cluster|endpoint)* +idl: (struct|enum|bitmap|cluster|endpoint|typedef)* %import common.ESCAPED_STRING %import common.WS diff --git a/scripts/py_matter_idl/matter_idl/matter_idl_parser.py b/scripts/py_matter_idl/matter_idl/matter_idl_parser.py index e071d008d1d726..20add72cf0bccd 100755 --- a/scripts/py_matter_idl/matter_idl/matter_idl_parser.py +++ b/scripts/py_matter_idl/matter_idl/matter_idl_parser.py @@ -23,7 +23,7 @@ AttributeStorage, Bitmap, Cluster, Command, CommandInstantiation, CommandQuality, ConstantEntry, DataType, DeviceType, Endpoint, Enum, Event, EventPriority, EventQuality, Field, FieldQuality, Idl, ParseMetaData, ServerClusterInstantiation, Struct, StructQuality, - StructTag) + StructTag, Typedef) def UnionOfAllFlags(flags_list): @@ -207,6 +207,10 @@ def enum(self, id, type, *entries): def bitmap(self, id, type, *entries): return Bitmap(name=id, base_type=type, entries=list(entries)) + @v_args(inline=True) + def typedef(self, id, type): + return Typedef(name=id, base_type=type) + def field(self, args): data_type, name = args[0], args[1] is_list = (len(args) == 4) @@ -496,6 +500,8 @@ def cluster(self, meta, api_maturity, name, code, revision, *content): result.structs.append(item) elif isinstance(item, Command): result.commands.append(item) + elif isinstance(item, Typedef): + result.typedefs.append(item) else: raise Exception("UNKNOWN cluster content item: %r" % item) @@ -508,6 +514,7 @@ def idl(self, items): global_bitmaps = [] global_enums = [] global_structs = [] + global_typedefs =[] for item in items: if isinstance(item, Cluster): @@ -520,10 +527,12 @@ def idl(self, items): global_bitmaps.append(dataclasses.replace(item, is_global=True)) elif isinstance(item, Struct): global_structs.append(dataclasses.replace(item, is_global=True)) + elif isinstance(item, Typedef): + global_typedefs.append(dataclasses.replace(item, is_global=True)) else: raise Exception("UNKNOWN idl content item: %r" % item) - return Idl(clusters=clusters, endpoints=endpoints, global_bitmaps=global_bitmaps, global_enums=global_enums, global_structs=global_structs) + return Idl(clusters=clusters, endpoints=endpoints, global_bitmaps=global_bitmaps, global_enums=global_enums, global_structs=global_structs, global_typedefs=global_typedefs) def prefix_doc_comment(self): print("TODO: prefix") @@ -563,15 +572,16 @@ def __init__(self, idl: Idl): self.bitmap_map = {b.name: b for b in idl.global_bitmaps} self.enum_map = {e.name: e for e in idl.global_enums} self.struct_map = {s.name: s for s in idl.global_structs} + self.typedef_map = {t.name: t for t in idl.global_typedefs} - self.global_types = set(self.bitmap_map.keys()).union(set(self.enum_map.keys())).union(set(self.struct_map.keys())) + self.global_types = set(self.bitmap_map.keys()).union(set(self.enum_map.keys())).union(set(self.struct_map.keys())).union(set(self.typedef_map.keys())) # Spec does not enforce unique naming in bitmap/enum/struct, however in practice # if we have both enum Foo and bitmap Foo for example, it would be impossible # to disambiguate `attribute Foo foo = 1` for the actual type we want. # # As a result, we do not try to namespace this and just error out - if len(self.global_types) != len(self.bitmap_map) + len(self.enum_map) + len(self.struct_map): + if len(self.global_types) != len(self.bitmap_map) + len(self.enum_map) + len(self.struct_map) + len(self.typedef_map): raise ValueError("Global type names are not unique.") def merge_global_types_into_cluster(self, cluster: Cluster) -> Cluster: @@ -604,6 +614,10 @@ def merge_global_types_into_cluster(self, cluster: Cluster) -> Cluster: global_types_added.add(type_name) changed = True cluster.structs.append(self.struct_map[type_name]) + elif type_name in self.typedef_map: + global_types_added.add(type_name) + changed = True + cluster.typedefs.append(self.typedef_map[type_name]) return cluster @@ -638,7 +652,11 @@ def __init__(self, skip_meta: bool, merge_globals: bool): ) def parse(self, file: str, file_name: Optional[str] = None): - idl = self.transformer.transform(self.parser.parse(file)) + idl = None + try: + idl = self.transformer.transform(self.parser.parse(file)) + except Exception as e: + raise Exception(f"Failed to parse: {file_name}") from e idl.parse_file_name = file_name # ZAP may generate the same definition of clusters several times. diff --git a/scripts/py_matter_idl/matter_idl/matter_idl_types.py b/scripts/py_matter_idl/matter_idl/matter_idl_types.py index d4a2195457ed60..4aee2ef3678441 100644 --- a/scripts/py_matter_idl/matter_idl/matter_idl_types.py +++ b/scripts/py_matter_idl/matter_idl/matter_idl_types.py @@ -206,6 +206,13 @@ class Bitmap: is_global: bool = False +@dataclass +class Typedef: + name: str + base_type: str + api_maturity: ApiMaturity = ApiMaturity.STABLE + is_global: bool = False + @dataclass class Command: name: str @@ -235,6 +242,7 @@ class Cluster: events: List[Event] = field(default_factory=list) attributes: List[Attribute] = field(default_factory=list) structs: List[Struct] = field(default_factory=list) + typedefs: List[Typedef] = field(default_factory=list) commands: List[Command] = field(default_factory=list) description: Optional[str] = None api_maturity: ApiMaturity = ApiMaturity.STABLE @@ -297,6 +305,7 @@ class Idl: global_bitmaps: List[Bitmap] = field(default_factory=list) global_enums: List[Enum] = field(default_factory=list) global_structs: List[Struct] = field(default_factory=list) + global_typedefs: List[Typedef] = field(default_factory=list) # IDL file name is available only if parsing provides a file name parse_file_name: Optional[str] = field(default=None) diff --git a/scripts/py_matter_idl/matter_idl/test_matter_idl_parser.py b/scripts/py_matter_idl/matter_idl/test_matter_idl_parser.py index ab79c279b0697f..319567d7ff6ee8 100755 --- a/scripts/py_matter_idl/matter_idl/test_matter_idl_parser.py +++ b/scripts/py_matter_idl/matter_idl/test_matter_idl_parser.py @@ -336,6 +336,20 @@ def test_cluster_enum(self): )]) self.assertIdlEqual(actual, expected) + def test_cluster_typedef(self): + actual = parseText(""" + client cluster WithTypedefs = 0xab { + typedef TestTypedef : int16u + } + """) + expected = Idl(clusters=[ + Cluster(name="WithTypedefs", + code=0xab, + typedefs=[ + Typedef(name="TestTypedef", base_type="int16u")], + )]) + self.assertIdlEqual(actual, expected) + def test_event_field_api_maturity(self): actual = parseText(""" server cluster MaturityTest = 1 { diff --git a/scripts/py_matter_idl/matter_idl/zapxml/handlers/handlers.py b/scripts/py_matter_idl/matter_idl/zapxml/handlers/handlers.py index a303f263f10bc1..0b9700fd9ff2a2 100644 --- a/scripts/py_matter_idl/matter_idl/zapxml/handlers/handlers.py +++ b/scripts/py_matter_idl/matter_idl/zapxml/handlers/handlers.py @@ -16,7 +16,7 @@ from typing import Any, Optional from matter_idl.matter_idl_types import (Attribute, Bitmap, Cluster, Command, CommandQuality, ConstantEntry, DataType, Enum, Event, - EventPriority, EventQuality, Field, FieldQuality, Idl, Struct, StructQuality, StructTag) + EventPriority, EventQuality, Field, FieldQuality, Idl, Struct, StructQuality, StructTag, Typedef) from .base import BaseHandler, HandledDepth from .context import Context, IdlPostProcessor @@ -355,6 +355,43 @@ def FinalizeProcessing(self, idl: Idl): def EndProcessing(self): self.context.AddIdlPostProcessor(self) +class TypedefHandler(BaseHandler, IdlPostProcessor): + """ Handling /configurator/typedef elements.""" + + def __init__(self, context: Context, attrs): + super().__init__(context) + + # no cluster codes means global. Note that at the time + # of writing this, no global typedefs were defined in XMLs + self._cluster_codes = set() + self.typedef = Typedef(name=attrs['name'], + base_type=attrs['type']) + + def GetNextProcessor(self, name, attrs): + if name.lower() == 'cluster': + self._cluster_codes.add(ParseInt(attrs['code'])) + return BaseHandler(self.context, handled=HandledDepth.SINGLE_TAG) + else: + return BaseHandler(self.context) + + def FinalizeProcessing(self, idl: Idl): + if not self._cluster_codes: + idl.global_typedefs.append(self._typedef) + return + + found = set() + for c in idl.clusters: + if c.code in self._cluster_codes: + c.typedefs.append(self._typedef) + found.add(c.code) + + if found != self._cluster_codes: + LOGGER.error('Typedef %s could not find its clusters (codes: %r)' % + (self._typedef.name, self._cluster_codes - found)) + + def EndProcessing(self): + self.context.AddIdlPostProcessor(self) + class FeaturesHandler(BaseHandler): """Handles .../features @@ -704,5 +741,7 @@ def GetNextProcessor(self, name: str, attrs): return BaseHandler(self.context, handled=HandledDepth.ENTIRE_TREE) elif name.lower() == 'global': return GlobalHandler(self.context) + elif name.lower() == 'typedef': + return TypedefHandler(self.context, attrs) else: return BaseHandler(self.context) diff --git a/scripts/tools/zap_regen_all.py b/scripts/tools/zap_regen_all.py index 0284e9eff9dd93..67ae891105bdca 100755 --- a/scripts/tools/zap_regen_all.py +++ b/scripts/tools/zap_regen_all.py @@ -311,6 +311,8 @@ def codeFormat(self): def generate(self) -> TargetRunStats: generate_start = time.time() + logging.info("Executing: %s" % self.command) + subprocess.check_call(self.command) self.codeFormat() diff --git a/src/app/zap-templates/partials/idl/cluster_definition.zapt b/src/app/zap-templates/partials/idl/cluster_definition.zapt index be431ae7d7cc2c..ba78e828d27fdb 100644 --- a/src/app/zap-templates/partials/idl/cluster_definition.zapt +++ b/src/app/zap-templates/partials/idl/cluster_definition.zapt @@ -22,6 +22,10 @@ cluster {{asUpperCamelCase name}} = {{!}} } {{/zcl_enums}} + {{#zcl_typedefs}} + typedef {{asUpperCamelCase name preserveAcronyms=true}} : {{type}}; + + {{/zcl_typedefs}} {{#zcl_bitmaps}} bitmap {{asUpperCamelCase name preserveAcronyms=true}} : bitmap{{multiply size 8}} { {{#zcl_bitmap_items}} diff --git a/src/app/zap-templates/partials/idl/global_types.zapt b/src/app/zap-templates/partials/idl/global_types.zapt index bd72b43b2b36b5..f793ea9cede903 100644 --- a/src/app/zap-templates/partials/idl/global_types.zapt +++ b/src/app/zap-templates/partials/idl/global_types.zapt @@ -8,6 +8,12 @@ enum {{asUpperCamelCase name preserveAcronyms=true}} : enum{{multiply size 8}} { {{/if}} {{/zcl_enums}} +{{#zcl_typedefs}} +{{#if has_no_clusters}} +typedef {{asUpperCamelCase name preserveAcronyms=true}} : {{type}}; + +{{/if}} +{{/zcl_typedefs}} {{#zcl_bitmaps}} {{#if has_no_clusters}} {{#if_is_atomic name}} diff --git a/src/app/zap-templates/templates/app/cluster-typedefs-check.zapt b/src/app/zap-templates/templates/app/cluster-typedefs-check.zapt new file mode 100644 index 00000000000000..a2a3d4ac1e4f4e --- /dev/null +++ b/src/app/zap-templates/templates/app/cluster-typedefs-check.zapt @@ -0,0 +1,29 @@ +{{> header}} + +#pragma once + +#include + +namespace chip { +namespace app { +namespace Clusters { +{{#zcl_typedefs}} +{{#if has_more_than_one_cluster}} +{{> cluster_typedefs_ensure_known_value ns="detail"}} +{{else if has_no_clusters}} +{{> cluster_typedefs_ensure_known_value ns="Globals"}} + +{{/if}} +{{/zcl_typedefs}} + +{{#zcl_clusters}} +{{#zcl_typedefs}} +{{#unless has_more_than_one_cluster}} +{{> cluster_typedefs_ensure_known_value ns=(asUpperCamelCase ../name)}} +{{/unless}} +{{/zcl_typedefs}} + +{{/zcl_clusters}} +} // namespace Clusters +} // namespace app +} // namespace chip diff --git a/src/app/zap-templates/templates/app/cluster-typedefs.zapt b/src/app/zap-templates/templates/app/cluster-typedefs.zapt new file mode 100644 index 00000000000000..18382e0188fdb6 --- /dev/null +++ b/src/app/zap-templates/templates/app/cluster-typedefs.zapt @@ -0,0 +1,53 @@ +{{> header}} + +#pragma once + +#include + + +namespace chip { +namespace app { +namespace Clusters { + +namespace detail { +// typedefs shared across multiple clusters. +{{#zcl_typedefs}} + +{{#if has_more_than_one_cluster}} + +{{> cluster_typedefs_enum ns=""}} + +{{/if}} +{{/zcl_typedefs}} + +} // namespace detail + +namespace Globals { +// Global typedefs. +{{#zcl_typedefs}} + +{{#if has_no_clusters}} + +{{> cluster_typedefs_enum ns=""}} + +{{/if}} +{{/zcl_typedefs}} +} // namespace Globals + +{{#zcl_clusters}} +namespace {{asUpperCamelCase name}} { +{{#zcl_typedefs}} + +{{#if has_more_than_one_cluster}} +using {{asUpperCamelCase name}} = Clusters::detail::{{asUpperCamelCase name}}; +{{else}} +{{> cluster_typedefs_enum ns=(asUpperCamelCase ../name)}} + +{{/if}} +{{/zcl_typedefs}} +} // namespace {{asUpperCamelCase name}} + +{{/zcl_clusters}} +} // namespace Clusters +} // namespace app +} // namespace chip diff --git a/src/app/zap-templates/zcl/zcl-with-test-extensions.json b/src/app/zap-templates/zcl/zcl-with-test-extensions.json index 0912be1df2db37..de05ac7e8a180f 100644 --- a/src/app/zap-templates/zcl/zcl-with-test-extensions.json +++ b/src/app/zap-templates/zcl/zcl-with-test-extensions.json @@ -682,7 +682,7 @@ }, "mandatoryDeviceTypes": "0x0016", "defaultReportingPolicy": "mandatory", - "ZCLDataTypes": ["ARRAY", "BITMAP", "ENUM", "NUMBER", "STRING", "STRUCT"], + "ZCLDataTypes": ["ARRAY", "BITMAP", "ENUM", "NUMBER", "STRING", "STRUCT", "TYPEDEF"], "fabricHandling": { "automaticallyCreateFields": true, "indexFieldId": 254, diff --git a/src/app/zap-templates/zcl/zcl.json b/src/app/zap-templates/zcl/zcl.json index 3a62c4c84ca6eb..00dc8bc8b5e754 100644 --- a/src/app/zap-templates/zcl/zcl.json +++ b/src/app/zap-templates/zcl/zcl.json @@ -676,7 +676,7 @@ }, "mandatoryDeviceTypes": "0x0016", "defaultReportingPolicy": "mandatory", - "ZCLDataTypes": ["ARRAY", "BITMAP", "ENUM", "NUMBER", "STRING", "STRUCT"], + "ZCLDataTypes": ["ARRAY", "BITMAP", "ENUM", "NUMBER", "STRING", "STRUCT", "TYPEDEF"], "fabricHandling": { "automaticallyCreateFields": true, "indexFieldId": 254, diff --git a/src/controller/java/templates/partials/decode_value.zapt b/src/controller/java/templates/partials/decode_value.zapt index 6401ef1c8b7f12..726ab0df3f9a6b 100644 --- a/src/controller/java/templates/partials/decode_value.zapt +++ b/src/controller/java/templates/partials/decode_value.zapt @@ -26,59 +26,64 @@ if ({{source}}.IsNull()) { chip::JniReferences::GetInstance().AddToList({{target}}, newElement_{{depth}}); } {{else}} - {{#if_is_struct type}} - {{#zcl_struct_items_by_struct_and_cluster_name type cluster}} - {{>decode_value target=(concat ../target "_" (asLowerCamelCase label)) source=(concat ../source "." (asLowerCamelCase label)) cluster=../cluster depth=(incrementDepth ../depth) omitDeclaration=false earlyReturn=../earlyReturn}} - {{/zcl_struct_items_by_struct_and_cluster_name}} + {{#if_is_typedef type}} + {{#zcl_typedef_by_typedef_and_cluster_name type cluster}} + {{>decode_value type=typeId target=target source=source errorCode=errorCode depth=(incrementDepth ../depth) isNullable=isNullable omitDeclaration=omitDeclaration earlyReturn=earlyReturn }} + {{/zcl_typedef_by_typedef_and_cluster_name}} + {{else}} + {{#if_is_struct type}} + {{#zcl_struct_items_by_struct_and_cluster_name type cluster}} + {{>decode_value target=(concat ../target "_" (asLowerCamelCase label)) source=(concat ../source "." (asLowerCamelCase label)) cluster=../cluster depth=(incrementDepth ../depth) omitDeclaration=false earlyReturn=../earlyReturn}} + {{/zcl_struct_items_by_struct_and_cluster_name}} - { - jclass {{asLowerCamelCase type}}StructClass_{{depth}}; - err = chip::JniReferences::GetInstance().GetLocalClassRef(env, "chip/devicecontroller/ChipStructs${{asUpperCamelCase cluster}}Cluster{{asUpperCamelCase type}}", {{asLowerCamelCase type}}StructClass_{{depth}}); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs${{asUpperCamelCase cluster}}Cluster{{asUpperCamelCase type}}"); - return {{earlyReturn}}; - } + { + jclass {{asLowerCamelCase type}}StructClass_{{depth}}; + err = chip::JniReferences::GetInstance().GetLocalClassRef(env, "chip/devicecontroller/ChipStructs${{asUpperCamelCase cluster}}Cluster{{asUpperCamelCase type}}", {{asLowerCamelCase type}}StructClass_{{depth}}); + if (err != CHIP_NO_ERROR) { + ChipLogError(Zcl, "Could not find class ChipStructs${{asUpperCamelCase cluster}}Cluster{{asUpperCamelCase type}}"); + return {{earlyReturn}}; + } - jmethodID {{asLowerCamelCase type}}StructCtor_{{depth}}; - err = chip::JniReferences::GetInstance().FindMethod( - env, {{asLowerCamelCase type}}StructClass_{{depth}}, "", - "({{#zcl_struct_items_by_struct_and_cluster_name type cluster}}{{asJniSignature type null (asUpperCamelCase ../cluster) true}}{{/zcl_struct_items_by_struct_and_cluster_name}})V", - &{{asLowerCamelCase type}}StructCtor_{{depth}}); - if (err != CHIP_NO_ERROR || {{asLowerCamelCase type}}StructCtor_{{depth}} == nullptr) { - ChipLogError(Zcl, "Could not find ChipStructs${{asUpperCamelCase cluster}}Cluster{{asUpperCamelCase type}} constructor"); - return {{earlyReturn}}; - } + jmethodID {{asLowerCamelCase type}}StructCtor_{{depth}}; + err = chip::JniReferences::GetInstance().FindMethod( + env, {{asLowerCamelCase type}}StructClass_{{depth}}, "", + "({{#zcl_struct_items_by_struct_and_cluster_name type cluster}}{{asJniSignature type null (asUpperCamelCase ../cluster) true}}{{/zcl_struct_items_by_struct_and_cluster_name}})V", + &{{asLowerCamelCase type}}StructCtor_{{depth}}); + if (err != CHIP_NO_ERROR || {{asLowerCamelCase type}}StructCtor_{{depth}} == nullptr) { + ChipLogError(Zcl, "Could not find ChipStructs${{asUpperCamelCase cluster}}Cluster{{asUpperCamelCase type}} constructor"); + return {{earlyReturn}}; + } {{target}} = env->NewObject({{asLowerCamelCase type}}StructClass_{{depth}}, {{asLowerCamelCase type}}StructCtor_{{depth}} {{#zcl_struct_items_by_struct_and_cluster_name type cluster}} , {{../target}}_{{asLowerCamelCase label}} {{/zcl_struct_items_by_struct_and_cluster_name}} ); - } - {{else}} - {{#if_is_strongly_typed_chip_enum type}} - std::string {{target}}ClassName = "{{asJniClassName type null (asUpperCamelCase cluster)}}"; - std::string {{target}}CtorSignature = "({{asJniSignature type null (asUpperCamelCase cluster) false}})V"; - {{asJniBasicType type false}} jni{{target}} = static_cast<{{asJniBasicType type false}}>({{source}}); - chip::JniReferences::GetInstance().CreateBoxedObject<{{asJniBasicType type false}}>({{target}}ClassName.c_str(), {{target}}CtorSignature.c_str(), jni{{target}}, {{target}}); {{else}} - {{#if (isOctetString type)}} - jbyteArray {{target}}ByteArray = env->NewByteArray(static_cast({{source}}.size())); - env->SetByteArrayRegion({{target}}ByteArray, 0, static_cast({{source}}.size()), reinterpret_cast({{source}}.data())); - {{target}} = {{target}}ByteArray; - {{else if (isCharString type)}} - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF({{source}}, {{target}})); - {{else}} + {{#if_is_strongly_typed_chip_enum type}} std::string {{target}}ClassName = "{{asJniClassName type null (asUpperCamelCase cluster)}}"; std::string {{target}}CtorSignature = "({{asJniSignature type null (asUpperCamelCase cluster) false}})V"; - {{#if_is_strongly_typed_bitmap type}} - {{asJniBasicType type false}} jni{{target}} = static_cast<{{asJniBasicType type false}}>({{source}}.Raw()); - chip::JniReferences::GetInstance().CreateBoxedObject<{{asJniBasicType type false}}>({{target}}ClassName.c_str(), {{target}}CtorSignature.c_str(), jni{{target}}, {{target}}); + {{asJniBasicType type false}} jni{{target}} = static_cast<{{asJniBasicType type false}}>({{source}}); + chip::JniReferences::GetInstance().CreateBoxedObject<{{asJniBasicType type false}}>({{target}}ClassName.c_str(), {{target}}CtorSignature.c_str(), jni{{target}}, {{target}}); + {{else}} + {{#if (isOctetString type)}} + jbyteArray {{target}}ByteArray = env->NewByteArray(static_cast({{source}}.size())); + env->SetByteArrayRegion({{target}}ByteArray, 0, static_cast({{source}}.size()), reinterpret_cast({{source}}.data())); + {{target}} = {{target}}ByteArray; + {{else if (isCharString type)}} + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF({{source}}, {{target}})); {{else}} - {{asJniBasicType type false}} jni{{target}} = static_cast<{{asJniBasicType type false}}>({{source}}); - chip::JniReferences::GetInstance().CreateBoxedObject<{{asJniBasicType type false}}>({{target}}ClassName.c_str(), {{target}}CtorSignature.c_str(), jni{{target}}, {{target}}); - {{/if_is_strongly_typed_bitmap}} - {{/if}} - {{/if_is_strongly_typed_chip_enum}} - {{/if_is_struct}} + std::string {{target}}ClassName = "{{asJniClassName type null (asUpperCamelCase cluster)}}"; + std::string {{target}}CtorSignature = "({{asJniSignature type null (asUpperCamelCase cluster) false}})V"; + {{#if_is_strongly_typed_bitmap type}} + {{asJniBasicType type false}} jni{{target}} = static_cast<{{asJniBasicType type false}}>({{source}}.Raw()); + chip::JniReferences::GetInstance().CreateBoxedObject<{{asJniBasicType type false}}>({{target}}ClassName.c_str(), {{target}}CtorSignature.c_str(), jni{{target}}, {{target}}); + {{else}} + {{asJniBasicType type false}} jni{{target}} = static_cast<{{asJniBasicType type false}}>({{source}}); + chip::JniReferences::GetInstance().CreateBoxedObject<{{asJniBasicType type false}}>({{target}}ClassName.c_str(), {{target}}CtorSignature.c_str(), jni{{target}}, {{target}}); + {{/if_is_strongly_typed_bitmap}} + {{/if}} + {{/if_is_strongly_typed_chip_enum}} + {{/if_is_struct}} + {{/if_is_typedef}} {{/if}} \ No newline at end of file diff --git a/src/controller/java/templates/templates.json b/src/controller/java/templates/templates.json index 5ff5eb7ef0dad5..4a04bec24af685 100644 --- a/src/controller/java/templates/templates.json +++ b/src/controller/java/templates/templates.json @@ -24,10 +24,6 @@ "name": "cluster_header", "path": "../../../app/zap-templates/partials/cluster_header.zapt" }, - { - "name": "encode_value", - "path": "partials/encode_value.zapt" - }, { "name": "decode_value", "path": "partials/decode_value.zapt" diff --git a/src/controller/python/templates/partials/typedef_def.zapt b/src/controller/python/templates/partials/typedef_def.zapt new file mode 100644 index 00000000000000..1a8a953a77b392 --- /dev/null +++ b/src/controller/python/templates/partials/typedef_def.zapt @@ -0,0 +1 @@ + {{asType label}} = '{{zapTypeToPythonClusterObjectType type ns=../cluster}}' diff --git a/src/controller/python/templates/python-CHIPClusters-py.zapt b/src/controller/python/templates/python-CHIPClusters-py.zapt index 284cd650a0a772..8d3ab8bc6b0186 100644 --- a/src/controller/python/templates/python-CHIPClusters-py.zapt +++ b/src/controller/python/templates/python-CHIPClusters-py.zapt @@ -26,8 +26,12 @@ class ChipClusters: {{#zcl_command_arguments}} {{#if_is_struct type}} "{{asLowerCamelCase label}}": "{{type}}", - {{else}} + {{else}} + {{#if_is_typedef type}} + "{{asLowerCamelCase label}}": "{{type}}", + {{else}} "{{asLowerCamelCase label}}": "{{#if (isCharString type)}}str{{else}}{{as_underlying_python_zcl_type type ../../id}}{{/if}}", + {{/if_is_typedef}} {{/if_is_struct}} {{/zcl_command_arguments}} }, diff --git a/src/controller/python/templates/python-cluster-Objects-py.zapt b/src/controller/python/templates/python-cluster-Objects-py.zapt index 381d266668082a..8689d7e21cf34d 100644 --- a/src/controller/python/templates/python-cluster-Objects-py.zapt +++ b/src/controller/python/templates/python-cluster-Objects-py.zapt @@ -2,7 +2,7 @@ {{> header}} ''' -# This file contains generated struct, enum, command definition. +# This file contains generated struct, enum, typedef, and command definition. # Users are not expected to import this file, instead, users can use import chip.clusters, # which will import all symbols from this file and can get a readable, pretty naming like # clusters.OnOff.commands.OnCommand @@ -55,6 +55,13 @@ class Globals: {{/if}} {{/zcl_structs}} + class Typedefs: +{{#zcl_typedefs}} +{{#if has_no_clusters}} +{{> typedef_def cluster="Globals"}} + +{{/if}} +{{/zcl_typedefs}} {{#zcl_clusters}} @@ -106,6 +113,13 @@ class {{asUpperCamelCase name}}(Cluster): {{> struct_def cluster=(asUpperCamelCase parent.name) }} {{/zcl_structs}} +{{#zcl_typedefs}} +{{#first}} + class Typedefs: +{{/first}} +{{> typedef_def cluster=(asUpperCamelCase parent.name) }} + +{{/zcl_typedefs}} {{#zcl_commands}} {{#first}} class Commands: diff --git a/src/controller/python/templates/templates.json b/src/controller/python/templates/templates.json index ebe67b0f384b22..8b0c0f4b368d2b 100644 --- a/src/controller/python/templates/templates.json +++ b/src/controller/python/templates/templates.json @@ -32,6 +32,10 @@ { "name": "struct_def", "path": "partials/struct_def.zapt" + }, + { + "name": "typedef_def", + "path": "partials/typedef_def.zapt" } ], "templates": [ diff --git a/src/darwin/Framework/CHIP/templates/partials/decode_value.zapt b/src/darwin/Framework/CHIP/templates/partials/decode_value.zapt index 16a9acbc6d4048..ae178118abb36f 100644 --- a/src/darwin/Framework/CHIP/templates/partials/decode_value.zapt +++ b/src/darwin/Framework/CHIP/templates/partials/decode_value.zapt @@ -27,31 +27,37 @@ {{target}} = array_{{depth}}; } {{else}} - {{#if_is_struct type}} - {{target}} = [{{asObjectiveCClass type cluster forceNotList=true}} new]; - {{#zcl_struct_items_by_struct_and_cluster_name type cluster}} - {{#if (isSupported (asUpperCamelCase ../cluster preserveAcronyms=true) struct=(asUpperCamelCase ../type preserveAcronyms=true) structField=(asStructPropertyName label))}} - {{>decode_value target=(concat ../target "." (asStructPropertyName label)) source=(concat ../source "." (asLowerCamelCase label)) cluster=../cluster errorCode=../errorCode depth=(incrementDepth ../depth) }} - {{/if}} - {{/zcl_struct_items_by_struct_and_cluster_name}} + {{#if_is_typedef type}} + {{#zcl_typedef_by_typedef_and_cluster_name type cluster}} + {{>decode_value type=typeId target=target source=source errorCode=errorCode depth=(incrementDepth ../depth) }} + {{/zcl_typedef_by_typedef_and_cluster_name}} {{else}} - {{#if_is_strongly_typed_chip_enum type}} - {{target}} = [NSNumber numberWith{{asObjectiveCNumberType "" type false}}:chip::to_underlying({{source}})]; + {{#if_is_struct type}} + {{target}} = [{{asObjectiveCClass type cluster forceNotList=true}} new]; + {{#zcl_struct_items_by_struct_and_cluster_name type cluster}} + {{#if (isSupported (asUpperCamelCase ../cluster preserveAcronyms=true) struct=(asUpperCamelCase ../type preserveAcronyms=true) structField=(asStructPropertyName label))}} + {{>decode_value target=(concat ../target "." (asStructPropertyName label)) source=(concat ../source "." (asLowerCamelCase label)) cluster=../cluster errorCode=../errorCode depth=(incrementDepth ../depth) }} + {{/if}} + {{/zcl_struct_items_by_struct_and_cluster_name}} {{else}} - {{#if_is_strongly_typed_bitmap type}} - {{target}} = [NSNumber numberWith{{asObjectiveCNumberType "" type false}}:{{source}}.Raw()]; - {{else if (isOctetString type)}} - {{target}} = AsData({{source}}); - {{else if (isCharString type)}} - {{target}} = AsString({{source}}); - if ({{target}} == nil) { - {{! Invalid UTF-8. Just make up an error for now. }} - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - {{errorCode}} - } + {{#if_is_strongly_typed_chip_enum type}} + {{target}} = [NSNumber numberWith{{asObjectiveCNumberType "" type false}}:chip::to_underlying({{source}})]; {{else}} - {{target}} = [NSNumber numberWith{{asObjectiveCNumberType "" type false}}:{{source}}]; - {{/if_is_strongly_typed_bitmap}} - {{/if_is_strongly_typed_chip_enum}} - {{/if_is_struct}} + {{#if_is_strongly_typed_bitmap type}} + {{target}} = [NSNumber numberWith{{asObjectiveCNumberType "" type false}}:{{source}}.Raw()]; + {{else if (isOctetString type)}} + {{target}} = AsData({{source}}); + {{else if (isCharString type)}} + {{target}} = AsString({{source}}); + if ({{target}} == nil) { + {{! Invalid UTF-8. Just make up an error for now. }} + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + {{errorCode}} + } + {{else}} + {{target}} = [NSNumber numberWith{{asObjectiveCNumberType "" type false}}:{{source}}]; + {{/if_is_strongly_typed_bitmap}} + {{/if_is_strongly_typed_chip_enum}} + {{/if_is_struct}} + {{/if_is_typedef}} {{/if}} diff --git a/src/darwin/Framework/CHIP/templates/partials/encode_value.zapt b/src/darwin/Framework/CHIP/templates/partials/encode_value.zapt index 16e2b3e1234417..c610319f53c4e6 100644 --- a/src/darwin/Framework/CHIP/templates/partials/encode_value.zapt +++ b/src/darwin/Framework/CHIP/templates/partials/encode_value.zapt @@ -45,21 +45,27 @@ {{else if (isCharString type)}} {{target}} = AsCharSpan({{source}}); {{else}} - {{#if_is_struct type}} - {{#zcl_struct_items_by_struct_and_cluster_name type cluster}} - {{#if (isSupported (asUpperCamelCase ../cluster preserveAcronyms=true) struct=(asUpperCamelCase ../type preserveAcronyms=true) structField=(asStructPropertyName label))}} - {{>encode_value target=(concat ../target "." (asLowerCamelCase label)) source=(concat ../source "." (asStructPropertyName label)) cluster=../cluster errorCode=../errorCode depth=(incrementDepth ../depth)}} - {{/if}} - {{/zcl_struct_items_by_struct_and_cluster_name}} + {{#if_is_typedef type}} + {{#zcl_typedef_by_typedef_and_cluster_name type cluster}} + {{>encode_value type=typeId target=target source=source errorCode=errorCode depth=(incrementDepth ../depth) }} + {{/zcl_typedef_by_typedef_and_cluster_name}} {{else}} - {{#if_is_strongly_typed_chip_enum type}} - {{target}} = static_cast>({{source}}.{{asObjectiveCNumberType source type true}}Value); + {{#if_is_struct type}} + {{#zcl_struct_items_by_struct_and_cluster_name type cluster}} + {{#if (isSupported (asUpperCamelCase ../cluster preserveAcronyms=true) struct=(asUpperCamelCase ../type preserveAcronyms=true) structField=(asStructPropertyName label))}} + {{>encode_value target=(concat ../target "." (asLowerCamelCase label)) source=(concat ../source "." (asStructPropertyName label)) cluster=../cluster errorCode=../errorCode depth=(incrementDepth ../depth)}} + {{/if}} + {{/zcl_struct_items_by_struct_and_cluster_name}} {{else}} - {{#if_is_strongly_typed_bitmap type}} + {{#if_is_strongly_typed_chip_enum type}} {{target}} = static_cast>({{source}}.{{asObjectiveCNumberType source type true}}Value); {{else}} - {{target}} = {{source}}.{{asObjectiveCNumberType source type true}}Value; - {{/if_is_strongly_typed_bitmap}} - {{/if_is_strongly_typed_chip_enum}} - {{/if_is_struct}} + {{#if_is_strongly_typed_bitmap type}} + {{target}} = static_cast>({{source}}.{{asObjectiveCNumberType source type true}}Value); + {{else}} + {{target}} = {{source}}.{{asObjectiveCNumberType source type true}}Value; + {{/if_is_strongly_typed_bitmap}} + {{/if_is_strongly_typed_chip_enum}} + {{/if_is_struct}} + {{/if_is_typedef}} {{/if}} diff --git a/src/darwin/Framework/CHIP/templates/partials/typedef_decl.zapt b/src/darwin/Framework/CHIP/templates/partials/typedef_decl.zapt new file mode 100644 index 00000000000000..86deb02b28dbb6 --- /dev/null +++ b/src/darwin/Framework/CHIP/templates/partials/typedef_decl.zapt @@ -0,0 +1,2 @@ +{{! Arguments: cluster (might be "Globals", is not case-canonicalized), name, typedefLabel }} +typedef {{asObjectiveCType type cluster}} {{asUnderlyingZclType name}}; \ No newline at end of file diff --git a/src/darwin/Framework/CHIP/templates/templates.json b/src/darwin/Framework/CHIP/templates/templates.json index d7e4b2106bc98e..5fffbfd268ba23 100644 --- a/src/darwin/Framework/CHIP/templates/templates.json +++ b/src/darwin/Framework/CHIP/templates/templates.json @@ -56,6 +56,10 @@ "name": "enum_decl", "path": "partials/enum_decl.zapt" }, + { + "name": "typedef_decl", + "path": "partials/typedef_decl.zapt" + }, { "name": "renamed_struct_field_impl", "path": "partials/renamed_struct_field_impl.zapt" From abc936f80a9a26c07d4f4942e3120629bb43b8d6 Mon Sep 17 00:00:00 2001 From: marcos <15697303+gmarcosb@users.noreply.github.com> Date: Fri, 18 Oct 2024 15:32:08 -0600 Subject: [PATCH 07/20] Update zapt templates to handle typedef --- .../templates/app/cluster-typedefs-check.zapt | 29 ------------------- .../zcl/data-model/chip/global-structs.xml | 1 + .../zcl/data-model/chip/global-typedefs.xml | 29 +++++++++++++++++++ .../zcl/data-model/chip/test-cluster.xml | 24 +++++++++++++++ src/app/zap-templates/zcl/zcl.json | 1 + src/app/zap-templates/zcl/zcl.xsd | 13 ++++++++- .../java/templates/partials/decode_value.zapt | 1 + .../CHIP/templates/MTRBaseClusters.zapt | 11 +++++++ .../CHIP/templates/partials/typedef_decl.zapt | 2 +- 9 files changed, 80 insertions(+), 31 deletions(-) delete mode 100644 src/app/zap-templates/templates/app/cluster-typedefs-check.zapt create mode 100644 src/app/zap-templates/zcl/data-model/chip/global-typedefs.xml diff --git a/src/app/zap-templates/templates/app/cluster-typedefs-check.zapt b/src/app/zap-templates/templates/app/cluster-typedefs-check.zapt deleted file mode 100644 index a2a3d4ac1e4f4e..00000000000000 --- a/src/app/zap-templates/templates/app/cluster-typedefs-check.zapt +++ /dev/null @@ -1,29 +0,0 @@ -{{> header}} - -#pragma once - -#include - -namespace chip { -namespace app { -namespace Clusters { -{{#zcl_typedefs}} -{{#if has_more_than_one_cluster}} -{{> cluster_typedefs_ensure_known_value ns="detail"}} -{{else if has_no_clusters}} -{{> cluster_typedefs_ensure_known_value ns="Globals"}} - -{{/if}} -{{/zcl_typedefs}} - -{{#zcl_clusters}} -{{#zcl_typedefs}} -{{#unless has_more_than_one_cluster}} -{{> cluster_typedefs_ensure_known_value ns=(asUpperCamelCase ../name)}} -{{/unless}} -{{/zcl_typedefs}} - -{{/zcl_clusters}} -} // namespace Clusters -} // namespace app -} // namespace chip diff --git a/src/app/zap-templates/zcl/data-model/chip/global-structs.xml b/src/app/zap-templates/zcl/data-model/chip/global-structs.xml index 743fdf366b724b..00f34435c735cc 100644 --- a/src/app/zap-templates/zcl/data-model/chip/global-structs.xml +++ b/src/app/zap-templates/zcl/data-model/chip/global-structs.xml @@ -38,5 +38,6 @@ limitations under the License. + diff --git a/src/app/zap-templates/zcl/data-model/chip/global-typedefs.xml b/src/app/zap-templates/zcl/data-model/chip/global-typedefs.xml new file mode 100644 index 00000000000000..e9503344a22ada --- /dev/null +++ b/src/app/zap-templates/zcl/data-model/chip/global-typedefs.xml @@ -0,0 +1,29 @@ + + + + + + + + diff --git a/src/app/zap-templates/zcl/data-model/chip/test-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/test-cluster.xml index 258c7cba5106df..8b4e3c5b81fca1 100644 --- a/src/app/zap-templates/zcl/data-model/chip/test-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/test-cluster.xml @@ -59,8 +59,14 @@ limitations under the License. + + + + + + @@ -104,6 +110,10 @@ limitations under the License. + + + @@ -202,6 +212,8 @@ limitations under the License. global_enum global_struct + typedef_attr + global_typedef mei_int8u @@ -310,6 +324,7 @@ limitations under the License. + + + @@ -605,6 +622,12 @@ limitations under the License. + + + + + + @@ -657,6 +680,7 @@ limitations under the License. + diff --git a/src/app/zap-templates/zcl/zcl.json b/src/app/zap-templates/zcl/zcl.json index 00dc8bc8b5e754..d8d67ea1e81bba 100644 --- a/src/app/zap-templates/zcl/zcl.json +++ b/src/app/zap-templates/zcl/zcl.json @@ -59,6 +59,7 @@ "global-bitmaps.xml", "global-enums.xml", "global-structs.xml", + "global-typedefs.xml", "groups-cluster.xml", "group-key-mgmt-cluster.xml", "icd-management-cluster.xml", diff --git a/src/app/zap-templates/zcl/zcl.xsd b/src/app/zap-templates/zcl/zcl.xsd index 1f78e6b9e076f0..75ca12447eec0b 100644 --- a/src/app/zap-templates/zcl/zcl.xsd +++ b/src/app/zap-templates/zcl/zcl.xsd @@ -147,6 +147,7 @@ This schema describes the format of the XML files, that describe the ZCL specifi + @@ -157,7 +158,7 @@ This schema describes the format of the XML files, that describe the ZCL specifi - + @@ -391,6 +392,16 @@ This schema describes the format of the XML files, that describe the ZCL specifi + + + + + + + + + + diff --git a/src/controller/java/templates/partials/decode_value.zapt b/src/controller/java/templates/partials/decode_value.zapt index 726ab0df3f9a6b..2a807d418924ff 100644 --- a/src/controller/java/templates/partials/decode_value.zapt +++ b/src/controller/java/templates/partials/decode_value.zapt @@ -59,6 +59,7 @@ if ({{source}}.IsNull()) { , {{../target}}_{{asLowerCamelCase label}} {{/zcl_struct_items_by_struct_and_cluster_name}} ); + } {{else}} {{#if_is_strongly_typed_chip_enum type}} std::string {{target}}ClassName = "{{asJniClassName type null (asUpperCamelCase cluster)}}"; diff --git a/src/darwin/Framework/CHIP/templates/MTRBaseClusters.zapt b/src/darwin/Framework/CHIP/templates/MTRBaseClusters.zapt index 6ca88e84dcad1a..e76a994cdad3bf 100644 --- a/src/darwin/Framework/CHIP/templates/MTRBaseClusters.zapt +++ b/src/darwin/Framework/CHIP/templates/MTRBaseClusters.zapt @@ -114,6 +114,13 @@ subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptio {{/if}} {{/zcl_enums}} +{{#zcl_typedefs}} +{{#if has_no_clusters}} +{{> typedef_decl cluster="Globals" name=name typedefLabel=label}} + +{{/if}} +{{/zcl_typedefs}} + {{#zcl_clusters}} {{#zcl_enums}} {{> enum_decl cluster=../name name=name enumLabel=label}} @@ -167,6 +174,10 @@ typedef NS_OPTIONS({{asUnderlyingZclType name}}, {{objCEnumName clusterName bitm {{/zcl_bitmaps}} +{{#zcl_typedefs}} +{{> typedef_decl cluster=../name name=name typedefLabel=label}} + +{{/zcl_typedefs}} {{/zcl_clusters}} {{#zcl_clusters}} diff --git a/src/darwin/Framework/CHIP/templates/partials/typedef_decl.zapt b/src/darwin/Framework/CHIP/templates/partials/typedef_decl.zapt index 86deb02b28dbb6..fa583cc0bd81fe 100644 --- a/src/darwin/Framework/CHIP/templates/partials/typedef_decl.zapt +++ b/src/darwin/Framework/CHIP/templates/partials/typedef_decl.zapt @@ -1,2 +1,2 @@ {{! Arguments: cluster (might be "Globals", is not case-canonicalized), name, typedefLabel }} -typedef {{asObjectiveCType type cluster}} {{asUnderlyingZclType name}}; \ No newline at end of file +typedef {{asObjectiveCType type cluster}} {{asUpperCamelCase typedefLabel preserveAcronyms=true}}; \ No newline at end of file From cef6738d64212590922651e343f9cd4b2bea6fba Mon Sep 17 00:00:00 2001 From: marcos <15697303+gmarcosb@users.noreply.github.com> Date: Thu, 17 Oct 2024 10:18:58 -0600 Subject: [PATCH 08/20] Update zapt templates to handle typedef --- .../templates/app/cluster-typedefs-check.zapt | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 src/app/zap-templates/templates/app/cluster-typedefs-check.zapt diff --git a/src/app/zap-templates/templates/app/cluster-typedefs-check.zapt b/src/app/zap-templates/templates/app/cluster-typedefs-check.zapt new file mode 100644 index 00000000000000..a2a3d4ac1e4f4e --- /dev/null +++ b/src/app/zap-templates/templates/app/cluster-typedefs-check.zapt @@ -0,0 +1,29 @@ +{{> header}} + +#pragma once + +#include + +namespace chip { +namespace app { +namespace Clusters { +{{#zcl_typedefs}} +{{#if has_more_than_one_cluster}} +{{> cluster_typedefs_ensure_known_value ns="detail"}} +{{else if has_no_clusters}} +{{> cluster_typedefs_ensure_known_value ns="Globals"}} + +{{/if}} +{{/zcl_typedefs}} + +{{#zcl_clusters}} +{{#zcl_typedefs}} +{{#unless has_more_than_one_cluster}} +{{> cluster_typedefs_ensure_known_value ns=(asUpperCamelCase ../name)}} +{{/unless}} +{{/zcl_typedefs}} + +{{/zcl_clusters}} +} // namespace Clusters +} // namespace app +} // namespace chip From fb2e87e7e88d36ffac3673021f5f79e6a414a270 Mon Sep 17 00:00:00 2001 From: marcos <15697303+gmarcosb@users.noreply.github.com> Date: Fri, 18 Oct 2024 15:32:08 -0600 Subject: [PATCH 09/20] Update zapt templates to handle typedef --- .../templates/app/cluster-typedefs-check.zapt | 29 ------------------- 1 file changed, 29 deletions(-) delete mode 100644 src/app/zap-templates/templates/app/cluster-typedefs-check.zapt diff --git a/src/app/zap-templates/templates/app/cluster-typedefs-check.zapt b/src/app/zap-templates/templates/app/cluster-typedefs-check.zapt deleted file mode 100644 index a2a3d4ac1e4f4e..00000000000000 --- a/src/app/zap-templates/templates/app/cluster-typedefs-check.zapt +++ /dev/null @@ -1,29 +0,0 @@ -{{> header}} - -#pragma once - -#include - -namespace chip { -namespace app { -namespace Clusters { -{{#zcl_typedefs}} -{{#if has_more_than_one_cluster}} -{{> cluster_typedefs_ensure_known_value ns="detail"}} -{{else if has_no_clusters}} -{{> cluster_typedefs_ensure_known_value ns="Globals"}} - -{{/if}} -{{/zcl_typedefs}} - -{{#zcl_clusters}} -{{#zcl_typedefs}} -{{#unless has_more_than_one_cluster}} -{{> cluster_typedefs_ensure_known_value ns=(asUpperCamelCase ../name)}} -{{/unless}} -{{/zcl_typedefs}} - -{{/zcl_clusters}} -} // namespace Clusters -} // namespace app -} // namespace chip From b2465cd0cd44d21147a56247d76575e7ddc6c6d5 Mon Sep 17 00:00:00 2001 From: marcos <15697303+gmarcosb@users.noreply.github.com> Date: Tue, 12 Nov 2024 15:17:30 -0700 Subject: [PATCH 10/20] Add global-typedefs.xml reference --- src/app/zap-templates/zcl/zcl-with-test-extensions.json | 1 + 1 file changed, 1 insertion(+) diff --git a/src/app/zap-templates/zcl/zcl-with-test-extensions.json b/src/app/zap-templates/zcl/zcl-with-test-extensions.json index de05ac7e8a180f..aae3d6066d2e2f 100644 --- a/src/app/zap-templates/zcl/zcl-with-test-extensions.json +++ b/src/app/zap-templates/zcl/zcl-with-test-extensions.json @@ -65,6 +65,7 @@ "global-bitmaps.xml", "global-enums.xml", "global-structs.xml", + "global-typedefs.xml", "groups-cluster.xml", "group-key-mgmt-cluster.xml", "icd-management-cluster.xml", From d78868c9aaa26032150efa64456bd773c11c44d3 Mon Sep 17 00:00:00 2001 From: marcos <15697303+gmarcosb@users.noreply.github.com> Date: Tue, 26 Nov 2024 10:21:57 -0700 Subject: [PATCH 11/20] Template fixes --- .../matter_idl/generators/idl/MatterIdl.jinja | 10 +++++++++- .../py_matter_idl/matter_idl/test_matter_idl_parser.py | 4 ++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/scripts/py_matter_idl/matter_idl/generators/idl/MatterIdl.jinja b/scripts/py_matter_idl/matter_idl/generators/idl/MatterIdl.jinja index a7a83745693229..160c882da92107 100644 --- a/scripts/py_matter_idl/matter_idl/generators/idl/MatterIdl.jinja +++ b/scripts/py_matter_idl/matter_idl/generators/idl/MatterIdl.jinja @@ -55,8 +55,9 @@ bitmap {{bitmap.name}} : {{ bitmap.base_type}} { {% endfor %} -{% for typedef in idl.global_typedefs %} +{%- for typedef in idl.global_typedefs %} typedef {{typedef.name}} : {{ typedef.base_type}}; +{% endfor %} {%- for cluster in idl.clusters %} {% if cluster.description %}/** {{cluster.description}} */ @@ -86,6 +87,13 @@ typedef {{typedef.name}} : {{ typedef.base_type}}; {% endfor %} + {%- for typedef in cluster.typedefs | selectattr("is_global")%} + /* GLOBAL: + typedef {{typedef.name}} : {{ typedef.base_type}}; + */ + + {% endfor %} + {%- for s in cluster.structs | selectattr("is_global") %} /* GLOBAL: {{render_struct(s) | indent(2)}} diff --git a/scripts/py_matter_idl/matter_idl/test_matter_idl_parser.py b/scripts/py_matter_idl/matter_idl/test_matter_idl_parser.py index 319567d7ff6ee8..405d9ad1e9bac1 100755 --- a/scripts/py_matter_idl/matter_idl/test_matter_idl_parser.py +++ b/scripts/py_matter_idl/matter_idl/test_matter_idl_parser.py @@ -34,7 +34,7 @@ from matter_idl.matter_idl_types import (AccessPrivilege, ApiMaturity, Attribute, AttributeInstantiation, AttributeQuality, AttributeStorage, Bitmap, Cluster, Command, CommandInstantiation, CommandQuality, ConstantEntry, DataType, DeviceType, Endpoint, Enum, Event, EventPriority, EventQuality, - Field, FieldQuality, Idl, ParseMetaData, ServerClusterInstantiation, Struct, StructTag) + Field, FieldQuality, Idl, ParseMetaData, ServerClusterInstantiation, Struct, StructTag, Typedef) class GeneratorContentStorage(GeneratorStorage): @@ -339,7 +339,7 @@ def test_cluster_enum(self): def test_cluster_typedef(self): actual = parseText(""" client cluster WithTypedefs = 0xab { - typedef TestTypedef : int16u + typedef TestTypedef : int16u; } """) expected = Idl(clusters=[ From b5ba77a07ca5d45c1e5ff849aac25aef596de6b8 Mon Sep 17 00:00:00 2001 From: marcos <15697303+gmarcosb@users.noreply.github.com> Date: Thu, 5 Dec 2024 16:10:31 -0700 Subject: [PATCH 12/20] Additional updates to zapt templates to handle typedef --- .../templates/commands.zapt | 29 +- .../templates/partials/decodable_value.zapt | 2 +- src/app/common/BUILD.gn | 9 + src/app/common/templates/templates.json | 9 + .../partials/cluster-typedefs-typedef.zapt | 2 + .../templates/app/cluster-objects.zapt | 1 + .../templates/app/cluster-typedefs.zapt | 6 +- .../zcl/data-model/chip/test-cluster.xml | 2 +- .../zcl/zcl-with-test-extensions.json | 10 +- src/app/zap-templates/zcl/zcl.json | 10 +- .../java/templates/partials/decode_value.zapt | 106 +- .../CHIP/templates/partials/decode_value.zapt | 58 +- .../CHIP/templates/partials/encode_value.zapt | 38 +- .../MTRAttributeSpecifiedCheck.mm | 6 + .../MTRAttributeTLVValueDecoder.mm | 103 ++ .../CHIP/zap-generated/MTRBaseClusters.mm | 1541 ++++++++++------- .../CHIP/zap-generated/MTRClusterNames.mm | 8 + .../CHIP/zap-generated/MTRClusters.mm | 32 + .../zap-generated/MTRCommandPayloadsObjc.mm | 217 +++ .../CHIP/zap-generated/MTRStructsObjc.mm | 24 +- src/lib/core/BUILD.gn | 1 + .../zap-generated/cluster-objects.h | 158 +- 22 files changed, 1516 insertions(+), 856 deletions(-) create mode 100644 src/app/zap-templates/partials/cluster-typedefs-typedef.zapt diff --git a/examples/darwin-framework-tool/templates/commands.zapt b/examples/darwin-framework-tool/templates/commands.zapt index 3b80f653c82a14..2b3206afbb6f5a 100644 --- a/examples/darwin-framework-tool/templates/commands.zapt +++ b/examples/darwin-framework-tool/templates/commands.zapt @@ -223,29 +223,14 @@ public: params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; {{#if_chip_complex}} - {{asObjectiveCType type parent.name}} value; - {{>decodable_value target="value" source="mValue" cluster=parent.name errorCode="return err;" depth=0}} + {{asObjectiveCType type parent.name}} value; + {{>decodable_value target="value" source="mValue" cluster=parent.name errorCode="return err;" depth=0}} + {{else if isNullable}} + {{asObjectiveCType type parent.name}} value; + {{>decodable_value target="value" source="mValue" cluster=parent.name isOptional=false isArray=false errorCode="return err;" depth=0}} {{else}} - {{#if isNullable}} - {{asObjectiveCType type parent.name}} value = nil; - if (!mValue.IsNull()) { - {{#if (isOctetString type)}} - value = [[NSData alloc] initWithBytes:mValue.Value().data() length:mValue.Value().size()]; - {{else if (isString type)}} - value = [[NSString alloc] initWithBytes:mValue.Value().data() length:mValue.Value().size() encoding:NSUTF8StringEncoding]; - {{else}} - value = [NSNumber numberWith{{asObjectiveCNumberType "" type false}}:mValue.Value()]; - {{/if}} - } - {{else}} - {{#if (isOctetString type)}} - {{asObjectiveCType type parent.name}} value = [[NSData alloc] initWithBytes:mValue.data() length:mValue.size()]; - {{else if (isString type)}} - {{asObjectiveCType type parent.name}} value = [[NSString alloc] initWithBytes:mValue.data() length:mValue.size() encoding:NSUTF8StringEncoding]; - {{else}} - {{asObjectiveCType type parent.name}} value = [NSNumber numberWith{{asObjectiveCNumberType "" type false}}:mValue{{#if isNullable}}.Value(){{/if}}]; - {{/if}} - {{/if}} + {{asObjectiveCType type parent.name}} + {{>decodable_value target="value" source="mValue" cluster=parent.name isOptional=false isArray=false errorCode="return err;" depth=0}} {{/if_chip_complex}} [cluster write{{>attribute}}WithValue:value params:params completion:^(NSError * _Nullable error) { diff --git a/examples/darwin-framework-tool/templates/partials/decodable_value.zapt b/examples/darwin-framework-tool/templates/partials/decodable_value.zapt index 07e791dcafa2a1..1f81430200cb82 100644 --- a/examples/darwin-framework-tool/templates/partials/decodable_value.zapt +++ b/examples/darwin-framework-tool/templates/partials/decodable_value.zapt @@ -29,7 +29,7 @@ {{else}} {{#if_is_typedef type}} {{#zcl_typedef_by_typedef_and_cluster_name type cluster}} - {{>decodable_value type=typeId target=target source=source errorCode=errorCode depth=(incrementDepth ../depth) }} + {{>decodable_value target=../target source=../source errorCode=../errorCode cluster=../cluster depth=../depth }} {{/zcl_typedef_by_typedef_and_cluster_name}} {{else}} {{#if_is_strongly_typed_chip_enum type}} diff --git a/src/app/common/BUILD.gn b/src/app/common/BUILD.gn index 36022674cc053a..1a533ed46e5a3a 100644 --- a/src/app/common/BUILD.gn +++ b/src/app/common/BUILD.gn @@ -68,3 +68,12 @@ source_set("enums") { public_configs = [ ":includes" ] } + +source_set("typedefs") { + sources = [ + "${chip_root}/zzz_generated/app-common/app-common/zap-generated/cluster-typedefs-check.h", + "${chip_root}/zzz_generated/app-common/app-common/zap-generated/cluster-typedefs.h", + ] + + public_configs = [ ":includes" ] +} diff --git a/src/app/common/templates/templates.json b/src/app/common/templates/templates.json index 148ab5419f5b84..4fe98783763d35 100644 --- a/src/app/common/templates/templates.json +++ b/src/app/common/templates/templates.json @@ -25,6 +25,10 @@ "name": "cluster_enums_enum", "path": "../../zap-templates/partials/cluster-enums-enum.zapt" }, + { + "name": "cluster_typedefs_typedef", + "path": "../../zap-templates/partials/cluster-typedefs-typedef.zapt" + }, { "name": "cluster_enums_ensure_known_value", "path": "../../zap-templates/partials/cluster-enums-ensure-known-value.zapt" @@ -98,6 +102,11 @@ "path": "../../zap-templates/templates/app/cluster-enums-check.zapt", "name": "Enum and bitmap method check header for clusters", "output": "cluster-enums-check.h" + }, + { + "path": "../../zap-templates/templates/app/cluster-typedefs.zapt", + "name": "Typedef header for clusters", + "output": "cluster-typedefs.h" } ] } diff --git a/src/app/zap-templates/partials/cluster-typedefs-typedef.zapt b/src/app/zap-templates/partials/cluster-typedefs-typedef.zapt new file mode 100644 index 00000000000000..9bf5e237922c2b --- /dev/null +++ b/src/app/zap-templates/partials/cluster-typedefs-typedef.zapt @@ -0,0 +1,2 @@ +// Typedef for {{label}} +using {{asType label}} = {{zapTypeToEncodableClusterObjectType type}}; \ No newline at end of file diff --git a/src/app/zap-templates/templates/app/cluster-objects.zapt b/src/app/zap-templates/templates/app/cluster-objects.zapt index 00cd367f85bfcb..8ccc0f2e8c8fa9 100644 --- a/src/app/zap-templates/templates/app/cluster-objects.zapt +++ b/src/app/zap-templates/templates/app/cluster-objects.zapt @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include diff --git a/src/app/zap-templates/templates/app/cluster-typedefs.zapt b/src/app/zap-templates/templates/app/cluster-typedefs.zapt index 18382e0188fdb6..fc6e8c2a009113 100644 --- a/src/app/zap-templates/templates/app/cluster-typedefs.zapt +++ b/src/app/zap-templates/templates/app/cluster-typedefs.zapt @@ -15,7 +15,7 @@ namespace detail { {{#if has_more_than_one_cluster}} -{{> cluster_typedefs_enum ns=""}} +{{> cluster_typedefs_typedef ns=""}} {{/if}} {{/zcl_typedefs}} @@ -28,7 +28,7 @@ namespace Globals { {{#if has_no_clusters}} -{{> cluster_typedefs_enum ns=""}} +{{> cluster_typedefs_typedef ns=""}} {{/if}} {{/zcl_typedefs}} @@ -41,7 +41,7 @@ namespace {{asUpperCamelCase name}} { {{#if has_more_than_one_cluster}} using {{asUpperCamelCase name}} = Clusters::detail::{{asUpperCamelCase name}}; {{else}} -{{> cluster_typedefs_enum ns=(asUpperCamelCase ../name)}} +{{> cluster_typedefs_typedef ns=(asUpperCamelCase ../name)}} {{/if}} {{/zcl_typedefs}} diff --git a/src/app/zap-templates/zcl/data-model/chip/test-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/test-cluster.xml index 8b4e3c5b81fca1..c50a1fa3f5095c 100644 --- a/src/app/zap-templates/zcl/data-model/chip/test-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/test-cluster.xml @@ -60,7 +60,7 @@ limitations under the License. - + diff --git a/src/app/zap-templates/zcl/zcl-with-test-extensions.json b/src/app/zap-templates/zcl/zcl-with-test-extensions.json index aae3d6066d2e2f..8e85bd7c7862d0 100644 --- a/src/app/zap-templates/zcl/zcl-with-test-extensions.json +++ b/src/app/zap-templates/zcl/zcl-with-test-extensions.json @@ -683,7 +683,15 @@ }, "mandatoryDeviceTypes": "0x0016", "defaultReportingPolicy": "mandatory", - "ZCLDataTypes": ["ARRAY", "BITMAP", "ENUM", "NUMBER", "STRING", "STRUCT", "TYPEDEF"], + "ZCLDataTypes": [ + "ARRAY", + "BITMAP", + "ENUM", + "NUMBER", + "STRING", + "STRUCT", + "TYPEDEF" + ], "fabricHandling": { "automaticallyCreateFields": true, "indexFieldId": 254, diff --git a/src/app/zap-templates/zcl/zcl.json b/src/app/zap-templates/zcl/zcl.json index d8d67ea1e81bba..5d26de9fff5d56 100644 --- a/src/app/zap-templates/zcl/zcl.json +++ b/src/app/zap-templates/zcl/zcl.json @@ -677,7 +677,15 @@ }, "mandatoryDeviceTypes": "0x0016", "defaultReportingPolicy": "mandatory", - "ZCLDataTypes": ["ARRAY", "BITMAP", "ENUM", "NUMBER", "STRING", "STRUCT", "TYPEDEF"], + "ZCLDataTypes": [ + "ARRAY", + "BITMAP", + "ENUM", + "NUMBER", + "STRING", + "STRUCT", + "TYPEDEF" + ], "fabricHandling": { "automaticallyCreateFields": true, "indexFieldId": 254, diff --git a/src/controller/java/templates/partials/decode_value.zapt b/src/controller/java/templates/partials/decode_value.zapt index 2a807d418924ff..4f5885c7be487a 100644 --- a/src/controller/java/templates/partials/decode_value.zapt +++ b/src/controller/java/templates/partials/decode_value.zapt @@ -25,66 +25,58 @@ if ({{source}}.IsNull()) { {{>decode_value target=(concat "newElement_" depth) source=(concat "entry_" depth) cluster=cluster depth=(incrementDepth depth) isArray=false forceNotList=true omitDeclaration=false earlyReturn=earlyReturn}} chip::JniReferences::GetInstance().AddToList({{target}}, newElement_{{depth}}); } -{{else}} - {{#if_is_typedef type}} - {{#zcl_typedef_by_typedef_and_cluster_name type cluster}} - {{>decode_value type=typeId target=target source=source errorCode=errorCode depth=(incrementDepth ../depth) isNullable=isNullable omitDeclaration=omitDeclaration earlyReturn=earlyReturn }} - {{/zcl_typedef_by_typedef_and_cluster_name}} - {{else}} - {{#if_is_struct type}} - {{#zcl_struct_items_by_struct_and_cluster_name type cluster}} - {{>decode_value target=(concat ../target "_" (asLowerCamelCase label)) source=(concat ../source "." (asLowerCamelCase label)) cluster=../cluster depth=(incrementDepth ../depth) omitDeclaration=false earlyReturn=../earlyReturn}} - {{/zcl_struct_items_by_struct_and_cluster_name}} +{{else if_is_typedef type}} + {{#zcl_typedef_by_typedef_and_cluster_name type cluster}} + {{>decode_value target=../target source=../source cluster=../cluster errorCode=../errorCode depth=../depth isNullable=../isNullable omitDeclaration=../omitDeclaration earlyReturn=../earlyReturn }} + {{/zcl_typedef_by_typedef_and_cluster_name}} +{{else if_is_struct type}} + {{#zcl_struct_items_by_struct_and_cluster_name type cluster}} + {{>decode_value target=(concat ../target "_" (asLowerCamelCase label)) source=(concat ../source "." (asLowerCamelCase label)) cluster=../cluster depth=(incrementDepth ../depth) omitDeclaration=false earlyReturn=../earlyReturn}} + {{/zcl_struct_items_by_struct_and_cluster_name}} - { - jclass {{asLowerCamelCase type}}StructClass_{{depth}}; - err = chip::JniReferences::GetInstance().GetLocalClassRef(env, "chip/devicecontroller/ChipStructs${{asUpperCamelCase cluster}}Cluster{{asUpperCamelCase type}}", {{asLowerCamelCase type}}StructClass_{{depth}}); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs${{asUpperCamelCase cluster}}Cluster{{asUpperCamelCase type}}"); - return {{earlyReturn}}; - } + { + jclass {{asLowerCamelCase type}}StructClass_{{depth}}; + err = chip::JniReferences::GetInstance().GetLocalClassRef(env, "chip/devicecontroller/ChipStructs${{asUpperCamelCase cluster}}Cluster{{asUpperCamelCase type}}", {{asLowerCamelCase type}}StructClass_{{depth}}); + if (err != CHIP_NO_ERROR) { + ChipLogError(Zcl, "Could not find class ChipStructs${{asUpperCamelCase cluster}}Cluster{{asUpperCamelCase type}}"); + return {{earlyReturn}}; + } - jmethodID {{asLowerCamelCase type}}StructCtor_{{depth}}; - err = chip::JniReferences::GetInstance().FindMethod( - env, {{asLowerCamelCase type}}StructClass_{{depth}}, "", - "({{#zcl_struct_items_by_struct_and_cluster_name type cluster}}{{asJniSignature type null (asUpperCamelCase ../cluster) true}}{{/zcl_struct_items_by_struct_and_cluster_name}})V", - &{{asLowerCamelCase type}}StructCtor_{{depth}}); - if (err != CHIP_NO_ERROR || {{asLowerCamelCase type}}StructCtor_{{depth}} == nullptr) { - ChipLogError(Zcl, "Could not find ChipStructs${{asUpperCamelCase cluster}}Cluster{{asUpperCamelCase type}} constructor"); - return {{earlyReturn}}; - } + jmethodID {{asLowerCamelCase type}}StructCtor_{{depth}}; + err = chip::JniReferences::GetInstance().FindMethod( + env, {{asLowerCamelCase type}}StructClass_{{depth}}, "", + "({{#zcl_struct_items_by_struct_and_cluster_name type cluster}}{{asJniSignature type null (asUpperCamelCase ../cluster) true}}{{/zcl_struct_items_by_struct_and_cluster_name}})V", + &{{asLowerCamelCase type}}StructCtor_{{depth}}); + if (err != CHIP_NO_ERROR || {{asLowerCamelCase type}}StructCtor_{{depth}} == nullptr) { + ChipLogError(Zcl, "Could not find ChipStructs${{asUpperCamelCase cluster}}Cluster{{asUpperCamelCase type}} constructor"); + return {{earlyReturn}}; + } - {{target}} = env->NewObject({{asLowerCamelCase type}}StructClass_{{depth}}, {{asLowerCamelCase type}}StructCtor_{{depth}} - {{#zcl_struct_items_by_struct_and_cluster_name type cluster}} - , {{../target}}_{{asLowerCamelCase label}} + {{target}} = env->NewObject({{asLowerCamelCase type}}StructClass_{{depth}}, {{asLowerCamelCase type}}StructCtor_{{depth}} + {{#zcl_struct_items_by_struct_and_cluster_name type cluster}} + , {{../target}}_{{asLowerCamelCase label}} {{/zcl_struct_items_by_struct_and_cluster_name}} ); - } - {{else}} - {{#if_is_strongly_typed_chip_enum type}} - std::string {{target}}ClassName = "{{asJniClassName type null (asUpperCamelCase cluster)}}"; - std::string {{target}}CtorSignature = "({{asJniSignature type null (asUpperCamelCase cluster) false}})V"; - {{asJniBasicType type false}} jni{{target}} = static_cast<{{asJniBasicType type false}}>({{source}}); - chip::JniReferences::GetInstance().CreateBoxedObject<{{asJniBasicType type false}}>({{target}}ClassName.c_str(), {{target}}CtorSignature.c_str(), jni{{target}}, {{target}}); - {{else}} - {{#if (isOctetString type)}} - jbyteArray {{target}}ByteArray = env->NewByteArray(static_cast({{source}}.size())); - env->SetByteArrayRegion({{target}}ByteArray, 0, static_cast({{source}}.size()), reinterpret_cast({{source}}.data())); - {{target}} = {{target}}ByteArray; - {{else if (isCharString type)}} - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF({{source}}, {{target}})); - {{else}} - std::string {{target}}ClassName = "{{asJniClassName type null (asUpperCamelCase cluster)}}"; - std::string {{target}}CtorSignature = "({{asJniSignature type null (asUpperCamelCase cluster) false}})V"; - {{#if_is_strongly_typed_bitmap type}} - {{asJniBasicType type false}} jni{{target}} = static_cast<{{asJniBasicType type false}}>({{source}}.Raw()); - chip::JniReferences::GetInstance().CreateBoxedObject<{{asJniBasicType type false}}>({{target}}ClassName.c_str(), {{target}}CtorSignature.c_str(), jni{{target}}, {{target}}); - {{else}} - {{asJniBasicType type false}} jni{{target}} = static_cast<{{asJniBasicType type false}}>({{source}}); - chip::JniReferences::GetInstance().CreateBoxedObject<{{asJniBasicType type false}}>({{target}}ClassName.c_str(), {{target}}CtorSignature.c_str(), jni{{target}}, {{target}}); - {{/if_is_strongly_typed_bitmap}} - {{/if}} - {{/if_is_strongly_typed_chip_enum}} - {{/if_is_struct}} - {{/if_is_typedef}} +} +{{else if_is_strongly_typed_chip_enum type}} + std::string {{target}}ClassName = "{{asJniClassName type null (asUpperCamelCase cluster)}}"; + std::string {{target}}CtorSignature = "({{asJniSignature type null (asUpperCamelCase cluster) false}})V"; + {{asJniBasicType type false}} jni{{target}} = static_cast<{{asJniBasicType type false}}>({{source}}); + chip::JniReferences::GetInstance().CreateBoxedObject<{{asJniBasicType type false}}>({{target}}ClassName.c_str(), {{target}}CtorSignature.c_str(), jni{{target}}, {{target}}); +{{else if (isOctetString type)}} + jbyteArray {{target}}ByteArray = env->NewByteArray(static_cast({{source}}.size())); + env->SetByteArrayRegion({{target}}ByteArray, 0, static_cast({{source}}.size()), reinterpret_cast({{source}}.data())); + {{target}} = {{target}}ByteArray; +{{else if (isCharString type)}} + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF({{source}}, {{target}})); +{{else}} + std::string {{target}}ClassName = "{{asJniClassName type null (asUpperCamelCase cluster)}}"; + std::string {{target}}CtorSignature = "({{asJniSignature type null (asUpperCamelCase cluster) false}})V"; + {{#if_is_strongly_typed_bitmap type}} + {{asJniBasicType type false}} jni{{target}} = static_cast<{{asJniBasicType type false}}>({{source}}.Raw()); + chip::JniReferences::GetInstance().CreateBoxedObject<{{asJniBasicType type false}}>({{target}}ClassName.c_str(), {{target}}CtorSignature.c_str(), jni{{target}}, {{target}}); + {{else}} + {{asJniBasicType type false}} jni{{target}} = static_cast<{{asJniBasicType type false}}>({{source}}); + chip::JniReferences::GetInstance().CreateBoxedObject<{{asJniBasicType type false}}>({{target}}ClassName.c_str(), {{target}}CtorSignature.c_str(), jni{{target}}, {{target}}); + {{/if_is_strongly_typed_bitmap}} {{/if}} \ No newline at end of file diff --git a/src/darwin/Framework/CHIP/templates/partials/decode_value.zapt b/src/darwin/Framework/CHIP/templates/partials/decode_value.zapt index ae178118abb36f..ec2fcdd955ca43 100644 --- a/src/darwin/Framework/CHIP/templates/partials/decode_value.zapt +++ b/src/darwin/Framework/CHIP/templates/partials/decode_value.zapt @@ -26,38 +26,30 @@ } {{target}} = array_{{depth}}; } +{{else if_is_typedef type}} + {{#zcl_typedef_by_typedef_and_cluster_name type cluster}} + {{>decode_value target=../target cluster=../cluster source=../source errorCode=../errorCode depth=(incrementDepth ../depth) }} + {{/zcl_typedef_by_typedef_and_cluster_name}} +{{else if_is_struct type}} + {{target}} = [{{asObjectiveCClass type cluster forceNotList=true}} new]; + {{#zcl_struct_items_by_struct_and_cluster_name type cluster}} + {{#if (isSupported (asUpperCamelCase ../cluster preserveAcronyms=true) struct=(asUpperCamelCase ../type preserveAcronyms=true) structField=(asStructPropertyName label))}} + {{>decode_value target=(concat ../target "." (asStructPropertyName label)) source=(concat ../source "." (asLowerCamelCase label)) cluster=../cluster errorCode=../errorCode depth=(incrementDepth ../depth) }} + {{/if}} + {{/zcl_struct_items_by_struct_and_cluster_name}} +{{else if_is_strongly_typed_chip_enum type}} + {{target}} = [NSNumber numberWith{{asObjectiveCNumberType "" type false}}:chip::to_underlying({{source}})]; +{{else if_is_strongly_typed_bitmap type}} + {{target}} = [NSNumber numberWith{{asObjectiveCNumberType "" type false}}:{{source}}.Raw()]; +{{else if (isOctetString type)}} + {{target}} = AsData({{source}}); +{{else if (isCharString type)}} + {{target}} = AsString({{source}}); + if ({{target}} == nil) { + {{! Invalid UTF-8. Just make up an error for now. }} + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + {{errorCode}} + } {{else}} - {{#if_is_typedef type}} - {{#zcl_typedef_by_typedef_and_cluster_name type cluster}} - {{>decode_value type=typeId target=target source=source errorCode=errorCode depth=(incrementDepth ../depth) }} - {{/zcl_typedef_by_typedef_and_cluster_name}} - {{else}} - {{#if_is_struct type}} - {{target}} = [{{asObjectiveCClass type cluster forceNotList=true}} new]; - {{#zcl_struct_items_by_struct_and_cluster_name type cluster}} - {{#if (isSupported (asUpperCamelCase ../cluster preserveAcronyms=true) struct=(asUpperCamelCase ../type preserveAcronyms=true) structField=(asStructPropertyName label))}} - {{>decode_value target=(concat ../target "." (asStructPropertyName label)) source=(concat ../source "." (asLowerCamelCase label)) cluster=../cluster errorCode=../errorCode depth=(incrementDepth ../depth) }} - {{/if}} - {{/zcl_struct_items_by_struct_and_cluster_name}} - {{else}} - {{#if_is_strongly_typed_chip_enum type}} - {{target}} = [NSNumber numberWith{{asObjectiveCNumberType "" type false}}:chip::to_underlying({{source}})]; - {{else}} - {{#if_is_strongly_typed_bitmap type}} - {{target}} = [NSNumber numberWith{{asObjectiveCNumberType "" type false}}:{{source}}.Raw()]; - {{else if (isOctetString type)}} - {{target}} = AsData({{source}}); - {{else if (isCharString type)}} - {{target}} = AsString({{source}}); - if ({{target}} == nil) { - {{! Invalid UTF-8. Just make up an error for now. }} - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - {{errorCode}} - } - {{else}} - {{target}} = [NSNumber numberWith{{asObjectiveCNumberType "" type false}}:{{source}}]; - {{/if_is_strongly_typed_bitmap}} - {{/if_is_strongly_typed_chip_enum}} - {{/if_is_struct}} - {{/if_is_typedef}} + {{target}} = [NSNumber numberWith{{asObjectiveCNumberType "" type false}}:{{source}}]; {{/if}} diff --git a/src/darwin/Framework/CHIP/templates/partials/encode_value.zapt b/src/darwin/Framework/CHIP/templates/partials/encode_value.zapt index c610319f53c4e6..700c5d98be10c5 100644 --- a/src/darwin/Framework/CHIP/templates/partials/encode_value.zapt +++ b/src/darwin/Framework/CHIP/templates/partials/encode_value.zapt @@ -44,28 +44,20 @@ {{target}} = AsByteSpan({{source}}); {{else if (isCharString type)}} {{target}} = AsCharSpan({{source}}); +{{else if_is_typedef type}} + {{#zcl_typedef_by_typedef_and_cluster_name type cluster}} + {{>encode_value target=../target source=../source cluster=../cluster errorCode=../errorCode depth=(incrementDepth ../depth) }} + {{/zcl_typedef_by_typedef_and_cluster_name}} +{{else if_is_struct type}} + {{#zcl_struct_items_by_struct_and_cluster_name type cluster}} + {{#if (isSupported (asUpperCamelCase ../cluster preserveAcronyms=true) struct=(asUpperCamelCase ../type preserveAcronyms=true) structField=(asStructPropertyName label))}} + {{>encode_value target=(concat ../target "." (asLowerCamelCase label)) source=(concat ../source "." (asStructPropertyName label)) cluster=../cluster errorCode=../errorCode depth=(incrementDepth ../depth)}} + {{/if}} + {{/zcl_struct_items_by_struct_and_cluster_name}} +{{else if_is_strongly_typed_chip_enum type}} + {{target}} = static_cast>({{source}}.{{asObjectiveCNumberType source type true}}Value); +{{else if_is_strongly_typed_bitmap type}} + {{target}} = static_cast>({{source}}.{{asObjectiveCNumberType source type true}}Value); {{else}} - {{#if_is_typedef type}} - {{#zcl_typedef_by_typedef_and_cluster_name type cluster}} - {{>encode_value type=typeId target=target source=source errorCode=errorCode depth=(incrementDepth ../depth) }} - {{/zcl_typedef_by_typedef_and_cluster_name}} - {{else}} - {{#if_is_struct type}} - {{#zcl_struct_items_by_struct_and_cluster_name type cluster}} - {{#if (isSupported (asUpperCamelCase ../cluster preserveAcronyms=true) struct=(asUpperCamelCase ../type preserveAcronyms=true) structField=(asStructPropertyName label))}} - {{>encode_value target=(concat ../target "." (asLowerCamelCase label)) source=(concat ../source "." (asStructPropertyName label)) cluster=../cluster errorCode=../errorCode depth=(incrementDepth ../depth)}} - {{/if}} - {{/zcl_struct_items_by_struct_and_cluster_name}} - {{else}} - {{#if_is_strongly_typed_chip_enum type}} - {{target}} = static_cast>({{source}}.{{asObjectiveCNumberType source type true}}Value); - {{else}} - {{#if_is_strongly_typed_bitmap type}} - {{target}} = static_cast>({{source}}.{{asObjectiveCNumberType source type true}}Value); - {{else}} - {{target}} = {{source}}.{{asObjectiveCNumberType source type true}}Value; - {{/if_is_strongly_typed_bitmap}} - {{/if_is_strongly_typed_chip_enum}} - {{/if_is_struct}} - {{/if_is_typedef}} + {{target}} = {{source}}.{{asObjectiveCNumberType source type true}}Value; {{/if}} diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm index ce5c71d23f1d69..67efc827efd974 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm @@ -6150,6 +6150,12 @@ static BOOL AttributeIsSpecifiedInUnitTestingCluster(AttributeId aAttributeId) case Attributes::NullableGlobalStruct::Id: { return YES; } + case Attributes::NullableTypedefAttr::Id: { + return YES; + } + case Attributes::NullableGlobalTypedef::Id: { + return YES; + } case Attributes::GeneratedCommandList::Id: { return YES; } diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm index 975c3b63f4a587..b1b6a8866d0821 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm @@ -18519,6 +18519,12 @@ static id _Nullable DecodeAttributeValueForUnitTestingCluster(AttributeId aAttri } else { newElement_0.nullableStruct.i = nil; } + if (entry_0.nullableStruct.Value().j.HasValue()) { + newElement_0.nullableStruct.j = [NSNumber numberWithUnsignedLongLong:entry_0.nullableStruct.Value().j.Value()]; + } else { + newElement_0.nullableStruct.j = nil; + } + newElement_0.nullableStruct.k = [NSNumber numberWithUnsignedInt:entry_0.nullableStruct.Value().k]; } if (entry_0.optionalStruct.HasValue()) { newElement_0.optionalStruct = [MTRUnitTestingClusterSimpleStruct new]; @@ -18540,6 +18546,12 @@ static id _Nullable DecodeAttributeValueForUnitTestingCluster(AttributeId aAttri } else { newElement_0.optionalStruct.i = nil; } + if (entry_0.optionalStruct.Value().j.HasValue()) { + newElement_0.optionalStruct.j = [NSNumber numberWithUnsignedLongLong:entry_0.optionalStruct.Value().j.Value()]; + } else { + newElement_0.optionalStruct.j = nil; + } + newElement_0.optionalStruct.k = [NSNumber numberWithUnsignedInt:entry_0.optionalStruct.Value().k]; } else { newElement_0.optionalStruct = nil; } @@ -18566,6 +18578,12 @@ static id _Nullable DecodeAttributeValueForUnitTestingCluster(AttributeId aAttri } else { newElement_0.nullableOptionalStruct.i = nil; } + if (entry_0.nullableOptionalStruct.Value().Value().j.HasValue()) { + newElement_0.nullableOptionalStruct.j = [NSNumber numberWithUnsignedLongLong:entry_0.nullableOptionalStruct.Value().Value().j.Value()]; + } else { + newElement_0.nullableOptionalStruct.j = nil; + } + newElement_0.nullableOptionalStruct.k = [NSNumber numberWithUnsignedInt:entry_0.nullableOptionalStruct.Value().Value().k]; } } else { newElement_0.nullableOptionalStruct = nil; @@ -18634,6 +18652,25 @@ static id _Nullable DecodeAttributeValueForUnitTestingCluster(AttributeId aAttri } else { newElement_0.nullableOptionalList = nil; } + if (entry_0.nullableTypedef.IsNull()) { + newElement_0.nullableTypedef = nil; + } else { + newElement_0.nullableTypedef = [NSNumber numberWithUnsignedLongLong:entry_0.nullableTypedef.Value()]; + } + if (entry_0.optionalTypedef.HasValue()) { + newElement_0.optionalTypedef = [NSNumber numberWithUnsignedLongLong:entry_0.optionalTypedef.Value()]; + } else { + newElement_0.optionalTypedef = nil; + } + if (entry_0.nullableOptionalTypedef.HasValue()) { + if (entry_0.nullableOptionalTypedef.Value().IsNull()) { + newElement_0.nullableOptionalTypedef = nil; + } else { + newElement_0.nullableOptionalTypedef = [NSNumber numberWithUnsignedLongLong:entry_0.nullableOptionalTypedef.Value().Value()]; + } + } else { + newElement_0.nullableOptionalTypedef = nil; + } [array_0 addObject:newElement_0]; } CHIP_ERROR err = iter_0.GetStatus(); @@ -18683,6 +18720,12 @@ static id _Nullable DecodeAttributeValueForUnitTestingCluster(AttributeId aAttri } else { value.i = nil; } + if (cppValue.j.HasValue()) { + value.j = [NSNumber numberWithUnsignedLongLong:cppValue.j.Value()]; + } else { + value.j = nil; + } + value.k = [NSNumber numberWithUnsignedInt:cppValue.k]; return value; } case Attributes::RangeRestrictedInt8u::Id: { @@ -18815,6 +18858,12 @@ static id _Nullable DecodeAttributeValueForUnitTestingCluster(AttributeId aAttri } else { newElement_0.fabricSensitiveStruct.i = nil; } + if (entry_0.fabricSensitiveStruct.j.HasValue()) { + newElement_0.fabricSensitiveStruct.j = [NSNumber numberWithUnsignedLongLong:entry_0.fabricSensitiveStruct.j.Value()]; + } else { + newElement_0.fabricSensitiveStruct.j = nil; + } + newElement_0.fabricSensitiveStruct.k = [NSNumber numberWithUnsignedInt:entry_0.fabricSensitiveStruct.k]; { // Scope for our temporary variables auto * array_2 = [NSMutableArray new]; auto iter_2 = entry_0.fabricSensitiveInt8uList.begin(); @@ -18916,6 +18965,15 @@ static id _Nullable DecodeAttributeValueForUnitTestingCluster(AttributeId aAttri } else { value.myEnum = nil; } + if (cppValue.myTypedef.HasValue()) { + if (cppValue.myTypedef.Value().IsNull()) { + value.myTypedef = nil; + } else { + value.myTypedef = [NSNumber numberWithUnsignedInt:cppValue.myTypedef.Value().Value()]; + } + } else { + value.myTypedef = nil; + } return value; } case Attributes::Unsupported::Id: { @@ -19406,6 +19464,12 @@ static id _Nullable DecodeAttributeValueForUnitTestingCluster(AttributeId aAttri } else { value.i = nil; } + if (cppValue.Value().j.HasValue()) { + value.j = [NSNumber numberWithUnsignedLongLong:cppValue.Value().j.Value()]; + } else { + value.j = nil; + } + value.k = [NSNumber numberWithUnsignedInt:cppValue.Value().k]; } return value; } @@ -19527,6 +19591,45 @@ static id _Nullable DecodeAttributeValueForUnitTestingCluster(AttributeId aAttri } else { value.myEnum = nil; } + if (cppValue.Value().myTypedef.HasValue()) { + if (cppValue.Value().myTypedef.Value().IsNull()) { + value.myTypedef = nil; + } else { + value.myTypedef = [NSNumber numberWithUnsignedInt:cppValue.Value().myTypedef.Value().Value()]; + } + } else { + value.myTypedef = nil; + } + } + return value; + } + case Attributes::NullableTypedefAttr::Id: { + using TypeInfo = Attributes::NullableTypedefAttr::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedLongLong:cppValue.Value()]; + } + return value; + } + case Attributes::NullableGlobalTypedef::Id: { + using TypeInfo = Attributes::NullableGlobalTypedef::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; } return value; } diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm index 47d9cb14157fe9..88cf7477dbd527 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm @@ -144,7 +144,7 @@ - (void)writeAttributeIdentifyTimeWithValue:(NSNumber * _Nonnull)value params:(M ListFreer listFreer; using TypeInfo = Identify::Attributes::IdentifyTime::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; + cppValue = value.unsignedShortValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -1573,7 +1573,7 @@ - (void)writeAttributeOnTimeWithValue:(NSNumber * _Nonnull)value params:(MTRWrit ListFreer listFreer; using TypeInfo = OnOff::Attributes::OnTime::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; + cppValue = value.unsignedShortValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -1637,7 +1637,7 @@ - (void)writeAttributeOffWaitTimeWithValue:(NSNumber * _Nonnull)value params:(MT ListFreer listFreer; using TypeInfo = OnOff::Attributes::OffWaitTime::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; + cppValue = value.unsignedShortValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -1705,7 +1705,7 @@ - (void)writeAttributeStartUpOnOffWithValue:(NSNumber * _Nullable)value params:( cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = static_cast>(value.unsignedCharValue); + nonNullValue_0 = static_cast>(value.unsignedCharValue); } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -2855,7 +2855,7 @@ - (void)writeAttributeOptionsWithValue:(NSNumber * _Nonnull)value params:(MTRWri ListFreer listFreer; using TypeInfo = LevelControl::Attributes::Options::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedCharValue); + cppValue = static_cast>(value.unsignedCharValue); chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -2919,7 +2919,7 @@ - (void)writeAttributeOnOffTransitionTimeWithValue:(NSNumber * _Nonnull)value pa ListFreer listFreer; using TypeInfo = LevelControl::Attributes::OnOffTransitionTime::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; + cppValue = value.unsignedShortValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -2987,7 +2987,7 @@ - (void)writeAttributeOnLevelWithValue:(NSNumber * _Nullable)value params:(MTRWr cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedCharValue; + nonNullValue_0 = value.unsignedCharValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -3056,7 +3056,7 @@ - (void)writeAttributeOnTransitionTimeWithValue:(NSNumber * _Nullable)value para cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedShortValue; + nonNullValue_0 = value.unsignedShortValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -3125,7 +3125,7 @@ - (void)writeAttributeOffTransitionTimeWithValue:(NSNumber * _Nullable)value par cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedShortValue; + nonNullValue_0 = value.unsignedShortValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -3194,7 +3194,7 @@ - (void)writeAttributeDefaultMoveRateWithValue:(NSNumber * _Nullable)value param cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedCharValue; + nonNullValue_0 = value.unsignedCharValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -3263,7 +3263,7 @@ - (void)writeAttributeStartUpCurrentLevelWithValue:(NSNumber * _Nullable)value p cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedCharValue; + nonNullValue_0 = value.unsignedCharValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -5180,23 +5180,23 @@ - (void)writeAttributeBindingWithValue:(NSArray * _Nonnull)value params:(MTRWrit MTR_LOG_ERROR("%@ incorrectly present in list of %@", value[i_0], NSStringFromClass(MTRBindingClusterTargetStruct.class)); return CHIP_ERROR_INVALID_ARGUMENT; } - if (element_0.node != nil) { - auto & definedValue_2 = listHolder_0->mList[i_0].node.Emplace(); - definedValue_2 = element_0.node.unsignedLongLongValue; + if (element_0.node != nil) { + auto & definedValue_2 = listHolder_0->mList[i_0].node.Emplace(); + definedValue_2 = element_0.node.unsignedLongLongValue; } - if (element_0.group != nil) { - auto & definedValue_2 = listHolder_0->mList[i_0].group.Emplace(); - definedValue_2 = element_0.group.unsignedShortValue; + if (element_0.group != nil) { + auto & definedValue_2 = listHolder_0->mList[i_0].group.Emplace(); + definedValue_2 = element_0.group.unsignedShortValue; } - if (element_0.endpoint != nil) { - auto & definedValue_2 = listHolder_0->mList[i_0].endpoint.Emplace(); - definedValue_2 = element_0.endpoint.unsignedShortValue; + if (element_0.endpoint != nil) { + auto & definedValue_2 = listHolder_0->mList[i_0].endpoint.Emplace(); + definedValue_2 = element_0.endpoint.unsignedShortValue; } - if (element_0.cluster != nil) { - auto & definedValue_2 = listHolder_0->mList[i_0].cluster.Emplace(); - definedValue_2 = element_0.cluster.unsignedIntValue; + if (element_0.cluster != nil) { + auto & definedValue_2 = listHolder_0->mList[i_0].cluster.Emplace(); + definedValue_2 = element_0.cluster.unsignedIntValue; } - listHolder_0->mList[i_0].fabricIndex = element_0.fabricIndex.unsignedCharValue; + listHolder_0->mList[i_0].fabricIndex = element_0.fabricIndex.unsignedCharValue; } cppValue = ListType_0(listHolder_0->mList, value.count); } else { @@ -5720,82 +5720,82 @@ - (void)writeAttributeACLWithValue:(NSArray * _Nonnull)value params:(MTRWritePar MTR_LOG_ERROR("%@ incorrectly present in list of %@", value[i_0], NSStringFromClass(MTRAccessControlClusterAccessControlEntryStruct.class)); return CHIP_ERROR_INVALID_ARGUMENT; } - listHolder_0->mList[i_0].privilege = static_castmList[i_0].privilege)>>(element_0.privilege.unsignedCharValue); - listHolder_0->mList[i_0].authMode = static_castmList[i_0].authMode)>>(element_0.authMode.unsignedCharValue); - if (element_0.subjects == nil) { - listHolder_0->mList[i_0].subjects.SetNull(); - } else { - auto & nonNullValue_2 = listHolder_0->mList[i_0].subjects.SetNonNull(); - { - using ListType_3 = std::remove_reference_t; - using ListMemberType_3 = ListMemberTypeGetter::Type; - if (element_0.subjects.count != 0) { - auto * listHolder_3 = new ListHolder(element_0.subjects.count); - if (listHolder_3 == nullptr || listHolder_3->mList == nullptr) { + listHolder_0->mList[i_0].privilege = static_castmList[i_0].privilege)>>(element_0.privilege.unsignedCharValue); + listHolder_0->mList[i_0].authMode = static_castmList[i_0].authMode)>>(element_0.authMode.unsignedCharValue); + if (element_0.subjects == nil) { + listHolder_0->mList[i_0].subjects.SetNull(); + } else { + auto & nonNullValue_2 = listHolder_0->mList[i_0].subjects.SetNonNull(); + { + using ListType_3 = std::remove_reference_t; + using ListMemberType_3 = ListMemberTypeGetter::Type; + if (element_0.subjects.count != 0) { + auto * listHolder_3 = new ListHolder(element_0.subjects.count); + if (listHolder_3 == nullptr || listHolder_3->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_3); + for (size_t i_3 = 0; i_3 < element_0.subjects.count; ++i_3) { + auto element_3 = MTR_SAFE_CAST(element_0.subjects[i_3], NSNumber); + if (!element_3) { + // Wrong kind of value. + MTR_LOG_ERROR("%@ incorrectly present in list of %@", element_0.subjects[i_3], NSStringFromClass(NSNumber.class)); return CHIP_ERROR_INVALID_ARGUMENT; } - listFreer.add(listHolder_3); - for (size_t i_3 = 0; i_3 < element_0.subjects.count; ++i_3) { - auto element_3 = MTR_SAFE_CAST(element_0.subjects[i_3], NSNumber); - if (!element_3) { - // Wrong kind of value. - MTR_LOG_ERROR("%@ incorrectly present in list of %@", element_0.subjects[i_3], NSStringFromClass(NSNumber.class)); - return CHIP_ERROR_INVALID_ARGUMENT; - } - listHolder_3->mList[i_3] = element_3.unsignedLongLongValue; + listHolder_3->mList[i_3] = element_3.unsignedLongLongValue; } - nonNullValue_2 = ListType_3(listHolder_3->mList, element_0.subjects.count); - } else { - nonNullValue_2 = ListType_3(); - } + nonNullValue_2 = ListType_3(listHolder_3->mList, element_0.subjects.count); + } else { + nonNullValue_2 = ListType_3(); } - } - if (element_0.targets == nil) { - listHolder_0->mList[i_0].targets.SetNull(); - } else { - auto & nonNullValue_2 = listHolder_0->mList[i_0].targets.SetNonNull(); - { - using ListType_3 = std::remove_reference_t; - using ListMemberType_3 = ListMemberTypeGetter::Type; - if (element_0.targets.count != 0) { - auto * listHolder_3 = new ListHolder(element_0.targets.count); - if (listHolder_3 == nullptr || listHolder_3->mList == nullptr) { + } + } + if (element_0.targets == nil) { + listHolder_0->mList[i_0].targets.SetNull(); + } else { + auto & nonNullValue_2 = listHolder_0->mList[i_0].targets.SetNonNull(); + { + using ListType_3 = std::remove_reference_t; + using ListMemberType_3 = ListMemberTypeGetter::Type; + if (element_0.targets.count != 0) { + auto * listHolder_3 = new ListHolder(element_0.targets.count); + if (listHolder_3 == nullptr || listHolder_3->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_3); + for (size_t i_3 = 0; i_3 < element_0.targets.count; ++i_3) { + auto element_3 = MTR_SAFE_CAST(element_0.targets[i_3], MTRAccessControlClusterAccessControlTargetStruct); + if (!element_3) { + // Wrong kind of value. + MTR_LOG_ERROR("%@ incorrectly present in list of %@", element_0.targets[i_3], NSStringFromClass(MTRAccessControlClusterAccessControlTargetStruct.class)); return CHIP_ERROR_INVALID_ARGUMENT; } - listFreer.add(listHolder_3); - for (size_t i_3 = 0; i_3 < element_0.targets.count; ++i_3) { - auto element_3 = MTR_SAFE_CAST(element_0.targets[i_3], MTRAccessControlClusterAccessControlTargetStruct); - if (!element_3) { - // Wrong kind of value. - MTR_LOG_ERROR("%@ incorrectly present in list of %@", element_0.targets[i_3], NSStringFromClass(MTRAccessControlClusterAccessControlTargetStruct.class)); - return CHIP_ERROR_INVALID_ARGUMENT; - } - if (element_3.cluster == nil) { - listHolder_3->mList[i_3].cluster.SetNull(); - } else { - auto & nonNullValue_5 = listHolder_3->mList[i_3].cluster.SetNonNull(); - nonNullValue_5 = element_3.cluster.unsignedIntValue; + if (element_3.cluster == nil) { + listHolder_3->mList[i_3].cluster.SetNull(); + } else { + auto & nonNullValue_5 = listHolder_3->mList[i_3].cluster.SetNonNull(); + nonNullValue_5 = element_3.cluster.unsignedIntValue; } - if (element_3.endpoint == nil) { - listHolder_3->mList[i_3].endpoint.SetNull(); - } else { - auto & nonNullValue_5 = listHolder_3->mList[i_3].endpoint.SetNonNull(); - nonNullValue_5 = element_3.endpoint.unsignedShortValue; + if (element_3.endpoint == nil) { + listHolder_3->mList[i_3].endpoint.SetNull(); + } else { + auto & nonNullValue_5 = listHolder_3->mList[i_3].endpoint.SetNonNull(); + nonNullValue_5 = element_3.endpoint.unsignedShortValue; } - if (element_3.deviceType == nil) { - listHolder_3->mList[i_3].deviceType.SetNull(); - } else { - auto & nonNullValue_5 = listHolder_3->mList[i_3].deviceType.SetNonNull(); - nonNullValue_5 = element_3.deviceType.unsignedIntValue; + if (element_3.deviceType == nil) { + listHolder_3->mList[i_3].deviceType.SetNull(); + } else { + auto & nonNullValue_5 = listHolder_3->mList[i_3].deviceType.SetNonNull(); + nonNullValue_5 = element_3.deviceType.unsignedIntValue; } } - nonNullValue_2 = ListType_3(listHolder_3->mList, element_0.targets.count); - } else { - nonNullValue_2 = ListType_3(); - } + nonNullValue_2 = ListType_3(listHolder_3->mList, element_0.targets.count); + } else { + nonNullValue_2 = ListType_3(); } - } - listHolder_0->mList[i_0].fabricIndex = element_0.fabricIndex.unsignedCharValue; + } + } + listHolder_0->mList[i_0].fabricIndex = element_0.fabricIndex.unsignedCharValue; } cppValue = ListType_0(listHolder_0->mList, value.count); } else { @@ -5881,8 +5881,8 @@ - (void)writeAttributeExtensionWithValue:(NSArray * _Nonnull)value params:(MTRWr MTR_LOG_ERROR("%@ incorrectly present in list of %@", value[i_0], NSStringFromClass(MTRAccessControlClusterAccessControlExtensionStruct.class)); return CHIP_ERROR_INVALID_ARGUMENT; } - listHolder_0->mList[i_0].data = AsByteSpan(element_0.data); - listHolder_0->mList[i_0].fabricIndex = element_0.fabricIndex.unsignedCharValue; + listHolder_0->mList[i_0].data = AsByteSpan(element_0.data); + listHolder_0->mList[i_0].fabricIndex = element_0.fabricIndex.unsignedCharValue; } cppValue = ListType_0(listHolder_0->mList, value.count); } else { @@ -8287,7 +8287,7 @@ - (void)writeAttributeLocalConfigDisabledWithValue:(NSNumber * _Nonnull)value pa ListFreer listFreer; using TypeInfo = BasicInformation::Attributes::LocalConfigDisabled::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.boolValue; + cppValue = value.boolValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -10183,9 +10183,9 @@ - (void)writeAttributeDefaultOTAProvidersWithValue:(NSArray * _Nonnull)value par MTR_LOG_ERROR("%@ incorrectly present in list of %@", value[i_0], NSStringFromClass(MTROTASoftwareUpdateRequestorClusterProviderLocation.class)); return CHIP_ERROR_INVALID_ARGUMENT; } - listHolder_0->mList[i_0].providerNodeID = element_0.providerNodeID.unsignedLongLongValue; - listHolder_0->mList[i_0].endpoint = element_0.endpoint.unsignedShortValue; - listHolder_0->mList[i_0].fabricIndex = element_0.fabricIndex.unsignedCharValue; + listHolder_0->mList[i_0].providerNodeID = element_0.providerNodeID.unsignedLongLongValue; + listHolder_0->mList[i_0].endpoint = element_0.endpoint.unsignedShortValue; + listHolder_0->mList[i_0].fabricIndex = element_0.fabricIndex.unsignedCharValue; } cppValue = ListType_0(listHolder_0->mList, value.count); } else { @@ -11438,7 +11438,7 @@ - (void)writeAttributeHourFormatWithValue:(NSNumber * _Nonnull)value params:(MTR ListFreer listFreer; using TypeInfo = TimeFormatLocalization::Attributes::HourFormat::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedCharValue); + cppValue = static_cast>(value.unsignedCharValue); chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -11502,7 +11502,7 @@ - (void)writeAttributeActiveCalendarTypeWithValue:(NSNumber * _Nonnull)value par ListFreer listFreer; using TypeInfo = TimeFormatLocalization::Attributes::ActiveCalendarType::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedCharValue); + cppValue = static_cast>(value.unsignedCharValue); chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -12093,7 +12093,7 @@ - (void)writeAttributeTemperatureUnitWithValue:(NSNumber * _Nonnull)value params ListFreer listFreer; using TypeInfo = UnitLocalization::Attributes::TemperatureUnit::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedCharValue); + cppValue = static_cast>(value.unsignedCharValue); chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -15719,7 +15719,7 @@ - (void)writeAttributeBreadcrumbWithValue:(NSNumber * _Nonnull)value params:(MTR ListFreer listFreer; using TypeInfo = GeneralCommissioning::Attributes::Breadcrumb::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedLongLongValue; + cppValue = value.unsignedLongLongValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -17006,7 +17006,7 @@ - (void)writeAttributeInterfaceEnabledWithValue:(NSNumber * _Nonnull)value param ListFreer listFreer; using TypeInfo = NetworkCommissioning::Attributes::InterfaceEnabled::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.boolValue; + cppValue = value.boolValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -32228,9 +32228,9 @@ - (void)writeAttributeGroupKeyMapWithValue:(NSArray * _Nonnull)value params:(MTR MTR_LOG_ERROR("%@ incorrectly present in list of %@", value[i_0], NSStringFromClass(MTRGroupKeyManagementClusterGroupKeyMapStruct.class)); return CHIP_ERROR_INVALID_ARGUMENT; } - listHolder_0->mList[i_0].groupId = element_0.groupId.unsignedShortValue; - listHolder_0->mList[i_0].groupKeySetID = element_0.groupKeySetID.unsignedShortValue; - listHolder_0->mList[i_0].fabricIndex = element_0.fabricIndex.unsignedCharValue; + listHolder_0->mList[i_0].groupId = element_0.groupId.unsignedShortValue; + listHolder_0->mList[i_0].groupKeySetID = element_0.groupKeySetID.unsignedShortValue; + listHolder_0->mList[i_0].fabricIndex = element_0.fabricIndex.unsignedCharValue; } cppValue = ListType_0(listHolder_0->mList, value.count); } else { @@ -33410,8 +33410,8 @@ - (void)writeAttributeLabelListWithValue:(NSArray * _Nonnull)value params:(MTRWr MTR_LOG_ERROR("%@ incorrectly present in list of %@", value[i_0], NSStringFromClass(MTRUserLabelClusterLabelStruct.class)); return CHIP_ERROR_INVALID_ARGUMENT; } - listHolder_0->mList[i_0].label = AsCharSpan(element_0.label); - listHolder_0->mList[i_0].value = AsCharSpan(element_0.value); + listHolder_0->mList[i_0].label = AsCharSpan(element_0.label); + listHolder_0->mList[i_0].value = AsCharSpan(element_0.value); } cppValue = ListType_0(listHolder_0->mList, value.count); } else { @@ -35959,7 +35959,7 @@ - (void)writeAttributeStartUpModeWithValue:(NSNumber * _Nullable)value params:(M cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedCharValue; + nonNullValue_0 = value.unsignedCharValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -36028,7 +36028,7 @@ - (void)writeAttributeOnModeWithValue:(NSNumber * _Nullable)value params:(MTRWri cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedCharValue; + nonNullValue_0 = value.unsignedCharValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -36317,7 +36317,7 @@ - (void)writeAttributeSelectedDrynessLevelWithValue:(NSNumber * _Nullable)value cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = static_cast>(value.unsignedCharValue); + nonNullValue_0 = static_cast>(value.unsignedCharValue); } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -36739,7 +36739,7 @@ - (void)writeAttributeStartUpModeWithValue:(NSNumber * _Nullable)value params:(M cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedCharValue; + nonNullValue_0 = value.unsignedCharValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -36808,7 +36808,7 @@ - (void)writeAttributeOnModeWithValue:(NSNumber * _Nullable)value params:(MTRWri cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedCharValue; + nonNullValue_0 = value.unsignedCharValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -37576,7 +37576,7 @@ - (void)writeAttributeStartUpModeWithValue:(NSNumber * _Nullable)value params:(M cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedCharValue; + nonNullValue_0 = value.unsignedCharValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -37645,7 +37645,7 @@ - (void)writeAttributeOnModeWithValue:(NSNumber * _Nullable)value params:(MTRWri cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedCharValue; + nonNullValue_0 = value.unsignedCharValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -37995,7 +37995,7 @@ - (void)writeAttributeStartUpModeWithValue:(NSNumber * _Nullable)value params:(M cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedCharValue; + nonNullValue_0 = value.unsignedCharValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -38064,7 +38064,7 @@ - (void)writeAttributeOnModeWithValue:(NSNumber * _Nullable)value params:(MTRWri cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedCharValue; + nonNullValue_0 = value.unsignedCharValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -38353,7 +38353,7 @@ - (void)writeAttributeSpinSpeedCurrentWithValue:(NSNumber * _Nullable)value para cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedCharValue; + nonNullValue_0 = value.unsignedCharValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -38418,7 +38418,7 @@ - (void)writeAttributeNumberOfRinsesWithValue:(NSNumber * _Nonnull)value params: ListFreer listFreer; using TypeInfo = LaundryWasherControls::Attributes::NumberOfRinses::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedCharValue); + cppValue = static_cast>(value.unsignedCharValue); chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -40086,7 +40086,7 @@ - (void)writeAttributeStartUpModeWithValue:(NSNumber * _Nullable)value params:(M cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedCharValue; + nonNullValue_0 = value.unsignedCharValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -40155,7 +40155,7 @@ - (void)writeAttributeOnModeWithValue:(NSNumber * _Nullable)value params:(MTRWri cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedCharValue; + nonNullValue_0 = value.unsignedCharValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -41049,7 +41049,7 @@ - (void)writeAttributeSmokeSensitivityLevelWithValue:(NSNumber * _Nonnull)value ListFreer listFreer; using TypeInfo = SmokeCoAlarm::Attributes::SmokeSensitivityLevel::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedCharValue); + cppValue = static_cast>(value.unsignedCharValue); chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -44187,7 +44187,7 @@ - (void)writeAttributeLastChangedTimeWithValue:(NSNumber * _Nullable)value param cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedIntValue; + nonNullValue_0 = value.unsignedIntValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -44649,7 +44649,7 @@ - (void)writeAttributeLastChangedTimeWithValue:(NSNumber * _Nullable)value param cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedIntValue; + nonNullValue_0 = value.unsignedIntValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -44983,7 +44983,7 @@ - (void)writeAttributeCurrentSensitivityLevelWithValue:(NSNumber * _Nonnull)valu ListFreer listFreer; using TypeInfo = BooleanStateConfiguration::Attributes::CurrentSensitivityLevel::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; + cppValue = value.unsignedCharValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -45580,7 +45580,7 @@ - (void)writeAttributeDefaultOpenDurationWithValue:(NSNumber * _Nullable)value p cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedIntValue; + nonNullValue_0 = value.unsignedIntValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -45861,7 +45861,7 @@ - (void)writeAttributeDefaultOpenLevelWithValue:(NSNumber * _Nonnull)value param ListFreer listFreer; using TypeInfo = ValveConfigurationAndControl::Attributes::DefaultOpenLevel::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; + cppValue = value.unsignedCharValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -48243,7 +48243,7 @@ - (void)writeAttributeDefaultRandomStartWithValue:(NSNumber * _Nonnull)value par ListFreer listFreer; using TypeInfo = DemandResponseLoadControl::Attributes::DefaultRandomStart::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; + cppValue = value.unsignedCharValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -48307,7 +48307,7 @@ - (void)writeAttributeDefaultRandomDurationWithValue:(NSNumber * _Nonnull)value ListFreer listFreer; using TypeInfo = DemandResponseLoadControl::Attributes::DefaultRandomDuration::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; + cppValue = value.unsignedCharValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -50067,7 +50067,7 @@ - (void)writeAttributeUserMaximumChargeCurrentWithValue:(NSNumber * _Nonnull)val ListFreer listFreer; using TypeInfo = EnergyEvse::Attributes::UserMaximumChargeCurrent::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.longLongValue; + cppValue = value.longLongValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -50131,7 +50131,7 @@ - (void)writeAttributeRandomizationDelayWindowWithValue:(NSNumber * _Nonnull)val ListFreer listFreer; using TypeInfo = EnergyEvse::Attributes::RandomizationDelayWindow::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedIntValue; + cppValue = value.unsignedIntValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -50343,7 +50343,7 @@ - (void)writeAttributeApproximateEVEfficiencyWithValue:(NSNumber * _Nullable)val cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedShortValue; + nonNullValue_0 = value.unsignedShortValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -50880,7 +50880,7 @@ - (void)writeAttributeCurrentEnergyBalanceWithValue:(NSNumber * _Nonnull)value p ListFreer listFreer; using TypeInfo = EnergyPreference::Attributes::CurrentEnergyBalance::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; + cppValue = value.unsignedCharValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -51016,7 +51016,7 @@ - (void)writeAttributeCurrentLowPowerModeSensitivityWithValue:(NSNumber * _Nonnu ListFreer listFreer; using TypeInfo = EnergyPreference::Attributes::CurrentLowPowerModeSensitivity::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; + cppValue = value.unsignedCharValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -53058,7 +53058,7 @@ - (void)writeAttributeDoorOpenEventsWithValue:(NSNumber * _Nonnull)value params: ListFreer listFreer; using TypeInfo = DoorLock::Attributes::DoorOpenEvents::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedIntValue; + cppValue = value.unsignedIntValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -53122,7 +53122,7 @@ - (void)writeAttributeDoorClosedEventsWithValue:(NSNumber * _Nonnull)value param ListFreer listFreer; using TypeInfo = DoorLock::Attributes::DoorClosedEvents::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedIntValue; + cppValue = value.unsignedIntValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -53186,7 +53186,7 @@ - (void)writeAttributeOpenPeriodWithValue:(NSNumber * _Nonnull)value params:(MTR ListFreer listFreer; using TypeInfo = DoorLock::Attributes::OpenPeriod::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; + cppValue = value.unsignedShortValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -53746,7 +53746,7 @@ - (void)writeAttributeLEDSettingsWithValue:(NSNumber * _Nonnull)value params:(MT ListFreer listFreer; using TypeInfo = DoorLock::Attributes::LEDSettings::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; + cppValue = value.unsignedCharValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -53810,7 +53810,7 @@ - (void)writeAttributeAutoRelockTimeWithValue:(NSNumber * _Nonnull)value params: ListFreer listFreer; using TypeInfo = DoorLock::Attributes::AutoRelockTime::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedIntValue; + cppValue = value.unsignedIntValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -53874,7 +53874,7 @@ - (void)writeAttributeSoundVolumeWithValue:(NSNumber * _Nonnull)value params:(MT ListFreer listFreer; using TypeInfo = DoorLock::Attributes::SoundVolume::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; + cppValue = value.unsignedCharValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -53938,7 +53938,7 @@ - (void)writeAttributeOperatingModeWithValue:(NSNumber * _Nonnull)value params:( ListFreer listFreer; using TypeInfo = DoorLock::Attributes::OperatingMode::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedCharValue); + cppValue = static_cast>(value.unsignedCharValue); chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -54074,7 +54074,7 @@ - (void)writeAttributeEnableLocalProgrammingWithValue:(NSNumber * _Nonnull)value ListFreer listFreer; using TypeInfo = DoorLock::Attributes::EnableLocalProgramming::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.boolValue; + cppValue = value.boolValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -54138,7 +54138,7 @@ - (void)writeAttributeEnableOneTouchLockingWithValue:(NSNumber * _Nonnull)value ListFreer listFreer; using TypeInfo = DoorLock::Attributes::EnableOneTouchLocking::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.boolValue; + cppValue = value.boolValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -54202,7 +54202,7 @@ - (void)writeAttributeEnableInsideStatusLEDWithValue:(NSNumber * _Nonnull)value ListFreer listFreer; using TypeInfo = DoorLock::Attributes::EnableInsideStatusLED::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.boolValue; + cppValue = value.boolValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -54266,7 +54266,7 @@ - (void)writeAttributeEnablePrivacyModeButtonWithValue:(NSNumber * _Nonnull)valu ListFreer listFreer; using TypeInfo = DoorLock::Attributes::EnablePrivacyModeButton::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.boolValue; + cppValue = value.boolValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -54330,7 +54330,7 @@ - (void)writeAttributeLocalProgrammingFeaturesWithValue:(NSNumber * _Nonnull)val ListFreer listFreer; using TypeInfo = DoorLock::Attributes::LocalProgrammingFeatures::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedCharValue); + cppValue = static_cast>(value.unsignedCharValue); chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -54394,7 +54394,7 @@ - (void)writeAttributeWrongCodeEntryLimitWithValue:(NSNumber * _Nonnull)value pa ListFreer listFreer; using TypeInfo = DoorLock::Attributes::WrongCodeEntryLimit::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; + cppValue = value.unsignedCharValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -54458,7 +54458,7 @@ - (void)writeAttributeUserCodeTemporaryDisableTimeWithValue:(NSNumber * _Nonnull ListFreer listFreer; using TypeInfo = DoorLock::Attributes::UserCodeTemporaryDisableTime::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; + cppValue = value.unsignedCharValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -54522,7 +54522,7 @@ - (void)writeAttributeSendPINOverTheAirWithValue:(NSNumber * _Nonnull)value para ListFreer listFreer; using TypeInfo = DoorLock::Attributes::SendPINOverTheAir::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.boolValue; + cppValue = value.boolValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -54586,7 +54586,7 @@ - (void)writeAttributeRequirePINforRemoteOperationWithValue:(NSNumber * _Nonnull ListFreer listFreer; using TypeInfo = DoorLock::Attributes::RequirePINforRemoteOperation::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.boolValue; + cppValue = value.boolValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -54650,7 +54650,7 @@ - (void)writeAttributeExpiringUserTimeoutWithValue:(NSNumber * _Nonnull)value pa ListFreer listFreer; using TypeInfo = DoorLock::Attributes::ExpiringUserTimeout::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; + cppValue = value.unsignedShortValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -57822,7 +57822,7 @@ - (void)writeAttributeModeWithValue:(NSNumber * _Nonnull)value params:(MTRWriteP ListFreer listFreer; using TypeInfo = WindowCovering::Attributes::Mode::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedCharValue); + cppValue = static_cast>(value.unsignedCharValue); chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -60219,7 +60219,7 @@ - (void)writeAttributeLifetimeRunningHoursWithValue:(NSNumber * _Nullable)value cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedIntValue; + nonNullValue_0 = value.unsignedIntValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -60324,7 +60324,7 @@ - (void)writeAttributeLifetimeEnergyConsumedWithValue:(NSNumber * _Nullable)valu cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedIntValue; + nonNullValue_0 = value.unsignedIntValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -60389,7 +60389,7 @@ - (void)writeAttributeOperationModeWithValue:(NSNumber * _Nonnull)value params:( ListFreer listFreer; using TypeInfo = PumpConfigurationAndControl::Attributes::OperationMode::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedCharValue); + cppValue = static_cast>(value.unsignedCharValue); chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -60453,7 +60453,7 @@ - (void)writeAttributeControlModeWithValue:(NSNumber * _Nonnull)value params:(MT ListFreer listFreer; using TypeInfo = PumpConfigurationAndControl::Attributes::ControlMode::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedCharValue); + cppValue = static_cast>(value.unsignedCharValue); chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -62221,7 +62221,7 @@ - (void)writeAttributeHVACSystemTypeConfigurationWithValue:(NSNumber * _Nonnull) ListFreer listFreer; using TypeInfo = Thermostat::Attributes::HVACSystemTypeConfiguration::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedCharValue); + cppValue = static_cast>(value.unsignedCharValue); chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -62285,7 +62285,7 @@ - (void)writeAttributeLocalTemperatureCalibrationWithValue:(NSNumber * _Nonnull) ListFreer listFreer; using TypeInfo = Thermostat::Attributes::LocalTemperatureCalibration::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.charValue; + cppValue = value.charValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -62349,7 +62349,7 @@ - (void)writeAttributeOccupiedCoolingSetpointWithValue:(NSNumber * _Nonnull)valu ListFreer listFreer; using TypeInfo = Thermostat::Attributes::OccupiedCoolingSetpoint::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.shortValue; + cppValue = value.shortValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -62413,7 +62413,7 @@ - (void)writeAttributeOccupiedHeatingSetpointWithValue:(NSNumber * _Nonnull)valu ListFreer listFreer; using TypeInfo = Thermostat::Attributes::OccupiedHeatingSetpoint::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.shortValue; + cppValue = value.shortValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -62477,7 +62477,7 @@ - (void)writeAttributeUnoccupiedCoolingSetpointWithValue:(NSNumber * _Nonnull)va ListFreer listFreer; using TypeInfo = Thermostat::Attributes::UnoccupiedCoolingSetpoint::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.shortValue; + cppValue = value.shortValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -62541,7 +62541,7 @@ - (void)writeAttributeUnoccupiedHeatingSetpointWithValue:(NSNumber * _Nonnull)va ListFreer listFreer; using TypeInfo = Thermostat::Attributes::UnoccupiedHeatingSetpoint::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.shortValue; + cppValue = value.shortValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -62605,7 +62605,7 @@ - (void)writeAttributeMinHeatSetpointLimitWithValue:(NSNumber * _Nonnull)value p ListFreer listFreer; using TypeInfo = Thermostat::Attributes::MinHeatSetpointLimit::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.shortValue; + cppValue = value.shortValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -62669,7 +62669,7 @@ - (void)writeAttributeMaxHeatSetpointLimitWithValue:(NSNumber * _Nonnull)value p ListFreer listFreer; using TypeInfo = Thermostat::Attributes::MaxHeatSetpointLimit::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.shortValue; + cppValue = value.shortValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -62733,7 +62733,7 @@ - (void)writeAttributeMinCoolSetpointLimitWithValue:(NSNumber * _Nonnull)value p ListFreer listFreer; using TypeInfo = Thermostat::Attributes::MinCoolSetpointLimit::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.shortValue; + cppValue = value.shortValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -62797,7 +62797,7 @@ - (void)writeAttributeMaxCoolSetpointLimitWithValue:(NSNumber * _Nonnull)value p ListFreer listFreer; using TypeInfo = Thermostat::Attributes::MaxCoolSetpointLimit::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.shortValue; + cppValue = value.shortValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -62861,7 +62861,7 @@ - (void)writeAttributeMinSetpointDeadBandWithValue:(NSNumber * _Nonnull)value pa ListFreer listFreer; using TypeInfo = Thermostat::Attributes::MinSetpointDeadBand::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.charValue; + cppValue = value.charValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -62925,7 +62925,7 @@ - (void)writeAttributeRemoteSensingWithValue:(NSNumber * _Nonnull)value params:( ListFreer listFreer; using TypeInfo = Thermostat::Attributes::RemoteSensing::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedCharValue); + cppValue = static_cast>(value.unsignedCharValue); chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -62989,7 +62989,7 @@ - (void)writeAttributeControlSequenceOfOperationWithValue:(NSNumber * _Nonnull)v ListFreer listFreer; using TypeInfo = Thermostat::Attributes::ControlSequenceOfOperation::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedCharValue); + cppValue = static_cast>(value.unsignedCharValue); chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -63053,7 +63053,7 @@ - (void)writeAttributeSystemModeWithValue:(NSNumber * _Nonnull)value params:(MTR ListFreer listFreer; using TypeInfo = Thermostat::Attributes::SystemMode::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedCharValue); + cppValue = static_cast>(value.unsignedCharValue); chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -63261,7 +63261,7 @@ - (void)writeAttributeTemperatureSetpointHoldWithValue:(NSNumber * _Nonnull)valu ListFreer listFreer; using TypeInfo = Thermostat::Attributes::TemperatureSetpointHold::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedCharValue); + cppValue = static_cast>(value.unsignedCharValue); chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -63329,7 +63329,7 @@ - (void)writeAttributeTemperatureSetpointHoldDurationWithValue:(NSNumber * _Null cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedShortValue; + nonNullValue_0 = value.unsignedShortValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -63394,7 +63394,7 @@ - (void)writeAttributeThermostatProgrammingOperationModeWithValue:(NSNumber * _N ListFreer listFreer; using TypeInfo = Thermostat::Attributes::ThermostatProgrammingOperationMode::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedCharValue); + cppValue = static_cast>(value.unsignedCharValue); chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -63606,7 +63606,7 @@ - (void)writeAttributeOccupiedSetbackWithValue:(NSNumber * _Nullable)value param cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedCharValue; + nonNullValue_0 = value.unsignedCharValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -63747,7 +63747,7 @@ - (void)writeAttributeUnoccupiedSetbackWithValue:(NSNumber * _Nullable)value par cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedCharValue; + nonNullValue_0 = value.unsignedCharValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -63884,7 +63884,7 @@ - (void)writeAttributeEmergencyHeatDeltaWithValue:(NSNumber * _Nonnull)value par ListFreer listFreer; using TypeInfo = Thermostat::Attributes::EmergencyHeatDelta::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; + cppValue = value.unsignedCharValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -63948,7 +63948,7 @@ - (void)writeAttributeACTypeWithValue:(NSNumber * _Nonnull)value params:(MTRWrit ListFreer listFreer; using TypeInfo = Thermostat::Attributes::ACType::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedCharValue); + cppValue = static_cast>(value.unsignedCharValue); chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -64012,7 +64012,7 @@ - (void)writeAttributeACCapacityWithValue:(NSNumber * _Nonnull)value params:(MTR ListFreer listFreer; using TypeInfo = Thermostat::Attributes::ACCapacity::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; + cppValue = value.unsignedShortValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -64076,7 +64076,7 @@ - (void)writeAttributeACRefrigerantTypeWithValue:(NSNumber * _Nonnull)value para ListFreer listFreer; using TypeInfo = Thermostat::Attributes::ACRefrigerantType::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedCharValue); + cppValue = static_cast>(value.unsignedCharValue); chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -64140,7 +64140,7 @@ - (void)writeAttributeACCompressorTypeWithValue:(NSNumber * _Nonnull)value param ListFreer listFreer; using TypeInfo = Thermostat::Attributes::ACCompressorType::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedCharValue); + cppValue = static_cast>(value.unsignedCharValue); chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -64204,7 +64204,7 @@ - (void)writeAttributeACErrorCodeWithValue:(NSNumber * _Nonnull)value params:(MT ListFreer listFreer; using TypeInfo = Thermostat::Attributes::ACErrorCode::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedIntValue); + cppValue = static_cast>(value.unsignedIntValue); chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -64268,7 +64268,7 @@ - (void)writeAttributeACLouverPositionWithValue:(NSNumber * _Nonnull)value param ListFreer listFreer; using TypeInfo = Thermostat::Attributes::ACLouverPosition::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedCharValue); + cppValue = static_cast>(value.unsignedCharValue); chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -64368,7 +64368,7 @@ - (void)writeAttributeACCapacityformatWithValue:(NSNumber * _Nonnull)value param ListFreer listFreer; using TypeInfo = Thermostat::Attributes::ACCapacityformat::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedCharValue); + cppValue = static_cast>(value.unsignedCharValue); chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -64736,35 +64736,35 @@ - (void)writeAttributePresetsWithValue:(NSArray * _Nonnull)value params:(MTRWrit MTR_LOG_ERROR("%@ incorrectly present in list of %@", value[i_0], NSStringFromClass(MTRThermostatClusterPresetStruct.class)); return CHIP_ERROR_INVALID_ARGUMENT; } - if (element_0.presetHandle == nil) { - listHolder_0->mList[i_0].presetHandle.SetNull(); - } else { - auto & nonNullValue_2 = listHolder_0->mList[i_0].presetHandle.SetNonNull(); - nonNullValue_2 = AsByteSpan(element_0.presetHandle); - } - listHolder_0->mList[i_0].presetScenario = static_castmList[i_0].presetScenario)>>(element_0.presetScenario.unsignedCharValue); - if (element_0.name != nil) { - auto & definedValue_2 = listHolder_0->mList[i_0].name.Emplace(); - if (element_0.name == nil) { - definedValue_2.SetNull(); - } else { - auto & nonNullValue_3 = definedValue_2.SetNonNull(); - nonNullValue_3 = AsCharSpan(element_0.name); - } - } - if (element_0.coolingSetpoint != nil) { - auto & definedValue_2 = listHolder_0->mList[i_0].coolingSetpoint.Emplace(); - definedValue_2 = element_0.coolingSetpoint.shortValue; + if (element_0.presetHandle == nil) { + listHolder_0->mList[i_0].presetHandle.SetNull(); + } else { + auto & nonNullValue_2 = listHolder_0->mList[i_0].presetHandle.SetNonNull(); + nonNullValue_2 = AsByteSpan(element_0.presetHandle); + } + listHolder_0->mList[i_0].presetScenario = static_castmList[i_0].presetScenario)>>(element_0.presetScenario.unsignedCharValue); + if (element_0.name != nil) { + auto & definedValue_2 = listHolder_0->mList[i_0].name.Emplace(); + if (element_0.name == nil) { + definedValue_2.SetNull(); + } else { + auto & nonNullValue_3 = definedValue_2.SetNonNull(); + nonNullValue_3 = AsCharSpan(element_0.name); + } + } + if (element_0.coolingSetpoint != nil) { + auto & definedValue_2 = listHolder_0->mList[i_0].coolingSetpoint.Emplace(); + definedValue_2 = element_0.coolingSetpoint.shortValue; } - if (element_0.heatingSetpoint != nil) { - auto & definedValue_2 = listHolder_0->mList[i_0].heatingSetpoint.Emplace(); - definedValue_2 = element_0.heatingSetpoint.shortValue; + if (element_0.heatingSetpoint != nil) { + auto & definedValue_2 = listHolder_0->mList[i_0].heatingSetpoint.Emplace(); + definedValue_2 = element_0.heatingSetpoint.shortValue; } - if (element_0.builtIn == nil) { - listHolder_0->mList[i_0].builtIn.SetNull(); - } else { - auto & nonNullValue_2 = listHolder_0->mList[i_0].builtIn.SetNonNull(); - nonNullValue_2 = element_0.builtIn.boolValue; + if (element_0.builtIn == nil) { + listHolder_0->mList[i_0].builtIn.SetNull(); + } else { + auto & nonNullValue_2 = listHolder_0->mList[i_0].builtIn.SetNonNull(); + nonNullValue_2 = element_0.builtIn.boolValue; } } cppValue = ListType_0(listHolder_0->mList, value.count); @@ -64851,66 +64851,66 @@ - (void)writeAttributeSchedulesWithValue:(NSArray * _Nonnull)value params:(MTRWr MTR_LOG_ERROR("%@ incorrectly present in list of %@", value[i_0], NSStringFromClass(MTRThermostatClusterScheduleStruct.class)); return CHIP_ERROR_INVALID_ARGUMENT; } - if (element_0.scheduleHandle == nil) { - listHolder_0->mList[i_0].scheduleHandle.SetNull(); - } else { - auto & nonNullValue_2 = listHolder_0->mList[i_0].scheduleHandle.SetNonNull(); - nonNullValue_2 = AsByteSpan(element_0.scheduleHandle); - } - listHolder_0->mList[i_0].systemMode = static_castmList[i_0].systemMode)>>(element_0.systemMode.unsignedCharValue); - if (element_0.name != nil) { - auto & definedValue_2 = listHolder_0->mList[i_0].name.Emplace(); - definedValue_2 = AsCharSpan(element_0.name); - } - if (element_0.presetHandle != nil) { - auto & definedValue_2 = listHolder_0->mList[i_0].presetHandle.Emplace(); - definedValue_2 = AsByteSpan(element_0.presetHandle); - } - { - using ListType_2 = std::remove_reference_tmList[i_0].transitions)>; - using ListMemberType_2 = ListMemberTypeGetter::Type; - if (element_0.transitions.count != 0) { - auto * listHolder_2 = new ListHolder(element_0.transitions.count); - if (listHolder_2 == nullptr || listHolder_2->mList == nullptr) { + if (element_0.scheduleHandle == nil) { + listHolder_0->mList[i_0].scheduleHandle.SetNull(); + } else { + auto & nonNullValue_2 = listHolder_0->mList[i_0].scheduleHandle.SetNonNull(); + nonNullValue_2 = AsByteSpan(element_0.scheduleHandle); + } + listHolder_0->mList[i_0].systemMode = static_castmList[i_0].systemMode)>>(element_0.systemMode.unsignedCharValue); + if (element_0.name != nil) { + auto & definedValue_2 = listHolder_0->mList[i_0].name.Emplace(); + definedValue_2 = AsCharSpan(element_0.name); + } + if (element_0.presetHandle != nil) { + auto & definedValue_2 = listHolder_0->mList[i_0].presetHandle.Emplace(); + definedValue_2 = AsByteSpan(element_0.presetHandle); + } + { + using ListType_2 = std::remove_reference_tmList[i_0].transitions)>; + using ListMemberType_2 = ListMemberTypeGetter::Type; + if (element_0.transitions.count != 0) { + auto * listHolder_2 = new ListHolder(element_0.transitions.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.transitions.count; ++i_2) { + auto element_2 = MTR_SAFE_CAST(element_0.transitions[i_2], MTRThermostatClusterScheduleTransitionStruct); + if (!element_2) { + // Wrong kind of value. + MTR_LOG_ERROR("%@ incorrectly present in list of %@", element_0.transitions[i_2], NSStringFromClass(MTRThermostatClusterScheduleTransitionStruct.class)); return CHIP_ERROR_INVALID_ARGUMENT; } - listFreer.add(listHolder_2); - for (size_t i_2 = 0; i_2 < element_0.transitions.count; ++i_2) { - auto element_2 = MTR_SAFE_CAST(element_0.transitions[i_2], MTRThermostatClusterScheduleTransitionStruct); - if (!element_2) { - // Wrong kind of value. - MTR_LOG_ERROR("%@ incorrectly present in list of %@", element_0.transitions[i_2], NSStringFromClass(MTRThermostatClusterScheduleTransitionStruct.class)); - return CHIP_ERROR_INVALID_ARGUMENT; - } - listHolder_2->mList[i_2].dayOfWeek = static_castmList[i_2].dayOfWeek)>>(element_2.dayOfWeek.unsignedCharValue); - listHolder_2->mList[i_2].transitionTime = element_2.transitionTime.unsignedShortValue; - if (element_2.presetHandle != nil) { - auto & definedValue_4 = listHolder_2->mList[i_2].presetHandle.Emplace(); - definedValue_4 = AsByteSpan(element_2.presetHandle); - } - if (element_2.systemMode != nil) { - auto & definedValue_4 = listHolder_2->mList[i_2].systemMode.Emplace(); - definedValue_4 = static_cast>(element_2.systemMode.unsignedCharValue); + listHolder_2->mList[i_2].dayOfWeek = static_castmList[i_2].dayOfWeek)>>(element_2.dayOfWeek.unsignedCharValue); + listHolder_2->mList[i_2].transitionTime = element_2.transitionTime.unsignedShortValue; + if (element_2.presetHandle != nil) { + auto & definedValue_4 = listHolder_2->mList[i_2].presetHandle.Emplace(); + definedValue_4 = AsByteSpan(element_2.presetHandle); + } + if (element_2.systemMode != nil) { + auto & definedValue_4 = listHolder_2->mList[i_2].systemMode.Emplace(); + definedValue_4 = static_cast>(element_2.systemMode.unsignedCharValue); } - if (element_2.coolingSetpoint != nil) { - auto & definedValue_4 = listHolder_2->mList[i_2].coolingSetpoint.Emplace(); - definedValue_4 = element_2.coolingSetpoint.shortValue; + if (element_2.coolingSetpoint != nil) { + auto & definedValue_4 = listHolder_2->mList[i_2].coolingSetpoint.Emplace(); + definedValue_4 = element_2.coolingSetpoint.shortValue; } - if (element_2.heatingSetpoint != nil) { - auto & definedValue_4 = listHolder_2->mList[i_2].heatingSetpoint.Emplace(); - definedValue_4 = element_2.heatingSetpoint.shortValue; + if (element_2.heatingSetpoint != nil) { + auto & definedValue_4 = listHolder_2->mList[i_2].heatingSetpoint.Emplace(); + definedValue_4 = element_2.heatingSetpoint.shortValue; } } - listHolder_0->mList[i_0].transitions = ListType_2(listHolder_2->mList, element_0.transitions.count); - } else { - listHolder_0->mList[i_0].transitions = ListType_2(); - } - } - if (element_0.builtIn == nil) { - listHolder_0->mList[i_0].builtIn.SetNull(); + listHolder_0->mList[i_0].transitions = ListType_2(listHolder_2->mList, element_0.transitions.count); } else { - auto & nonNullValue_2 = listHolder_0->mList[i_0].builtIn.SetNonNull(); - nonNullValue_2 = element_0.builtIn.boolValue; + listHolder_0->mList[i_0].transitions = ListType_2(); + } + } + if (element_0.builtIn == nil) { + listHolder_0->mList[i_0].builtIn.SetNull(); + } else { + auto & nonNullValue_2 = listHolder_0->mList[i_0].builtIn.SetNonNull(); + nonNullValue_2 = element_0.builtIn.boolValue; } } cppValue = ListType_0(listHolder_0->mList, value.count); @@ -67371,7 +67371,7 @@ - (void)writeAttributeFanModeWithValue:(NSNumber * _Nonnull)value params:(MTRWri ListFreer listFreer; using TypeInfo = FanControl::Attributes::FanMode::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedCharValue); + cppValue = static_cast>(value.unsignedCharValue); chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -67435,7 +67435,7 @@ - (void)writeAttributeFanModeSequenceWithValue:(NSNumber * _Nonnull)value params ListFreer listFreer; using TypeInfo = FanControl::Attributes::FanModeSequence::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedCharValue); + cppValue = static_cast>(value.unsignedCharValue); chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -67503,7 +67503,7 @@ - (void)writeAttributePercentSettingWithValue:(NSNumber * _Nullable)value params cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedCharValue; + nonNullValue_0 = value.unsignedCharValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -67644,7 +67644,7 @@ - (void)writeAttributeSpeedSettingWithValue:(NSNumber * _Nullable)value params:( cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedCharValue; + nonNullValue_0 = value.unsignedCharValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -67781,7 +67781,7 @@ - (void)writeAttributeRockSettingWithValue:(NSNumber * _Nonnull)value params:(MT ListFreer listFreer; using TypeInfo = FanControl::Attributes::RockSetting::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedCharValue); + cppValue = static_cast>(value.unsignedCharValue); chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -67881,7 +67881,7 @@ - (void)writeAttributeWindSettingWithValue:(NSNumber * _Nonnull)value params:(MT ListFreer listFreer; using TypeInfo = FanControl::Attributes::WindSetting::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedCharValue); + cppValue = static_cast>(value.unsignedCharValue); chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -67945,7 +67945,7 @@ - (void)writeAttributeAirflowDirectionWithValue:(NSNumber * _Nonnull)value param ListFreer listFreer; using TypeInfo = FanControl::Attributes::AirflowDirection::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedCharValue); + cppValue = static_cast>(value.unsignedCharValue); chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -68812,7 +68812,7 @@ - (void)writeAttributeTemperatureDisplayModeWithValue:(NSNumber * _Nonnull)value ListFreer listFreer; using TypeInfo = ThermostatUserInterfaceConfiguration::Attributes::TemperatureDisplayMode::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedCharValue); + cppValue = static_cast>(value.unsignedCharValue); chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -68876,7 +68876,7 @@ - (void)writeAttributeKeypadLockoutWithValue:(NSNumber * _Nonnull)value params:( ListFreer listFreer; using TypeInfo = ThermostatUserInterfaceConfiguration::Attributes::KeypadLockout::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedCharValue); + cppValue = static_cast>(value.unsignedCharValue); chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -68940,7 +68940,7 @@ - (void)writeAttributeScheduleProgrammingVisibilityWithValue:(NSNumber * _Nonnul ListFreer listFreer; using TypeInfo = ThermostatUserInterfaceConfiguration::Attributes::ScheduleProgrammingVisibility::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedCharValue); + cppValue = static_cast>(value.unsignedCharValue); chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -70284,7 +70284,7 @@ - (void)writeAttributeOptionsWithValue:(NSNumber * _Nonnull)value params:(MTRWri ListFreer listFreer; using TypeInfo = ColorControl::Attributes::Options::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedCharValue); + cppValue = static_cast>(value.unsignedCharValue); chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -71032,7 +71032,7 @@ - (void)writeAttributeWhitePointXWithValue:(NSNumber * _Nonnull)value params:(MT ListFreer listFreer; using TypeInfo = ColorControl::Attributes::WhitePointX::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; + cppValue = value.unsignedShortValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -71096,7 +71096,7 @@ - (void)writeAttributeWhitePointYWithValue:(NSNumber * _Nonnull)value params:(MT ListFreer listFreer; using TypeInfo = ColorControl::Attributes::WhitePointY::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; + cppValue = value.unsignedShortValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -71160,7 +71160,7 @@ - (void)writeAttributeColorPointRXWithValue:(NSNumber * _Nonnull)value params:(M ListFreer listFreer; using TypeInfo = ColorControl::Attributes::ColorPointRX::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; + cppValue = value.unsignedShortValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -71224,7 +71224,7 @@ - (void)writeAttributeColorPointRYWithValue:(NSNumber * _Nonnull)value params:(M ListFreer listFreer; using TypeInfo = ColorControl::Attributes::ColorPointRY::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; + cppValue = value.unsignedShortValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -71292,7 +71292,7 @@ - (void)writeAttributeColorPointRIntensityWithValue:(NSNumber * _Nullable)value cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedCharValue; + nonNullValue_0 = value.unsignedCharValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -71357,7 +71357,7 @@ - (void)writeAttributeColorPointGXWithValue:(NSNumber * _Nonnull)value params:(M ListFreer listFreer; using TypeInfo = ColorControl::Attributes::ColorPointGX::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; + cppValue = value.unsignedShortValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -71421,7 +71421,7 @@ - (void)writeAttributeColorPointGYWithValue:(NSNumber * _Nonnull)value params:(M ListFreer listFreer; using TypeInfo = ColorControl::Attributes::ColorPointGY::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; + cppValue = value.unsignedShortValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -71489,7 +71489,7 @@ - (void)writeAttributeColorPointGIntensityWithValue:(NSNumber * _Nullable)value cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedCharValue; + nonNullValue_0 = value.unsignedCharValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -71554,7 +71554,7 @@ - (void)writeAttributeColorPointBXWithValue:(NSNumber * _Nonnull)value params:(M ListFreer listFreer; using TypeInfo = ColorControl::Attributes::ColorPointBX::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; + cppValue = value.unsignedShortValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -71618,7 +71618,7 @@ - (void)writeAttributeColorPointBYWithValue:(NSNumber * _Nonnull)value params:(M ListFreer listFreer; using TypeInfo = ColorControl::Attributes::ColorPointBY::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; + cppValue = value.unsignedShortValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -71686,7 +71686,7 @@ - (void)writeAttributeColorPointBIntensityWithValue:(NSNumber * _Nullable)value cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedCharValue; + nonNullValue_0 = value.unsignedCharValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -72151,7 +72151,7 @@ - (void)writeAttributeStartUpColorTemperatureMiredsWithValue:(NSNumber * _Nullab cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedShortValue; + nonNullValue_0 = value.unsignedShortValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -74714,7 +74714,7 @@ - (void)writeAttributeMinLevelWithValue:(NSNumber * _Nonnull)value params:(MTRWr ListFreer listFreer; using TypeInfo = BallastConfiguration::Attributes::MinLevel::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; + cppValue = value.unsignedCharValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -74778,7 +74778,7 @@ - (void)writeAttributeMaxLevelWithValue:(NSNumber * _Nonnull)value params:(MTRWr ListFreer listFreer; using TypeInfo = BallastConfiguration::Attributes::MaxLevel::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; + cppValue = value.unsignedCharValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -74846,7 +74846,7 @@ - (void)writeAttributeIntrinsicBallastFactorWithValue:(NSNumber * _Nullable)valu cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedCharValue; + nonNullValue_0 = value.unsignedCharValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -74915,7 +74915,7 @@ - (void)writeAttributeBallastFactorAdjustmentWithValue:(NSNumber * _Nullable)val cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedCharValue; + nonNullValue_0 = value.unsignedCharValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -75148,7 +75148,7 @@ - (void)writeAttributeLampRatedHoursWithValue:(NSNumber * _Nullable)value params cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedIntValue; + nonNullValue_0 = value.unsignedIntValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -75217,7 +75217,7 @@ - (void)writeAttributeLampBurnHoursWithValue:(NSNumber * _Nullable)value params: cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedIntValue; + nonNullValue_0 = value.unsignedIntValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -75282,7 +75282,7 @@ - (void)writeAttributeLampAlarmModeWithValue:(NSNumber * _Nonnull)value params:( ListFreer listFreer; using TypeInfo = BallastConfiguration::Attributes::LampAlarmMode::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedCharValue); + cppValue = static_cast>(value.unsignedCharValue); chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -75350,7 +75350,7 @@ - (void)writeAttributeLampBurnHoursTripPointWithValue:(NSNumber * _Nullable)valu cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedIntValue; + nonNullValue_0 = value.unsignedIntValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -80159,7 +80159,7 @@ - (void)writeAttributeHoldTimeWithValue:(NSNumber * _Nonnull)value params:(MTRWr ListFreer listFreer; using TypeInfo = OccupancySensing::Attributes::HoldTime::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; + cppValue = value.unsignedShortValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -80259,7 +80259,7 @@ - (void)writeAttributePIROccupiedToUnoccupiedDelayWithValue:(NSNumber * _Nonnull ListFreer listFreer; using TypeInfo = OccupancySensing::Attributes::PIROccupiedToUnoccupiedDelay::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; + cppValue = value.unsignedShortValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -80323,7 +80323,7 @@ - (void)writeAttributePIRUnoccupiedToOccupiedDelayWithValue:(NSNumber * _Nonnull ListFreer listFreer; using TypeInfo = OccupancySensing::Attributes::PIRUnoccupiedToOccupiedDelay::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; + cppValue = value.unsignedShortValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -80387,7 +80387,7 @@ - (void)writeAttributePIRUnoccupiedToOccupiedThresholdWithValue:(NSNumber * _Non ListFreer listFreer; using TypeInfo = OccupancySensing::Attributes::PIRUnoccupiedToOccupiedThreshold::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; + cppValue = value.unsignedCharValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -80451,7 +80451,7 @@ - (void)writeAttributeUltrasonicOccupiedToUnoccupiedDelayWithValue:(NSNumber * _ ListFreer listFreer; using TypeInfo = OccupancySensing::Attributes::UltrasonicOccupiedToUnoccupiedDelay::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; + cppValue = value.unsignedShortValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -80515,7 +80515,7 @@ - (void)writeAttributeUltrasonicUnoccupiedToOccupiedDelayWithValue:(NSNumber * _ ListFreer listFreer; using TypeInfo = OccupancySensing::Attributes::UltrasonicUnoccupiedToOccupiedDelay::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; + cppValue = value.unsignedShortValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -80579,7 +80579,7 @@ - (void)writeAttributeUltrasonicUnoccupiedToOccupiedThresholdWithValue:(NSNumber ListFreer listFreer; using TypeInfo = OccupancySensing::Attributes::UltrasonicUnoccupiedToOccupiedThreshold::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; + cppValue = value.unsignedCharValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -80643,7 +80643,7 @@ - (void)writeAttributePhysicalContactOccupiedToUnoccupiedDelayWithValue:(NSNumbe ListFreer listFreer; using TypeInfo = OccupancySensing::Attributes::PhysicalContactOccupiedToUnoccupiedDelay::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; + cppValue = value.unsignedShortValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -80707,7 +80707,7 @@ - (void)writeAttributePhysicalContactUnoccupiedToOccupiedDelayWithValue:(NSNumbe ListFreer listFreer; using TypeInfo = OccupancySensing::Attributes::PhysicalContactUnoccupiedToOccupiedDelay::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; + cppValue = value.unsignedShortValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -80771,7 +80771,7 @@ - (void)writeAttributePhysicalContactUnoccupiedToOccupiedThresholdWithValue:(NSN ListFreer listFreer; using TypeInfo = OccupancySensing::Attributes::PhysicalContactUnoccupiedToOccupiedThreshold::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; + cppValue = value.unsignedCharValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -93517,7 +93517,7 @@ - (void)writeAttributeSupportedStreamingProtocolsWithValue:(NSNumber * _Nonnull) ListFreer listFreer; using TypeInfo = ContentLauncher::Attributes::SupportedStreamingProtocols::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedIntValue); + cppValue = static_cast>(value.unsignedIntValue); chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -94743,11 +94743,11 @@ - (void)writeAttributeCurrentAppWithValue:(MTRApplicationLauncherClusterApplicat cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0.application.catalogVendorID = value.application.catalogVendorID.unsignedShortValue; - nonNullValue_0.application.applicationID = AsCharSpan(value.application.applicationID); - if (value.endpoint != nil) { - auto & definedValue_2 = nonNullValue_0.endpoint.Emplace(); - definedValue_2 = value.endpoint.unsignedShortValue; + nonNullValue_0.application.catalogVendorID = value.application.catalogVendorID.unsignedShortValue; + nonNullValue_0.application.applicationID = AsCharSpan(value.application.applicationID); + if (value.endpoint != nil) { + auto & definedValue_2 = nonNullValue_0.endpoint.Emplace(); + definedValue_2 = value.endpoint.unsignedShortValue; } } @@ -97838,13 +97838,13 @@ - (void)writeAttributeTriggersWithValue:(NSArray * _Nonnull)value params:(MTRWri MTR_LOG_ERROR("%@ incorrectly present in list of %@", value[i_0], NSStringFromClass(MTRZoneManagementClusterZoneTriggerControlStruct.class)); return CHIP_ERROR_INVALID_ARGUMENT; } - listHolder_0->mList[i_0].initialDuration = element_0.initialDuration.unsignedShortValue; - listHolder_0->mList[i_0].augmentationDuration = element_0.augmentationDuration.unsignedShortValue; - listHolder_0->mList[i_0].maxDuration = element_0.maxDuration.unsignedIntValue; - listHolder_0->mList[i_0].blindDuration = element_0.blindDuration.unsignedShortValue; - if (element_0.sensitivity != nil) { - auto & definedValue_2 = listHolder_0->mList[i_0].sensitivity.Emplace(); - definedValue_2 = element_0.sensitivity.unsignedCharValue; + listHolder_0->mList[i_0].initialDuration = element_0.initialDuration.unsignedShortValue; + listHolder_0->mList[i_0].augmentationDuration = element_0.augmentationDuration.unsignedShortValue; + listHolder_0->mList[i_0].maxDuration = element_0.maxDuration.unsignedIntValue; + listHolder_0->mList[i_0].blindDuration = element_0.blindDuration.unsignedShortValue; + if (element_0.sensitivity != nil) { + auto & definedValue_2 = listHolder_0->mList[i_0].sensitivity.Emplace(); + definedValue_2 = element_0.sensitivity.unsignedCharValue; } } cppValue = ListType_0(listHolder_0->mList, value.count); @@ -97915,7 +97915,7 @@ - (void)writeAttributeSensitivityWithValue:(NSNumber * _Nonnull)value params:(MT ListFreer listFreer; using TypeInfo = ZoneManagement::Attributes::Sensitivity::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; + cppValue = value.unsignedCharValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -98848,7 +98848,7 @@ - (void)writeAttributeHDRModeEnabledWithValue:(NSNumber * _Nonnull)value params: ListFreer listFreer; using TypeInfo = CameraAvStreamManagement::Attributes::HDRModeEnabled::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.boolValue; + cppValue = value.boolValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -99092,7 +99092,7 @@ - (void)writeAttributeSoftRecordingPrivacyModeEnabledWithValue:(NSNumber * _Nonn ListFreer listFreer; using TypeInfo = CameraAvStreamManagement::Attributes::SoftRecordingPrivacyModeEnabled::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.boolValue; + cppValue = value.boolValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -99156,7 +99156,7 @@ - (void)writeAttributeSoftLivestreamPrivacyModeEnabledWithValue:(NSNumber * _Non ListFreer listFreer; using TypeInfo = CameraAvStreamManagement::Attributes::SoftLivestreamPrivacyModeEnabled::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.boolValue; + cppValue = value.boolValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -99256,7 +99256,7 @@ - (void)writeAttributeNightVisionWithValue:(NSNumber * _Nonnull)value params:(MT ListFreer listFreer; using TypeInfo = CameraAvStreamManagement::Attributes::NightVision::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedCharValue); + cppValue = static_cast>(value.unsignedCharValue); chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -99320,7 +99320,7 @@ - (void)writeAttributeNightVisionIllumWithValue:(NSNumber * _Nonnull)value param ListFreer listFreer; using TypeInfo = CameraAvStreamManagement::Attributes::NightVisionIllum::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedCharValue); + cppValue = static_cast>(value.unsignedCharValue); chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -99384,10 +99384,10 @@ - (void)writeAttributeViewportWithValue:(MTRCameraAVStreamManagementClusterViewp ListFreer listFreer; using TypeInfo = CameraAvStreamManagement::Attributes::Viewport::TypeInfo; TypeInfo::Type cppValue; - cppValue.x1 = value.x1.unsignedShortValue; - cppValue.y1 = value.y1.unsignedShortValue; - cppValue.x2 = value.x2.unsignedShortValue; - cppValue.y2 = value.y2.unsignedShortValue; + cppValue.x1 = value.x1.unsignedShortValue; + cppValue.y1 = value.y1.unsignedShortValue; + cppValue.x2 = value.x2.unsignedShortValue; + cppValue.y2 = value.y2.unsignedShortValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -99451,7 +99451,7 @@ - (void)writeAttributeSpeakerMutedWithValue:(NSNumber * _Nonnull)value params:(M ListFreer listFreer; using TypeInfo = CameraAvStreamManagement::Attributes::SpeakerMuted::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.boolValue; + cppValue = value.boolValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -99515,7 +99515,7 @@ - (void)writeAttributeSpeakerVolumeLevelWithValue:(NSNumber * _Nonnull)value par ListFreer listFreer; using TypeInfo = CameraAvStreamManagement::Attributes::SpeakerVolumeLevel::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; + cppValue = value.unsignedCharValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -99651,7 +99651,7 @@ - (void)writeAttributeMicrophoneMutedWithValue:(NSNumber * _Nonnull)value params ListFreer listFreer; using TypeInfo = CameraAvStreamManagement::Attributes::MicrophoneMuted::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.boolValue; + cppValue = value.boolValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -99715,7 +99715,7 @@ - (void)writeAttributeMicrophoneVolumeLevelWithValue:(NSNumber * _Nonnull)value ListFreer listFreer; using TypeInfo = CameraAvStreamManagement::Attributes::MicrophoneVolumeLevel::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; + cppValue = value.unsignedCharValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -99851,7 +99851,7 @@ - (void)writeAttributeMicrophoneAGCEnabledWithValue:(NSNumber * _Nonnull)value p ListFreer listFreer; using TypeInfo = CameraAvStreamManagement::Attributes::MicrophoneAGCEnabled::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.boolValue; + cppValue = value.boolValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -99915,7 +99915,7 @@ - (void)writeAttributeImageRotationWithValue:(NSNumber * _Nonnull)value params:( ListFreer listFreer; using TypeInfo = CameraAvStreamManagement::Attributes::ImageRotation::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; + cppValue = value.unsignedShortValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -99979,7 +99979,7 @@ - (void)writeAttributeImageFlipHorizontalWithValue:(NSNumber * _Nonnull)value pa ListFreer listFreer; using TypeInfo = CameraAvStreamManagement::Attributes::ImageFlipHorizontal::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.boolValue; + cppValue = value.boolValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -100043,7 +100043,7 @@ - (void)writeAttributeImageFlipVerticalWithValue:(NSNumber * _Nonnull)value para ListFreer listFreer; using TypeInfo = CameraAvStreamManagement::Attributes::ImageFlipVertical::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.boolValue; + cppValue = value.boolValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -100107,7 +100107,7 @@ - (void)writeAttributeLocalVideoRecordingEnabledWithValue:(NSNumber * _Nonnull)v ListFreer listFreer; using TypeInfo = CameraAvStreamManagement::Attributes::LocalVideoRecordingEnabled::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.boolValue; + cppValue = value.boolValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -100171,7 +100171,7 @@ - (void)writeAttributeLocalSnapshotRecordingEnabledWithValue:(NSNumber * _Nonnul ListFreer listFreer; using TypeInfo = CameraAvStreamManagement::Attributes::LocalSnapshotRecordingEnabled::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.boolValue; + cppValue = value.boolValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -100235,7 +100235,7 @@ - (void)writeAttributeStatusLightEnabledWithValue:(NSNumber * _Nonnull)value par ListFreer listFreer; using TypeInfo = CameraAvStreamManagement::Attributes::StatusLightEnabled::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.boolValue; + cppValue = value.boolValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -100299,7 +100299,7 @@ - (void)writeAttributeStatusLightBrightnessWithValue:(NSNumber * _Nonnull)value ListFreer listFreer; using TypeInfo = CameraAvStreamManagement::Attributes::StatusLightBrightness::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedCharValue); + cppValue = static_cast>(value.unsignedCharValue); chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -101270,7 +101270,7 @@ - (void)writeAttributeActiveChimeIDWithValue:(NSNumber * _Nonnull)value params:( ListFreer listFreer; using TypeInfo = Chime::Attributes::ActiveChimeID::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; + cppValue = value.unsignedCharValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -101334,7 +101334,7 @@ - (void)writeAttributeEnabledWithValue:(NSNumber * _Nonnull)value params:(MTRWri ListFreer listFreer; using TypeInfo = Chime::Attributes::Enabled::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.boolValue; + cppValue = value.boolValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -102787,7 +102787,7 @@ - (void)writeAttributeBooleanWithValue:(NSNumber * _Nonnull)value params:(MTRWri ListFreer listFreer; using TypeInfo = UnitTesting::Attributes::Boolean::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.boolValue; + cppValue = value.boolValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -102851,7 +102851,7 @@ - (void)writeAttributeBitmap8WithValue:(NSNumber * _Nonnull)value params:(MTRWri ListFreer listFreer; using TypeInfo = UnitTesting::Attributes::Bitmap8::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedCharValue); + cppValue = static_cast>(value.unsignedCharValue); chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -102915,7 +102915,7 @@ - (void)writeAttributeBitmap16WithValue:(NSNumber * _Nonnull)value params:(MTRWr ListFreer listFreer; using TypeInfo = UnitTesting::Attributes::Bitmap16::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedShortValue); + cppValue = static_cast>(value.unsignedShortValue); chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -102979,7 +102979,7 @@ - (void)writeAttributeBitmap32WithValue:(NSNumber * _Nonnull)value params:(MTRWr ListFreer listFreer; using TypeInfo = UnitTesting::Attributes::Bitmap32::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedIntValue); + cppValue = static_cast>(value.unsignedIntValue); chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -103043,7 +103043,7 @@ - (void)writeAttributeBitmap64WithValue:(NSNumber * _Nonnull)value params:(MTRWr ListFreer listFreer; using TypeInfo = UnitTesting::Attributes::Bitmap64::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedLongLongValue); + cppValue = static_cast>(value.unsignedLongLongValue); chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -103107,7 +103107,7 @@ - (void)writeAttributeInt8uWithValue:(NSNumber * _Nonnull)value params:(MTRWrite ListFreer listFreer; using TypeInfo = UnitTesting::Attributes::Int8u::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; + cppValue = value.unsignedCharValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -103171,7 +103171,7 @@ - (void)writeAttributeInt16uWithValue:(NSNumber * _Nonnull)value params:(MTRWrit ListFreer listFreer; using TypeInfo = UnitTesting::Attributes::Int16u::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; + cppValue = value.unsignedShortValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -103235,7 +103235,7 @@ - (void)writeAttributeInt24uWithValue:(NSNumber * _Nonnull)value params:(MTRWrit ListFreer listFreer; using TypeInfo = UnitTesting::Attributes::Int24u::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedIntValue; + cppValue = value.unsignedIntValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -103299,7 +103299,7 @@ - (void)writeAttributeInt32uWithValue:(NSNumber * _Nonnull)value params:(MTRWrit ListFreer listFreer; using TypeInfo = UnitTesting::Attributes::Int32u::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedIntValue; + cppValue = value.unsignedIntValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -103363,7 +103363,7 @@ - (void)writeAttributeInt40uWithValue:(NSNumber * _Nonnull)value params:(MTRWrit ListFreer listFreer; using TypeInfo = UnitTesting::Attributes::Int40u::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedLongLongValue; + cppValue = value.unsignedLongLongValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -103427,7 +103427,7 @@ - (void)writeAttributeInt48uWithValue:(NSNumber * _Nonnull)value params:(MTRWrit ListFreer listFreer; using TypeInfo = UnitTesting::Attributes::Int48u::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedLongLongValue; + cppValue = value.unsignedLongLongValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -103491,7 +103491,7 @@ - (void)writeAttributeInt56uWithValue:(NSNumber * _Nonnull)value params:(MTRWrit ListFreer listFreer; using TypeInfo = UnitTesting::Attributes::Int56u::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedLongLongValue; + cppValue = value.unsignedLongLongValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -103555,7 +103555,7 @@ - (void)writeAttributeInt64uWithValue:(NSNumber * _Nonnull)value params:(MTRWrit ListFreer listFreer; using TypeInfo = UnitTesting::Attributes::Int64u::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedLongLongValue; + cppValue = value.unsignedLongLongValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -103619,7 +103619,7 @@ - (void)writeAttributeInt8sWithValue:(NSNumber * _Nonnull)value params:(MTRWrite ListFreer listFreer; using TypeInfo = UnitTesting::Attributes::Int8s::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.charValue; + cppValue = value.charValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -103683,7 +103683,7 @@ - (void)writeAttributeInt16sWithValue:(NSNumber * _Nonnull)value params:(MTRWrit ListFreer listFreer; using TypeInfo = UnitTesting::Attributes::Int16s::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.shortValue; + cppValue = value.shortValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -103747,7 +103747,7 @@ - (void)writeAttributeInt24sWithValue:(NSNumber * _Nonnull)value params:(MTRWrit ListFreer listFreer; using TypeInfo = UnitTesting::Attributes::Int24s::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.intValue; + cppValue = value.intValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -103811,7 +103811,7 @@ - (void)writeAttributeInt32sWithValue:(NSNumber * _Nonnull)value params:(MTRWrit ListFreer listFreer; using TypeInfo = UnitTesting::Attributes::Int32s::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.intValue; + cppValue = value.intValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -103875,7 +103875,7 @@ - (void)writeAttributeInt40sWithValue:(NSNumber * _Nonnull)value params:(MTRWrit ListFreer listFreer; using TypeInfo = UnitTesting::Attributes::Int40s::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.longLongValue; + cppValue = value.longLongValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -103939,7 +103939,7 @@ - (void)writeAttributeInt48sWithValue:(NSNumber * _Nonnull)value params:(MTRWrit ListFreer listFreer; using TypeInfo = UnitTesting::Attributes::Int48s::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.longLongValue; + cppValue = value.longLongValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -104003,7 +104003,7 @@ - (void)writeAttributeInt56sWithValue:(NSNumber * _Nonnull)value params:(MTRWrit ListFreer listFreer; using TypeInfo = UnitTesting::Attributes::Int56s::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.longLongValue; + cppValue = value.longLongValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -104067,7 +104067,7 @@ - (void)writeAttributeInt64sWithValue:(NSNumber * _Nonnull)value params:(MTRWrit ListFreer listFreer; using TypeInfo = UnitTesting::Attributes::Int64s::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.longLongValue; + cppValue = value.longLongValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -104131,7 +104131,7 @@ - (void)writeAttributeEnum8WithValue:(NSNumber * _Nonnull)value params:(MTRWrite ListFreer listFreer; using TypeInfo = UnitTesting::Attributes::Enum8::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; + cppValue = value.unsignedCharValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -104195,7 +104195,7 @@ - (void)writeAttributeEnum16WithValue:(NSNumber * _Nonnull)value params:(MTRWrit ListFreer listFreer; using TypeInfo = UnitTesting::Attributes::Enum16::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; + cppValue = value.unsignedShortValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -104259,7 +104259,7 @@ - (void)writeAttributeFloatSingleWithValue:(NSNumber * _Nonnull)value params:(MT ListFreer listFreer; using TypeInfo = UnitTesting::Attributes::FloatSingle::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.floatValue; + cppValue = value.floatValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -104323,7 +104323,7 @@ - (void)writeAttributeFloatDoubleWithValue:(NSNumber * _Nonnull)value params:(MT ListFreer listFreer; using TypeInfo = UnitTesting::Attributes::FloatDouble::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.doubleValue; + cppValue = value.doubleValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -104467,7 +104467,7 @@ - (void)writeAttributeListInt8uWithValue:(NSArray * _Nonnull)value params:(MTRWr MTR_LOG_ERROR("%@ incorrectly present in list of %@", value[i_0], NSStringFromClass(NSNumber.class)); return CHIP_ERROR_INVALID_ARGUMENT; } - listHolder_0->mList[i_0] = element_0.unsignedCharValue; + listHolder_0->mList[i_0] = element_0.unsignedCharValue; } cppValue = ListType_0(listHolder_0->mList, value.count); } else { @@ -104639,8 +104639,8 @@ - (void)writeAttributeListStructOctetStringWithValue:(NSArray * _Nonnull)value p MTR_LOG_ERROR("%@ incorrectly present in list of %@", value[i_0], NSStringFromClass(MTRUnitTestingClusterTestListStructOctet.class)); return CHIP_ERROR_INVALID_ARGUMENT; } - listHolder_0->mList[i_0].member1 = element_0.member1.unsignedLongLongValue; - listHolder_0->mList[i_0].member2 = AsByteSpan(element_0.member2); + listHolder_0->mList[i_0].member1 = element_0.member1.unsignedLongLongValue; + listHolder_0->mList[i_0].member2 = AsByteSpan(element_0.member2); } cppValue = ListType_0(listHolder_0->mList, value.count); } else { @@ -104902,7 +104902,7 @@ - (void)writeAttributeEpochUsWithValue:(NSNumber * _Nonnull)value params:(MTRWri ListFreer listFreer; using TypeInfo = UnitTesting::Attributes::EpochUs::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedLongLongValue; + cppValue = value.unsignedLongLongValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -104966,7 +104966,7 @@ - (void)writeAttributeEpochSWithValue:(NSNumber * _Nonnull)value params:(MTRWrit ListFreer listFreer; using TypeInfo = UnitTesting::Attributes::EpochS::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedIntValue; + cppValue = value.unsignedIntValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -105030,7 +105030,7 @@ - (void)writeAttributeVendorIdWithValue:(NSNumber * _Nonnull)value params:(MTRWr ListFreer listFreer; using TypeInfo = UnitTesting::Attributes::VendorId::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedShortValue); + cppValue = static_cast>(value.unsignedShortValue); chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -105110,181 +105110,215 @@ - (void)writeAttributeListNullablesAndOptionalsStructWithValue:(NSArray * _Nonnu MTR_LOG_ERROR("%@ incorrectly present in list of %@", value[i_0], NSStringFromClass(MTRUnitTestingClusterNullablesAndOptionalsStruct.class)); return CHIP_ERROR_INVALID_ARGUMENT; } - if (element_0.nullableInt == nil) { - listHolder_0->mList[i_0].nullableInt.SetNull(); - } else { - auto & nonNullValue_2 = listHolder_0->mList[i_0].nullableInt.SetNonNull(); - nonNullValue_2 = element_0.nullableInt.unsignedShortValue; + if (element_0.nullableInt == nil) { + listHolder_0->mList[i_0].nullableInt.SetNull(); + } else { + auto & nonNullValue_2 = listHolder_0->mList[i_0].nullableInt.SetNonNull(); + nonNullValue_2 = element_0.nullableInt.unsignedShortValue; } - if (element_0.optionalInt != nil) { - auto & definedValue_2 = listHolder_0->mList[i_0].optionalInt.Emplace(); - definedValue_2 = element_0.optionalInt.unsignedShortValue; + if (element_0.optionalInt != nil) { + auto & definedValue_2 = listHolder_0->mList[i_0].optionalInt.Emplace(); + definedValue_2 = element_0.optionalInt.unsignedShortValue; } - if (element_0.nullableOptionalInt != nil) { - auto & definedValue_2 = listHolder_0->mList[i_0].nullableOptionalInt.Emplace(); - if (element_0.nullableOptionalInt == nil) { - definedValue_2.SetNull(); - } else { - auto & nonNullValue_3 = definedValue_2.SetNonNull(); - nonNullValue_3 = element_0.nullableOptionalInt.unsignedShortValue; + if (element_0.nullableOptionalInt != nil) { + auto & definedValue_2 = listHolder_0->mList[i_0].nullableOptionalInt.Emplace(); + if (element_0.nullableOptionalInt == nil) { + definedValue_2.SetNull(); + } else { + auto & nonNullValue_3 = definedValue_2.SetNonNull(); + nonNullValue_3 = element_0.nullableOptionalInt.unsignedShortValue; } - } - if (element_0.nullableString == nil) { - listHolder_0->mList[i_0].nullableString.SetNull(); - } else { - auto & nonNullValue_2 = listHolder_0->mList[i_0].nullableString.SetNonNull(); - nonNullValue_2 = AsCharSpan(element_0.nullableString); - } - if (element_0.optionalString != nil) { - auto & definedValue_2 = listHolder_0->mList[i_0].optionalString.Emplace(); - definedValue_2 = AsCharSpan(element_0.optionalString); - } - if (element_0.nullableOptionalString != nil) { - auto & definedValue_2 = listHolder_0->mList[i_0].nullableOptionalString.Emplace(); - if (element_0.nullableOptionalString == nil) { - definedValue_2.SetNull(); - } else { - auto & nonNullValue_3 = definedValue_2.SetNonNull(); - nonNullValue_3 = AsCharSpan(element_0.nullableOptionalString); - } - } - if (element_0.nullableStruct == nil) { - listHolder_0->mList[i_0].nullableStruct.SetNull(); - } else { - auto & nonNullValue_2 = listHolder_0->mList[i_0].nullableStruct.SetNonNull(); - nonNullValue_2.a = element_0.nullableStruct.a.unsignedCharValue; - nonNullValue_2.b = element_0.nullableStruct.b.boolValue; - nonNullValue_2.c = static_cast>(element_0.nullableStruct.c.unsignedCharValue); - nonNullValue_2.d = AsByteSpan(element_0.nullableStruct.d); - nonNullValue_2.e = AsCharSpan(element_0.nullableStruct.e); - nonNullValue_2.f = static_cast>(element_0.nullableStruct.f.unsignedCharValue); - nonNullValue_2.g = element_0.nullableStruct.g.floatValue; - nonNullValue_2.h = element_0.nullableStruct.h.doubleValue; - if (element_0.nullableStruct.i != nil) { - auto & definedValue_4 = nonNullValue_2.i.Emplace(); - definedValue_4 = static_cast>(element_0.nullableStruct.i.unsignedCharValue); + } + if (element_0.nullableString == nil) { + listHolder_0->mList[i_0].nullableString.SetNull(); + } else { + auto & nonNullValue_2 = listHolder_0->mList[i_0].nullableString.SetNonNull(); + nonNullValue_2 = AsCharSpan(element_0.nullableString); + } + if (element_0.optionalString != nil) { + auto & definedValue_2 = listHolder_0->mList[i_0].optionalString.Emplace(); + definedValue_2 = AsCharSpan(element_0.optionalString); + } + if (element_0.nullableOptionalString != nil) { + auto & definedValue_2 = listHolder_0->mList[i_0].nullableOptionalString.Emplace(); + if (element_0.nullableOptionalString == nil) { + definedValue_2.SetNull(); + } else { + auto & nonNullValue_3 = definedValue_2.SetNonNull(); + nonNullValue_3 = AsCharSpan(element_0.nullableOptionalString); + } + } + if (element_0.nullableStruct == nil) { + listHolder_0->mList[i_0].nullableStruct.SetNull(); + } else { + auto & nonNullValue_2 = listHolder_0->mList[i_0].nullableStruct.SetNonNull(); + nonNullValue_2.a = element_0.nullableStruct.a.unsignedCharValue; + nonNullValue_2.b = element_0.nullableStruct.b.boolValue; + nonNullValue_2.c = static_cast>(element_0.nullableStruct.c.unsignedCharValue); + nonNullValue_2.d = AsByteSpan(element_0.nullableStruct.d); + nonNullValue_2.e = AsCharSpan(element_0.nullableStruct.e); + nonNullValue_2.f = static_cast>(element_0.nullableStruct.f.unsignedCharValue); + nonNullValue_2.g = element_0.nullableStruct.g.floatValue; + nonNullValue_2.h = element_0.nullableStruct.h.doubleValue; + if (element_0.nullableStruct.i != nil) { + auto & definedValue_4 = nonNullValue_2.i.Emplace(); + definedValue_4 = static_cast>(element_0.nullableStruct.i.unsignedCharValue); } + if (element_0.nullableStruct.j != nil) { + auto & definedValue_4 = nonNullValue_2.j.Emplace(); + definedValue_4 = element_0.nullableStruct.j.unsignedLongLongValue; } - if (element_0.optionalStruct != nil) { - auto & definedValue_2 = listHolder_0->mList[i_0].optionalStruct.Emplace(); - definedValue_2.a = element_0.optionalStruct.a.unsignedCharValue; - definedValue_2.b = element_0.optionalStruct.b.boolValue; - definedValue_2.c = static_cast>(element_0.optionalStruct.c.unsignedCharValue); - definedValue_2.d = AsByteSpan(element_0.optionalStruct.d); - definedValue_2.e = AsCharSpan(element_0.optionalStruct.e); - definedValue_2.f = static_cast>(element_0.optionalStruct.f.unsignedCharValue); - definedValue_2.g = element_0.optionalStruct.g.floatValue; - definedValue_2.h = element_0.optionalStruct.h.doubleValue; - if (element_0.optionalStruct.i != nil) { - auto & definedValue_4 = definedValue_2.i.Emplace(); - definedValue_4 = static_cast>(element_0.optionalStruct.i.unsignedCharValue); + nonNullValue_2.k = element_0.nullableStruct.k.unsignedIntValue; } + if (element_0.optionalStruct != nil) { + auto & definedValue_2 = listHolder_0->mList[i_0].optionalStruct.Emplace(); + definedValue_2.a = element_0.optionalStruct.a.unsignedCharValue; + definedValue_2.b = element_0.optionalStruct.b.boolValue; + definedValue_2.c = static_cast>(element_0.optionalStruct.c.unsignedCharValue); + definedValue_2.d = AsByteSpan(element_0.optionalStruct.d); + definedValue_2.e = AsCharSpan(element_0.optionalStruct.e); + definedValue_2.f = static_cast>(element_0.optionalStruct.f.unsignedCharValue); + definedValue_2.g = element_0.optionalStruct.g.floatValue; + definedValue_2.h = element_0.optionalStruct.h.doubleValue; + if (element_0.optionalStruct.i != nil) { + auto & definedValue_4 = definedValue_2.i.Emplace(); + definedValue_4 = static_cast>(element_0.optionalStruct.i.unsignedCharValue); } - if (element_0.nullableOptionalStruct != nil) { - auto & definedValue_2 = listHolder_0->mList[i_0].nullableOptionalStruct.Emplace(); - if (element_0.nullableOptionalStruct == nil) { - definedValue_2.SetNull(); - } else { - auto & nonNullValue_3 = definedValue_2.SetNonNull(); - nonNullValue_3.a = element_0.nullableOptionalStruct.a.unsignedCharValue; - nonNullValue_3.b = element_0.nullableOptionalStruct.b.boolValue; - nonNullValue_3.c = static_cast>(element_0.nullableOptionalStruct.c.unsignedCharValue); - nonNullValue_3.d = AsByteSpan(element_0.nullableOptionalStruct.d); - nonNullValue_3.e = AsCharSpan(element_0.nullableOptionalStruct.e); - nonNullValue_3.f = static_cast>(element_0.nullableOptionalStruct.f.unsignedCharValue); - nonNullValue_3.g = element_0.nullableOptionalStruct.g.floatValue; - nonNullValue_3.h = element_0.nullableOptionalStruct.h.doubleValue; - if (element_0.nullableOptionalStruct.i != nil) { - auto & definedValue_5 = nonNullValue_3.i.Emplace(); - definedValue_5 = static_cast>(element_0.nullableOptionalStruct.i.unsignedCharValue); + if (element_0.optionalStruct.j != nil) { + auto & definedValue_4 = definedValue_2.j.Emplace(); + definedValue_4 = element_0.optionalStruct.j.unsignedLongLongValue; } + definedValue_2.k = element_0.optionalStruct.k.unsignedIntValue; } - } - if (element_0.nullableList == nil) { - listHolder_0->mList[i_0].nullableList.SetNull(); - } else { - auto & nonNullValue_2 = listHolder_0->mList[i_0].nullableList.SetNonNull(); - { - using ListType_3 = std::remove_reference_t; - using ListMemberType_3 = ListMemberTypeGetter::Type; - if (element_0.nullableList.count != 0) { - auto * listHolder_3 = new ListHolder(element_0.nullableList.count); - if (listHolder_3 == nullptr || listHolder_3->mList == nullptr) { + if (element_0.nullableOptionalStruct != nil) { + auto & definedValue_2 = listHolder_0->mList[i_0].nullableOptionalStruct.Emplace(); + if (element_0.nullableOptionalStruct == nil) { + definedValue_2.SetNull(); + } else { + auto & nonNullValue_3 = definedValue_2.SetNonNull(); + nonNullValue_3.a = element_0.nullableOptionalStruct.a.unsignedCharValue; + nonNullValue_3.b = element_0.nullableOptionalStruct.b.boolValue; + nonNullValue_3.c = static_cast>(element_0.nullableOptionalStruct.c.unsignedCharValue); + nonNullValue_3.d = AsByteSpan(element_0.nullableOptionalStruct.d); + nonNullValue_3.e = AsCharSpan(element_0.nullableOptionalStruct.e); + nonNullValue_3.f = static_cast>(element_0.nullableOptionalStruct.f.unsignedCharValue); + nonNullValue_3.g = element_0.nullableOptionalStruct.g.floatValue; + nonNullValue_3.h = element_0.nullableOptionalStruct.h.doubleValue; + if (element_0.nullableOptionalStruct.i != nil) { + auto & definedValue_5 = nonNullValue_3.i.Emplace(); + definedValue_5 = static_cast>(element_0.nullableOptionalStruct.i.unsignedCharValue); + } + if (element_0.nullableOptionalStruct.j != nil) { + auto & definedValue_5 = nonNullValue_3.j.Emplace(); + definedValue_5 = element_0.nullableOptionalStruct.j.unsignedLongLongValue; + } + nonNullValue_3.k = element_0.nullableOptionalStruct.k.unsignedIntValue; + } + } + if (element_0.nullableList == nil) { + listHolder_0->mList[i_0].nullableList.SetNull(); + } else { + auto & nonNullValue_2 = listHolder_0->mList[i_0].nullableList.SetNonNull(); + { + using ListType_3 = std::remove_reference_t; + using ListMemberType_3 = ListMemberTypeGetter::Type; + if (element_0.nullableList.count != 0) { + auto * listHolder_3 = new ListHolder(element_0.nullableList.count); + if (listHolder_3 == nullptr || listHolder_3->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_3); + for (size_t i_3 = 0; i_3 < element_0.nullableList.count; ++i_3) { + auto element_3 = MTR_SAFE_CAST(element_0.nullableList[i_3], NSNumber); + if (!element_3) { + // Wrong kind of value. + MTR_LOG_ERROR("%@ incorrectly present in list of %@", element_0.nullableList[i_3], NSStringFromClass(NSNumber.class)); return CHIP_ERROR_INVALID_ARGUMENT; } - listFreer.add(listHolder_3); - for (size_t i_3 = 0; i_3 < element_0.nullableList.count; ++i_3) { - auto element_3 = MTR_SAFE_CAST(element_0.nullableList[i_3], NSNumber); - if (!element_3) { - // Wrong kind of value. - MTR_LOG_ERROR("%@ incorrectly present in list of %@", element_0.nullableList[i_3], NSStringFromClass(NSNumber.class)); - return CHIP_ERROR_INVALID_ARGUMENT; - } - listHolder_3->mList[i_3] = static_castmList[i_3])>>(element_3.unsignedCharValue); + listHolder_3->mList[i_3] = static_castmList[i_3])>>(element_3.unsignedCharValue); } - nonNullValue_2 = ListType_3(listHolder_3->mList, element_0.nullableList.count); - } else { - nonNullValue_2 = ListType_3(); - } + nonNullValue_2 = ListType_3(listHolder_3->mList, element_0.nullableList.count); + } else { + nonNullValue_2 = ListType_3(); } - } - if (element_0.optionalList != nil) { - auto & definedValue_2 = listHolder_0->mList[i_0].optionalList.Emplace(); - { - using ListType_3 = std::remove_reference_t; - using ListMemberType_3 = ListMemberTypeGetter::Type; - if (element_0.optionalList.count != 0) { - auto * listHolder_3 = new ListHolder(element_0.optionalList.count); - if (listHolder_3 == nullptr || listHolder_3->mList == nullptr) { + } + } + if (element_0.optionalList != nil) { + auto & definedValue_2 = listHolder_0->mList[i_0].optionalList.Emplace(); + { + using ListType_3 = std::remove_reference_t; + using ListMemberType_3 = ListMemberTypeGetter::Type; + if (element_0.optionalList.count != 0) { + auto * listHolder_3 = new ListHolder(element_0.optionalList.count); + if (listHolder_3 == nullptr || listHolder_3->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_3); + for (size_t i_3 = 0; i_3 < element_0.optionalList.count; ++i_3) { + auto element_3 = MTR_SAFE_CAST(element_0.optionalList[i_3], NSNumber); + if (!element_3) { + // Wrong kind of value. + MTR_LOG_ERROR("%@ incorrectly present in list of %@", element_0.optionalList[i_3], NSStringFromClass(NSNumber.class)); return CHIP_ERROR_INVALID_ARGUMENT; } - listFreer.add(listHolder_3); - for (size_t i_3 = 0; i_3 < element_0.optionalList.count; ++i_3) { - auto element_3 = MTR_SAFE_CAST(element_0.optionalList[i_3], NSNumber); - if (!element_3) { - // Wrong kind of value. - MTR_LOG_ERROR("%@ incorrectly present in list of %@", element_0.optionalList[i_3], NSStringFromClass(NSNumber.class)); - return CHIP_ERROR_INVALID_ARGUMENT; - } - listHolder_3->mList[i_3] = static_castmList[i_3])>>(element_3.unsignedCharValue); + listHolder_3->mList[i_3] = static_castmList[i_3])>>(element_3.unsignedCharValue); } - definedValue_2 = ListType_3(listHolder_3->mList, element_0.optionalList.count); - } else { - definedValue_2 = ListType_3(); - } - } - } - if (element_0.nullableOptionalList != nil) { - auto & definedValue_2 = listHolder_0->mList[i_0].nullableOptionalList.Emplace(); - if (element_0.nullableOptionalList == nil) { - definedValue_2.SetNull(); + definedValue_2 = ListType_3(listHolder_3->mList, element_0.optionalList.count); } else { - auto & nonNullValue_3 = definedValue_2.SetNonNull(); - { - using ListType_4 = std::remove_reference_t; - using ListMemberType_4 = ListMemberTypeGetter::Type; - if (element_0.nullableOptionalList.count != 0) { - auto * listHolder_4 = new ListHolder(element_0.nullableOptionalList.count); - if (listHolder_4 == nullptr || listHolder_4->mList == nullptr) { + definedValue_2 = ListType_3(); + } + } + } + if (element_0.nullableOptionalList != nil) { + auto & definedValue_2 = listHolder_0->mList[i_0].nullableOptionalList.Emplace(); + if (element_0.nullableOptionalList == nil) { + definedValue_2.SetNull(); + } else { + auto & nonNullValue_3 = definedValue_2.SetNonNull(); + { + using ListType_4 = std::remove_reference_t; + using ListMemberType_4 = ListMemberTypeGetter::Type; + if (element_0.nullableOptionalList.count != 0) { + auto * listHolder_4 = new ListHolder(element_0.nullableOptionalList.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_0.nullableOptionalList.count; ++i_4) { + auto element_4 = MTR_SAFE_CAST(element_0.nullableOptionalList[i_4], NSNumber); + if (!element_4) { + // Wrong kind of value. + MTR_LOG_ERROR("%@ incorrectly present in list of %@", element_0.nullableOptionalList[i_4], NSStringFromClass(NSNumber.class)); return CHIP_ERROR_INVALID_ARGUMENT; } - listFreer.add(listHolder_4); - for (size_t i_4 = 0; i_4 < element_0.nullableOptionalList.count; ++i_4) { - auto element_4 = MTR_SAFE_CAST(element_0.nullableOptionalList[i_4], NSNumber); - if (!element_4) { - // Wrong kind of value. - MTR_LOG_ERROR("%@ incorrectly present in list of %@", element_0.nullableOptionalList[i_4], NSStringFromClass(NSNumber.class)); - return CHIP_ERROR_INVALID_ARGUMENT; - } - listHolder_4->mList[i_4] = static_castmList[i_4])>>(element_4.unsignedCharValue); + listHolder_4->mList[i_4] = static_castmList[i_4])>>(element_4.unsignedCharValue); } - nonNullValue_3 = ListType_4(listHolder_4->mList, element_0.nullableOptionalList.count); - } else { - nonNullValue_3 = ListType_4(); - } + nonNullValue_3 = ListType_4(listHolder_4->mList, element_0.nullableOptionalList.count); + } else { + nonNullValue_3 = ListType_4(); } - } - } + } + } + } + if (element_0.nullableTypedef == nil) { + listHolder_0->mList[i_0].nullableTypedef.SetNull(); + } else { + auto & nonNullValue_2 = listHolder_0->mList[i_0].nullableTypedef.SetNonNull(); + nonNullValue_2 = element_0.nullableTypedef.unsignedLongLongValue; + } + if (element_0.optionalTypedef != nil) { + auto & definedValue_2 = listHolder_0->mList[i_0].optionalTypedef.Emplace(); + definedValue_2 = element_0.optionalTypedef.unsignedLongLongValue; + } + if (element_0.nullableOptionalTypedef != nil) { + auto & definedValue_2 = listHolder_0->mList[i_0].nullableOptionalTypedef.Emplace(); + if (element_0.nullableOptionalTypedef == nil) { + definedValue_2.SetNull(); + } else { + auto & nonNullValue_3 = definedValue_2.SetNonNull(); + nonNullValue_3 = element_0.nullableOptionalTypedef.unsignedLongLongValue; + } + } } cppValue = ListType_0(listHolder_0->mList, value.count); } else { @@ -105354,7 +105388,7 @@ - (void)writeAttributeEnumAttrWithValue:(NSNumber * _Nonnull)value params:(MTRWr ListFreer listFreer; using TypeInfo = UnitTesting::Attributes::EnumAttr::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedCharValue); + cppValue = static_cast>(value.unsignedCharValue); chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -105418,18 +105452,23 @@ - (void)writeAttributeStructAttrWithValue:(MTRUnitTestingClusterSimpleStruct * _ ListFreer listFreer; using TypeInfo = UnitTesting::Attributes::StructAttr::TypeInfo; TypeInfo::Type cppValue; - cppValue.a = value.a.unsignedCharValue; - cppValue.b = value.b.boolValue; - cppValue.c = static_cast>(value.c.unsignedCharValue); - cppValue.d = AsByteSpan(value.d); - cppValue.e = AsCharSpan(value.e); - cppValue.f = static_cast>(value.f.unsignedCharValue); - cppValue.g = value.g.floatValue; - cppValue.h = value.h.doubleValue; - if (value.i != nil) { - auto & definedValue_1 = cppValue.i.Emplace(); - definedValue_1 = static_cast>(value.i.unsignedCharValue); + cppValue.a = value.a.unsignedCharValue; + cppValue.b = value.b.boolValue; + cppValue.c = static_cast>(value.c.unsignedCharValue); + cppValue.d = AsByteSpan(value.d); + cppValue.e = AsCharSpan(value.e); + cppValue.f = static_cast>(value.f.unsignedCharValue); + cppValue.g = value.g.floatValue; + cppValue.h = value.h.doubleValue; + if (value.i != nil) { + auto & definedValue_1 = cppValue.i.Emplace(); + definedValue_1 = static_cast>(value.i.unsignedCharValue); + } + if (value.j != nil) { + auto & definedValue_1 = cppValue.j.Emplace(); + definedValue_1 = value.j.unsignedLongLongValue; } + cppValue.k = value.k.unsignedIntValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -105493,7 +105532,7 @@ - (void)writeAttributeRangeRestrictedInt8uWithValue:(NSNumber * _Nonnull)value p ListFreer listFreer; using TypeInfo = UnitTesting::Attributes::RangeRestrictedInt8u::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; + cppValue = value.unsignedCharValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -105557,7 +105596,7 @@ - (void)writeAttributeRangeRestrictedInt8sWithValue:(NSNumber * _Nonnull)value p ListFreer listFreer; using TypeInfo = UnitTesting::Attributes::RangeRestrictedInt8s::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.charValue; + cppValue = value.charValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -105621,7 +105660,7 @@ - (void)writeAttributeRangeRestrictedInt16uWithValue:(NSNumber * _Nonnull)value ListFreer listFreer; using TypeInfo = UnitTesting::Attributes::RangeRestrictedInt16u::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; + cppValue = value.unsignedShortValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -105685,7 +105724,7 @@ - (void)writeAttributeRangeRestrictedInt16sWithValue:(NSNumber * _Nonnull)value ListFreer listFreer; using TypeInfo = UnitTesting::Attributes::RangeRestrictedInt16s::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.shortValue; + cppValue = value.shortValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -105851,63 +105890,68 @@ - (void)writeAttributeListFabricScopedWithValue:(NSArray * _Nonnull)value params MTR_LOG_ERROR("%@ incorrectly present in list of %@", value[i_0], NSStringFromClass(MTRUnitTestingClusterTestFabricScoped.class)); return CHIP_ERROR_INVALID_ARGUMENT; } - listHolder_0->mList[i_0].fabricSensitiveInt8u = element_0.fabricSensitiveInt8u.unsignedCharValue; - if (element_0.optionalFabricSensitiveInt8u != nil) { - auto & definedValue_2 = listHolder_0->mList[i_0].optionalFabricSensitiveInt8u.Emplace(); - definedValue_2 = element_0.optionalFabricSensitiveInt8u.unsignedCharValue; + listHolder_0->mList[i_0].fabricSensitiveInt8u = element_0.fabricSensitiveInt8u.unsignedCharValue; + if (element_0.optionalFabricSensitiveInt8u != nil) { + auto & definedValue_2 = listHolder_0->mList[i_0].optionalFabricSensitiveInt8u.Emplace(); + definedValue_2 = element_0.optionalFabricSensitiveInt8u.unsignedCharValue; } - if (element_0.nullableFabricSensitiveInt8u == nil) { - listHolder_0->mList[i_0].nullableFabricSensitiveInt8u.SetNull(); - } else { - auto & nonNullValue_2 = listHolder_0->mList[i_0].nullableFabricSensitiveInt8u.SetNonNull(); - nonNullValue_2 = element_0.nullableFabricSensitiveInt8u.unsignedCharValue; + if (element_0.nullableFabricSensitiveInt8u == nil) { + listHolder_0->mList[i_0].nullableFabricSensitiveInt8u.SetNull(); + } else { + auto & nonNullValue_2 = listHolder_0->mList[i_0].nullableFabricSensitiveInt8u.SetNonNull(); + nonNullValue_2 = element_0.nullableFabricSensitiveInt8u.unsignedCharValue; } - if (element_0.nullableOptionalFabricSensitiveInt8u != nil) { - auto & definedValue_2 = listHolder_0->mList[i_0].nullableOptionalFabricSensitiveInt8u.Emplace(); - if (element_0.nullableOptionalFabricSensitiveInt8u == nil) { - definedValue_2.SetNull(); - } else { - auto & nonNullValue_3 = definedValue_2.SetNonNull(); - nonNullValue_3 = element_0.nullableOptionalFabricSensitiveInt8u.unsignedCharValue; + if (element_0.nullableOptionalFabricSensitiveInt8u != nil) { + auto & definedValue_2 = listHolder_0->mList[i_0].nullableOptionalFabricSensitiveInt8u.Emplace(); + if (element_0.nullableOptionalFabricSensitiveInt8u == nil) { + definedValue_2.SetNull(); + } else { + auto & nonNullValue_3 = definedValue_2.SetNonNull(); + nonNullValue_3 = element_0.nullableOptionalFabricSensitiveInt8u.unsignedCharValue; } - } - listHolder_0->mList[i_0].fabricSensitiveCharString = AsCharSpan(element_0.fabricSensitiveCharString); - listHolder_0->mList[i_0].fabricSensitiveStruct.a = element_0.fabricSensitiveStruct.a.unsignedCharValue; - listHolder_0->mList[i_0].fabricSensitiveStruct.b = element_0.fabricSensitiveStruct.b.boolValue; - listHolder_0->mList[i_0].fabricSensitiveStruct.c = static_castmList[i_0].fabricSensitiveStruct.c)>>(element_0.fabricSensitiveStruct.c.unsignedCharValue); - listHolder_0->mList[i_0].fabricSensitiveStruct.d = AsByteSpan(element_0.fabricSensitiveStruct.d); - listHolder_0->mList[i_0].fabricSensitiveStruct.e = AsCharSpan(element_0.fabricSensitiveStruct.e); - listHolder_0->mList[i_0].fabricSensitiveStruct.f = static_castmList[i_0].fabricSensitiveStruct.f)>>(element_0.fabricSensitiveStruct.f.unsignedCharValue); - listHolder_0->mList[i_0].fabricSensitiveStruct.g = element_0.fabricSensitiveStruct.g.floatValue; - listHolder_0->mList[i_0].fabricSensitiveStruct.h = element_0.fabricSensitiveStruct.h.doubleValue; - if (element_0.fabricSensitiveStruct.i != nil) { - auto & definedValue_3 = listHolder_0->mList[i_0].fabricSensitiveStruct.i.Emplace(); - definedValue_3 = static_cast>(element_0.fabricSensitiveStruct.i.unsignedCharValue); + } + listHolder_0->mList[i_0].fabricSensitiveCharString = AsCharSpan(element_0.fabricSensitiveCharString); + listHolder_0->mList[i_0].fabricSensitiveStruct.a = element_0.fabricSensitiveStruct.a.unsignedCharValue; + listHolder_0->mList[i_0].fabricSensitiveStruct.b = element_0.fabricSensitiveStruct.b.boolValue; + listHolder_0->mList[i_0].fabricSensitiveStruct.c = static_castmList[i_0].fabricSensitiveStruct.c)>>(element_0.fabricSensitiveStruct.c.unsignedCharValue); + listHolder_0->mList[i_0].fabricSensitiveStruct.d = AsByteSpan(element_0.fabricSensitiveStruct.d); + listHolder_0->mList[i_0].fabricSensitiveStruct.e = AsCharSpan(element_0.fabricSensitiveStruct.e); + listHolder_0->mList[i_0].fabricSensitiveStruct.f = static_castmList[i_0].fabricSensitiveStruct.f)>>(element_0.fabricSensitiveStruct.f.unsignedCharValue); + listHolder_0->mList[i_0].fabricSensitiveStruct.g = element_0.fabricSensitiveStruct.g.floatValue; + listHolder_0->mList[i_0].fabricSensitiveStruct.h = element_0.fabricSensitiveStruct.h.doubleValue; + if (element_0.fabricSensitiveStruct.i != nil) { + auto & definedValue_3 = listHolder_0->mList[i_0].fabricSensitiveStruct.i.Emplace(); + definedValue_3 = static_cast>(element_0.fabricSensitiveStruct.i.unsignedCharValue); } - { - using ListType_2 = std::remove_reference_tmList[i_0].fabricSensitiveInt8uList)>; - using ListMemberType_2 = ListMemberTypeGetter::Type; - if (element_0.fabricSensitiveInt8uList.count != 0) { - auto * listHolder_2 = new ListHolder(element_0.fabricSensitiveInt8uList.count); - if (listHolder_2 == nullptr || listHolder_2->mList == nullptr) { + if (element_0.fabricSensitiveStruct.j != nil) { + auto & definedValue_3 = listHolder_0->mList[i_0].fabricSensitiveStruct.j.Emplace(); + definedValue_3 = element_0.fabricSensitiveStruct.j.unsignedLongLongValue; + } + listHolder_0->mList[i_0].fabricSensitiveStruct.k = element_0.fabricSensitiveStruct.k.unsignedIntValue; + { + using ListType_2 = std::remove_reference_tmList[i_0].fabricSensitiveInt8uList)>; + using ListMemberType_2 = ListMemberTypeGetter::Type; + if (element_0.fabricSensitiveInt8uList.count != 0) { + auto * listHolder_2 = new ListHolder(element_0.fabricSensitiveInt8uList.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.fabricSensitiveInt8uList.count; ++i_2) { + auto element_2 = MTR_SAFE_CAST(element_0.fabricSensitiveInt8uList[i_2], NSNumber); + if (!element_2) { + // Wrong kind of value. + MTR_LOG_ERROR("%@ incorrectly present in list of %@", element_0.fabricSensitiveInt8uList[i_2], NSStringFromClass(NSNumber.class)); return CHIP_ERROR_INVALID_ARGUMENT; } - listFreer.add(listHolder_2); - for (size_t i_2 = 0; i_2 < element_0.fabricSensitiveInt8uList.count; ++i_2) { - auto element_2 = MTR_SAFE_CAST(element_0.fabricSensitiveInt8uList[i_2], NSNumber); - if (!element_2) { - // Wrong kind of value. - MTR_LOG_ERROR("%@ incorrectly present in list of %@", element_0.fabricSensitiveInt8uList[i_2], NSStringFromClass(NSNumber.class)); - return CHIP_ERROR_INVALID_ARGUMENT; - } - listHolder_2->mList[i_2] = element_2.unsignedCharValue; + listHolder_2->mList[i_2] = element_2.unsignedCharValue; } - listHolder_0->mList[i_0].fabricSensitiveInt8uList = ListType_2(listHolder_2->mList, element_0.fabricSensitiveInt8uList.count); - } else { - listHolder_0->mList[i_0].fabricSensitiveInt8uList = ListType_2(); - } + listHolder_0->mList[i_0].fabricSensitiveInt8uList = ListType_2(listHolder_2->mList, element_0.fabricSensitiveInt8uList.count); + } else { + listHolder_0->mList[i_0].fabricSensitiveInt8uList = ListType_2(); } - listHolder_0->mList[i_0].fabricIndex = element_0.fabricIndex.unsignedCharValue; + } + listHolder_0->mList[i_0].fabricIndex = element_0.fabricIndex.unsignedCharValue; } cppValue = ListType_0(listHolder_0->mList, value.count); } else { @@ -105980,7 +106024,7 @@ - (void)writeAttributeTimedWriteBooleanWithValue:(NSNumber * _Nonnull)value para ListFreer listFreer; using TypeInfo = UnitTesting::Attributes::TimedWriteBoolean::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.boolValue; + cppValue = value.boolValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -106044,7 +106088,7 @@ - (void)writeAttributeGeneralErrorBooleanWithValue:(NSNumber * _Nonnull)value pa ListFreer listFreer; using TypeInfo = UnitTesting::Attributes::GeneralErrorBoolean::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.boolValue; + cppValue = value.boolValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -106108,7 +106152,7 @@ - (void)writeAttributeClusterErrorBooleanWithValue:(NSNumber * _Nonnull)value pa ListFreer listFreer; using TypeInfo = UnitTesting::Attributes::ClusterErrorBoolean::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.boolValue; + cppValue = value.boolValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -106172,7 +106216,7 @@ - (void)writeAttributeGlobalEnumWithValue:(NSNumber * _Nonnull)value params:(MTR ListFreer listFreer; using TypeInfo = UnitTesting::Attributes::GlobalEnum::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedCharValue); + cppValue = static_cast>(value.unsignedCharValue); chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -106236,22 +106280,31 @@ - (void)writeAttributeGlobalStructWithValue:(MTRDataTypeTestGlobalStruct * _Nonn ListFreer listFreer; using TypeInfo = UnitTesting::Attributes::GlobalStruct::TypeInfo; TypeInfo::Type cppValue; - cppValue.name = AsCharSpan(value.name); - if (value.myBitmap == nil) { - cppValue.myBitmap.SetNull(); - } else { - auto & nonNullValue_1 = cppValue.myBitmap.SetNonNull(); - nonNullValue_1 = static_cast>(value.myBitmap.unsignedIntValue); + cppValue.name = AsCharSpan(value.name); + if (value.myBitmap == nil) { + cppValue.myBitmap.SetNull(); + } else { + auto & nonNullValue_1 = cppValue.myBitmap.SetNonNull(); + nonNullValue_1 = static_cast>(value.myBitmap.unsignedIntValue); } - if (value.myEnum != nil) { - auto & definedValue_1 = cppValue.myEnum.Emplace(); - if (value.myEnum == nil) { - definedValue_1.SetNull(); - } else { - auto & nonNullValue_2 = definedValue_1.SetNonNull(); - nonNullValue_2 = static_cast>(value.myEnum.unsignedCharValue); + if (value.myEnum != nil) { + auto & definedValue_1 = cppValue.myEnum.Emplace(); + if (value.myEnum == nil) { + definedValue_1.SetNull(); + } else { + auto & nonNullValue_2 = definedValue_1.SetNonNull(); + nonNullValue_2 = static_cast>(value.myEnum.unsignedCharValue); } - } + } + if (value.myTypedef != nil) { + auto & definedValue_1 = cppValue.myTypedef.Emplace(); + if (value.myTypedef == nil) { + definedValue_1.SetNull(); + } else { + auto & nonNullValue_2 = definedValue_1.SetNonNull(); + nonNullValue_2 = value.myTypedef.unsignedIntValue; + } + } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -106315,7 +106368,7 @@ - (void)writeAttributeUnsupportedWithValue:(NSNumber * _Nonnull)value params:(MT ListFreer listFreer; using TypeInfo = UnitTesting::Attributes::Unsupported::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.boolValue; + cppValue = value.boolValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -106379,7 +106432,7 @@ - (void)writeAttributeReadFailureCodeWithValue:(NSNumber * _Nonnull)value params ListFreer listFreer; using TypeInfo = UnitTesting::Attributes::ReadFailureCode::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; + cppValue = value.unsignedCharValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -106443,7 +106496,7 @@ - (void)writeAttributeFailureInt32UWithValue:(NSNumber * _Nonnull)value params:( ListFreer listFreer; using TypeInfo = UnitTesting::Attributes::FailureInt32U::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedIntValue; + cppValue = value.unsignedIntValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -106511,7 +106564,7 @@ - (void)writeAttributeNullableBooleanWithValue:(NSNumber * _Nullable)value param cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.boolValue; + nonNullValue_0 = value.boolValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -106580,7 +106633,7 @@ - (void)writeAttributeNullableBitmap8WithValue:(NSNumber * _Nullable)value param cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = static_cast>(value.unsignedCharValue); + nonNullValue_0 = static_cast>(value.unsignedCharValue); } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -106649,7 +106702,7 @@ - (void)writeAttributeNullableBitmap16WithValue:(NSNumber * _Nullable)value para cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = static_cast>(value.unsignedShortValue); + nonNullValue_0 = static_cast>(value.unsignedShortValue); } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -106718,7 +106771,7 @@ - (void)writeAttributeNullableBitmap32WithValue:(NSNumber * _Nullable)value para cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = static_cast>(value.unsignedIntValue); + nonNullValue_0 = static_cast>(value.unsignedIntValue); } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -106787,7 +106840,7 @@ - (void)writeAttributeNullableBitmap64WithValue:(NSNumber * _Nullable)value para cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = static_cast>(value.unsignedLongLongValue); + nonNullValue_0 = static_cast>(value.unsignedLongLongValue); } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -106856,7 +106909,7 @@ - (void)writeAttributeNullableInt8uWithValue:(NSNumber * _Nullable)value params: cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedCharValue; + nonNullValue_0 = value.unsignedCharValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -106925,7 +106978,7 @@ - (void)writeAttributeNullableInt16uWithValue:(NSNumber * _Nullable)value params cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedShortValue; + nonNullValue_0 = value.unsignedShortValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -106994,7 +107047,7 @@ - (void)writeAttributeNullableInt24uWithValue:(NSNumber * _Nullable)value params cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedIntValue; + nonNullValue_0 = value.unsignedIntValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -107063,7 +107116,7 @@ - (void)writeAttributeNullableInt32uWithValue:(NSNumber * _Nullable)value params cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedIntValue; + nonNullValue_0 = value.unsignedIntValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -107132,7 +107185,7 @@ - (void)writeAttributeNullableInt40uWithValue:(NSNumber * _Nullable)value params cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedLongLongValue; + nonNullValue_0 = value.unsignedLongLongValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -107201,7 +107254,7 @@ - (void)writeAttributeNullableInt48uWithValue:(NSNumber * _Nullable)value params cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedLongLongValue; + nonNullValue_0 = value.unsignedLongLongValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -107270,7 +107323,7 @@ - (void)writeAttributeNullableInt56uWithValue:(NSNumber * _Nullable)value params cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedLongLongValue; + nonNullValue_0 = value.unsignedLongLongValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -107339,7 +107392,7 @@ - (void)writeAttributeNullableInt64uWithValue:(NSNumber * _Nullable)value params cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedLongLongValue; + nonNullValue_0 = value.unsignedLongLongValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -107408,7 +107461,7 @@ - (void)writeAttributeNullableInt8sWithValue:(NSNumber * _Nullable)value params: cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.charValue; + nonNullValue_0 = value.charValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -107477,7 +107530,7 @@ - (void)writeAttributeNullableInt16sWithValue:(NSNumber * _Nullable)value params cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.shortValue; + nonNullValue_0 = value.shortValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -107546,7 +107599,7 @@ - (void)writeAttributeNullableInt24sWithValue:(NSNumber * _Nullable)value params cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.intValue; + nonNullValue_0 = value.intValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -107615,7 +107668,7 @@ - (void)writeAttributeNullableInt32sWithValue:(NSNumber * _Nullable)value params cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.intValue; + nonNullValue_0 = value.intValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -107684,7 +107737,7 @@ - (void)writeAttributeNullableInt40sWithValue:(NSNumber * _Nullable)value params cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.longLongValue; + nonNullValue_0 = value.longLongValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -107753,7 +107806,7 @@ - (void)writeAttributeNullableInt48sWithValue:(NSNumber * _Nullable)value params cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.longLongValue; + nonNullValue_0 = value.longLongValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -107822,7 +107875,7 @@ - (void)writeAttributeNullableInt56sWithValue:(NSNumber * _Nullable)value params cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.longLongValue; + nonNullValue_0 = value.longLongValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -107891,7 +107944,7 @@ - (void)writeAttributeNullableInt64sWithValue:(NSNumber * _Nullable)value params cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.longLongValue; + nonNullValue_0 = value.longLongValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -107960,7 +108013,7 @@ - (void)writeAttributeNullableEnum8WithValue:(NSNumber * _Nullable)value params: cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedCharValue; + nonNullValue_0 = value.unsignedCharValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -108029,7 +108082,7 @@ - (void)writeAttributeNullableEnum16WithValue:(NSNumber * _Nullable)value params cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedShortValue; + nonNullValue_0 = value.unsignedShortValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -108098,7 +108151,7 @@ - (void)writeAttributeNullableFloatSingleWithValue:(NSNumber * _Nullable)value p cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.floatValue; + nonNullValue_0 = value.floatValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -108167,7 +108220,7 @@ - (void)writeAttributeNullableFloatDoubleWithValue:(NSNumber * _Nullable)value p cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.doubleValue; + nonNullValue_0 = value.doubleValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -108374,7 +108427,7 @@ - (void)writeAttributeNullableEnumAttrWithValue:(NSNumber * _Nullable)value para cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = static_cast>(value.unsignedCharValue); + nonNullValue_0 = static_cast>(value.unsignedCharValue); } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -108443,18 +108496,23 @@ - (void)writeAttributeNullableStructWithValue:(MTRUnitTestingClusterSimpleStruct cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0.a = value.a.unsignedCharValue; - nonNullValue_0.b = value.b.boolValue; - nonNullValue_0.c = static_cast>(value.c.unsignedCharValue); - nonNullValue_0.d = AsByteSpan(value.d); - nonNullValue_0.e = AsCharSpan(value.e); - nonNullValue_0.f = static_cast>(value.f.unsignedCharValue); - nonNullValue_0.g = value.g.floatValue; - nonNullValue_0.h = value.h.doubleValue; - if (value.i != nil) { - auto & definedValue_2 = nonNullValue_0.i.Emplace(); - definedValue_2 = static_cast>(value.i.unsignedCharValue); + nonNullValue_0.a = value.a.unsignedCharValue; + nonNullValue_0.b = value.b.boolValue; + nonNullValue_0.c = static_cast>(value.c.unsignedCharValue); + nonNullValue_0.d = AsByteSpan(value.d); + nonNullValue_0.e = AsCharSpan(value.e); + nonNullValue_0.f = static_cast>(value.f.unsignedCharValue); + nonNullValue_0.g = value.g.floatValue; + nonNullValue_0.h = value.h.doubleValue; + if (value.i != nil) { + auto & definedValue_2 = nonNullValue_0.i.Emplace(); + definedValue_2 = static_cast>(value.i.unsignedCharValue); + } + if (value.j != nil) { + auto & definedValue_2 = nonNullValue_0.j.Emplace(); + definedValue_2 = value.j.unsignedLongLongValue; } + nonNullValue_0.k = value.k.unsignedIntValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -108523,7 +108581,7 @@ - (void)writeAttributeNullableRangeRestrictedInt8uWithValue:(NSNumber * _Nullabl cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedCharValue; + nonNullValue_0 = value.unsignedCharValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -108592,7 +108650,7 @@ - (void)writeAttributeNullableRangeRestrictedInt8sWithValue:(NSNumber * _Nullabl cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.charValue; + nonNullValue_0 = value.charValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -108661,7 +108719,7 @@ - (void)writeAttributeNullableRangeRestrictedInt16uWithValue:(NSNumber * _Nullab cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedShortValue; + nonNullValue_0 = value.unsignedShortValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -108730,7 +108788,7 @@ - (void)writeAttributeNullableRangeRestrictedInt16sWithValue:(NSNumber * _Nullab cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.shortValue; + nonNullValue_0 = value.shortValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -108795,7 +108853,7 @@ - (void)writeAttributeWriteOnlyInt8uWithValue:(NSNumber * _Nonnull)value params: ListFreer listFreer; using TypeInfo = UnitTesting::Attributes::WriteOnlyInt8u::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; + cppValue = value.unsignedCharValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -108863,7 +108921,7 @@ - (void)writeAttributeNullableGlobalEnumWithValue:(NSNumber * _Nullable)value pa cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = static_cast>(value.unsignedCharValue); + nonNullValue_0 = static_cast>(value.unsignedCharValue); } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -108932,22 +108990,31 @@ - (void)writeAttributeNullableGlobalStructWithValue:(MTRDataTypeTestGlobalStruct cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0.name = AsCharSpan(value.name); - if (value.myBitmap == nil) { - nonNullValue_0.myBitmap.SetNull(); - } else { - auto & nonNullValue_2 = nonNullValue_0.myBitmap.SetNonNull(); - nonNullValue_2 = static_cast>(value.myBitmap.unsignedIntValue); + nonNullValue_0.name = AsCharSpan(value.name); + if (value.myBitmap == nil) { + nonNullValue_0.myBitmap.SetNull(); + } else { + auto & nonNullValue_2 = nonNullValue_0.myBitmap.SetNonNull(); + nonNullValue_2 = static_cast>(value.myBitmap.unsignedIntValue); } - if (value.myEnum != nil) { - auto & definedValue_2 = nonNullValue_0.myEnum.Emplace(); - if (value.myEnum == nil) { - definedValue_2.SetNull(); - } else { - auto & nonNullValue_3 = definedValue_2.SetNonNull(); - nonNullValue_3 = static_cast>(value.myEnum.unsignedCharValue); + if (value.myEnum != nil) { + auto & definedValue_2 = nonNullValue_0.myEnum.Emplace(); + if (value.myEnum == nil) { + definedValue_2.SetNull(); + } else { + auto & nonNullValue_3 = definedValue_2.SetNonNull(); + nonNullValue_3 = static_cast>(value.myEnum.unsignedCharValue); } - } + } + if (value.myTypedef != nil) { + auto & definedValue_2 = nonNullValue_0.myTypedef.Emplace(); + if (value.myTypedef == nil) { + definedValue_2.SetNull(); + } else { + auto & nonNullValue_3 = definedValue_2.SetNonNull(); + nonNullValue_3 = value.myTypedef.unsignedIntValue; + } + } } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -108980,6 +109047,144 @@ + (void)readAttributeNullableGlobalStructWithClusterStateCache:(MTRClusterStateC completion:completion]; } +- (void)readAttributeNullableTypedefAttrWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = UnitTesting::Attributes::NullableTypedefAttr::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)writeAttributeNullableTypedefAttrWithValue:(NSNumber * _Nullable)value completion:(MTRStatusCompletion)completion +{ + [self writeAttributeNullableTypedefAttrWithValue:(NSNumber * _Nullable) value params:nil completion:completion]; +} +- (void)writeAttributeNullableTypedefAttrWithValue:(NSNumber * _Nullable)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion +{ + // Make a copy of params before we go async. + params = [params copy]; + value = [value copy]; + + auto * bridge = new MTRDefaultSuccessCallbackBridge(self.callbackQueue, ^(id _Nullable ignored, NSError * _Nullable error) { completion(error); }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, DefaultSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { + chip::Optional timedWriteTimeout; + if (params != nil) { + if (params.timedWriteTimeout != nil){ + timedWriteTimeout.SetValue(params.timedWriteTimeout.unsignedShortValue); + } + } + + ListFreer listFreer; + using TypeInfo = UnitTesting::Attributes::NullableTypedefAttr::TypeInfo; + TypeInfo::Type cppValue; + if (value == nil) { + cppValue.SetNull(); + } else { + auto & nonNullValue_0 = cppValue.SetNonNull(); + nonNullValue_0 = value.unsignedLongLongValue; + } + + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); + return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); + std::move(*bridge).DispatchAction(self.device); +} + +- (void)subscribeAttributeNullableTypedefAttrWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = UnitTesting::Attributes::NullableTypedefAttr::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeNullableTypedefAttrWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = UnitTesting::Attributes::NullableTypedefAttr::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeNullableGlobalTypedefWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = UnitTesting::Attributes::NullableGlobalTypedef::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)writeAttributeNullableGlobalTypedefWithValue:(NSNumber * _Nullable)value completion:(MTRStatusCompletion)completion +{ + [self writeAttributeNullableGlobalTypedefWithValue:(NSNumber * _Nullable) value params:nil completion:completion]; +} +- (void)writeAttributeNullableGlobalTypedefWithValue:(NSNumber * _Nullable)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion +{ + // Make a copy of params before we go async. + params = [params copy]; + value = [value copy]; + + auto * bridge = new MTRDefaultSuccessCallbackBridge(self.callbackQueue, ^(id _Nullable ignored, NSError * _Nullable error) { completion(error); }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, DefaultSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { + chip::Optional timedWriteTimeout; + if (params != nil) { + if (params.timedWriteTimeout != nil){ + timedWriteTimeout.SetValue(params.timedWriteTimeout.unsignedShortValue); + } + } + + ListFreer listFreer; + using TypeInfo = UnitTesting::Attributes::NullableGlobalTypedef::TypeInfo; + TypeInfo::Type cppValue; + if (value == nil) { + cppValue.SetNull(); + } else { + auto & nonNullValue_0 = cppValue.SetNonNull(); + nonNullValue_0 = value.unsignedIntValue; + } + + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); + return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); + std::move(*bridge).DispatchAction(self.device); +} + +- (void)subscribeAttributeNullableGlobalTypedefWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = UnitTesting::Attributes::NullableGlobalTypedef::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeNullableGlobalTypedefWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = UnitTesting::Attributes::NullableGlobalTypedef::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + - (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { using TypeInfo = UnitTesting::Attributes::GeneratedCommandList::TypeInfo; @@ -109192,7 +109397,7 @@ - (void)writeAttributeMeiInt8uWithValue:(NSNumber * _Nonnull)value params:(MTRWr ListFreer listFreer; using TypeInfo = UnitTesting::Attributes::MeiInt8u::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; + cppValue = value.unsignedCharValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -113218,7 +113423,7 @@ - (void)writeAttributeFlipFlopWithValue:(NSNumber * _Nonnull)value params:(MTRWr ListFreer listFreer; using TypeInfo = SampleMei::Attributes::FlipFlop::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.boolValue; + cppValue = value.boolValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm b/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm index 96b2c0cd3bf3e6..aed38af5a68b4b 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm @@ -8461,6 +8461,14 @@ result = @"NullableGlobalStruct"; break; + case MTRAttributeIDTypeClusterUnitTestingAttributeNullableTypedefAttrID: + result = @"NullableTypedefAttr"; + break; + + case MTRAttributeIDTypeClusterUnitTestingAttributeNullableGlobalTypedefID: + result = @"NullableGlobalTypedef"; + break; + case MTRAttributeIDTypeClusterUnitTestingAttributeGeneratedCommandListID: result = @"GeneratedCommandList"; break; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm index 1d6828deddb868..336a73d0f3acdf 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm @@ -22454,6 +22454,38 @@ - (void)writeAttributeNullableGlobalStructWithValue:(NSDictionary * _Nullable)readAttributeNullableTypedefAttrWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeUnitTestingID) attributeID:@(MTRAttributeIDTypeClusterUnitTestingAttributeNullableTypedefAttrID) params:params]; +} + +- (void)writeAttributeNullableTypedefAttrWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeNullableTypedefAttrWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeNullableTypedefAttrWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params +{ + NSNumber * timedWriteTimeout = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeUnitTestingID) attributeID:@(MTRAttributeIDTypeClusterUnitTestingAttributeNullableTypedefAttrID) value:dataValueDictionary expectedValueInterval:expectedValueIntervalMs timedWriteTimeout:timedWriteTimeout]; +} + +- (NSDictionary * _Nullable)readAttributeNullableGlobalTypedefWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeUnitTestingID) attributeID:@(MTRAttributeIDTypeClusterUnitTestingAttributeNullableGlobalTypedefID) params:params]; +} + +- (void)writeAttributeNullableGlobalTypedefWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeNullableGlobalTypedefWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeNullableGlobalTypedefWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params +{ + NSNumber * timedWriteTimeout = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeUnitTestingID) attributeID:@(MTRAttributeIDTypeClusterUnitTestingAttributeNullableGlobalTypedefID) value:dataValueDictionary expectedValueInterval:expectedValueIntervalMs timedWriteTimeout:timedWriteTimeout]; +} + - (NSDictionary * _Nullable)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params { return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeUnitTestingID) attributeID:@(MTRAttributeIDTypeClusterUnitTestingAttributeGeneratedCommandListID) params:params]; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm index 318455a23b9210..f0301da956d454 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm @@ -35508,6 +35508,12 @@ - (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::UnitTest } else { newElement_0.c.i = nil; } + if (entry_0.c.j.HasValue()) { + newElement_0.c.j = [NSNumber numberWithUnsignedLongLong:entry_0.c.j.Value()]; + } else { + newElement_0.c.j = nil; + } + newElement_0.c.k = [NSNumber numberWithUnsignedInt:entry_0.c.k]; { // Scope for our temporary variables auto * array_2 = [NSMutableArray new]; auto iter_2 = entry_0.d.begin(); @@ -35532,6 +35538,12 @@ - (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::UnitTest } else { newElement_2.i = nil; } + if (entry_2.j.HasValue()) { + newElement_2.j = [NSNumber numberWithUnsignedLongLong:entry_2.j.Value()]; + } else { + newElement_2.j = nil; + } + newElement_2.k = [NSNumber numberWithUnsignedInt:entry_2.k]; [array_2 addObject:newElement_2]; } CHIP_ERROR err = iter_2.GetStatus(); @@ -35619,6 +35631,12 @@ - (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::UnitTest } else { newElement_0.i = nil; } + if (entry_0.j.HasValue()) { + newElement_0.j = [NSNumber numberWithUnsignedLongLong:entry_0.j.Value()]; + } else { + newElement_0.j = nil; + } + newElement_0.k = [NSNumber numberWithUnsignedInt:entry_0.k]; [array_0 addObject:newElement_0]; } CHIP_ERROR err = iter_0.GetStatus(); @@ -35668,6 +35686,23 @@ - (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::UnitTest { self.arg6 = [NSNumber numberWithBool:decodableStruct.arg6]; } + { + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = decodableStruct.arg7.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithUnsignedLongLong:entry_0]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + return err; + } + self.arg7 = array_0; + } + } return CHIP_NO_ERROR; } @@ -36136,6 +36171,11 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader auto & definedValue_3 = listHolder_0->mList[i_0].c.i.Emplace(); definedValue_3 = static_cast>(element_0.c.i.unsignedCharValue); } + if (element_0.c.j != nil) { + auto & definedValue_3 = listHolder_0->mList[i_0].c.j.Emplace(); + definedValue_3 = element_0.c.j.unsignedLongLongValue; + } + listHolder_0->mList[i_0].c.k = element_0.c.k.unsignedIntValue; { using ListType_2 = std::remove_reference_tmList[i_0].d)>; using ListMemberType_2 = ListMemberTypeGetter::Type; @@ -36164,6 +36204,11 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader auto & definedValue_4 = listHolder_2->mList[i_2].i.Emplace(); definedValue_4 = static_cast>(element_2.i.unsignedCharValue); } + if (element_2.j != nil) { + auto & definedValue_4 = listHolder_2->mList[i_2].j.Emplace(); + definedValue_4 = element_2.j.unsignedLongLongValue; + } + listHolder_2->mList[i_2].k = element_2.k.unsignedIntValue; } listHolder_0->mList[i_0].d = ListType_2(listHolder_2->mList, element_0.d.count); } else { @@ -36275,6 +36320,11 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader auto & definedValue_2 = listHolder_0->mList[i_0].i.Emplace(); definedValue_2 = static_cast>(element_0.i.unsignedCharValue); } + if (element_0.j != nil) { + auto & definedValue_2 = listHolder_0->mList[i_0].j.Emplace(); + definedValue_2 = element_0.j.unsignedLongLongValue; + } + listHolder_0->mList[i_0].k = element_0.k.unsignedIntValue; } encodableStruct.arg2 = ListType_0(listHolder_0->mList, self.arg2.count); } else { @@ -36338,6 +36388,31 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader { encodableStruct.arg6 = self.arg6.boolValue; } + { + { + using ListType_0 = std::remove_reference_t; + using ListMemberType_0 = ListMemberTypeGetter::Type; + if (self.arg7.count != 0) { + auto * listHolder_0 = new ListHolder(self.arg7.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 < self.arg7.count; ++i_0) { + auto element_0 = MTR_SAFE_CAST(self.arg7[i_0], NSNumber); + if (!element_0) { + // Wrong kind of value. + MTR_LOG_ERROR("%@ incorrectly present in list of %@", self.arg7[i_0], NSStringFromClass(NSNumber.class)); + return CHIP_ERROR_INVALID_ARGUMENT; + } + listHolder_0->mList[i_0] = element_0.unsignedLongLongValue; + } + encodableStruct.arg7 = ListType_0(listHolder_0->mList, self.arg7.count); + } else { + encodableStruct.arg7 = ListType_0(); + } + } + } auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); if (buffer.IsNull()) { @@ -36561,6 +36636,11 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader auto & definedValue_1 = encodableStruct.arg1.i.Emplace(); definedValue_1 = static_cast>(self.arg1.i.unsignedCharValue); } + if (self.arg1.j != nil) { + auto & definedValue_1 = encodableStruct.arg1.j.Emplace(); + definedValue_1 = self.arg1.j.unsignedLongLongValue; + } + encodableStruct.arg1.k = self.arg1.k.unsignedIntValue; } auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); @@ -36870,6 +36950,12 @@ - (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::UnitTest } else { self.nullableStructValue.i = nil; } + if (decodableStruct.nullableStructValue.Value().j.HasValue()) { + self.nullableStructValue.j = [NSNumber numberWithUnsignedLongLong:decodableStruct.nullableStructValue.Value().j.Value()]; + } else { + self.nullableStructValue.j = nil; + } + self.nullableStructValue.k = [NSNumber numberWithUnsignedInt:decodableStruct.nullableStructValue.Value().k]; } else { self.nullableStructValue = nil; } @@ -36897,6 +36983,12 @@ - (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::UnitTest } else { self.optionalStructValue.i = nil; } + if (decodableStruct.optionalStructValue.Value().j.HasValue()) { + self.optionalStructValue.j = [NSNumber numberWithUnsignedLongLong:decodableStruct.optionalStructValue.Value().j.Value()]; + } else { + self.optionalStructValue.j = nil; + } + self.optionalStructValue.k = [NSNumber numberWithUnsignedInt:decodableStruct.optionalStructValue.Value().k]; } else { self.optionalStructValue = nil; } @@ -36931,6 +37023,12 @@ - (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::UnitTest } else { self.nullableOptionalStructValue.i = nil; } + if (decodableStruct.nullableOptionalStructValue.Value().j.HasValue()) { + self.nullableOptionalStructValue.j = [NSNumber numberWithUnsignedLongLong:decodableStruct.nullableOptionalStructValue.Value().j.Value()]; + } else { + self.nullableOptionalStructValue.j = nil; + } + self.nullableOptionalStructValue.k = [NSNumber numberWithUnsignedInt:decodableStruct.nullableOptionalStructValue.Value().k]; } else { self.nullableOptionalStructValue = nil; } @@ -37014,6 +37112,36 @@ - (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::UnitTest self.nullableOptionalListValue = nil; } } + { + self.nullableTypedefWasNull = [NSNumber numberWithBool:decodableStruct.nullableTypedefWasNull]; + } + { + if (decodableStruct.nullableTypedefValue.HasValue()) { + self.nullableTypedefValue = [NSNumber numberWithUnsignedLongLong:decodableStruct.nullableTypedefValue.Value()]; + } else { + self.nullableTypedefValue = nil; + } + } + { + self.optionalTypedefWasPresent = [NSNumber numberWithBool:decodableStruct.optionalTypedefWasPresent]; + } + { + if (decodableStruct.optionalTypedefValue.HasValue()) { + self.optionalTypedefValue = [NSNumber numberWithUnsignedLongLong:decodableStruct.optionalTypedefValue.Value()]; + } else { + self.optionalTypedefValue = nil; + } + } + { + self.nullableOptionalTypedefWasPresent = [NSNumber numberWithBool:decodableStruct.nullableOptionalTypedefWasPresent]; + } + { + if (decodableStruct.nullableOptionalTypedefWasNull.HasValue()) { + self.nullableOptionalTypedefWasNull = [NSNumber numberWithBool:decodableStruct.nullableOptionalTypedefWasNull.Value()]; + } else { + self.nullableOptionalTypedefWasNull = nil; + } + } return CHIP_NO_ERROR; } @@ -37103,6 +37231,11 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader auto & definedValue_2 = encodableStruct.arg1.c.i.Emplace(); definedValue_2 = static_cast>(self.arg1.c.i.unsignedCharValue); } + if (self.arg1.c.j != nil) { + auto & definedValue_2 = encodableStruct.arg1.c.j.Emplace(); + definedValue_2 = self.arg1.c.j.unsignedLongLongValue; + } + encodableStruct.arg1.c.k = self.arg1.c.k.unsignedIntValue; if (self.arg1.d != nil) { auto & definedValue_1 = encodableStruct.arg1.d.Emplace(); definedValue_1.name = AsCharSpan(self.arg1.d.name); @@ -37121,6 +37254,15 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader nonNullValue_4 = static_cast>(self.arg1.d.myEnum.unsignedCharValue); } } + if (self.arg1.d.myTypedef != nil) { + auto & definedValue_3 = definedValue_1.myTypedef.Emplace(); + if (self.arg1.d.myTypedef == nil) { + definedValue_3.SetNull(); + } else { + auto & nonNullValue_4 = definedValue_3.SetNonNull(); + nonNullValue_4 = self.arg1.d.myTypedef.unsignedIntValue; + } + } } } @@ -37320,6 +37462,11 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader auto & definedValue_2 = listHolder_0->mList[i_0].i.Emplace(); definedValue_2 = static_cast>(element_0.i.unsignedCharValue); } + if (element_0.j != nil) { + auto & definedValue_2 = listHolder_0->mList[i_0].j.Emplace(); + definedValue_2 = element_0.j.unsignedLongLongValue; + } + listHolder_0->mList[i_0].k = element_0.k.unsignedIntValue; } encodableStruct.arg1 = ListType_0(listHolder_0->mList, self.arg1.count); } else { @@ -37464,6 +37611,12 @@ - (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::UnitTest } else { self.arg1.i = nil; } + if (decodableStruct.arg1.j.HasValue()) { + self.arg1.j = [NSNumber numberWithUnsignedLongLong:decodableStruct.arg1.j.Value()]; + } else { + self.arg1.j = nil; + } + self.arg1.k = [NSNumber numberWithUnsignedInt:decodableStruct.arg1.k]; } return CHIP_NO_ERROR; } @@ -37720,6 +37873,11 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader auto & definedValue_2 = encodableStruct.arg1.c.i.Emplace(); definedValue_2 = static_cast>(self.arg1.c.i.unsignedCharValue); } + if (self.arg1.c.j != nil) { + auto & definedValue_2 = encodableStruct.arg1.c.j.Emplace(); + definedValue_2 = self.arg1.c.j.unsignedLongLongValue; + } + encodableStruct.arg1.c.k = self.arg1.c.k.unsignedIntValue; { using ListType_1 = std::remove_reference_t; using ListMemberType_1 = ListMemberTypeGetter::Type; @@ -37748,6 +37906,11 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader auto & definedValue_3 = listHolder_1->mList[i_1].i.Emplace(); definedValue_3 = static_cast>(element_1.i.unsignedCharValue); } + if (element_1.j != nil) { + auto & definedValue_3 = listHolder_1->mList[i_1].j.Emplace(); + definedValue_3 = element_1.j.unsignedLongLongValue; + } + listHolder_1->mList[i_1].k = element_1.k.unsignedIntValue; } encodableStruct.arg1.d = ListType_1(listHolder_1->mList, self.arg1.d.count); } else { @@ -38023,6 +38186,11 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader auto & definedValue_3 = listHolder_0->mList[i_0].c.i.Emplace(); definedValue_3 = static_cast>(element_0.c.i.unsignedCharValue); } + if (element_0.c.j != nil) { + auto & definedValue_3 = listHolder_0->mList[i_0].c.j.Emplace(); + definedValue_3 = element_0.c.j.unsignedLongLongValue; + } + listHolder_0->mList[i_0].c.k = element_0.c.k.unsignedIntValue; { using ListType_2 = std::remove_reference_tmList[i_0].d)>; using ListMemberType_2 = ListMemberTypeGetter::Type; @@ -38051,6 +38219,11 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader auto & definedValue_4 = listHolder_2->mList[i_2].i.Emplace(); definedValue_4 = static_cast>(element_2.i.unsignedCharValue); } + if (element_2.j != nil) { + auto & definedValue_4 = listHolder_2->mList[i_2].j.Emplace(); + definedValue_4 = element_2.j.unsignedLongLongValue; + } + listHolder_2->mList[i_2].k = element_2.k.unsignedIntValue; } listHolder_0->mList[i_0].d = ListType_2(listHolder_2->mList, element_0.d.count); } else { @@ -38630,10 +38803,22 @@ - (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::UnitTest } else { self.field1.myEnum = nil; } + if (decodableStruct.field1.myTypedef.HasValue()) { + if (decodableStruct.field1.myTypedef.Value().IsNull()) { + self.field1.myTypedef = nil; + } else { + self.field1.myTypedef = [NSNumber numberWithUnsignedInt:decodableStruct.field1.myTypedef.Value().Value()]; + } + } else { + self.field1.myTypedef = nil; + } } { self.field2 = [NSNumber numberWithUnsignedChar:chip::to_underlying(decodableStruct.field2)]; } + { + self.field3 = [NSNumber numberWithUnsignedInt:decodableStruct.field3]; + } return CHIP_NO_ERROR; } @@ -38869,6 +39054,11 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader auto & definedValue_2 = nonNullValue_0.i.Emplace(); definedValue_2 = static_cast>(self.nullableStruct.i.unsignedCharValue); } + if (self.nullableStruct.j != nil) { + auto & definedValue_2 = nonNullValue_0.j.Emplace(); + definedValue_2 = self.nullableStruct.j.unsignedLongLongValue; + } + nonNullValue_0.k = self.nullableStruct.k.unsignedIntValue; } } { @@ -38886,6 +39076,11 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader auto & definedValue_2 = definedValue_0.i.Emplace(); definedValue_2 = static_cast>(self.optionalStruct.i.unsignedCharValue); } + if (self.optionalStruct.j != nil) { + auto & definedValue_2 = definedValue_0.j.Emplace(); + definedValue_2 = self.optionalStruct.j.unsignedLongLongValue; + } + definedValue_0.k = self.optionalStruct.k.unsignedIntValue; } } { @@ -38907,6 +39102,11 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader auto & definedValue_3 = nonNullValue_1.i.Emplace(); definedValue_3 = static_cast>(self.nullableOptionalStruct.i.unsignedCharValue); } + if (self.nullableOptionalStruct.j != nil) { + auto & definedValue_3 = nonNullValue_1.j.Emplace(); + definedValue_3 = self.nullableOptionalStruct.j.unsignedLongLongValue; + } + nonNullValue_1.k = self.nullableOptionalStruct.k.unsignedIntValue; } } } @@ -39107,6 +39307,11 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader auto & definedValue_1 = encodableStruct.arg1.i.Emplace(); definedValue_1 = static_cast>(self.arg1.i.unsignedCharValue); } + if (self.arg1.j != nil) { + auto & definedValue_1 = encodableStruct.arg1.j.Emplace(); + definedValue_1 = self.arg1.j.unsignedLongLongValue; + } + encodableStruct.arg1.k = self.arg1.k.unsignedIntValue; } auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); @@ -39821,10 +40026,22 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader nonNullValue_2 = static_cast>(self.field1.myEnum.unsignedCharValue); } } + if (self.field1.myTypedef != nil) { + auto & definedValue_1 = encodableStruct.field1.myTypedef.Emplace(); + if (self.field1.myTypedef == nil) { + definedValue_1.SetNull(); + } else { + auto & nonNullValue_2 = definedValue_1.SetNonNull(); + nonNullValue_2 = self.field1.myTypedef.unsignedIntValue; + } + } } { encodableStruct.field2 = static_cast>(self.field2.unsignedCharValue); } + { + encodableStruct.field3 = self.field3.unsignedIntValue; + } auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); if (buffer.IsNull()) { diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm index ddc22861202fc1..e5ccc86214dd6c 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm @@ -29,6 +29,8 @@ - (instancetype)init _myBitmap = nil; _myEnum = nil; + + _myTypedef = nil; } return self; } @@ -40,13 +42,14 @@ - (id)copyWithZone:(NSZone * _Nullable)zone other.name = self.name; other.myBitmap = self.myBitmap; other.myEnum = self.myEnum; + other.myTypedef = self.myTypedef; return other; } - (NSString *)description { - NSString * descriptionString = [NSString stringWithFormat:@"<%@: name:%@; myBitmap:%@; myEnum:%@; >", NSStringFromClass([self class]), _name, _myBitmap, _myEnum]; + NSString * descriptionString = [NSString stringWithFormat:@"<%@: name:%@; myBitmap:%@; myEnum:%@; myTypedef:%@; >", NSStringFromClass([self class]), _name, _myBitmap, _myEnum, _myTypedef]; return descriptionString; } @@ -9846,6 +9849,10 @@ - (instancetype)init _h = @(0); _i = nil; + + _j = nil; + + _k = @(0); } return self; } @@ -9863,13 +9870,15 @@ - (id)copyWithZone:(NSZone * _Nullable)zone other.g = self.g; other.h = self.h; other.i = self.i; + other.j = self.j; + other.k = self.k; return other; } - (NSString *)description { - NSString * descriptionString = [NSString stringWithFormat:@"<%@: a:%@; b:%@; c:%@; d:%@; e:%@; f:%@; g:%@; h:%@; i:%@; >", NSStringFromClass([self class]), _a, _b, _c, [_d base64EncodedStringWithOptions:0], _e, _f, _g, _h, _i]; + NSString * descriptionString = [NSString stringWithFormat:@"<%@: a:%@; b:%@; c:%@; d:%@; e:%@; f:%@; g:%@; h:%@; i:%@; j:%@; k:%@; >", NSStringFromClass([self class]), _a, _b, _c, [_d base64EncodedStringWithOptions:0], _e, _f, _g, _h, _i, _j, _k]; return descriptionString; } @@ -9973,6 +9982,12 @@ - (instancetype)init _optionalList = nil; _nullableOptionalList = nil; + + _nullableTypedef = nil; + + _optionalTypedef = nil; + + _nullableOptionalTypedef = nil; } return self; } @@ -9993,13 +10008,16 @@ - (id)copyWithZone:(NSZone * _Nullable)zone other.nullableList = self.nullableList; other.optionalList = self.optionalList; other.nullableOptionalList = self.nullableOptionalList; + other.nullableTypedef = self.nullableTypedef; + other.optionalTypedef = self.optionalTypedef; + other.nullableOptionalTypedef = self.nullableOptionalTypedef; return other; } - (NSString *)description { - NSString * descriptionString = [NSString stringWithFormat:@"<%@: nullableInt:%@; optionalInt:%@; nullableOptionalInt:%@; nullableString:%@; optionalString:%@; nullableOptionalString:%@; nullableStruct:%@; optionalStruct:%@; nullableOptionalStruct:%@; nullableList:%@; optionalList:%@; nullableOptionalList:%@; >", NSStringFromClass([self class]), _nullableInt, _optionalInt, _nullableOptionalInt, _nullableString, _optionalString, _nullableOptionalString, _nullableStruct, _optionalStruct, _nullableOptionalStruct, _nullableList, _optionalList, _nullableOptionalList]; + NSString * descriptionString = [NSString stringWithFormat:@"<%@: nullableInt:%@; optionalInt:%@; nullableOptionalInt:%@; nullableString:%@; optionalString:%@; nullableOptionalString:%@; nullableStruct:%@; optionalStruct:%@; nullableOptionalStruct:%@; nullableList:%@; optionalList:%@; nullableOptionalList:%@; nullableTypedef:%@; optionalTypedef:%@; nullableOptionalTypedef:%@; >", NSStringFromClass([self class]), _nullableInt, _optionalInt, _nullableOptionalInt, _nullableString, _optionalString, _nullableOptionalString, _nullableStruct, _optionalStruct, _nullableOptionalStruct, _nullableList, _optionalList, _nullableOptionalList, _nullableTypedef, _optionalTypedef, _nullableOptionalTypedef]; return descriptionString; } diff --git a/src/lib/core/BUILD.gn b/src/lib/core/BUILD.gn index 265f5fea7fc5b8..80ee711934ea96 100644 --- a/src/lib/core/BUILD.gn +++ b/src/lib/core/BUILD.gn @@ -190,6 +190,7 @@ static_library("core") { ":chip_config_header", ":error", "${chip_root}/src/app/common:enums", + "${chip_root}/src/app/common:typedefs", "${chip_root}/src/ble", "${chip_root}/src/inet", "${chip_root}/src/lib/support", diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h index 2357a87dd9d9fa..a7c98799c40732 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h @@ -19,6 +19,7 @@ #pragma once +#include #include #include #include @@ -397,9 +398,10 @@ namespace Structs { namespace TestGlobalStruct { enum class Fields : uint8_t { - kName = 0, - kMyBitmap = 1, - kMyEnum = 2, + kName = 0, + kMyBitmap = 1, + kMyEnum = 2, + kMyTypedef = 3, }; struct Type @@ -408,6 +410,7 @@ struct Type chip::CharSpan name; DataModel::Nullable> myBitmap; Optional> myEnum; + Optional> myTypedef; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -43777,6 +43780,8 @@ enum class Fields : uint8_t kG = 6, kH = 7, kI = 8, + kJ = 9, + kK = 10, }; struct Type @@ -43791,6 +43796,8 @@ struct Type float g = static_cast(0); double h = static_cast(0); Optional i; + Optional j; + uint32_t k = static_cast(0); CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -43865,18 +43872,21 @@ struct DecodableType namespace NullablesAndOptionalsStruct { enum class Fields : uint8_t { - kNullableInt = 0, - kOptionalInt = 1, - kNullableOptionalInt = 2, - kNullableString = 3, - kOptionalString = 4, - kNullableOptionalString = 5, - kNullableStruct = 6, - kOptionalStruct = 7, - kNullableOptionalStruct = 8, - kNullableList = 9, - kOptionalList = 10, - kNullableOptionalList = 11, + kNullableInt = 0, + kOptionalInt = 1, + kNullableOptionalInt = 2, + kNullableString = 3, + kOptionalString = 4, + kNullableOptionalString = 5, + kNullableStruct = 6, + kOptionalStruct = 7, + kNullableOptionalStruct = 8, + kNullableList = 9, + kOptionalList = 10, + kNullableOptionalList = 11, + kNullableTypedef = 12, + kOptionalTypedef = 13, + kNullableOptionalTypedef = 14, }; struct Type @@ -43894,6 +43904,9 @@ struct Type DataModel::Nullable> nullableList; Optional> optionalList; Optional>> nullableOptionalList; + DataModel::Nullable nullableTypedef; + Optional optionalTypedef; + Optional> nullableOptionalTypedef; static constexpr bool kIsFabricScoped = false; @@ -43915,6 +43928,9 @@ struct DecodableType DataModel::Nullable> nullableList; Optional> optionalList; Optional>> nullableOptionalList; + DataModel::Nullable nullableTypedef; + Optional optionalTypedef; + Optional> nullableOptionalTypedef; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -44484,6 +44500,7 @@ enum class Fields : uint8_t kArg4 = 3, kArg5 = 4, kArg6 = 5, + kArg7 = 6, }; struct Type @@ -44499,6 +44516,7 @@ struct Type DataModel::List arg4; SimpleEnum arg5 = static_cast(0); bool arg6 = static_cast(0); + DataModel::List arg7; CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; @@ -44519,6 +44537,7 @@ struct DecodableType DataModel::DecodableList arg4; SimpleEnum arg5 = static_cast(0); bool arg6 = static_cast(0); + DataModel::DecodableList arg7; CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace TestStructArrayArgumentResponse @@ -44665,6 +44684,7 @@ enum class Fields : uint8_t kArg4 = 3, kArg5 = 4, kArg6 = 5, + kArg7 = 6, }; struct Type @@ -44680,6 +44700,7 @@ struct Type DataModel::List arg4; SimpleEnum arg5 = static_cast(0); bool arg6 = static_cast(0); + DataModel::List arg7; CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; @@ -44700,6 +44721,7 @@ struct DecodableType DataModel::DecodableList arg4; SimpleEnum arg5 = static_cast(0); bool arg6 = static_cast(0); + DataModel::DecodableList arg7; CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace TestStructArrayArgumentRequest @@ -44779,34 +44801,40 @@ struct DecodableType namespace TestComplexNullableOptionalResponse { enum class Fields : uint8_t { - kNullableIntWasNull = 0, - kNullableIntValue = 1, - kOptionalIntWasPresent = 2, - kOptionalIntValue = 3, - kNullableOptionalIntWasPresent = 4, - kNullableOptionalIntWasNull = 5, - kNullableOptionalIntValue = 6, - kNullableStringWasNull = 7, - kNullableStringValue = 8, - kOptionalStringWasPresent = 9, - kOptionalStringValue = 10, - kNullableOptionalStringWasPresent = 11, - kNullableOptionalStringWasNull = 12, - kNullableOptionalStringValue = 13, - kNullableStructWasNull = 14, - kNullableStructValue = 15, - kOptionalStructWasPresent = 16, - kOptionalStructValue = 17, - kNullableOptionalStructWasPresent = 18, - kNullableOptionalStructWasNull = 19, - kNullableOptionalStructValue = 20, - kNullableListWasNull = 21, - kNullableListValue = 22, - kOptionalListWasPresent = 23, - kOptionalListValue = 24, - kNullableOptionalListWasPresent = 25, - kNullableOptionalListWasNull = 26, - kNullableOptionalListValue = 27, + kNullableIntWasNull = 0, + kNullableIntValue = 1, + kOptionalIntWasPresent = 2, + kOptionalIntValue = 3, + kNullableOptionalIntWasPresent = 4, + kNullableOptionalIntWasNull = 5, + kNullableOptionalIntValue = 6, + kNullableStringWasNull = 7, + kNullableStringValue = 8, + kOptionalStringWasPresent = 9, + kOptionalStringValue = 10, + kNullableOptionalStringWasPresent = 11, + kNullableOptionalStringWasNull = 12, + kNullableOptionalStringValue = 13, + kNullableStructWasNull = 14, + kNullableStructValue = 15, + kOptionalStructWasPresent = 16, + kOptionalStructValue = 17, + kNullableOptionalStructWasPresent = 18, + kNullableOptionalStructWasNull = 19, + kNullableOptionalStructValue = 20, + kNullableListWasNull = 21, + kNullableListValue = 22, + kOptionalListWasPresent = 23, + kOptionalListValue = 24, + kNullableOptionalListWasPresent = 25, + kNullableOptionalListWasNull = 26, + kNullableOptionalListValue = 27, + kNullableTypedefWasNull = 28, + kNullableTypedefValue = 29, + kOptionalTypedefWasPresent = 30, + kOptionalTypedefValue = 31, + kNullableOptionalTypedefWasPresent = 32, + kNullableOptionalTypedefWasNull = 33, }; struct Type @@ -44844,6 +44872,12 @@ struct Type bool nullableOptionalListWasPresent = static_cast(0); Optional nullableOptionalListWasNull; Optional> nullableOptionalListValue; + bool nullableTypedefWasNull = static_cast(0); + Optional nullableTypedefValue; + bool optionalTypedefWasPresent = static_cast(0); + Optional optionalTypedefValue; + bool nullableOptionalTypedefWasPresent = static_cast(0); + Optional nullableOptionalTypedefWasNull; CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; @@ -44886,6 +44920,12 @@ struct DecodableType bool nullableOptionalListWasPresent = static_cast(0); Optional nullableOptionalListWasNull; Optional> nullableOptionalListValue; + bool nullableTypedefWasNull = static_cast(0); + Optional nullableTypedefValue; + bool optionalTypedefWasPresent = static_cast(0); + Optional optionalTypedefValue; + bool nullableOptionalTypedefWasPresent = static_cast(0); + Optional nullableOptionalTypedefWasNull; CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace TestComplexNullableOptionalResponse @@ -45313,6 +45353,7 @@ enum class Fields : uint8_t { kField1 = 0, kField2 = 1, + kField3 = 2, }; struct Type @@ -45324,6 +45365,7 @@ struct Type Globals::Structs::TestGlobalStruct::Type field1; Globals::TestGlobalEnum field2 = static_cast(0); + uint32_t field3 = static_cast(0); CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; @@ -45340,6 +45382,7 @@ struct DecodableType Globals::Structs::TestGlobalStruct::DecodableType field1; Globals::TestGlobalEnum field2 = static_cast(0); + uint32_t field3 = static_cast(0); CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace GlobalEchoResponse @@ -45715,6 +45758,7 @@ enum class Fields : uint8_t { kField1 = 0, kField2 = 1, + kField3 = 2, }; struct Type @@ -45726,6 +45770,7 @@ struct Type Globals::Structs::TestGlobalStruct::Type field1; Globals::TestGlobalEnum field2 = static_cast(0); + uint32_t field3 = static_cast(0); CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; @@ -45742,6 +45787,7 @@ struct DecodableType Globals::Structs::TestGlobalStruct::DecodableType field1; Globals::TestGlobalEnum field2 = static_cast(0); + uint32_t field3 = static_cast(0); CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace GlobalEchoRequest @@ -46890,6 +46936,30 @@ struct TypeInfo static constexpr bool MustUseTimedWrite() { return false; } }; } // namespace NullableGlobalStruct +namespace NullableTypedefAttr { +struct TypeInfo +{ + using Type = chip::app::DataModel::Nullable; + using DecodableType = chip::app::DataModel::Nullable; + using DecodableArgType = const chip::app::DataModel::Nullable &; + + static constexpr ClusterId GetClusterId() { return Clusters::UnitTesting::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::NullableTypedefAttr::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace NullableTypedefAttr +namespace NullableGlobalTypedef { +struct TypeInfo +{ + using Type = chip::app::DataModel::Nullable; + using DecodableType = chip::app::DataModel::Nullable; + using DecodableArgType = const chip::app::DataModel::Nullable &; + + static constexpr ClusterId GetClusterId() { return Clusters::UnitTesting::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::NullableGlobalTypedef::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace NullableGlobalTypedef namespace GeneratedCommandList { struct TypeInfo : public Clusters::Globals::Attributes::GeneratedCommandList::TypeInfo { @@ -47033,6 +47103,8 @@ struct TypeInfo Attributes::WriteOnlyInt8u::TypeInfo::DecodableType writeOnlyInt8u = static_cast(0); Attributes::NullableGlobalEnum::TypeInfo::DecodableType nullableGlobalEnum; Attributes::NullableGlobalStruct::TypeInfo::DecodableType nullableGlobalStruct; + Attributes::NullableTypedefAttr::TypeInfo::DecodableType nullableTypedefAttr; + Attributes::NullableGlobalTypedef::TypeInfo::DecodableType nullableGlobalTypedef; Attributes::GeneratedCommandList::TypeInfo::DecodableType generatedCommandList; Attributes::AcceptedCommandList::TypeInfo::DecodableType acceptedCommandList; Attributes::AttributeList::TypeInfo::DecodableType attributeList; From e1be309b67107be64d02b59f51e33e614db78820 Mon Sep 17 00:00:00 2001 From: marcos <15697303+gmarcosb@users.noreply.github.com> Date: Thu, 5 Dec 2024 16:11:58 -0700 Subject: [PATCH 13/20] Revert generated file --- .../zap-generated/cluster-objects.h | 158 +++++------------- 1 file changed, 43 insertions(+), 115 deletions(-) diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h index a7c98799c40732..2357a87dd9d9fa 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h @@ -19,7 +19,6 @@ #pragma once -#include #include #include #include @@ -398,10 +397,9 @@ namespace Structs { namespace TestGlobalStruct { enum class Fields : uint8_t { - kName = 0, - kMyBitmap = 1, - kMyEnum = 2, - kMyTypedef = 3, + kName = 0, + kMyBitmap = 1, + kMyEnum = 2, }; struct Type @@ -410,7 +408,6 @@ struct Type chip::CharSpan name; DataModel::Nullable> myBitmap; Optional> myEnum; - Optional> myTypedef; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -43780,8 +43777,6 @@ enum class Fields : uint8_t kG = 6, kH = 7, kI = 8, - kJ = 9, - kK = 10, }; struct Type @@ -43796,8 +43791,6 @@ struct Type float g = static_cast(0); double h = static_cast(0); Optional i; - Optional j; - uint32_t k = static_cast(0); CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -43872,21 +43865,18 @@ struct DecodableType namespace NullablesAndOptionalsStruct { enum class Fields : uint8_t { - kNullableInt = 0, - kOptionalInt = 1, - kNullableOptionalInt = 2, - kNullableString = 3, - kOptionalString = 4, - kNullableOptionalString = 5, - kNullableStruct = 6, - kOptionalStruct = 7, - kNullableOptionalStruct = 8, - kNullableList = 9, - kOptionalList = 10, - kNullableOptionalList = 11, - kNullableTypedef = 12, - kOptionalTypedef = 13, - kNullableOptionalTypedef = 14, + kNullableInt = 0, + kOptionalInt = 1, + kNullableOptionalInt = 2, + kNullableString = 3, + kOptionalString = 4, + kNullableOptionalString = 5, + kNullableStruct = 6, + kOptionalStruct = 7, + kNullableOptionalStruct = 8, + kNullableList = 9, + kOptionalList = 10, + kNullableOptionalList = 11, }; struct Type @@ -43904,9 +43894,6 @@ struct Type DataModel::Nullable> nullableList; Optional> optionalList; Optional>> nullableOptionalList; - DataModel::Nullable nullableTypedef; - Optional optionalTypedef; - Optional> nullableOptionalTypedef; static constexpr bool kIsFabricScoped = false; @@ -43928,9 +43915,6 @@ struct DecodableType DataModel::Nullable> nullableList; Optional> optionalList; Optional>> nullableOptionalList; - DataModel::Nullable nullableTypedef; - Optional optionalTypedef; - Optional> nullableOptionalTypedef; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -44500,7 +44484,6 @@ enum class Fields : uint8_t kArg4 = 3, kArg5 = 4, kArg6 = 5, - kArg7 = 6, }; struct Type @@ -44516,7 +44499,6 @@ struct Type DataModel::List arg4; SimpleEnum arg5 = static_cast(0); bool arg6 = static_cast(0); - DataModel::List arg7; CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; @@ -44537,7 +44519,6 @@ struct DecodableType DataModel::DecodableList arg4; SimpleEnum arg5 = static_cast(0); bool arg6 = static_cast(0); - DataModel::DecodableList arg7; CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace TestStructArrayArgumentResponse @@ -44684,7 +44665,6 @@ enum class Fields : uint8_t kArg4 = 3, kArg5 = 4, kArg6 = 5, - kArg7 = 6, }; struct Type @@ -44700,7 +44680,6 @@ struct Type DataModel::List arg4; SimpleEnum arg5 = static_cast(0); bool arg6 = static_cast(0); - DataModel::List arg7; CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; @@ -44721,7 +44700,6 @@ struct DecodableType DataModel::DecodableList arg4; SimpleEnum arg5 = static_cast(0); bool arg6 = static_cast(0); - DataModel::DecodableList arg7; CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace TestStructArrayArgumentRequest @@ -44801,40 +44779,34 @@ struct DecodableType namespace TestComplexNullableOptionalResponse { enum class Fields : uint8_t { - kNullableIntWasNull = 0, - kNullableIntValue = 1, - kOptionalIntWasPresent = 2, - kOptionalIntValue = 3, - kNullableOptionalIntWasPresent = 4, - kNullableOptionalIntWasNull = 5, - kNullableOptionalIntValue = 6, - kNullableStringWasNull = 7, - kNullableStringValue = 8, - kOptionalStringWasPresent = 9, - kOptionalStringValue = 10, - kNullableOptionalStringWasPresent = 11, - kNullableOptionalStringWasNull = 12, - kNullableOptionalStringValue = 13, - kNullableStructWasNull = 14, - kNullableStructValue = 15, - kOptionalStructWasPresent = 16, - kOptionalStructValue = 17, - kNullableOptionalStructWasPresent = 18, - kNullableOptionalStructWasNull = 19, - kNullableOptionalStructValue = 20, - kNullableListWasNull = 21, - kNullableListValue = 22, - kOptionalListWasPresent = 23, - kOptionalListValue = 24, - kNullableOptionalListWasPresent = 25, - kNullableOptionalListWasNull = 26, - kNullableOptionalListValue = 27, - kNullableTypedefWasNull = 28, - kNullableTypedefValue = 29, - kOptionalTypedefWasPresent = 30, - kOptionalTypedefValue = 31, - kNullableOptionalTypedefWasPresent = 32, - kNullableOptionalTypedefWasNull = 33, + kNullableIntWasNull = 0, + kNullableIntValue = 1, + kOptionalIntWasPresent = 2, + kOptionalIntValue = 3, + kNullableOptionalIntWasPresent = 4, + kNullableOptionalIntWasNull = 5, + kNullableOptionalIntValue = 6, + kNullableStringWasNull = 7, + kNullableStringValue = 8, + kOptionalStringWasPresent = 9, + kOptionalStringValue = 10, + kNullableOptionalStringWasPresent = 11, + kNullableOptionalStringWasNull = 12, + kNullableOptionalStringValue = 13, + kNullableStructWasNull = 14, + kNullableStructValue = 15, + kOptionalStructWasPresent = 16, + kOptionalStructValue = 17, + kNullableOptionalStructWasPresent = 18, + kNullableOptionalStructWasNull = 19, + kNullableOptionalStructValue = 20, + kNullableListWasNull = 21, + kNullableListValue = 22, + kOptionalListWasPresent = 23, + kOptionalListValue = 24, + kNullableOptionalListWasPresent = 25, + kNullableOptionalListWasNull = 26, + kNullableOptionalListValue = 27, }; struct Type @@ -44872,12 +44844,6 @@ struct Type bool nullableOptionalListWasPresent = static_cast(0); Optional nullableOptionalListWasNull; Optional> nullableOptionalListValue; - bool nullableTypedefWasNull = static_cast(0); - Optional nullableTypedefValue; - bool optionalTypedefWasPresent = static_cast(0); - Optional optionalTypedefValue; - bool nullableOptionalTypedefWasPresent = static_cast(0); - Optional nullableOptionalTypedefWasNull; CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; @@ -44920,12 +44886,6 @@ struct DecodableType bool nullableOptionalListWasPresent = static_cast(0); Optional nullableOptionalListWasNull; Optional> nullableOptionalListValue; - bool nullableTypedefWasNull = static_cast(0); - Optional nullableTypedefValue; - bool optionalTypedefWasPresent = static_cast(0); - Optional optionalTypedefValue; - bool nullableOptionalTypedefWasPresent = static_cast(0); - Optional nullableOptionalTypedefWasNull; CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace TestComplexNullableOptionalResponse @@ -45353,7 +45313,6 @@ enum class Fields : uint8_t { kField1 = 0, kField2 = 1, - kField3 = 2, }; struct Type @@ -45365,7 +45324,6 @@ struct Type Globals::Structs::TestGlobalStruct::Type field1; Globals::TestGlobalEnum field2 = static_cast(0); - uint32_t field3 = static_cast(0); CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; @@ -45382,7 +45340,6 @@ struct DecodableType Globals::Structs::TestGlobalStruct::DecodableType field1; Globals::TestGlobalEnum field2 = static_cast(0); - uint32_t field3 = static_cast(0); CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace GlobalEchoResponse @@ -45758,7 +45715,6 @@ enum class Fields : uint8_t { kField1 = 0, kField2 = 1, - kField3 = 2, }; struct Type @@ -45770,7 +45726,6 @@ struct Type Globals::Structs::TestGlobalStruct::Type field1; Globals::TestGlobalEnum field2 = static_cast(0); - uint32_t field3 = static_cast(0); CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; @@ -45787,7 +45742,6 @@ struct DecodableType Globals::Structs::TestGlobalStruct::DecodableType field1; Globals::TestGlobalEnum field2 = static_cast(0); - uint32_t field3 = static_cast(0); CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace GlobalEchoRequest @@ -46936,30 +46890,6 @@ struct TypeInfo static constexpr bool MustUseTimedWrite() { return false; } }; } // namespace NullableGlobalStruct -namespace NullableTypedefAttr { -struct TypeInfo -{ - using Type = chip::app::DataModel::Nullable; - using DecodableType = chip::app::DataModel::Nullable; - using DecodableArgType = const chip::app::DataModel::Nullable &; - - static constexpr ClusterId GetClusterId() { return Clusters::UnitTesting::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::NullableTypedefAttr::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace NullableTypedefAttr -namespace NullableGlobalTypedef { -struct TypeInfo -{ - using Type = chip::app::DataModel::Nullable; - using DecodableType = chip::app::DataModel::Nullable; - using DecodableArgType = const chip::app::DataModel::Nullable &; - - static constexpr ClusterId GetClusterId() { return Clusters::UnitTesting::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::NullableGlobalTypedef::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace NullableGlobalTypedef namespace GeneratedCommandList { struct TypeInfo : public Clusters::Globals::Attributes::GeneratedCommandList::TypeInfo { @@ -47103,8 +47033,6 @@ struct TypeInfo Attributes::WriteOnlyInt8u::TypeInfo::DecodableType writeOnlyInt8u = static_cast(0); Attributes::NullableGlobalEnum::TypeInfo::DecodableType nullableGlobalEnum; Attributes::NullableGlobalStruct::TypeInfo::DecodableType nullableGlobalStruct; - Attributes::NullableTypedefAttr::TypeInfo::DecodableType nullableTypedefAttr; - Attributes::NullableGlobalTypedef::TypeInfo::DecodableType nullableGlobalTypedef; Attributes::GeneratedCommandList::TypeInfo::DecodableType generatedCommandList; Attributes::AcceptedCommandList::TypeInfo::DecodableType acceptedCommandList; Attributes::AttributeList::TypeInfo::DecodableType attributeList; From 31bd2bcdcad47f301b240730a13dff82638270ab Mon Sep 17 00:00:00 2001 From: marcos <15697303+gmarcosb@users.noreply.github.com> Date: Thu, 17 Oct 2024 10:18:58 -0600 Subject: [PATCH 14/20] Update zapt templates to handle typedef --- .../templates/app/cluster-typedefs-check.zapt | 29 +++++++++++++++++++ .../java/templates/partials/decode_value.zapt | 1 - .../CHIP/templates/partials/typedef_decl.zapt | 2 +- 3 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 src/app/zap-templates/templates/app/cluster-typedefs-check.zapt diff --git a/src/app/zap-templates/templates/app/cluster-typedefs-check.zapt b/src/app/zap-templates/templates/app/cluster-typedefs-check.zapt new file mode 100644 index 00000000000000..a2a3d4ac1e4f4e --- /dev/null +++ b/src/app/zap-templates/templates/app/cluster-typedefs-check.zapt @@ -0,0 +1,29 @@ +{{> header}} + +#pragma once + +#include + +namespace chip { +namespace app { +namespace Clusters { +{{#zcl_typedefs}} +{{#if has_more_than_one_cluster}} +{{> cluster_typedefs_ensure_known_value ns="detail"}} +{{else if has_no_clusters}} +{{> cluster_typedefs_ensure_known_value ns="Globals"}} + +{{/if}} +{{/zcl_typedefs}} + +{{#zcl_clusters}} +{{#zcl_typedefs}} +{{#unless has_more_than_one_cluster}} +{{> cluster_typedefs_ensure_known_value ns=(asUpperCamelCase ../name)}} +{{/unless}} +{{/zcl_typedefs}} + +{{/zcl_clusters}} +} // namespace Clusters +} // namespace app +} // namespace chip diff --git a/src/controller/java/templates/partials/decode_value.zapt b/src/controller/java/templates/partials/decode_value.zapt index 2a807d418924ff..726ab0df3f9a6b 100644 --- a/src/controller/java/templates/partials/decode_value.zapt +++ b/src/controller/java/templates/partials/decode_value.zapt @@ -59,7 +59,6 @@ if ({{source}}.IsNull()) { , {{../target}}_{{asLowerCamelCase label}} {{/zcl_struct_items_by_struct_and_cluster_name}} ); - } {{else}} {{#if_is_strongly_typed_chip_enum type}} std::string {{target}}ClassName = "{{asJniClassName type null (asUpperCamelCase cluster)}}"; diff --git a/src/darwin/Framework/CHIP/templates/partials/typedef_decl.zapt b/src/darwin/Framework/CHIP/templates/partials/typedef_decl.zapt index fa583cc0bd81fe..86deb02b28dbb6 100644 --- a/src/darwin/Framework/CHIP/templates/partials/typedef_decl.zapt +++ b/src/darwin/Framework/CHIP/templates/partials/typedef_decl.zapt @@ -1,2 +1,2 @@ {{! Arguments: cluster (might be "Globals", is not case-canonicalized), name, typedefLabel }} -typedef {{asObjectiveCType type cluster}} {{asUpperCamelCase typedefLabel preserveAcronyms=true}}; \ No newline at end of file +typedef {{asObjectiveCType type cluster}} {{asUnderlyingZclType name}}; \ No newline at end of file From 04cab6c1293c4eb9a13dc8486b4bc3525011bbf0 Mon Sep 17 00:00:00 2001 From: marcos <15697303+gmarcosb@users.noreply.github.com> Date: Fri, 18 Oct 2024 15:32:08 -0600 Subject: [PATCH 15/20] Update zapt templates to handle typedef --- .../templates/app/cluster-typedefs-check.zapt | 29 ------------------- .../java/templates/partials/decode_value.zapt | 1 + .../CHIP/templates/partials/typedef_decl.zapt | 2 +- 3 files changed, 2 insertions(+), 30 deletions(-) delete mode 100644 src/app/zap-templates/templates/app/cluster-typedefs-check.zapt diff --git a/src/app/zap-templates/templates/app/cluster-typedefs-check.zapt b/src/app/zap-templates/templates/app/cluster-typedefs-check.zapt deleted file mode 100644 index a2a3d4ac1e4f4e..00000000000000 --- a/src/app/zap-templates/templates/app/cluster-typedefs-check.zapt +++ /dev/null @@ -1,29 +0,0 @@ -{{> header}} - -#pragma once - -#include - -namespace chip { -namespace app { -namespace Clusters { -{{#zcl_typedefs}} -{{#if has_more_than_one_cluster}} -{{> cluster_typedefs_ensure_known_value ns="detail"}} -{{else if has_no_clusters}} -{{> cluster_typedefs_ensure_known_value ns="Globals"}} - -{{/if}} -{{/zcl_typedefs}} - -{{#zcl_clusters}} -{{#zcl_typedefs}} -{{#unless has_more_than_one_cluster}} -{{> cluster_typedefs_ensure_known_value ns=(asUpperCamelCase ../name)}} -{{/unless}} -{{/zcl_typedefs}} - -{{/zcl_clusters}} -} // namespace Clusters -} // namespace app -} // namespace chip diff --git a/src/controller/java/templates/partials/decode_value.zapt b/src/controller/java/templates/partials/decode_value.zapt index 726ab0df3f9a6b..2a807d418924ff 100644 --- a/src/controller/java/templates/partials/decode_value.zapt +++ b/src/controller/java/templates/partials/decode_value.zapt @@ -59,6 +59,7 @@ if ({{source}}.IsNull()) { , {{../target}}_{{asLowerCamelCase label}} {{/zcl_struct_items_by_struct_and_cluster_name}} ); + } {{else}} {{#if_is_strongly_typed_chip_enum type}} std::string {{target}}ClassName = "{{asJniClassName type null (asUpperCamelCase cluster)}}"; diff --git a/src/darwin/Framework/CHIP/templates/partials/typedef_decl.zapt b/src/darwin/Framework/CHIP/templates/partials/typedef_decl.zapt index 86deb02b28dbb6..fa583cc0bd81fe 100644 --- a/src/darwin/Framework/CHIP/templates/partials/typedef_decl.zapt +++ b/src/darwin/Framework/CHIP/templates/partials/typedef_decl.zapt @@ -1,2 +1,2 @@ {{! Arguments: cluster (might be "Globals", is not case-canonicalized), name, typedefLabel }} -typedef {{asObjectiveCType type cluster}} {{asUnderlyingZclType name}}; \ No newline at end of file +typedef {{asObjectiveCType type cluster}} {{asUpperCamelCase typedefLabel preserveAcronyms=true}}; \ No newline at end of file From fc41d2d3b4fca332cf29682a5fbce0e08a32f63c Mon Sep 17 00:00:00 2001 From: marcos <15697303+gmarcosb@users.noreply.github.com> Date: Thu, 17 Oct 2024 10:18:58 -0600 Subject: [PATCH 16/20] Update zapt templates to handle typedef --- .../templates/app/cluster-typedefs-check.zapt | 29 +++++++++++++++++++ .../java/templates/partials/decode_value.zapt | 1 - .../CHIP/templates/partials/typedef_decl.zapt | 2 +- 3 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 src/app/zap-templates/templates/app/cluster-typedefs-check.zapt diff --git a/src/app/zap-templates/templates/app/cluster-typedefs-check.zapt b/src/app/zap-templates/templates/app/cluster-typedefs-check.zapt new file mode 100644 index 00000000000000..a2a3d4ac1e4f4e --- /dev/null +++ b/src/app/zap-templates/templates/app/cluster-typedefs-check.zapt @@ -0,0 +1,29 @@ +{{> header}} + +#pragma once + +#include + +namespace chip { +namespace app { +namespace Clusters { +{{#zcl_typedefs}} +{{#if has_more_than_one_cluster}} +{{> cluster_typedefs_ensure_known_value ns="detail"}} +{{else if has_no_clusters}} +{{> cluster_typedefs_ensure_known_value ns="Globals"}} + +{{/if}} +{{/zcl_typedefs}} + +{{#zcl_clusters}} +{{#zcl_typedefs}} +{{#unless has_more_than_one_cluster}} +{{> cluster_typedefs_ensure_known_value ns=(asUpperCamelCase ../name)}} +{{/unless}} +{{/zcl_typedefs}} + +{{/zcl_clusters}} +} // namespace Clusters +} // namespace app +} // namespace chip diff --git a/src/controller/java/templates/partials/decode_value.zapt b/src/controller/java/templates/partials/decode_value.zapt index 2a807d418924ff..726ab0df3f9a6b 100644 --- a/src/controller/java/templates/partials/decode_value.zapt +++ b/src/controller/java/templates/partials/decode_value.zapt @@ -59,7 +59,6 @@ if ({{source}}.IsNull()) { , {{../target}}_{{asLowerCamelCase label}} {{/zcl_struct_items_by_struct_and_cluster_name}} ); - } {{else}} {{#if_is_strongly_typed_chip_enum type}} std::string {{target}}ClassName = "{{asJniClassName type null (asUpperCamelCase cluster)}}"; diff --git a/src/darwin/Framework/CHIP/templates/partials/typedef_decl.zapt b/src/darwin/Framework/CHIP/templates/partials/typedef_decl.zapt index fa583cc0bd81fe..86deb02b28dbb6 100644 --- a/src/darwin/Framework/CHIP/templates/partials/typedef_decl.zapt +++ b/src/darwin/Framework/CHIP/templates/partials/typedef_decl.zapt @@ -1,2 +1,2 @@ {{! Arguments: cluster (might be "Globals", is not case-canonicalized), name, typedefLabel }} -typedef {{asObjectiveCType type cluster}} {{asUpperCamelCase typedefLabel preserveAcronyms=true}}; \ No newline at end of file +typedef {{asObjectiveCType type cluster}} {{asUnderlyingZclType name}}; \ No newline at end of file From d282a02e759cc201516095f3e8352201b826c379 Mon Sep 17 00:00:00 2001 From: marcos <15697303+gmarcosb@users.noreply.github.com> Date: Fri, 18 Oct 2024 15:32:08 -0600 Subject: [PATCH 17/20] Update zapt templates to handle typedef --- .../templates/app/cluster-typedefs-check.zapt | 29 ------------------- .../java/templates/partials/decode_value.zapt | 1 + .../CHIP/templates/partials/typedef_decl.zapt | 2 +- 3 files changed, 2 insertions(+), 30 deletions(-) delete mode 100644 src/app/zap-templates/templates/app/cluster-typedefs-check.zapt diff --git a/src/app/zap-templates/templates/app/cluster-typedefs-check.zapt b/src/app/zap-templates/templates/app/cluster-typedefs-check.zapt deleted file mode 100644 index a2a3d4ac1e4f4e..00000000000000 --- a/src/app/zap-templates/templates/app/cluster-typedefs-check.zapt +++ /dev/null @@ -1,29 +0,0 @@ -{{> header}} - -#pragma once - -#include - -namespace chip { -namespace app { -namespace Clusters { -{{#zcl_typedefs}} -{{#if has_more_than_one_cluster}} -{{> cluster_typedefs_ensure_known_value ns="detail"}} -{{else if has_no_clusters}} -{{> cluster_typedefs_ensure_known_value ns="Globals"}} - -{{/if}} -{{/zcl_typedefs}} - -{{#zcl_clusters}} -{{#zcl_typedefs}} -{{#unless has_more_than_one_cluster}} -{{> cluster_typedefs_ensure_known_value ns=(asUpperCamelCase ../name)}} -{{/unless}} -{{/zcl_typedefs}} - -{{/zcl_clusters}} -} // namespace Clusters -} // namespace app -} // namespace chip diff --git a/src/controller/java/templates/partials/decode_value.zapt b/src/controller/java/templates/partials/decode_value.zapt index 726ab0df3f9a6b..2a807d418924ff 100644 --- a/src/controller/java/templates/partials/decode_value.zapt +++ b/src/controller/java/templates/partials/decode_value.zapt @@ -59,6 +59,7 @@ if ({{source}}.IsNull()) { , {{../target}}_{{asLowerCamelCase label}} {{/zcl_struct_items_by_struct_and_cluster_name}} ); + } {{else}} {{#if_is_strongly_typed_chip_enum type}} std::string {{target}}ClassName = "{{asJniClassName type null (asUpperCamelCase cluster)}}"; diff --git a/src/darwin/Framework/CHIP/templates/partials/typedef_decl.zapt b/src/darwin/Framework/CHIP/templates/partials/typedef_decl.zapt index 86deb02b28dbb6..fa583cc0bd81fe 100644 --- a/src/darwin/Framework/CHIP/templates/partials/typedef_decl.zapt +++ b/src/darwin/Framework/CHIP/templates/partials/typedef_decl.zapt @@ -1,2 +1,2 @@ {{! Arguments: cluster (might be "Globals", is not case-canonicalized), name, typedefLabel }} -typedef {{asObjectiveCType type cluster}} {{asUnderlyingZclType name}}; \ No newline at end of file +typedef {{asObjectiveCType type cluster}} {{asUpperCamelCase typedefLabel preserveAcronyms=true}}; \ No newline at end of file From aec97862706f02a54d5d5030075883b5fcc00fc1 Mon Sep 17 00:00:00 2001 From: marcos <15697303+gmarcosb@users.noreply.github.com> Date: Tue, 26 Nov 2024 10:21:57 -0700 Subject: [PATCH 18/20] Template fixes --- .../matter_idl/generators/idl/MatterIdl.jinja | 10 +++++++++- .../py_matter_idl/matter_idl/test_matter_idl_parser.py | 4 ++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/scripts/py_matter_idl/matter_idl/generators/idl/MatterIdl.jinja b/scripts/py_matter_idl/matter_idl/generators/idl/MatterIdl.jinja index a7a83745693229..160c882da92107 100644 --- a/scripts/py_matter_idl/matter_idl/generators/idl/MatterIdl.jinja +++ b/scripts/py_matter_idl/matter_idl/generators/idl/MatterIdl.jinja @@ -55,8 +55,9 @@ bitmap {{bitmap.name}} : {{ bitmap.base_type}} { {% endfor %} -{% for typedef in idl.global_typedefs %} +{%- for typedef in idl.global_typedefs %} typedef {{typedef.name}} : {{ typedef.base_type}}; +{% endfor %} {%- for cluster in idl.clusters %} {% if cluster.description %}/** {{cluster.description}} */ @@ -86,6 +87,13 @@ typedef {{typedef.name}} : {{ typedef.base_type}}; {% endfor %} + {%- for typedef in cluster.typedefs | selectattr("is_global")%} + /* GLOBAL: + typedef {{typedef.name}} : {{ typedef.base_type}}; + */ + + {% endfor %} + {%- for s in cluster.structs | selectattr("is_global") %} /* GLOBAL: {{render_struct(s) | indent(2)}} diff --git a/scripts/py_matter_idl/matter_idl/test_matter_idl_parser.py b/scripts/py_matter_idl/matter_idl/test_matter_idl_parser.py index 319567d7ff6ee8..405d9ad1e9bac1 100755 --- a/scripts/py_matter_idl/matter_idl/test_matter_idl_parser.py +++ b/scripts/py_matter_idl/matter_idl/test_matter_idl_parser.py @@ -34,7 +34,7 @@ from matter_idl.matter_idl_types import (AccessPrivilege, ApiMaturity, Attribute, AttributeInstantiation, AttributeQuality, AttributeStorage, Bitmap, Cluster, Command, CommandInstantiation, CommandQuality, ConstantEntry, DataType, DeviceType, Endpoint, Enum, Event, EventPriority, EventQuality, - Field, FieldQuality, Idl, ParseMetaData, ServerClusterInstantiation, Struct, StructTag) + Field, FieldQuality, Idl, ParseMetaData, ServerClusterInstantiation, Struct, StructTag, Typedef) class GeneratorContentStorage(GeneratorStorage): @@ -339,7 +339,7 @@ def test_cluster_enum(self): def test_cluster_typedef(self): actual = parseText(""" client cluster WithTypedefs = 0xab { - typedef TestTypedef : int16u + typedef TestTypedef : int16u; } """) expected = Idl(clusters=[ From b49faab14f5283df08ddddb703046c38ba6a6083 Mon Sep 17 00:00:00 2001 From: marcos <15697303+gmarcosb@users.noreply.github.com> Date: Thu, 5 Dec 2024 16:10:31 -0700 Subject: [PATCH 19/20] Additional updates to zapt templates to handle typedef --- .../templates/commands.zapt | 29 +- .../templates/partials/decodable_value.zapt | 2 +- src/app/common/BUILD.gn | 9 + src/app/common/templates/templates.json | 9 + .../partials/cluster-typedefs-typedef.zapt | 2 + .../templates/app/cluster-objects.zapt | 1 + .../templates/app/cluster-typedefs.zapt | 6 +- .../zcl/data-model/chip/test-cluster.xml | 2 +- .../zcl/zcl-with-test-extensions.json | 10 +- src/app/zap-templates/zcl/zcl.json | 10 +- .../java/templates/partials/decode_value.zapt | 106 +- .../CHIP/templates/partials/decode_value.zapt | 58 +- .../CHIP/templates/partials/encode_value.zapt | 38 +- .../MTRAttributeSpecifiedCheck.mm | 6 + .../MTRAttributeTLVValueDecoder.mm | 103 ++ .../CHIP/zap-generated/MTRBaseClusters.mm | 1541 ++++++++++------- .../CHIP/zap-generated/MTRClusterNames.mm | 8 + .../CHIP/zap-generated/MTRClusters.mm | 32 + .../zap-generated/MTRCommandPayloadsObjc.mm | 217 +++ .../CHIP/zap-generated/MTRStructsObjc.mm | 24 +- src/lib/core/BUILD.gn | 1 + .../zap-generated/cluster-objects.h | 158 +- 22 files changed, 1516 insertions(+), 856 deletions(-) create mode 100644 src/app/zap-templates/partials/cluster-typedefs-typedef.zapt diff --git a/examples/darwin-framework-tool/templates/commands.zapt b/examples/darwin-framework-tool/templates/commands.zapt index 3b80f653c82a14..2b3206afbb6f5a 100644 --- a/examples/darwin-framework-tool/templates/commands.zapt +++ b/examples/darwin-framework-tool/templates/commands.zapt @@ -223,29 +223,14 @@ public: params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; {{#if_chip_complex}} - {{asObjectiveCType type parent.name}} value; - {{>decodable_value target="value" source="mValue" cluster=parent.name errorCode="return err;" depth=0}} + {{asObjectiveCType type parent.name}} value; + {{>decodable_value target="value" source="mValue" cluster=parent.name errorCode="return err;" depth=0}} + {{else if isNullable}} + {{asObjectiveCType type parent.name}} value; + {{>decodable_value target="value" source="mValue" cluster=parent.name isOptional=false isArray=false errorCode="return err;" depth=0}} {{else}} - {{#if isNullable}} - {{asObjectiveCType type parent.name}} value = nil; - if (!mValue.IsNull()) { - {{#if (isOctetString type)}} - value = [[NSData alloc] initWithBytes:mValue.Value().data() length:mValue.Value().size()]; - {{else if (isString type)}} - value = [[NSString alloc] initWithBytes:mValue.Value().data() length:mValue.Value().size() encoding:NSUTF8StringEncoding]; - {{else}} - value = [NSNumber numberWith{{asObjectiveCNumberType "" type false}}:mValue.Value()]; - {{/if}} - } - {{else}} - {{#if (isOctetString type)}} - {{asObjectiveCType type parent.name}} value = [[NSData alloc] initWithBytes:mValue.data() length:mValue.size()]; - {{else if (isString type)}} - {{asObjectiveCType type parent.name}} value = [[NSString alloc] initWithBytes:mValue.data() length:mValue.size() encoding:NSUTF8StringEncoding]; - {{else}} - {{asObjectiveCType type parent.name}} value = [NSNumber numberWith{{asObjectiveCNumberType "" type false}}:mValue{{#if isNullable}}.Value(){{/if}}]; - {{/if}} - {{/if}} + {{asObjectiveCType type parent.name}} + {{>decodable_value target="value" source="mValue" cluster=parent.name isOptional=false isArray=false errorCode="return err;" depth=0}} {{/if_chip_complex}} [cluster write{{>attribute}}WithValue:value params:params completion:^(NSError * _Nullable error) { diff --git a/examples/darwin-framework-tool/templates/partials/decodable_value.zapt b/examples/darwin-framework-tool/templates/partials/decodable_value.zapt index 07e791dcafa2a1..1f81430200cb82 100644 --- a/examples/darwin-framework-tool/templates/partials/decodable_value.zapt +++ b/examples/darwin-framework-tool/templates/partials/decodable_value.zapt @@ -29,7 +29,7 @@ {{else}} {{#if_is_typedef type}} {{#zcl_typedef_by_typedef_and_cluster_name type cluster}} - {{>decodable_value type=typeId target=target source=source errorCode=errorCode depth=(incrementDepth ../depth) }} + {{>decodable_value target=../target source=../source errorCode=../errorCode cluster=../cluster depth=../depth }} {{/zcl_typedef_by_typedef_and_cluster_name}} {{else}} {{#if_is_strongly_typed_chip_enum type}} diff --git a/src/app/common/BUILD.gn b/src/app/common/BUILD.gn index 36022674cc053a..1a533ed46e5a3a 100644 --- a/src/app/common/BUILD.gn +++ b/src/app/common/BUILD.gn @@ -68,3 +68,12 @@ source_set("enums") { public_configs = [ ":includes" ] } + +source_set("typedefs") { + sources = [ + "${chip_root}/zzz_generated/app-common/app-common/zap-generated/cluster-typedefs-check.h", + "${chip_root}/zzz_generated/app-common/app-common/zap-generated/cluster-typedefs.h", + ] + + public_configs = [ ":includes" ] +} diff --git a/src/app/common/templates/templates.json b/src/app/common/templates/templates.json index 148ab5419f5b84..4fe98783763d35 100644 --- a/src/app/common/templates/templates.json +++ b/src/app/common/templates/templates.json @@ -25,6 +25,10 @@ "name": "cluster_enums_enum", "path": "../../zap-templates/partials/cluster-enums-enum.zapt" }, + { + "name": "cluster_typedefs_typedef", + "path": "../../zap-templates/partials/cluster-typedefs-typedef.zapt" + }, { "name": "cluster_enums_ensure_known_value", "path": "../../zap-templates/partials/cluster-enums-ensure-known-value.zapt" @@ -98,6 +102,11 @@ "path": "../../zap-templates/templates/app/cluster-enums-check.zapt", "name": "Enum and bitmap method check header for clusters", "output": "cluster-enums-check.h" + }, + { + "path": "../../zap-templates/templates/app/cluster-typedefs.zapt", + "name": "Typedef header for clusters", + "output": "cluster-typedefs.h" } ] } diff --git a/src/app/zap-templates/partials/cluster-typedefs-typedef.zapt b/src/app/zap-templates/partials/cluster-typedefs-typedef.zapt new file mode 100644 index 00000000000000..9bf5e237922c2b --- /dev/null +++ b/src/app/zap-templates/partials/cluster-typedefs-typedef.zapt @@ -0,0 +1,2 @@ +// Typedef for {{label}} +using {{asType label}} = {{zapTypeToEncodableClusterObjectType type}}; \ No newline at end of file diff --git a/src/app/zap-templates/templates/app/cluster-objects.zapt b/src/app/zap-templates/templates/app/cluster-objects.zapt index 00cd367f85bfcb..8ccc0f2e8c8fa9 100644 --- a/src/app/zap-templates/templates/app/cluster-objects.zapt +++ b/src/app/zap-templates/templates/app/cluster-objects.zapt @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include diff --git a/src/app/zap-templates/templates/app/cluster-typedefs.zapt b/src/app/zap-templates/templates/app/cluster-typedefs.zapt index 18382e0188fdb6..fc6e8c2a009113 100644 --- a/src/app/zap-templates/templates/app/cluster-typedefs.zapt +++ b/src/app/zap-templates/templates/app/cluster-typedefs.zapt @@ -15,7 +15,7 @@ namespace detail { {{#if has_more_than_one_cluster}} -{{> cluster_typedefs_enum ns=""}} +{{> cluster_typedefs_typedef ns=""}} {{/if}} {{/zcl_typedefs}} @@ -28,7 +28,7 @@ namespace Globals { {{#if has_no_clusters}} -{{> cluster_typedefs_enum ns=""}} +{{> cluster_typedefs_typedef ns=""}} {{/if}} {{/zcl_typedefs}} @@ -41,7 +41,7 @@ namespace {{asUpperCamelCase name}} { {{#if has_more_than_one_cluster}} using {{asUpperCamelCase name}} = Clusters::detail::{{asUpperCamelCase name}}; {{else}} -{{> cluster_typedefs_enum ns=(asUpperCamelCase ../name)}} +{{> cluster_typedefs_typedef ns=(asUpperCamelCase ../name)}} {{/if}} {{/zcl_typedefs}} diff --git a/src/app/zap-templates/zcl/data-model/chip/test-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/test-cluster.xml index 8b4e3c5b81fca1..c50a1fa3f5095c 100644 --- a/src/app/zap-templates/zcl/data-model/chip/test-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/test-cluster.xml @@ -60,7 +60,7 @@ limitations under the License. - + diff --git a/src/app/zap-templates/zcl/zcl-with-test-extensions.json b/src/app/zap-templates/zcl/zcl-with-test-extensions.json index aae3d6066d2e2f..8e85bd7c7862d0 100644 --- a/src/app/zap-templates/zcl/zcl-with-test-extensions.json +++ b/src/app/zap-templates/zcl/zcl-with-test-extensions.json @@ -683,7 +683,15 @@ }, "mandatoryDeviceTypes": "0x0016", "defaultReportingPolicy": "mandatory", - "ZCLDataTypes": ["ARRAY", "BITMAP", "ENUM", "NUMBER", "STRING", "STRUCT", "TYPEDEF"], + "ZCLDataTypes": [ + "ARRAY", + "BITMAP", + "ENUM", + "NUMBER", + "STRING", + "STRUCT", + "TYPEDEF" + ], "fabricHandling": { "automaticallyCreateFields": true, "indexFieldId": 254, diff --git a/src/app/zap-templates/zcl/zcl.json b/src/app/zap-templates/zcl/zcl.json index d8d67ea1e81bba..5d26de9fff5d56 100644 --- a/src/app/zap-templates/zcl/zcl.json +++ b/src/app/zap-templates/zcl/zcl.json @@ -677,7 +677,15 @@ }, "mandatoryDeviceTypes": "0x0016", "defaultReportingPolicy": "mandatory", - "ZCLDataTypes": ["ARRAY", "BITMAP", "ENUM", "NUMBER", "STRING", "STRUCT", "TYPEDEF"], + "ZCLDataTypes": [ + "ARRAY", + "BITMAP", + "ENUM", + "NUMBER", + "STRING", + "STRUCT", + "TYPEDEF" + ], "fabricHandling": { "automaticallyCreateFields": true, "indexFieldId": 254, diff --git a/src/controller/java/templates/partials/decode_value.zapt b/src/controller/java/templates/partials/decode_value.zapt index 2a807d418924ff..4f5885c7be487a 100644 --- a/src/controller/java/templates/partials/decode_value.zapt +++ b/src/controller/java/templates/partials/decode_value.zapt @@ -25,66 +25,58 @@ if ({{source}}.IsNull()) { {{>decode_value target=(concat "newElement_" depth) source=(concat "entry_" depth) cluster=cluster depth=(incrementDepth depth) isArray=false forceNotList=true omitDeclaration=false earlyReturn=earlyReturn}} chip::JniReferences::GetInstance().AddToList({{target}}, newElement_{{depth}}); } -{{else}} - {{#if_is_typedef type}} - {{#zcl_typedef_by_typedef_and_cluster_name type cluster}} - {{>decode_value type=typeId target=target source=source errorCode=errorCode depth=(incrementDepth ../depth) isNullable=isNullable omitDeclaration=omitDeclaration earlyReturn=earlyReturn }} - {{/zcl_typedef_by_typedef_and_cluster_name}} - {{else}} - {{#if_is_struct type}} - {{#zcl_struct_items_by_struct_and_cluster_name type cluster}} - {{>decode_value target=(concat ../target "_" (asLowerCamelCase label)) source=(concat ../source "." (asLowerCamelCase label)) cluster=../cluster depth=(incrementDepth ../depth) omitDeclaration=false earlyReturn=../earlyReturn}} - {{/zcl_struct_items_by_struct_and_cluster_name}} +{{else if_is_typedef type}} + {{#zcl_typedef_by_typedef_and_cluster_name type cluster}} + {{>decode_value target=../target source=../source cluster=../cluster errorCode=../errorCode depth=../depth isNullable=../isNullable omitDeclaration=../omitDeclaration earlyReturn=../earlyReturn }} + {{/zcl_typedef_by_typedef_and_cluster_name}} +{{else if_is_struct type}} + {{#zcl_struct_items_by_struct_and_cluster_name type cluster}} + {{>decode_value target=(concat ../target "_" (asLowerCamelCase label)) source=(concat ../source "." (asLowerCamelCase label)) cluster=../cluster depth=(incrementDepth ../depth) omitDeclaration=false earlyReturn=../earlyReturn}} + {{/zcl_struct_items_by_struct_and_cluster_name}} - { - jclass {{asLowerCamelCase type}}StructClass_{{depth}}; - err = chip::JniReferences::GetInstance().GetLocalClassRef(env, "chip/devicecontroller/ChipStructs${{asUpperCamelCase cluster}}Cluster{{asUpperCamelCase type}}", {{asLowerCamelCase type}}StructClass_{{depth}}); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs${{asUpperCamelCase cluster}}Cluster{{asUpperCamelCase type}}"); - return {{earlyReturn}}; - } + { + jclass {{asLowerCamelCase type}}StructClass_{{depth}}; + err = chip::JniReferences::GetInstance().GetLocalClassRef(env, "chip/devicecontroller/ChipStructs${{asUpperCamelCase cluster}}Cluster{{asUpperCamelCase type}}", {{asLowerCamelCase type}}StructClass_{{depth}}); + if (err != CHIP_NO_ERROR) { + ChipLogError(Zcl, "Could not find class ChipStructs${{asUpperCamelCase cluster}}Cluster{{asUpperCamelCase type}}"); + return {{earlyReturn}}; + } - jmethodID {{asLowerCamelCase type}}StructCtor_{{depth}}; - err = chip::JniReferences::GetInstance().FindMethod( - env, {{asLowerCamelCase type}}StructClass_{{depth}}, "", - "({{#zcl_struct_items_by_struct_and_cluster_name type cluster}}{{asJniSignature type null (asUpperCamelCase ../cluster) true}}{{/zcl_struct_items_by_struct_and_cluster_name}})V", - &{{asLowerCamelCase type}}StructCtor_{{depth}}); - if (err != CHIP_NO_ERROR || {{asLowerCamelCase type}}StructCtor_{{depth}} == nullptr) { - ChipLogError(Zcl, "Could not find ChipStructs${{asUpperCamelCase cluster}}Cluster{{asUpperCamelCase type}} constructor"); - return {{earlyReturn}}; - } + jmethodID {{asLowerCamelCase type}}StructCtor_{{depth}}; + err = chip::JniReferences::GetInstance().FindMethod( + env, {{asLowerCamelCase type}}StructClass_{{depth}}, "", + "({{#zcl_struct_items_by_struct_and_cluster_name type cluster}}{{asJniSignature type null (asUpperCamelCase ../cluster) true}}{{/zcl_struct_items_by_struct_and_cluster_name}})V", + &{{asLowerCamelCase type}}StructCtor_{{depth}}); + if (err != CHIP_NO_ERROR || {{asLowerCamelCase type}}StructCtor_{{depth}} == nullptr) { + ChipLogError(Zcl, "Could not find ChipStructs${{asUpperCamelCase cluster}}Cluster{{asUpperCamelCase type}} constructor"); + return {{earlyReturn}}; + } - {{target}} = env->NewObject({{asLowerCamelCase type}}StructClass_{{depth}}, {{asLowerCamelCase type}}StructCtor_{{depth}} - {{#zcl_struct_items_by_struct_and_cluster_name type cluster}} - , {{../target}}_{{asLowerCamelCase label}} + {{target}} = env->NewObject({{asLowerCamelCase type}}StructClass_{{depth}}, {{asLowerCamelCase type}}StructCtor_{{depth}} + {{#zcl_struct_items_by_struct_and_cluster_name type cluster}} + , {{../target}}_{{asLowerCamelCase label}} {{/zcl_struct_items_by_struct_and_cluster_name}} ); - } - {{else}} - {{#if_is_strongly_typed_chip_enum type}} - std::string {{target}}ClassName = "{{asJniClassName type null (asUpperCamelCase cluster)}}"; - std::string {{target}}CtorSignature = "({{asJniSignature type null (asUpperCamelCase cluster) false}})V"; - {{asJniBasicType type false}} jni{{target}} = static_cast<{{asJniBasicType type false}}>({{source}}); - chip::JniReferences::GetInstance().CreateBoxedObject<{{asJniBasicType type false}}>({{target}}ClassName.c_str(), {{target}}CtorSignature.c_str(), jni{{target}}, {{target}}); - {{else}} - {{#if (isOctetString type)}} - jbyteArray {{target}}ByteArray = env->NewByteArray(static_cast({{source}}.size())); - env->SetByteArrayRegion({{target}}ByteArray, 0, static_cast({{source}}.size()), reinterpret_cast({{source}}.data())); - {{target}} = {{target}}ByteArray; - {{else if (isCharString type)}} - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF({{source}}, {{target}})); - {{else}} - std::string {{target}}ClassName = "{{asJniClassName type null (asUpperCamelCase cluster)}}"; - std::string {{target}}CtorSignature = "({{asJniSignature type null (asUpperCamelCase cluster) false}})V"; - {{#if_is_strongly_typed_bitmap type}} - {{asJniBasicType type false}} jni{{target}} = static_cast<{{asJniBasicType type false}}>({{source}}.Raw()); - chip::JniReferences::GetInstance().CreateBoxedObject<{{asJniBasicType type false}}>({{target}}ClassName.c_str(), {{target}}CtorSignature.c_str(), jni{{target}}, {{target}}); - {{else}} - {{asJniBasicType type false}} jni{{target}} = static_cast<{{asJniBasicType type false}}>({{source}}); - chip::JniReferences::GetInstance().CreateBoxedObject<{{asJniBasicType type false}}>({{target}}ClassName.c_str(), {{target}}CtorSignature.c_str(), jni{{target}}, {{target}}); - {{/if_is_strongly_typed_bitmap}} - {{/if}} - {{/if_is_strongly_typed_chip_enum}} - {{/if_is_struct}} - {{/if_is_typedef}} +} +{{else if_is_strongly_typed_chip_enum type}} + std::string {{target}}ClassName = "{{asJniClassName type null (asUpperCamelCase cluster)}}"; + std::string {{target}}CtorSignature = "({{asJniSignature type null (asUpperCamelCase cluster) false}})V"; + {{asJniBasicType type false}} jni{{target}} = static_cast<{{asJniBasicType type false}}>({{source}}); + chip::JniReferences::GetInstance().CreateBoxedObject<{{asJniBasicType type false}}>({{target}}ClassName.c_str(), {{target}}CtorSignature.c_str(), jni{{target}}, {{target}}); +{{else if (isOctetString type)}} + jbyteArray {{target}}ByteArray = env->NewByteArray(static_cast({{source}}.size())); + env->SetByteArrayRegion({{target}}ByteArray, 0, static_cast({{source}}.size()), reinterpret_cast({{source}}.data())); + {{target}} = {{target}}ByteArray; +{{else if (isCharString type)}} + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF({{source}}, {{target}})); +{{else}} + std::string {{target}}ClassName = "{{asJniClassName type null (asUpperCamelCase cluster)}}"; + std::string {{target}}CtorSignature = "({{asJniSignature type null (asUpperCamelCase cluster) false}})V"; + {{#if_is_strongly_typed_bitmap type}} + {{asJniBasicType type false}} jni{{target}} = static_cast<{{asJniBasicType type false}}>({{source}}.Raw()); + chip::JniReferences::GetInstance().CreateBoxedObject<{{asJniBasicType type false}}>({{target}}ClassName.c_str(), {{target}}CtorSignature.c_str(), jni{{target}}, {{target}}); + {{else}} + {{asJniBasicType type false}} jni{{target}} = static_cast<{{asJniBasicType type false}}>({{source}}); + chip::JniReferences::GetInstance().CreateBoxedObject<{{asJniBasicType type false}}>({{target}}ClassName.c_str(), {{target}}CtorSignature.c_str(), jni{{target}}, {{target}}); + {{/if_is_strongly_typed_bitmap}} {{/if}} \ No newline at end of file diff --git a/src/darwin/Framework/CHIP/templates/partials/decode_value.zapt b/src/darwin/Framework/CHIP/templates/partials/decode_value.zapt index ae178118abb36f..ec2fcdd955ca43 100644 --- a/src/darwin/Framework/CHIP/templates/partials/decode_value.zapt +++ b/src/darwin/Framework/CHIP/templates/partials/decode_value.zapt @@ -26,38 +26,30 @@ } {{target}} = array_{{depth}}; } +{{else if_is_typedef type}} + {{#zcl_typedef_by_typedef_and_cluster_name type cluster}} + {{>decode_value target=../target cluster=../cluster source=../source errorCode=../errorCode depth=(incrementDepth ../depth) }} + {{/zcl_typedef_by_typedef_and_cluster_name}} +{{else if_is_struct type}} + {{target}} = [{{asObjectiveCClass type cluster forceNotList=true}} new]; + {{#zcl_struct_items_by_struct_and_cluster_name type cluster}} + {{#if (isSupported (asUpperCamelCase ../cluster preserveAcronyms=true) struct=(asUpperCamelCase ../type preserveAcronyms=true) structField=(asStructPropertyName label))}} + {{>decode_value target=(concat ../target "." (asStructPropertyName label)) source=(concat ../source "." (asLowerCamelCase label)) cluster=../cluster errorCode=../errorCode depth=(incrementDepth ../depth) }} + {{/if}} + {{/zcl_struct_items_by_struct_and_cluster_name}} +{{else if_is_strongly_typed_chip_enum type}} + {{target}} = [NSNumber numberWith{{asObjectiveCNumberType "" type false}}:chip::to_underlying({{source}})]; +{{else if_is_strongly_typed_bitmap type}} + {{target}} = [NSNumber numberWith{{asObjectiveCNumberType "" type false}}:{{source}}.Raw()]; +{{else if (isOctetString type)}} + {{target}} = AsData({{source}}); +{{else if (isCharString type)}} + {{target}} = AsString({{source}}); + if ({{target}} == nil) { + {{! Invalid UTF-8. Just make up an error for now. }} + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + {{errorCode}} + } {{else}} - {{#if_is_typedef type}} - {{#zcl_typedef_by_typedef_and_cluster_name type cluster}} - {{>decode_value type=typeId target=target source=source errorCode=errorCode depth=(incrementDepth ../depth) }} - {{/zcl_typedef_by_typedef_and_cluster_name}} - {{else}} - {{#if_is_struct type}} - {{target}} = [{{asObjectiveCClass type cluster forceNotList=true}} new]; - {{#zcl_struct_items_by_struct_and_cluster_name type cluster}} - {{#if (isSupported (asUpperCamelCase ../cluster preserveAcronyms=true) struct=(asUpperCamelCase ../type preserveAcronyms=true) structField=(asStructPropertyName label))}} - {{>decode_value target=(concat ../target "." (asStructPropertyName label)) source=(concat ../source "." (asLowerCamelCase label)) cluster=../cluster errorCode=../errorCode depth=(incrementDepth ../depth) }} - {{/if}} - {{/zcl_struct_items_by_struct_and_cluster_name}} - {{else}} - {{#if_is_strongly_typed_chip_enum type}} - {{target}} = [NSNumber numberWith{{asObjectiveCNumberType "" type false}}:chip::to_underlying({{source}})]; - {{else}} - {{#if_is_strongly_typed_bitmap type}} - {{target}} = [NSNumber numberWith{{asObjectiveCNumberType "" type false}}:{{source}}.Raw()]; - {{else if (isOctetString type)}} - {{target}} = AsData({{source}}); - {{else if (isCharString type)}} - {{target}} = AsString({{source}}); - if ({{target}} == nil) { - {{! Invalid UTF-8. Just make up an error for now. }} - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - {{errorCode}} - } - {{else}} - {{target}} = [NSNumber numberWith{{asObjectiveCNumberType "" type false}}:{{source}}]; - {{/if_is_strongly_typed_bitmap}} - {{/if_is_strongly_typed_chip_enum}} - {{/if_is_struct}} - {{/if_is_typedef}} + {{target}} = [NSNumber numberWith{{asObjectiveCNumberType "" type false}}:{{source}}]; {{/if}} diff --git a/src/darwin/Framework/CHIP/templates/partials/encode_value.zapt b/src/darwin/Framework/CHIP/templates/partials/encode_value.zapt index c610319f53c4e6..700c5d98be10c5 100644 --- a/src/darwin/Framework/CHIP/templates/partials/encode_value.zapt +++ b/src/darwin/Framework/CHIP/templates/partials/encode_value.zapt @@ -44,28 +44,20 @@ {{target}} = AsByteSpan({{source}}); {{else if (isCharString type)}} {{target}} = AsCharSpan({{source}}); +{{else if_is_typedef type}} + {{#zcl_typedef_by_typedef_and_cluster_name type cluster}} + {{>encode_value target=../target source=../source cluster=../cluster errorCode=../errorCode depth=(incrementDepth ../depth) }} + {{/zcl_typedef_by_typedef_and_cluster_name}} +{{else if_is_struct type}} + {{#zcl_struct_items_by_struct_and_cluster_name type cluster}} + {{#if (isSupported (asUpperCamelCase ../cluster preserveAcronyms=true) struct=(asUpperCamelCase ../type preserveAcronyms=true) structField=(asStructPropertyName label))}} + {{>encode_value target=(concat ../target "." (asLowerCamelCase label)) source=(concat ../source "." (asStructPropertyName label)) cluster=../cluster errorCode=../errorCode depth=(incrementDepth ../depth)}} + {{/if}} + {{/zcl_struct_items_by_struct_and_cluster_name}} +{{else if_is_strongly_typed_chip_enum type}} + {{target}} = static_cast>({{source}}.{{asObjectiveCNumberType source type true}}Value); +{{else if_is_strongly_typed_bitmap type}} + {{target}} = static_cast>({{source}}.{{asObjectiveCNumberType source type true}}Value); {{else}} - {{#if_is_typedef type}} - {{#zcl_typedef_by_typedef_and_cluster_name type cluster}} - {{>encode_value type=typeId target=target source=source errorCode=errorCode depth=(incrementDepth ../depth) }} - {{/zcl_typedef_by_typedef_and_cluster_name}} - {{else}} - {{#if_is_struct type}} - {{#zcl_struct_items_by_struct_and_cluster_name type cluster}} - {{#if (isSupported (asUpperCamelCase ../cluster preserveAcronyms=true) struct=(asUpperCamelCase ../type preserveAcronyms=true) structField=(asStructPropertyName label))}} - {{>encode_value target=(concat ../target "." (asLowerCamelCase label)) source=(concat ../source "." (asStructPropertyName label)) cluster=../cluster errorCode=../errorCode depth=(incrementDepth ../depth)}} - {{/if}} - {{/zcl_struct_items_by_struct_and_cluster_name}} - {{else}} - {{#if_is_strongly_typed_chip_enum type}} - {{target}} = static_cast>({{source}}.{{asObjectiveCNumberType source type true}}Value); - {{else}} - {{#if_is_strongly_typed_bitmap type}} - {{target}} = static_cast>({{source}}.{{asObjectiveCNumberType source type true}}Value); - {{else}} - {{target}} = {{source}}.{{asObjectiveCNumberType source type true}}Value; - {{/if_is_strongly_typed_bitmap}} - {{/if_is_strongly_typed_chip_enum}} - {{/if_is_struct}} - {{/if_is_typedef}} + {{target}} = {{source}}.{{asObjectiveCNumberType source type true}}Value; {{/if}} diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm index ce5c71d23f1d69..67efc827efd974 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm @@ -6150,6 +6150,12 @@ static BOOL AttributeIsSpecifiedInUnitTestingCluster(AttributeId aAttributeId) case Attributes::NullableGlobalStruct::Id: { return YES; } + case Attributes::NullableTypedefAttr::Id: { + return YES; + } + case Attributes::NullableGlobalTypedef::Id: { + return YES; + } case Attributes::GeneratedCommandList::Id: { return YES; } diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm index 975c3b63f4a587..b1b6a8866d0821 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm @@ -18519,6 +18519,12 @@ static id _Nullable DecodeAttributeValueForUnitTestingCluster(AttributeId aAttri } else { newElement_0.nullableStruct.i = nil; } + if (entry_0.nullableStruct.Value().j.HasValue()) { + newElement_0.nullableStruct.j = [NSNumber numberWithUnsignedLongLong:entry_0.nullableStruct.Value().j.Value()]; + } else { + newElement_0.nullableStruct.j = nil; + } + newElement_0.nullableStruct.k = [NSNumber numberWithUnsignedInt:entry_0.nullableStruct.Value().k]; } if (entry_0.optionalStruct.HasValue()) { newElement_0.optionalStruct = [MTRUnitTestingClusterSimpleStruct new]; @@ -18540,6 +18546,12 @@ static id _Nullable DecodeAttributeValueForUnitTestingCluster(AttributeId aAttri } else { newElement_0.optionalStruct.i = nil; } + if (entry_0.optionalStruct.Value().j.HasValue()) { + newElement_0.optionalStruct.j = [NSNumber numberWithUnsignedLongLong:entry_0.optionalStruct.Value().j.Value()]; + } else { + newElement_0.optionalStruct.j = nil; + } + newElement_0.optionalStruct.k = [NSNumber numberWithUnsignedInt:entry_0.optionalStruct.Value().k]; } else { newElement_0.optionalStruct = nil; } @@ -18566,6 +18578,12 @@ static id _Nullable DecodeAttributeValueForUnitTestingCluster(AttributeId aAttri } else { newElement_0.nullableOptionalStruct.i = nil; } + if (entry_0.nullableOptionalStruct.Value().Value().j.HasValue()) { + newElement_0.nullableOptionalStruct.j = [NSNumber numberWithUnsignedLongLong:entry_0.nullableOptionalStruct.Value().Value().j.Value()]; + } else { + newElement_0.nullableOptionalStruct.j = nil; + } + newElement_0.nullableOptionalStruct.k = [NSNumber numberWithUnsignedInt:entry_0.nullableOptionalStruct.Value().Value().k]; } } else { newElement_0.nullableOptionalStruct = nil; @@ -18634,6 +18652,25 @@ static id _Nullable DecodeAttributeValueForUnitTestingCluster(AttributeId aAttri } else { newElement_0.nullableOptionalList = nil; } + if (entry_0.nullableTypedef.IsNull()) { + newElement_0.nullableTypedef = nil; + } else { + newElement_0.nullableTypedef = [NSNumber numberWithUnsignedLongLong:entry_0.nullableTypedef.Value()]; + } + if (entry_0.optionalTypedef.HasValue()) { + newElement_0.optionalTypedef = [NSNumber numberWithUnsignedLongLong:entry_0.optionalTypedef.Value()]; + } else { + newElement_0.optionalTypedef = nil; + } + if (entry_0.nullableOptionalTypedef.HasValue()) { + if (entry_0.nullableOptionalTypedef.Value().IsNull()) { + newElement_0.nullableOptionalTypedef = nil; + } else { + newElement_0.nullableOptionalTypedef = [NSNumber numberWithUnsignedLongLong:entry_0.nullableOptionalTypedef.Value().Value()]; + } + } else { + newElement_0.nullableOptionalTypedef = nil; + } [array_0 addObject:newElement_0]; } CHIP_ERROR err = iter_0.GetStatus(); @@ -18683,6 +18720,12 @@ static id _Nullable DecodeAttributeValueForUnitTestingCluster(AttributeId aAttri } else { value.i = nil; } + if (cppValue.j.HasValue()) { + value.j = [NSNumber numberWithUnsignedLongLong:cppValue.j.Value()]; + } else { + value.j = nil; + } + value.k = [NSNumber numberWithUnsignedInt:cppValue.k]; return value; } case Attributes::RangeRestrictedInt8u::Id: { @@ -18815,6 +18858,12 @@ static id _Nullable DecodeAttributeValueForUnitTestingCluster(AttributeId aAttri } else { newElement_0.fabricSensitiveStruct.i = nil; } + if (entry_0.fabricSensitiveStruct.j.HasValue()) { + newElement_0.fabricSensitiveStruct.j = [NSNumber numberWithUnsignedLongLong:entry_0.fabricSensitiveStruct.j.Value()]; + } else { + newElement_0.fabricSensitiveStruct.j = nil; + } + newElement_0.fabricSensitiveStruct.k = [NSNumber numberWithUnsignedInt:entry_0.fabricSensitiveStruct.k]; { // Scope for our temporary variables auto * array_2 = [NSMutableArray new]; auto iter_2 = entry_0.fabricSensitiveInt8uList.begin(); @@ -18916,6 +18965,15 @@ static id _Nullable DecodeAttributeValueForUnitTestingCluster(AttributeId aAttri } else { value.myEnum = nil; } + if (cppValue.myTypedef.HasValue()) { + if (cppValue.myTypedef.Value().IsNull()) { + value.myTypedef = nil; + } else { + value.myTypedef = [NSNumber numberWithUnsignedInt:cppValue.myTypedef.Value().Value()]; + } + } else { + value.myTypedef = nil; + } return value; } case Attributes::Unsupported::Id: { @@ -19406,6 +19464,12 @@ static id _Nullable DecodeAttributeValueForUnitTestingCluster(AttributeId aAttri } else { value.i = nil; } + if (cppValue.Value().j.HasValue()) { + value.j = [NSNumber numberWithUnsignedLongLong:cppValue.Value().j.Value()]; + } else { + value.j = nil; + } + value.k = [NSNumber numberWithUnsignedInt:cppValue.Value().k]; } return value; } @@ -19527,6 +19591,45 @@ static id _Nullable DecodeAttributeValueForUnitTestingCluster(AttributeId aAttri } else { value.myEnum = nil; } + if (cppValue.Value().myTypedef.HasValue()) { + if (cppValue.Value().myTypedef.Value().IsNull()) { + value.myTypedef = nil; + } else { + value.myTypedef = [NSNumber numberWithUnsignedInt:cppValue.Value().myTypedef.Value().Value()]; + } + } else { + value.myTypedef = nil; + } + } + return value; + } + case Attributes::NullableTypedefAttr::Id: { + using TypeInfo = Attributes::NullableTypedefAttr::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedLongLong:cppValue.Value()]; + } + return value; + } + case Attributes::NullableGlobalTypedef::Id: { + using TypeInfo = Attributes::NullableGlobalTypedef::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; } return value; } diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm index 47d9cb14157fe9..88cf7477dbd527 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm @@ -144,7 +144,7 @@ - (void)writeAttributeIdentifyTimeWithValue:(NSNumber * _Nonnull)value params:(M ListFreer listFreer; using TypeInfo = Identify::Attributes::IdentifyTime::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; + cppValue = value.unsignedShortValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -1573,7 +1573,7 @@ - (void)writeAttributeOnTimeWithValue:(NSNumber * _Nonnull)value params:(MTRWrit ListFreer listFreer; using TypeInfo = OnOff::Attributes::OnTime::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; + cppValue = value.unsignedShortValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -1637,7 +1637,7 @@ - (void)writeAttributeOffWaitTimeWithValue:(NSNumber * _Nonnull)value params:(MT ListFreer listFreer; using TypeInfo = OnOff::Attributes::OffWaitTime::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; + cppValue = value.unsignedShortValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -1705,7 +1705,7 @@ - (void)writeAttributeStartUpOnOffWithValue:(NSNumber * _Nullable)value params:( cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = static_cast>(value.unsignedCharValue); + nonNullValue_0 = static_cast>(value.unsignedCharValue); } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -2855,7 +2855,7 @@ - (void)writeAttributeOptionsWithValue:(NSNumber * _Nonnull)value params:(MTRWri ListFreer listFreer; using TypeInfo = LevelControl::Attributes::Options::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedCharValue); + cppValue = static_cast>(value.unsignedCharValue); chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -2919,7 +2919,7 @@ - (void)writeAttributeOnOffTransitionTimeWithValue:(NSNumber * _Nonnull)value pa ListFreer listFreer; using TypeInfo = LevelControl::Attributes::OnOffTransitionTime::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; + cppValue = value.unsignedShortValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -2987,7 +2987,7 @@ - (void)writeAttributeOnLevelWithValue:(NSNumber * _Nullable)value params:(MTRWr cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedCharValue; + nonNullValue_0 = value.unsignedCharValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -3056,7 +3056,7 @@ - (void)writeAttributeOnTransitionTimeWithValue:(NSNumber * _Nullable)value para cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedShortValue; + nonNullValue_0 = value.unsignedShortValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -3125,7 +3125,7 @@ - (void)writeAttributeOffTransitionTimeWithValue:(NSNumber * _Nullable)value par cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedShortValue; + nonNullValue_0 = value.unsignedShortValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -3194,7 +3194,7 @@ - (void)writeAttributeDefaultMoveRateWithValue:(NSNumber * _Nullable)value param cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedCharValue; + nonNullValue_0 = value.unsignedCharValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -3263,7 +3263,7 @@ - (void)writeAttributeStartUpCurrentLevelWithValue:(NSNumber * _Nullable)value p cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedCharValue; + nonNullValue_0 = value.unsignedCharValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -5180,23 +5180,23 @@ - (void)writeAttributeBindingWithValue:(NSArray * _Nonnull)value params:(MTRWrit MTR_LOG_ERROR("%@ incorrectly present in list of %@", value[i_0], NSStringFromClass(MTRBindingClusterTargetStruct.class)); return CHIP_ERROR_INVALID_ARGUMENT; } - if (element_0.node != nil) { - auto & definedValue_2 = listHolder_0->mList[i_0].node.Emplace(); - definedValue_2 = element_0.node.unsignedLongLongValue; + if (element_0.node != nil) { + auto & definedValue_2 = listHolder_0->mList[i_0].node.Emplace(); + definedValue_2 = element_0.node.unsignedLongLongValue; } - if (element_0.group != nil) { - auto & definedValue_2 = listHolder_0->mList[i_0].group.Emplace(); - definedValue_2 = element_0.group.unsignedShortValue; + if (element_0.group != nil) { + auto & definedValue_2 = listHolder_0->mList[i_0].group.Emplace(); + definedValue_2 = element_0.group.unsignedShortValue; } - if (element_0.endpoint != nil) { - auto & definedValue_2 = listHolder_0->mList[i_0].endpoint.Emplace(); - definedValue_2 = element_0.endpoint.unsignedShortValue; + if (element_0.endpoint != nil) { + auto & definedValue_2 = listHolder_0->mList[i_0].endpoint.Emplace(); + definedValue_2 = element_0.endpoint.unsignedShortValue; } - if (element_0.cluster != nil) { - auto & definedValue_2 = listHolder_0->mList[i_0].cluster.Emplace(); - definedValue_2 = element_0.cluster.unsignedIntValue; + if (element_0.cluster != nil) { + auto & definedValue_2 = listHolder_0->mList[i_0].cluster.Emplace(); + definedValue_2 = element_0.cluster.unsignedIntValue; } - listHolder_0->mList[i_0].fabricIndex = element_0.fabricIndex.unsignedCharValue; + listHolder_0->mList[i_0].fabricIndex = element_0.fabricIndex.unsignedCharValue; } cppValue = ListType_0(listHolder_0->mList, value.count); } else { @@ -5720,82 +5720,82 @@ - (void)writeAttributeACLWithValue:(NSArray * _Nonnull)value params:(MTRWritePar MTR_LOG_ERROR("%@ incorrectly present in list of %@", value[i_0], NSStringFromClass(MTRAccessControlClusterAccessControlEntryStruct.class)); return CHIP_ERROR_INVALID_ARGUMENT; } - listHolder_0->mList[i_0].privilege = static_castmList[i_0].privilege)>>(element_0.privilege.unsignedCharValue); - listHolder_0->mList[i_0].authMode = static_castmList[i_0].authMode)>>(element_0.authMode.unsignedCharValue); - if (element_0.subjects == nil) { - listHolder_0->mList[i_0].subjects.SetNull(); - } else { - auto & nonNullValue_2 = listHolder_0->mList[i_0].subjects.SetNonNull(); - { - using ListType_3 = std::remove_reference_t; - using ListMemberType_3 = ListMemberTypeGetter::Type; - if (element_0.subjects.count != 0) { - auto * listHolder_3 = new ListHolder(element_0.subjects.count); - if (listHolder_3 == nullptr || listHolder_3->mList == nullptr) { + listHolder_0->mList[i_0].privilege = static_castmList[i_0].privilege)>>(element_0.privilege.unsignedCharValue); + listHolder_0->mList[i_0].authMode = static_castmList[i_0].authMode)>>(element_0.authMode.unsignedCharValue); + if (element_0.subjects == nil) { + listHolder_0->mList[i_0].subjects.SetNull(); + } else { + auto & nonNullValue_2 = listHolder_0->mList[i_0].subjects.SetNonNull(); + { + using ListType_3 = std::remove_reference_t; + using ListMemberType_3 = ListMemberTypeGetter::Type; + if (element_0.subjects.count != 0) { + auto * listHolder_3 = new ListHolder(element_0.subjects.count); + if (listHolder_3 == nullptr || listHolder_3->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_3); + for (size_t i_3 = 0; i_3 < element_0.subjects.count; ++i_3) { + auto element_3 = MTR_SAFE_CAST(element_0.subjects[i_3], NSNumber); + if (!element_3) { + // Wrong kind of value. + MTR_LOG_ERROR("%@ incorrectly present in list of %@", element_0.subjects[i_3], NSStringFromClass(NSNumber.class)); return CHIP_ERROR_INVALID_ARGUMENT; } - listFreer.add(listHolder_3); - for (size_t i_3 = 0; i_3 < element_0.subjects.count; ++i_3) { - auto element_3 = MTR_SAFE_CAST(element_0.subjects[i_3], NSNumber); - if (!element_3) { - // Wrong kind of value. - MTR_LOG_ERROR("%@ incorrectly present in list of %@", element_0.subjects[i_3], NSStringFromClass(NSNumber.class)); - return CHIP_ERROR_INVALID_ARGUMENT; - } - listHolder_3->mList[i_3] = element_3.unsignedLongLongValue; + listHolder_3->mList[i_3] = element_3.unsignedLongLongValue; } - nonNullValue_2 = ListType_3(listHolder_3->mList, element_0.subjects.count); - } else { - nonNullValue_2 = ListType_3(); - } + nonNullValue_2 = ListType_3(listHolder_3->mList, element_0.subjects.count); + } else { + nonNullValue_2 = ListType_3(); } - } - if (element_0.targets == nil) { - listHolder_0->mList[i_0].targets.SetNull(); - } else { - auto & nonNullValue_2 = listHolder_0->mList[i_0].targets.SetNonNull(); - { - using ListType_3 = std::remove_reference_t; - using ListMemberType_3 = ListMemberTypeGetter::Type; - if (element_0.targets.count != 0) { - auto * listHolder_3 = new ListHolder(element_0.targets.count); - if (listHolder_3 == nullptr || listHolder_3->mList == nullptr) { + } + } + if (element_0.targets == nil) { + listHolder_0->mList[i_0].targets.SetNull(); + } else { + auto & nonNullValue_2 = listHolder_0->mList[i_0].targets.SetNonNull(); + { + using ListType_3 = std::remove_reference_t; + using ListMemberType_3 = ListMemberTypeGetter::Type; + if (element_0.targets.count != 0) { + auto * listHolder_3 = new ListHolder(element_0.targets.count); + if (listHolder_3 == nullptr || listHolder_3->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_3); + for (size_t i_3 = 0; i_3 < element_0.targets.count; ++i_3) { + auto element_3 = MTR_SAFE_CAST(element_0.targets[i_3], MTRAccessControlClusterAccessControlTargetStruct); + if (!element_3) { + // Wrong kind of value. + MTR_LOG_ERROR("%@ incorrectly present in list of %@", element_0.targets[i_3], NSStringFromClass(MTRAccessControlClusterAccessControlTargetStruct.class)); return CHIP_ERROR_INVALID_ARGUMENT; } - listFreer.add(listHolder_3); - for (size_t i_3 = 0; i_3 < element_0.targets.count; ++i_3) { - auto element_3 = MTR_SAFE_CAST(element_0.targets[i_3], MTRAccessControlClusterAccessControlTargetStruct); - if (!element_3) { - // Wrong kind of value. - MTR_LOG_ERROR("%@ incorrectly present in list of %@", element_0.targets[i_3], NSStringFromClass(MTRAccessControlClusterAccessControlTargetStruct.class)); - return CHIP_ERROR_INVALID_ARGUMENT; - } - if (element_3.cluster == nil) { - listHolder_3->mList[i_3].cluster.SetNull(); - } else { - auto & nonNullValue_5 = listHolder_3->mList[i_3].cluster.SetNonNull(); - nonNullValue_5 = element_3.cluster.unsignedIntValue; + if (element_3.cluster == nil) { + listHolder_3->mList[i_3].cluster.SetNull(); + } else { + auto & nonNullValue_5 = listHolder_3->mList[i_3].cluster.SetNonNull(); + nonNullValue_5 = element_3.cluster.unsignedIntValue; } - if (element_3.endpoint == nil) { - listHolder_3->mList[i_3].endpoint.SetNull(); - } else { - auto & nonNullValue_5 = listHolder_3->mList[i_3].endpoint.SetNonNull(); - nonNullValue_5 = element_3.endpoint.unsignedShortValue; + if (element_3.endpoint == nil) { + listHolder_3->mList[i_3].endpoint.SetNull(); + } else { + auto & nonNullValue_5 = listHolder_3->mList[i_3].endpoint.SetNonNull(); + nonNullValue_5 = element_3.endpoint.unsignedShortValue; } - if (element_3.deviceType == nil) { - listHolder_3->mList[i_3].deviceType.SetNull(); - } else { - auto & nonNullValue_5 = listHolder_3->mList[i_3].deviceType.SetNonNull(); - nonNullValue_5 = element_3.deviceType.unsignedIntValue; + if (element_3.deviceType == nil) { + listHolder_3->mList[i_3].deviceType.SetNull(); + } else { + auto & nonNullValue_5 = listHolder_3->mList[i_3].deviceType.SetNonNull(); + nonNullValue_5 = element_3.deviceType.unsignedIntValue; } } - nonNullValue_2 = ListType_3(listHolder_3->mList, element_0.targets.count); - } else { - nonNullValue_2 = ListType_3(); - } + nonNullValue_2 = ListType_3(listHolder_3->mList, element_0.targets.count); + } else { + nonNullValue_2 = ListType_3(); } - } - listHolder_0->mList[i_0].fabricIndex = element_0.fabricIndex.unsignedCharValue; + } + } + listHolder_0->mList[i_0].fabricIndex = element_0.fabricIndex.unsignedCharValue; } cppValue = ListType_0(listHolder_0->mList, value.count); } else { @@ -5881,8 +5881,8 @@ - (void)writeAttributeExtensionWithValue:(NSArray * _Nonnull)value params:(MTRWr MTR_LOG_ERROR("%@ incorrectly present in list of %@", value[i_0], NSStringFromClass(MTRAccessControlClusterAccessControlExtensionStruct.class)); return CHIP_ERROR_INVALID_ARGUMENT; } - listHolder_0->mList[i_0].data = AsByteSpan(element_0.data); - listHolder_0->mList[i_0].fabricIndex = element_0.fabricIndex.unsignedCharValue; + listHolder_0->mList[i_0].data = AsByteSpan(element_0.data); + listHolder_0->mList[i_0].fabricIndex = element_0.fabricIndex.unsignedCharValue; } cppValue = ListType_0(listHolder_0->mList, value.count); } else { @@ -8287,7 +8287,7 @@ - (void)writeAttributeLocalConfigDisabledWithValue:(NSNumber * _Nonnull)value pa ListFreer listFreer; using TypeInfo = BasicInformation::Attributes::LocalConfigDisabled::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.boolValue; + cppValue = value.boolValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -10183,9 +10183,9 @@ - (void)writeAttributeDefaultOTAProvidersWithValue:(NSArray * _Nonnull)value par MTR_LOG_ERROR("%@ incorrectly present in list of %@", value[i_0], NSStringFromClass(MTROTASoftwareUpdateRequestorClusterProviderLocation.class)); return CHIP_ERROR_INVALID_ARGUMENT; } - listHolder_0->mList[i_0].providerNodeID = element_0.providerNodeID.unsignedLongLongValue; - listHolder_0->mList[i_0].endpoint = element_0.endpoint.unsignedShortValue; - listHolder_0->mList[i_0].fabricIndex = element_0.fabricIndex.unsignedCharValue; + listHolder_0->mList[i_0].providerNodeID = element_0.providerNodeID.unsignedLongLongValue; + listHolder_0->mList[i_0].endpoint = element_0.endpoint.unsignedShortValue; + listHolder_0->mList[i_0].fabricIndex = element_0.fabricIndex.unsignedCharValue; } cppValue = ListType_0(listHolder_0->mList, value.count); } else { @@ -11438,7 +11438,7 @@ - (void)writeAttributeHourFormatWithValue:(NSNumber * _Nonnull)value params:(MTR ListFreer listFreer; using TypeInfo = TimeFormatLocalization::Attributes::HourFormat::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedCharValue); + cppValue = static_cast>(value.unsignedCharValue); chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -11502,7 +11502,7 @@ - (void)writeAttributeActiveCalendarTypeWithValue:(NSNumber * _Nonnull)value par ListFreer listFreer; using TypeInfo = TimeFormatLocalization::Attributes::ActiveCalendarType::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedCharValue); + cppValue = static_cast>(value.unsignedCharValue); chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -12093,7 +12093,7 @@ - (void)writeAttributeTemperatureUnitWithValue:(NSNumber * _Nonnull)value params ListFreer listFreer; using TypeInfo = UnitLocalization::Attributes::TemperatureUnit::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedCharValue); + cppValue = static_cast>(value.unsignedCharValue); chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -15719,7 +15719,7 @@ - (void)writeAttributeBreadcrumbWithValue:(NSNumber * _Nonnull)value params:(MTR ListFreer listFreer; using TypeInfo = GeneralCommissioning::Attributes::Breadcrumb::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedLongLongValue; + cppValue = value.unsignedLongLongValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -17006,7 +17006,7 @@ - (void)writeAttributeInterfaceEnabledWithValue:(NSNumber * _Nonnull)value param ListFreer listFreer; using TypeInfo = NetworkCommissioning::Attributes::InterfaceEnabled::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.boolValue; + cppValue = value.boolValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -32228,9 +32228,9 @@ - (void)writeAttributeGroupKeyMapWithValue:(NSArray * _Nonnull)value params:(MTR MTR_LOG_ERROR("%@ incorrectly present in list of %@", value[i_0], NSStringFromClass(MTRGroupKeyManagementClusterGroupKeyMapStruct.class)); return CHIP_ERROR_INVALID_ARGUMENT; } - listHolder_0->mList[i_0].groupId = element_0.groupId.unsignedShortValue; - listHolder_0->mList[i_0].groupKeySetID = element_0.groupKeySetID.unsignedShortValue; - listHolder_0->mList[i_0].fabricIndex = element_0.fabricIndex.unsignedCharValue; + listHolder_0->mList[i_0].groupId = element_0.groupId.unsignedShortValue; + listHolder_0->mList[i_0].groupKeySetID = element_0.groupKeySetID.unsignedShortValue; + listHolder_0->mList[i_0].fabricIndex = element_0.fabricIndex.unsignedCharValue; } cppValue = ListType_0(listHolder_0->mList, value.count); } else { @@ -33410,8 +33410,8 @@ - (void)writeAttributeLabelListWithValue:(NSArray * _Nonnull)value params:(MTRWr MTR_LOG_ERROR("%@ incorrectly present in list of %@", value[i_0], NSStringFromClass(MTRUserLabelClusterLabelStruct.class)); return CHIP_ERROR_INVALID_ARGUMENT; } - listHolder_0->mList[i_0].label = AsCharSpan(element_0.label); - listHolder_0->mList[i_0].value = AsCharSpan(element_0.value); + listHolder_0->mList[i_0].label = AsCharSpan(element_0.label); + listHolder_0->mList[i_0].value = AsCharSpan(element_0.value); } cppValue = ListType_0(listHolder_0->mList, value.count); } else { @@ -35959,7 +35959,7 @@ - (void)writeAttributeStartUpModeWithValue:(NSNumber * _Nullable)value params:(M cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedCharValue; + nonNullValue_0 = value.unsignedCharValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -36028,7 +36028,7 @@ - (void)writeAttributeOnModeWithValue:(NSNumber * _Nullable)value params:(MTRWri cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedCharValue; + nonNullValue_0 = value.unsignedCharValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -36317,7 +36317,7 @@ - (void)writeAttributeSelectedDrynessLevelWithValue:(NSNumber * _Nullable)value cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = static_cast>(value.unsignedCharValue); + nonNullValue_0 = static_cast>(value.unsignedCharValue); } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -36739,7 +36739,7 @@ - (void)writeAttributeStartUpModeWithValue:(NSNumber * _Nullable)value params:(M cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedCharValue; + nonNullValue_0 = value.unsignedCharValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -36808,7 +36808,7 @@ - (void)writeAttributeOnModeWithValue:(NSNumber * _Nullable)value params:(MTRWri cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedCharValue; + nonNullValue_0 = value.unsignedCharValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -37576,7 +37576,7 @@ - (void)writeAttributeStartUpModeWithValue:(NSNumber * _Nullable)value params:(M cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedCharValue; + nonNullValue_0 = value.unsignedCharValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -37645,7 +37645,7 @@ - (void)writeAttributeOnModeWithValue:(NSNumber * _Nullable)value params:(MTRWri cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedCharValue; + nonNullValue_0 = value.unsignedCharValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -37995,7 +37995,7 @@ - (void)writeAttributeStartUpModeWithValue:(NSNumber * _Nullable)value params:(M cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedCharValue; + nonNullValue_0 = value.unsignedCharValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -38064,7 +38064,7 @@ - (void)writeAttributeOnModeWithValue:(NSNumber * _Nullable)value params:(MTRWri cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedCharValue; + nonNullValue_0 = value.unsignedCharValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -38353,7 +38353,7 @@ - (void)writeAttributeSpinSpeedCurrentWithValue:(NSNumber * _Nullable)value para cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedCharValue; + nonNullValue_0 = value.unsignedCharValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -38418,7 +38418,7 @@ - (void)writeAttributeNumberOfRinsesWithValue:(NSNumber * _Nonnull)value params: ListFreer listFreer; using TypeInfo = LaundryWasherControls::Attributes::NumberOfRinses::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedCharValue); + cppValue = static_cast>(value.unsignedCharValue); chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -40086,7 +40086,7 @@ - (void)writeAttributeStartUpModeWithValue:(NSNumber * _Nullable)value params:(M cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedCharValue; + nonNullValue_0 = value.unsignedCharValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -40155,7 +40155,7 @@ - (void)writeAttributeOnModeWithValue:(NSNumber * _Nullable)value params:(MTRWri cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedCharValue; + nonNullValue_0 = value.unsignedCharValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -41049,7 +41049,7 @@ - (void)writeAttributeSmokeSensitivityLevelWithValue:(NSNumber * _Nonnull)value ListFreer listFreer; using TypeInfo = SmokeCoAlarm::Attributes::SmokeSensitivityLevel::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedCharValue); + cppValue = static_cast>(value.unsignedCharValue); chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -44187,7 +44187,7 @@ - (void)writeAttributeLastChangedTimeWithValue:(NSNumber * _Nullable)value param cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedIntValue; + nonNullValue_0 = value.unsignedIntValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -44649,7 +44649,7 @@ - (void)writeAttributeLastChangedTimeWithValue:(NSNumber * _Nullable)value param cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedIntValue; + nonNullValue_0 = value.unsignedIntValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -44983,7 +44983,7 @@ - (void)writeAttributeCurrentSensitivityLevelWithValue:(NSNumber * _Nonnull)valu ListFreer listFreer; using TypeInfo = BooleanStateConfiguration::Attributes::CurrentSensitivityLevel::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; + cppValue = value.unsignedCharValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -45580,7 +45580,7 @@ - (void)writeAttributeDefaultOpenDurationWithValue:(NSNumber * _Nullable)value p cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedIntValue; + nonNullValue_0 = value.unsignedIntValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -45861,7 +45861,7 @@ - (void)writeAttributeDefaultOpenLevelWithValue:(NSNumber * _Nonnull)value param ListFreer listFreer; using TypeInfo = ValveConfigurationAndControl::Attributes::DefaultOpenLevel::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; + cppValue = value.unsignedCharValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -48243,7 +48243,7 @@ - (void)writeAttributeDefaultRandomStartWithValue:(NSNumber * _Nonnull)value par ListFreer listFreer; using TypeInfo = DemandResponseLoadControl::Attributes::DefaultRandomStart::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; + cppValue = value.unsignedCharValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -48307,7 +48307,7 @@ - (void)writeAttributeDefaultRandomDurationWithValue:(NSNumber * _Nonnull)value ListFreer listFreer; using TypeInfo = DemandResponseLoadControl::Attributes::DefaultRandomDuration::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; + cppValue = value.unsignedCharValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -50067,7 +50067,7 @@ - (void)writeAttributeUserMaximumChargeCurrentWithValue:(NSNumber * _Nonnull)val ListFreer listFreer; using TypeInfo = EnergyEvse::Attributes::UserMaximumChargeCurrent::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.longLongValue; + cppValue = value.longLongValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -50131,7 +50131,7 @@ - (void)writeAttributeRandomizationDelayWindowWithValue:(NSNumber * _Nonnull)val ListFreer listFreer; using TypeInfo = EnergyEvse::Attributes::RandomizationDelayWindow::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedIntValue; + cppValue = value.unsignedIntValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -50343,7 +50343,7 @@ - (void)writeAttributeApproximateEVEfficiencyWithValue:(NSNumber * _Nullable)val cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedShortValue; + nonNullValue_0 = value.unsignedShortValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -50880,7 +50880,7 @@ - (void)writeAttributeCurrentEnergyBalanceWithValue:(NSNumber * _Nonnull)value p ListFreer listFreer; using TypeInfo = EnergyPreference::Attributes::CurrentEnergyBalance::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; + cppValue = value.unsignedCharValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -51016,7 +51016,7 @@ - (void)writeAttributeCurrentLowPowerModeSensitivityWithValue:(NSNumber * _Nonnu ListFreer listFreer; using TypeInfo = EnergyPreference::Attributes::CurrentLowPowerModeSensitivity::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; + cppValue = value.unsignedCharValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -53058,7 +53058,7 @@ - (void)writeAttributeDoorOpenEventsWithValue:(NSNumber * _Nonnull)value params: ListFreer listFreer; using TypeInfo = DoorLock::Attributes::DoorOpenEvents::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedIntValue; + cppValue = value.unsignedIntValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -53122,7 +53122,7 @@ - (void)writeAttributeDoorClosedEventsWithValue:(NSNumber * _Nonnull)value param ListFreer listFreer; using TypeInfo = DoorLock::Attributes::DoorClosedEvents::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedIntValue; + cppValue = value.unsignedIntValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -53186,7 +53186,7 @@ - (void)writeAttributeOpenPeriodWithValue:(NSNumber * _Nonnull)value params:(MTR ListFreer listFreer; using TypeInfo = DoorLock::Attributes::OpenPeriod::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; + cppValue = value.unsignedShortValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -53746,7 +53746,7 @@ - (void)writeAttributeLEDSettingsWithValue:(NSNumber * _Nonnull)value params:(MT ListFreer listFreer; using TypeInfo = DoorLock::Attributes::LEDSettings::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; + cppValue = value.unsignedCharValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -53810,7 +53810,7 @@ - (void)writeAttributeAutoRelockTimeWithValue:(NSNumber * _Nonnull)value params: ListFreer listFreer; using TypeInfo = DoorLock::Attributes::AutoRelockTime::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedIntValue; + cppValue = value.unsignedIntValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -53874,7 +53874,7 @@ - (void)writeAttributeSoundVolumeWithValue:(NSNumber * _Nonnull)value params:(MT ListFreer listFreer; using TypeInfo = DoorLock::Attributes::SoundVolume::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; + cppValue = value.unsignedCharValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -53938,7 +53938,7 @@ - (void)writeAttributeOperatingModeWithValue:(NSNumber * _Nonnull)value params:( ListFreer listFreer; using TypeInfo = DoorLock::Attributes::OperatingMode::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedCharValue); + cppValue = static_cast>(value.unsignedCharValue); chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -54074,7 +54074,7 @@ - (void)writeAttributeEnableLocalProgrammingWithValue:(NSNumber * _Nonnull)value ListFreer listFreer; using TypeInfo = DoorLock::Attributes::EnableLocalProgramming::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.boolValue; + cppValue = value.boolValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -54138,7 +54138,7 @@ - (void)writeAttributeEnableOneTouchLockingWithValue:(NSNumber * _Nonnull)value ListFreer listFreer; using TypeInfo = DoorLock::Attributes::EnableOneTouchLocking::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.boolValue; + cppValue = value.boolValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -54202,7 +54202,7 @@ - (void)writeAttributeEnableInsideStatusLEDWithValue:(NSNumber * _Nonnull)value ListFreer listFreer; using TypeInfo = DoorLock::Attributes::EnableInsideStatusLED::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.boolValue; + cppValue = value.boolValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -54266,7 +54266,7 @@ - (void)writeAttributeEnablePrivacyModeButtonWithValue:(NSNumber * _Nonnull)valu ListFreer listFreer; using TypeInfo = DoorLock::Attributes::EnablePrivacyModeButton::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.boolValue; + cppValue = value.boolValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -54330,7 +54330,7 @@ - (void)writeAttributeLocalProgrammingFeaturesWithValue:(NSNumber * _Nonnull)val ListFreer listFreer; using TypeInfo = DoorLock::Attributes::LocalProgrammingFeatures::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedCharValue); + cppValue = static_cast>(value.unsignedCharValue); chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -54394,7 +54394,7 @@ - (void)writeAttributeWrongCodeEntryLimitWithValue:(NSNumber * _Nonnull)value pa ListFreer listFreer; using TypeInfo = DoorLock::Attributes::WrongCodeEntryLimit::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; + cppValue = value.unsignedCharValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -54458,7 +54458,7 @@ - (void)writeAttributeUserCodeTemporaryDisableTimeWithValue:(NSNumber * _Nonnull ListFreer listFreer; using TypeInfo = DoorLock::Attributes::UserCodeTemporaryDisableTime::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; + cppValue = value.unsignedCharValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -54522,7 +54522,7 @@ - (void)writeAttributeSendPINOverTheAirWithValue:(NSNumber * _Nonnull)value para ListFreer listFreer; using TypeInfo = DoorLock::Attributes::SendPINOverTheAir::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.boolValue; + cppValue = value.boolValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -54586,7 +54586,7 @@ - (void)writeAttributeRequirePINforRemoteOperationWithValue:(NSNumber * _Nonnull ListFreer listFreer; using TypeInfo = DoorLock::Attributes::RequirePINforRemoteOperation::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.boolValue; + cppValue = value.boolValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -54650,7 +54650,7 @@ - (void)writeAttributeExpiringUserTimeoutWithValue:(NSNumber * _Nonnull)value pa ListFreer listFreer; using TypeInfo = DoorLock::Attributes::ExpiringUserTimeout::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; + cppValue = value.unsignedShortValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -57822,7 +57822,7 @@ - (void)writeAttributeModeWithValue:(NSNumber * _Nonnull)value params:(MTRWriteP ListFreer listFreer; using TypeInfo = WindowCovering::Attributes::Mode::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedCharValue); + cppValue = static_cast>(value.unsignedCharValue); chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -60219,7 +60219,7 @@ - (void)writeAttributeLifetimeRunningHoursWithValue:(NSNumber * _Nullable)value cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedIntValue; + nonNullValue_0 = value.unsignedIntValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -60324,7 +60324,7 @@ - (void)writeAttributeLifetimeEnergyConsumedWithValue:(NSNumber * _Nullable)valu cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedIntValue; + nonNullValue_0 = value.unsignedIntValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -60389,7 +60389,7 @@ - (void)writeAttributeOperationModeWithValue:(NSNumber * _Nonnull)value params:( ListFreer listFreer; using TypeInfo = PumpConfigurationAndControl::Attributes::OperationMode::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedCharValue); + cppValue = static_cast>(value.unsignedCharValue); chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -60453,7 +60453,7 @@ - (void)writeAttributeControlModeWithValue:(NSNumber * _Nonnull)value params:(MT ListFreer listFreer; using TypeInfo = PumpConfigurationAndControl::Attributes::ControlMode::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedCharValue); + cppValue = static_cast>(value.unsignedCharValue); chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -62221,7 +62221,7 @@ - (void)writeAttributeHVACSystemTypeConfigurationWithValue:(NSNumber * _Nonnull) ListFreer listFreer; using TypeInfo = Thermostat::Attributes::HVACSystemTypeConfiguration::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedCharValue); + cppValue = static_cast>(value.unsignedCharValue); chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -62285,7 +62285,7 @@ - (void)writeAttributeLocalTemperatureCalibrationWithValue:(NSNumber * _Nonnull) ListFreer listFreer; using TypeInfo = Thermostat::Attributes::LocalTemperatureCalibration::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.charValue; + cppValue = value.charValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -62349,7 +62349,7 @@ - (void)writeAttributeOccupiedCoolingSetpointWithValue:(NSNumber * _Nonnull)valu ListFreer listFreer; using TypeInfo = Thermostat::Attributes::OccupiedCoolingSetpoint::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.shortValue; + cppValue = value.shortValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -62413,7 +62413,7 @@ - (void)writeAttributeOccupiedHeatingSetpointWithValue:(NSNumber * _Nonnull)valu ListFreer listFreer; using TypeInfo = Thermostat::Attributes::OccupiedHeatingSetpoint::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.shortValue; + cppValue = value.shortValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -62477,7 +62477,7 @@ - (void)writeAttributeUnoccupiedCoolingSetpointWithValue:(NSNumber * _Nonnull)va ListFreer listFreer; using TypeInfo = Thermostat::Attributes::UnoccupiedCoolingSetpoint::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.shortValue; + cppValue = value.shortValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -62541,7 +62541,7 @@ - (void)writeAttributeUnoccupiedHeatingSetpointWithValue:(NSNumber * _Nonnull)va ListFreer listFreer; using TypeInfo = Thermostat::Attributes::UnoccupiedHeatingSetpoint::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.shortValue; + cppValue = value.shortValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -62605,7 +62605,7 @@ - (void)writeAttributeMinHeatSetpointLimitWithValue:(NSNumber * _Nonnull)value p ListFreer listFreer; using TypeInfo = Thermostat::Attributes::MinHeatSetpointLimit::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.shortValue; + cppValue = value.shortValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -62669,7 +62669,7 @@ - (void)writeAttributeMaxHeatSetpointLimitWithValue:(NSNumber * _Nonnull)value p ListFreer listFreer; using TypeInfo = Thermostat::Attributes::MaxHeatSetpointLimit::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.shortValue; + cppValue = value.shortValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -62733,7 +62733,7 @@ - (void)writeAttributeMinCoolSetpointLimitWithValue:(NSNumber * _Nonnull)value p ListFreer listFreer; using TypeInfo = Thermostat::Attributes::MinCoolSetpointLimit::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.shortValue; + cppValue = value.shortValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -62797,7 +62797,7 @@ - (void)writeAttributeMaxCoolSetpointLimitWithValue:(NSNumber * _Nonnull)value p ListFreer listFreer; using TypeInfo = Thermostat::Attributes::MaxCoolSetpointLimit::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.shortValue; + cppValue = value.shortValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -62861,7 +62861,7 @@ - (void)writeAttributeMinSetpointDeadBandWithValue:(NSNumber * _Nonnull)value pa ListFreer listFreer; using TypeInfo = Thermostat::Attributes::MinSetpointDeadBand::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.charValue; + cppValue = value.charValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -62925,7 +62925,7 @@ - (void)writeAttributeRemoteSensingWithValue:(NSNumber * _Nonnull)value params:( ListFreer listFreer; using TypeInfo = Thermostat::Attributes::RemoteSensing::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedCharValue); + cppValue = static_cast>(value.unsignedCharValue); chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -62989,7 +62989,7 @@ - (void)writeAttributeControlSequenceOfOperationWithValue:(NSNumber * _Nonnull)v ListFreer listFreer; using TypeInfo = Thermostat::Attributes::ControlSequenceOfOperation::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedCharValue); + cppValue = static_cast>(value.unsignedCharValue); chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -63053,7 +63053,7 @@ - (void)writeAttributeSystemModeWithValue:(NSNumber * _Nonnull)value params:(MTR ListFreer listFreer; using TypeInfo = Thermostat::Attributes::SystemMode::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedCharValue); + cppValue = static_cast>(value.unsignedCharValue); chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -63261,7 +63261,7 @@ - (void)writeAttributeTemperatureSetpointHoldWithValue:(NSNumber * _Nonnull)valu ListFreer listFreer; using TypeInfo = Thermostat::Attributes::TemperatureSetpointHold::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedCharValue); + cppValue = static_cast>(value.unsignedCharValue); chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -63329,7 +63329,7 @@ - (void)writeAttributeTemperatureSetpointHoldDurationWithValue:(NSNumber * _Null cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedShortValue; + nonNullValue_0 = value.unsignedShortValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -63394,7 +63394,7 @@ - (void)writeAttributeThermostatProgrammingOperationModeWithValue:(NSNumber * _N ListFreer listFreer; using TypeInfo = Thermostat::Attributes::ThermostatProgrammingOperationMode::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedCharValue); + cppValue = static_cast>(value.unsignedCharValue); chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -63606,7 +63606,7 @@ - (void)writeAttributeOccupiedSetbackWithValue:(NSNumber * _Nullable)value param cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedCharValue; + nonNullValue_0 = value.unsignedCharValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -63747,7 +63747,7 @@ - (void)writeAttributeUnoccupiedSetbackWithValue:(NSNumber * _Nullable)value par cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedCharValue; + nonNullValue_0 = value.unsignedCharValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -63884,7 +63884,7 @@ - (void)writeAttributeEmergencyHeatDeltaWithValue:(NSNumber * _Nonnull)value par ListFreer listFreer; using TypeInfo = Thermostat::Attributes::EmergencyHeatDelta::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; + cppValue = value.unsignedCharValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -63948,7 +63948,7 @@ - (void)writeAttributeACTypeWithValue:(NSNumber * _Nonnull)value params:(MTRWrit ListFreer listFreer; using TypeInfo = Thermostat::Attributes::ACType::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedCharValue); + cppValue = static_cast>(value.unsignedCharValue); chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -64012,7 +64012,7 @@ - (void)writeAttributeACCapacityWithValue:(NSNumber * _Nonnull)value params:(MTR ListFreer listFreer; using TypeInfo = Thermostat::Attributes::ACCapacity::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; + cppValue = value.unsignedShortValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -64076,7 +64076,7 @@ - (void)writeAttributeACRefrigerantTypeWithValue:(NSNumber * _Nonnull)value para ListFreer listFreer; using TypeInfo = Thermostat::Attributes::ACRefrigerantType::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedCharValue); + cppValue = static_cast>(value.unsignedCharValue); chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -64140,7 +64140,7 @@ - (void)writeAttributeACCompressorTypeWithValue:(NSNumber * _Nonnull)value param ListFreer listFreer; using TypeInfo = Thermostat::Attributes::ACCompressorType::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedCharValue); + cppValue = static_cast>(value.unsignedCharValue); chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -64204,7 +64204,7 @@ - (void)writeAttributeACErrorCodeWithValue:(NSNumber * _Nonnull)value params:(MT ListFreer listFreer; using TypeInfo = Thermostat::Attributes::ACErrorCode::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedIntValue); + cppValue = static_cast>(value.unsignedIntValue); chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -64268,7 +64268,7 @@ - (void)writeAttributeACLouverPositionWithValue:(NSNumber * _Nonnull)value param ListFreer listFreer; using TypeInfo = Thermostat::Attributes::ACLouverPosition::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedCharValue); + cppValue = static_cast>(value.unsignedCharValue); chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -64368,7 +64368,7 @@ - (void)writeAttributeACCapacityformatWithValue:(NSNumber * _Nonnull)value param ListFreer listFreer; using TypeInfo = Thermostat::Attributes::ACCapacityformat::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedCharValue); + cppValue = static_cast>(value.unsignedCharValue); chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -64736,35 +64736,35 @@ - (void)writeAttributePresetsWithValue:(NSArray * _Nonnull)value params:(MTRWrit MTR_LOG_ERROR("%@ incorrectly present in list of %@", value[i_0], NSStringFromClass(MTRThermostatClusterPresetStruct.class)); return CHIP_ERROR_INVALID_ARGUMENT; } - if (element_0.presetHandle == nil) { - listHolder_0->mList[i_0].presetHandle.SetNull(); - } else { - auto & nonNullValue_2 = listHolder_0->mList[i_0].presetHandle.SetNonNull(); - nonNullValue_2 = AsByteSpan(element_0.presetHandle); - } - listHolder_0->mList[i_0].presetScenario = static_castmList[i_0].presetScenario)>>(element_0.presetScenario.unsignedCharValue); - if (element_0.name != nil) { - auto & definedValue_2 = listHolder_0->mList[i_0].name.Emplace(); - if (element_0.name == nil) { - definedValue_2.SetNull(); - } else { - auto & nonNullValue_3 = definedValue_2.SetNonNull(); - nonNullValue_3 = AsCharSpan(element_0.name); - } - } - if (element_0.coolingSetpoint != nil) { - auto & definedValue_2 = listHolder_0->mList[i_0].coolingSetpoint.Emplace(); - definedValue_2 = element_0.coolingSetpoint.shortValue; + if (element_0.presetHandle == nil) { + listHolder_0->mList[i_0].presetHandle.SetNull(); + } else { + auto & nonNullValue_2 = listHolder_0->mList[i_0].presetHandle.SetNonNull(); + nonNullValue_2 = AsByteSpan(element_0.presetHandle); + } + listHolder_0->mList[i_0].presetScenario = static_castmList[i_0].presetScenario)>>(element_0.presetScenario.unsignedCharValue); + if (element_0.name != nil) { + auto & definedValue_2 = listHolder_0->mList[i_0].name.Emplace(); + if (element_0.name == nil) { + definedValue_2.SetNull(); + } else { + auto & nonNullValue_3 = definedValue_2.SetNonNull(); + nonNullValue_3 = AsCharSpan(element_0.name); + } + } + if (element_0.coolingSetpoint != nil) { + auto & definedValue_2 = listHolder_0->mList[i_0].coolingSetpoint.Emplace(); + definedValue_2 = element_0.coolingSetpoint.shortValue; } - if (element_0.heatingSetpoint != nil) { - auto & definedValue_2 = listHolder_0->mList[i_0].heatingSetpoint.Emplace(); - definedValue_2 = element_0.heatingSetpoint.shortValue; + if (element_0.heatingSetpoint != nil) { + auto & definedValue_2 = listHolder_0->mList[i_0].heatingSetpoint.Emplace(); + definedValue_2 = element_0.heatingSetpoint.shortValue; } - if (element_0.builtIn == nil) { - listHolder_0->mList[i_0].builtIn.SetNull(); - } else { - auto & nonNullValue_2 = listHolder_0->mList[i_0].builtIn.SetNonNull(); - nonNullValue_2 = element_0.builtIn.boolValue; + if (element_0.builtIn == nil) { + listHolder_0->mList[i_0].builtIn.SetNull(); + } else { + auto & nonNullValue_2 = listHolder_0->mList[i_0].builtIn.SetNonNull(); + nonNullValue_2 = element_0.builtIn.boolValue; } } cppValue = ListType_0(listHolder_0->mList, value.count); @@ -64851,66 +64851,66 @@ - (void)writeAttributeSchedulesWithValue:(NSArray * _Nonnull)value params:(MTRWr MTR_LOG_ERROR("%@ incorrectly present in list of %@", value[i_0], NSStringFromClass(MTRThermostatClusterScheduleStruct.class)); return CHIP_ERROR_INVALID_ARGUMENT; } - if (element_0.scheduleHandle == nil) { - listHolder_0->mList[i_0].scheduleHandle.SetNull(); - } else { - auto & nonNullValue_2 = listHolder_0->mList[i_0].scheduleHandle.SetNonNull(); - nonNullValue_2 = AsByteSpan(element_0.scheduleHandle); - } - listHolder_0->mList[i_0].systemMode = static_castmList[i_0].systemMode)>>(element_0.systemMode.unsignedCharValue); - if (element_0.name != nil) { - auto & definedValue_2 = listHolder_0->mList[i_0].name.Emplace(); - definedValue_2 = AsCharSpan(element_0.name); - } - if (element_0.presetHandle != nil) { - auto & definedValue_2 = listHolder_0->mList[i_0].presetHandle.Emplace(); - definedValue_2 = AsByteSpan(element_0.presetHandle); - } - { - using ListType_2 = std::remove_reference_tmList[i_0].transitions)>; - using ListMemberType_2 = ListMemberTypeGetter::Type; - if (element_0.transitions.count != 0) { - auto * listHolder_2 = new ListHolder(element_0.transitions.count); - if (listHolder_2 == nullptr || listHolder_2->mList == nullptr) { + if (element_0.scheduleHandle == nil) { + listHolder_0->mList[i_0].scheduleHandle.SetNull(); + } else { + auto & nonNullValue_2 = listHolder_0->mList[i_0].scheduleHandle.SetNonNull(); + nonNullValue_2 = AsByteSpan(element_0.scheduleHandle); + } + listHolder_0->mList[i_0].systemMode = static_castmList[i_0].systemMode)>>(element_0.systemMode.unsignedCharValue); + if (element_0.name != nil) { + auto & definedValue_2 = listHolder_0->mList[i_0].name.Emplace(); + definedValue_2 = AsCharSpan(element_0.name); + } + if (element_0.presetHandle != nil) { + auto & definedValue_2 = listHolder_0->mList[i_0].presetHandle.Emplace(); + definedValue_2 = AsByteSpan(element_0.presetHandle); + } + { + using ListType_2 = std::remove_reference_tmList[i_0].transitions)>; + using ListMemberType_2 = ListMemberTypeGetter::Type; + if (element_0.transitions.count != 0) { + auto * listHolder_2 = new ListHolder(element_0.transitions.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.transitions.count; ++i_2) { + auto element_2 = MTR_SAFE_CAST(element_0.transitions[i_2], MTRThermostatClusterScheduleTransitionStruct); + if (!element_2) { + // Wrong kind of value. + MTR_LOG_ERROR("%@ incorrectly present in list of %@", element_0.transitions[i_2], NSStringFromClass(MTRThermostatClusterScheduleTransitionStruct.class)); return CHIP_ERROR_INVALID_ARGUMENT; } - listFreer.add(listHolder_2); - for (size_t i_2 = 0; i_2 < element_0.transitions.count; ++i_2) { - auto element_2 = MTR_SAFE_CAST(element_0.transitions[i_2], MTRThermostatClusterScheduleTransitionStruct); - if (!element_2) { - // Wrong kind of value. - MTR_LOG_ERROR("%@ incorrectly present in list of %@", element_0.transitions[i_2], NSStringFromClass(MTRThermostatClusterScheduleTransitionStruct.class)); - return CHIP_ERROR_INVALID_ARGUMENT; - } - listHolder_2->mList[i_2].dayOfWeek = static_castmList[i_2].dayOfWeek)>>(element_2.dayOfWeek.unsignedCharValue); - listHolder_2->mList[i_2].transitionTime = element_2.transitionTime.unsignedShortValue; - if (element_2.presetHandle != nil) { - auto & definedValue_4 = listHolder_2->mList[i_2].presetHandle.Emplace(); - definedValue_4 = AsByteSpan(element_2.presetHandle); - } - if (element_2.systemMode != nil) { - auto & definedValue_4 = listHolder_2->mList[i_2].systemMode.Emplace(); - definedValue_4 = static_cast>(element_2.systemMode.unsignedCharValue); + listHolder_2->mList[i_2].dayOfWeek = static_castmList[i_2].dayOfWeek)>>(element_2.dayOfWeek.unsignedCharValue); + listHolder_2->mList[i_2].transitionTime = element_2.transitionTime.unsignedShortValue; + if (element_2.presetHandle != nil) { + auto & definedValue_4 = listHolder_2->mList[i_2].presetHandle.Emplace(); + definedValue_4 = AsByteSpan(element_2.presetHandle); + } + if (element_2.systemMode != nil) { + auto & definedValue_4 = listHolder_2->mList[i_2].systemMode.Emplace(); + definedValue_4 = static_cast>(element_2.systemMode.unsignedCharValue); } - if (element_2.coolingSetpoint != nil) { - auto & definedValue_4 = listHolder_2->mList[i_2].coolingSetpoint.Emplace(); - definedValue_4 = element_2.coolingSetpoint.shortValue; + if (element_2.coolingSetpoint != nil) { + auto & definedValue_4 = listHolder_2->mList[i_2].coolingSetpoint.Emplace(); + definedValue_4 = element_2.coolingSetpoint.shortValue; } - if (element_2.heatingSetpoint != nil) { - auto & definedValue_4 = listHolder_2->mList[i_2].heatingSetpoint.Emplace(); - definedValue_4 = element_2.heatingSetpoint.shortValue; + if (element_2.heatingSetpoint != nil) { + auto & definedValue_4 = listHolder_2->mList[i_2].heatingSetpoint.Emplace(); + definedValue_4 = element_2.heatingSetpoint.shortValue; } } - listHolder_0->mList[i_0].transitions = ListType_2(listHolder_2->mList, element_0.transitions.count); - } else { - listHolder_0->mList[i_0].transitions = ListType_2(); - } - } - if (element_0.builtIn == nil) { - listHolder_0->mList[i_0].builtIn.SetNull(); + listHolder_0->mList[i_0].transitions = ListType_2(listHolder_2->mList, element_0.transitions.count); } else { - auto & nonNullValue_2 = listHolder_0->mList[i_0].builtIn.SetNonNull(); - nonNullValue_2 = element_0.builtIn.boolValue; + listHolder_0->mList[i_0].transitions = ListType_2(); + } + } + if (element_0.builtIn == nil) { + listHolder_0->mList[i_0].builtIn.SetNull(); + } else { + auto & nonNullValue_2 = listHolder_0->mList[i_0].builtIn.SetNonNull(); + nonNullValue_2 = element_0.builtIn.boolValue; } } cppValue = ListType_0(listHolder_0->mList, value.count); @@ -67371,7 +67371,7 @@ - (void)writeAttributeFanModeWithValue:(NSNumber * _Nonnull)value params:(MTRWri ListFreer listFreer; using TypeInfo = FanControl::Attributes::FanMode::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedCharValue); + cppValue = static_cast>(value.unsignedCharValue); chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -67435,7 +67435,7 @@ - (void)writeAttributeFanModeSequenceWithValue:(NSNumber * _Nonnull)value params ListFreer listFreer; using TypeInfo = FanControl::Attributes::FanModeSequence::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedCharValue); + cppValue = static_cast>(value.unsignedCharValue); chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -67503,7 +67503,7 @@ - (void)writeAttributePercentSettingWithValue:(NSNumber * _Nullable)value params cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedCharValue; + nonNullValue_0 = value.unsignedCharValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -67644,7 +67644,7 @@ - (void)writeAttributeSpeedSettingWithValue:(NSNumber * _Nullable)value params:( cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedCharValue; + nonNullValue_0 = value.unsignedCharValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -67781,7 +67781,7 @@ - (void)writeAttributeRockSettingWithValue:(NSNumber * _Nonnull)value params:(MT ListFreer listFreer; using TypeInfo = FanControl::Attributes::RockSetting::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedCharValue); + cppValue = static_cast>(value.unsignedCharValue); chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -67881,7 +67881,7 @@ - (void)writeAttributeWindSettingWithValue:(NSNumber * _Nonnull)value params:(MT ListFreer listFreer; using TypeInfo = FanControl::Attributes::WindSetting::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedCharValue); + cppValue = static_cast>(value.unsignedCharValue); chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -67945,7 +67945,7 @@ - (void)writeAttributeAirflowDirectionWithValue:(NSNumber * _Nonnull)value param ListFreer listFreer; using TypeInfo = FanControl::Attributes::AirflowDirection::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedCharValue); + cppValue = static_cast>(value.unsignedCharValue); chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -68812,7 +68812,7 @@ - (void)writeAttributeTemperatureDisplayModeWithValue:(NSNumber * _Nonnull)value ListFreer listFreer; using TypeInfo = ThermostatUserInterfaceConfiguration::Attributes::TemperatureDisplayMode::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedCharValue); + cppValue = static_cast>(value.unsignedCharValue); chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -68876,7 +68876,7 @@ - (void)writeAttributeKeypadLockoutWithValue:(NSNumber * _Nonnull)value params:( ListFreer listFreer; using TypeInfo = ThermostatUserInterfaceConfiguration::Attributes::KeypadLockout::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedCharValue); + cppValue = static_cast>(value.unsignedCharValue); chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -68940,7 +68940,7 @@ - (void)writeAttributeScheduleProgrammingVisibilityWithValue:(NSNumber * _Nonnul ListFreer listFreer; using TypeInfo = ThermostatUserInterfaceConfiguration::Attributes::ScheduleProgrammingVisibility::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedCharValue); + cppValue = static_cast>(value.unsignedCharValue); chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -70284,7 +70284,7 @@ - (void)writeAttributeOptionsWithValue:(NSNumber * _Nonnull)value params:(MTRWri ListFreer listFreer; using TypeInfo = ColorControl::Attributes::Options::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedCharValue); + cppValue = static_cast>(value.unsignedCharValue); chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -71032,7 +71032,7 @@ - (void)writeAttributeWhitePointXWithValue:(NSNumber * _Nonnull)value params:(MT ListFreer listFreer; using TypeInfo = ColorControl::Attributes::WhitePointX::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; + cppValue = value.unsignedShortValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -71096,7 +71096,7 @@ - (void)writeAttributeWhitePointYWithValue:(NSNumber * _Nonnull)value params:(MT ListFreer listFreer; using TypeInfo = ColorControl::Attributes::WhitePointY::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; + cppValue = value.unsignedShortValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -71160,7 +71160,7 @@ - (void)writeAttributeColorPointRXWithValue:(NSNumber * _Nonnull)value params:(M ListFreer listFreer; using TypeInfo = ColorControl::Attributes::ColorPointRX::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; + cppValue = value.unsignedShortValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -71224,7 +71224,7 @@ - (void)writeAttributeColorPointRYWithValue:(NSNumber * _Nonnull)value params:(M ListFreer listFreer; using TypeInfo = ColorControl::Attributes::ColorPointRY::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; + cppValue = value.unsignedShortValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -71292,7 +71292,7 @@ - (void)writeAttributeColorPointRIntensityWithValue:(NSNumber * _Nullable)value cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedCharValue; + nonNullValue_0 = value.unsignedCharValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -71357,7 +71357,7 @@ - (void)writeAttributeColorPointGXWithValue:(NSNumber * _Nonnull)value params:(M ListFreer listFreer; using TypeInfo = ColorControl::Attributes::ColorPointGX::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; + cppValue = value.unsignedShortValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -71421,7 +71421,7 @@ - (void)writeAttributeColorPointGYWithValue:(NSNumber * _Nonnull)value params:(M ListFreer listFreer; using TypeInfo = ColorControl::Attributes::ColorPointGY::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; + cppValue = value.unsignedShortValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -71489,7 +71489,7 @@ - (void)writeAttributeColorPointGIntensityWithValue:(NSNumber * _Nullable)value cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedCharValue; + nonNullValue_0 = value.unsignedCharValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -71554,7 +71554,7 @@ - (void)writeAttributeColorPointBXWithValue:(NSNumber * _Nonnull)value params:(M ListFreer listFreer; using TypeInfo = ColorControl::Attributes::ColorPointBX::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; + cppValue = value.unsignedShortValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -71618,7 +71618,7 @@ - (void)writeAttributeColorPointBYWithValue:(NSNumber * _Nonnull)value params:(M ListFreer listFreer; using TypeInfo = ColorControl::Attributes::ColorPointBY::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; + cppValue = value.unsignedShortValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -71686,7 +71686,7 @@ - (void)writeAttributeColorPointBIntensityWithValue:(NSNumber * _Nullable)value cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedCharValue; + nonNullValue_0 = value.unsignedCharValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -72151,7 +72151,7 @@ - (void)writeAttributeStartUpColorTemperatureMiredsWithValue:(NSNumber * _Nullab cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedShortValue; + nonNullValue_0 = value.unsignedShortValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -74714,7 +74714,7 @@ - (void)writeAttributeMinLevelWithValue:(NSNumber * _Nonnull)value params:(MTRWr ListFreer listFreer; using TypeInfo = BallastConfiguration::Attributes::MinLevel::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; + cppValue = value.unsignedCharValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -74778,7 +74778,7 @@ - (void)writeAttributeMaxLevelWithValue:(NSNumber * _Nonnull)value params:(MTRWr ListFreer listFreer; using TypeInfo = BallastConfiguration::Attributes::MaxLevel::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; + cppValue = value.unsignedCharValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -74846,7 +74846,7 @@ - (void)writeAttributeIntrinsicBallastFactorWithValue:(NSNumber * _Nullable)valu cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedCharValue; + nonNullValue_0 = value.unsignedCharValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -74915,7 +74915,7 @@ - (void)writeAttributeBallastFactorAdjustmentWithValue:(NSNumber * _Nullable)val cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedCharValue; + nonNullValue_0 = value.unsignedCharValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -75148,7 +75148,7 @@ - (void)writeAttributeLampRatedHoursWithValue:(NSNumber * _Nullable)value params cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedIntValue; + nonNullValue_0 = value.unsignedIntValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -75217,7 +75217,7 @@ - (void)writeAttributeLampBurnHoursWithValue:(NSNumber * _Nullable)value params: cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedIntValue; + nonNullValue_0 = value.unsignedIntValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -75282,7 +75282,7 @@ - (void)writeAttributeLampAlarmModeWithValue:(NSNumber * _Nonnull)value params:( ListFreer listFreer; using TypeInfo = BallastConfiguration::Attributes::LampAlarmMode::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedCharValue); + cppValue = static_cast>(value.unsignedCharValue); chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -75350,7 +75350,7 @@ - (void)writeAttributeLampBurnHoursTripPointWithValue:(NSNumber * _Nullable)valu cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedIntValue; + nonNullValue_0 = value.unsignedIntValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -80159,7 +80159,7 @@ - (void)writeAttributeHoldTimeWithValue:(NSNumber * _Nonnull)value params:(MTRWr ListFreer listFreer; using TypeInfo = OccupancySensing::Attributes::HoldTime::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; + cppValue = value.unsignedShortValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -80259,7 +80259,7 @@ - (void)writeAttributePIROccupiedToUnoccupiedDelayWithValue:(NSNumber * _Nonnull ListFreer listFreer; using TypeInfo = OccupancySensing::Attributes::PIROccupiedToUnoccupiedDelay::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; + cppValue = value.unsignedShortValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -80323,7 +80323,7 @@ - (void)writeAttributePIRUnoccupiedToOccupiedDelayWithValue:(NSNumber * _Nonnull ListFreer listFreer; using TypeInfo = OccupancySensing::Attributes::PIRUnoccupiedToOccupiedDelay::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; + cppValue = value.unsignedShortValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -80387,7 +80387,7 @@ - (void)writeAttributePIRUnoccupiedToOccupiedThresholdWithValue:(NSNumber * _Non ListFreer listFreer; using TypeInfo = OccupancySensing::Attributes::PIRUnoccupiedToOccupiedThreshold::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; + cppValue = value.unsignedCharValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -80451,7 +80451,7 @@ - (void)writeAttributeUltrasonicOccupiedToUnoccupiedDelayWithValue:(NSNumber * _ ListFreer listFreer; using TypeInfo = OccupancySensing::Attributes::UltrasonicOccupiedToUnoccupiedDelay::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; + cppValue = value.unsignedShortValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -80515,7 +80515,7 @@ - (void)writeAttributeUltrasonicUnoccupiedToOccupiedDelayWithValue:(NSNumber * _ ListFreer listFreer; using TypeInfo = OccupancySensing::Attributes::UltrasonicUnoccupiedToOccupiedDelay::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; + cppValue = value.unsignedShortValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -80579,7 +80579,7 @@ - (void)writeAttributeUltrasonicUnoccupiedToOccupiedThresholdWithValue:(NSNumber ListFreer listFreer; using TypeInfo = OccupancySensing::Attributes::UltrasonicUnoccupiedToOccupiedThreshold::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; + cppValue = value.unsignedCharValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -80643,7 +80643,7 @@ - (void)writeAttributePhysicalContactOccupiedToUnoccupiedDelayWithValue:(NSNumbe ListFreer listFreer; using TypeInfo = OccupancySensing::Attributes::PhysicalContactOccupiedToUnoccupiedDelay::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; + cppValue = value.unsignedShortValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -80707,7 +80707,7 @@ - (void)writeAttributePhysicalContactUnoccupiedToOccupiedDelayWithValue:(NSNumbe ListFreer listFreer; using TypeInfo = OccupancySensing::Attributes::PhysicalContactUnoccupiedToOccupiedDelay::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; + cppValue = value.unsignedShortValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -80771,7 +80771,7 @@ - (void)writeAttributePhysicalContactUnoccupiedToOccupiedThresholdWithValue:(NSN ListFreer listFreer; using TypeInfo = OccupancySensing::Attributes::PhysicalContactUnoccupiedToOccupiedThreshold::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; + cppValue = value.unsignedCharValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -93517,7 +93517,7 @@ - (void)writeAttributeSupportedStreamingProtocolsWithValue:(NSNumber * _Nonnull) ListFreer listFreer; using TypeInfo = ContentLauncher::Attributes::SupportedStreamingProtocols::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedIntValue); + cppValue = static_cast>(value.unsignedIntValue); chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -94743,11 +94743,11 @@ - (void)writeAttributeCurrentAppWithValue:(MTRApplicationLauncherClusterApplicat cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0.application.catalogVendorID = value.application.catalogVendorID.unsignedShortValue; - nonNullValue_0.application.applicationID = AsCharSpan(value.application.applicationID); - if (value.endpoint != nil) { - auto & definedValue_2 = nonNullValue_0.endpoint.Emplace(); - definedValue_2 = value.endpoint.unsignedShortValue; + nonNullValue_0.application.catalogVendorID = value.application.catalogVendorID.unsignedShortValue; + nonNullValue_0.application.applicationID = AsCharSpan(value.application.applicationID); + if (value.endpoint != nil) { + auto & definedValue_2 = nonNullValue_0.endpoint.Emplace(); + definedValue_2 = value.endpoint.unsignedShortValue; } } @@ -97838,13 +97838,13 @@ - (void)writeAttributeTriggersWithValue:(NSArray * _Nonnull)value params:(MTRWri MTR_LOG_ERROR("%@ incorrectly present in list of %@", value[i_0], NSStringFromClass(MTRZoneManagementClusterZoneTriggerControlStruct.class)); return CHIP_ERROR_INVALID_ARGUMENT; } - listHolder_0->mList[i_0].initialDuration = element_0.initialDuration.unsignedShortValue; - listHolder_0->mList[i_0].augmentationDuration = element_0.augmentationDuration.unsignedShortValue; - listHolder_0->mList[i_0].maxDuration = element_0.maxDuration.unsignedIntValue; - listHolder_0->mList[i_0].blindDuration = element_0.blindDuration.unsignedShortValue; - if (element_0.sensitivity != nil) { - auto & definedValue_2 = listHolder_0->mList[i_0].sensitivity.Emplace(); - definedValue_2 = element_0.sensitivity.unsignedCharValue; + listHolder_0->mList[i_0].initialDuration = element_0.initialDuration.unsignedShortValue; + listHolder_0->mList[i_0].augmentationDuration = element_0.augmentationDuration.unsignedShortValue; + listHolder_0->mList[i_0].maxDuration = element_0.maxDuration.unsignedIntValue; + listHolder_0->mList[i_0].blindDuration = element_0.blindDuration.unsignedShortValue; + if (element_0.sensitivity != nil) { + auto & definedValue_2 = listHolder_0->mList[i_0].sensitivity.Emplace(); + definedValue_2 = element_0.sensitivity.unsignedCharValue; } } cppValue = ListType_0(listHolder_0->mList, value.count); @@ -97915,7 +97915,7 @@ - (void)writeAttributeSensitivityWithValue:(NSNumber * _Nonnull)value params:(MT ListFreer listFreer; using TypeInfo = ZoneManagement::Attributes::Sensitivity::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; + cppValue = value.unsignedCharValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -98848,7 +98848,7 @@ - (void)writeAttributeHDRModeEnabledWithValue:(NSNumber * _Nonnull)value params: ListFreer listFreer; using TypeInfo = CameraAvStreamManagement::Attributes::HDRModeEnabled::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.boolValue; + cppValue = value.boolValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -99092,7 +99092,7 @@ - (void)writeAttributeSoftRecordingPrivacyModeEnabledWithValue:(NSNumber * _Nonn ListFreer listFreer; using TypeInfo = CameraAvStreamManagement::Attributes::SoftRecordingPrivacyModeEnabled::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.boolValue; + cppValue = value.boolValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -99156,7 +99156,7 @@ - (void)writeAttributeSoftLivestreamPrivacyModeEnabledWithValue:(NSNumber * _Non ListFreer listFreer; using TypeInfo = CameraAvStreamManagement::Attributes::SoftLivestreamPrivacyModeEnabled::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.boolValue; + cppValue = value.boolValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -99256,7 +99256,7 @@ - (void)writeAttributeNightVisionWithValue:(NSNumber * _Nonnull)value params:(MT ListFreer listFreer; using TypeInfo = CameraAvStreamManagement::Attributes::NightVision::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedCharValue); + cppValue = static_cast>(value.unsignedCharValue); chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -99320,7 +99320,7 @@ - (void)writeAttributeNightVisionIllumWithValue:(NSNumber * _Nonnull)value param ListFreer listFreer; using TypeInfo = CameraAvStreamManagement::Attributes::NightVisionIllum::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedCharValue); + cppValue = static_cast>(value.unsignedCharValue); chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -99384,10 +99384,10 @@ - (void)writeAttributeViewportWithValue:(MTRCameraAVStreamManagementClusterViewp ListFreer listFreer; using TypeInfo = CameraAvStreamManagement::Attributes::Viewport::TypeInfo; TypeInfo::Type cppValue; - cppValue.x1 = value.x1.unsignedShortValue; - cppValue.y1 = value.y1.unsignedShortValue; - cppValue.x2 = value.x2.unsignedShortValue; - cppValue.y2 = value.y2.unsignedShortValue; + cppValue.x1 = value.x1.unsignedShortValue; + cppValue.y1 = value.y1.unsignedShortValue; + cppValue.x2 = value.x2.unsignedShortValue; + cppValue.y2 = value.y2.unsignedShortValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -99451,7 +99451,7 @@ - (void)writeAttributeSpeakerMutedWithValue:(NSNumber * _Nonnull)value params:(M ListFreer listFreer; using TypeInfo = CameraAvStreamManagement::Attributes::SpeakerMuted::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.boolValue; + cppValue = value.boolValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -99515,7 +99515,7 @@ - (void)writeAttributeSpeakerVolumeLevelWithValue:(NSNumber * _Nonnull)value par ListFreer listFreer; using TypeInfo = CameraAvStreamManagement::Attributes::SpeakerVolumeLevel::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; + cppValue = value.unsignedCharValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -99651,7 +99651,7 @@ - (void)writeAttributeMicrophoneMutedWithValue:(NSNumber * _Nonnull)value params ListFreer listFreer; using TypeInfo = CameraAvStreamManagement::Attributes::MicrophoneMuted::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.boolValue; + cppValue = value.boolValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -99715,7 +99715,7 @@ - (void)writeAttributeMicrophoneVolumeLevelWithValue:(NSNumber * _Nonnull)value ListFreer listFreer; using TypeInfo = CameraAvStreamManagement::Attributes::MicrophoneVolumeLevel::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; + cppValue = value.unsignedCharValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -99851,7 +99851,7 @@ - (void)writeAttributeMicrophoneAGCEnabledWithValue:(NSNumber * _Nonnull)value p ListFreer listFreer; using TypeInfo = CameraAvStreamManagement::Attributes::MicrophoneAGCEnabled::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.boolValue; + cppValue = value.boolValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -99915,7 +99915,7 @@ - (void)writeAttributeImageRotationWithValue:(NSNumber * _Nonnull)value params:( ListFreer listFreer; using TypeInfo = CameraAvStreamManagement::Attributes::ImageRotation::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; + cppValue = value.unsignedShortValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -99979,7 +99979,7 @@ - (void)writeAttributeImageFlipHorizontalWithValue:(NSNumber * _Nonnull)value pa ListFreer listFreer; using TypeInfo = CameraAvStreamManagement::Attributes::ImageFlipHorizontal::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.boolValue; + cppValue = value.boolValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -100043,7 +100043,7 @@ - (void)writeAttributeImageFlipVerticalWithValue:(NSNumber * _Nonnull)value para ListFreer listFreer; using TypeInfo = CameraAvStreamManagement::Attributes::ImageFlipVertical::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.boolValue; + cppValue = value.boolValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -100107,7 +100107,7 @@ - (void)writeAttributeLocalVideoRecordingEnabledWithValue:(NSNumber * _Nonnull)v ListFreer listFreer; using TypeInfo = CameraAvStreamManagement::Attributes::LocalVideoRecordingEnabled::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.boolValue; + cppValue = value.boolValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -100171,7 +100171,7 @@ - (void)writeAttributeLocalSnapshotRecordingEnabledWithValue:(NSNumber * _Nonnul ListFreer listFreer; using TypeInfo = CameraAvStreamManagement::Attributes::LocalSnapshotRecordingEnabled::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.boolValue; + cppValue = value.boolValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -100235,7 +100235,7 @@ - (void)writeAttributeStatusLightEnabledWithValue:(NSNumber * _Nonnull)value par ListFreer listFreer; using TypeInfo = CameraAvStreamManagement::Attributes::StatusLightEnabled::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.boolValue; + cppValue = value.boolValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -100299,7 +100299,7 @@ - (void)writeAttributeStatusLightBrightnessWithValue:(NSNumber * _Nonnull)value ListFreer listFreer; using TypeInfo = CameraAvStreamManagement::Attributes::StatusLightBrightness::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedCharValue); + cppValue = static_cast>(value.unsignedCharValue); chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -101270,7 +101270,7 @@ - (void)writeAttributeActiveChimeIDWithValue:(NSNumber * _Nonnull)value params:( ListFreer listFreer; using TypeInfo = Chime::Attributes::ActiveChimeID::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; + cppValue = value.unsignedCharValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -101334,7 +101334,7 @@ - (void)writeAttributeEnabledWithValue:(NSNumber * _Nonnull)value params:(MTRWri ListFreer listFreer; using TypeInfo = Chime::Attributes::Enabled::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.boolValue; + cppValue = value.boolValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -102787,7 +102787,7 @@ - (void)writeAttributeBooleanWithValue:(NSNumber * _Nonnull)value params:(MTRWri ListFreer listFreer; using TypeInfo = UnitTesting::Attributes::Boolean::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.boolValue; + cppValue = value.boolValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -102851,7 +102851,7 @@ - (void)writeAttributeBitmap8WithValue:(NSNumber * _Nonnull)value params:(MTRWri ListFreer listFreer; using TypeInfo = UnitTesting::Attributes::Bitmap8::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedCharValue); + cppValue = static_cast>(value.unsignedCharValue); chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -102915,7 +102915,7 @@ - (void)writeAttributeBitmap16WithValue:(NSNumber * _Nonnull)value params:(MTRWr ListFreer listFreer; using TypeInfo = UnitTesting::Attributes::Bitmap16::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedShortValue); + cppValue = static_cast>(value.unsignedShortValue); chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -102979,7 +102979,7 @@ - (void)writeAttributeBitmap32WithValue:(NSNumber * _Nonnull)value params:(MTRWr ListFreer listFreer; using TypeInfo = UnitTesting::Attributes::Bitmap32::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedIntValue); + cppValue = static_cast>(value.unsignedIntValue); chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -103043,7 +103043,7 @@ - (void)writeAttributeBitmap64WithValue:(NSNumber * _Nonnull)value params:(MTRWr ListFreer listFreer; using TypeInfo = UnitTesting::Attributes::Bitmap64::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedLongLongValue); + cppValue = static_cast>(value.unsignedLongLongValue); chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -103107,7 +103107,7 @@ - (void)writeAttributeInt8uWithValue:(NSNumber * _Nonnull)value params:(MTRWrite ListFreer listFreer; using TypeInfo = UnitTesting::Attributes::Int8u::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; + cppValue = value.unsignedCharValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -103171,7 +103171,7 @@ - (void)writeAttributeInt16uWithValue:(NSNumber * _Nonnull)value params:(MTRWrit ListFreer listFreer; using TypeInfo = UnitTesting::Attributes::Int16u::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; + cppValue = value.unsignedShortValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -103235,7 +103235,7 @@ - (void)writeAttributeInt24uWithValue:(NSNumber * _Nonnull)value params:(MTRWrit ListFreer listFreer; using TypeInfo = UnitTesting::Attributes::Int24u::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedIntValue; + cppValue = value.unsignedIntValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -103299,7 +103299,7 @@ - (void)writeAttributeInt32uWithValue:(NSNumber * _Nonnull)value params:(MTRWrit ListFreer listFreer; using TypeInfo = UnitTesting::Attributes::Int32u::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedIntValue; + cppValue = value.unsignedIntValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -103363,7 +103363,7 @@ - (void)writeAttributeInt40uWithValue:(NSNumber * _Nonnull)value params:(MTRWrit ListFreer listFreer; using TypeInfo = UnitTesting::Attributes::Int40u::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedLongLongValue; + cppValue = value.unsignedLongLongValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -103427,7 +103427,7 @@ - (void)writeAttributeInt48uWithValue:(NSNumber * _Nonnull)value params:(MTRWrit ListFreer listFreer; using TypeInfo = UnitTesting::Attributes::Int48u::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedLongLongValue; + cppValue = value.unsignedLongLongValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -103491,7 +103491,7 @@ - (void)writeAttributeInt56uWithValue:(NSNumber * _Nonnull)value params:(MTRWrit ListFreer listFreer; using TypeInfo = UnitTesting::Attributes::Int56u::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedLongLongValue; + cppValue = value.unsignedLongLongValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -103555,7 +103555,7 @@ - (void)writeAttributeInt64uWithValue:(NSNumber * _Nonnull)value params:(MTRWrit ListFreer listFreer; using TypeInfo = UnitTesting::Attributes::Int64u::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedLongLongValue; + cppValue = value.unsignedLongLongValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -103619,7 +103619,7 @@ - (void)writeAttributeInt8sWithValue:(NSNumber * _Nonnull)value params:(MTRWrite ListFreer listFreer; using TypeInfo = UnitTesting::Attributes::Int8s::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.charValue; + cppValue = value.charValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -103683,7 +103683,7 @@ - (void)writeAttributeInt16sWithValue:(NSNumber * _Nonnull)value params:(MTRWrit ListFreer listFreer; using TypeInfo = UnitTesting::Attributes::Int16s::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.shortValue; + cppValue = value.shortValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -103747,7 +103747,7 @@ - (void)writeAttributeInt24sWithValue:(NSNumber * _Nonnull)value params:(MTRWrit ListFreer listFreer; using TypeInfo = UnitTesting::Attributes::Int24s::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.intValue; + cppValue = value.intValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -103811,7 +103811,7 @@ - (void)writeAttributeInt32sWithValue:(NSNumber * _Nonnull)value params:(MTRWrit ListFreer listFreer; using TypeInfo = UnitTesting::Attributes::Int32s::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.intValue; + cppValue = value.intValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -103875,7 +103875,7 @@ - (void)writeAttributeInt40sWithValue:(NSNumber * _Nonnull)value params:(MTRWrit ListFreer listFreer; using TypeInfo = UnitTesting::Attributes::Int40s::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.longLongValue; + cppValue = value.longLongValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -103939,7 +103939,7 @@ - (void)writeAttributeInt48sWithValue:(NSNumber * _Nonnull)value params:(MTRWrit ListFreer listFreer; using TypeInfo = UnitTesting::Attributes::Int48s::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.longLongValue; + cppValue = value.longLongValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -104003,7 +104003,7 @@ - (void)writeAttributeInt56sWithValue:(NSNumber * _Nonnull)value params:(MTRWrit ListFreer listFreer; using TypeInfo = UnitTesting::Attributes::Int56s::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.longLongValue; + cppValue = value.longLongValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -104067,7 +104067,7 @@ - (void)writeAttributeInt64sWithValue:(NSNumber * _Nonnull)value params:(MTRWrit ListFreer listFreer; using TypeInfo = UnitTesting::Attributes::Int64s::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.longLongValue; + cppValue = value.longLongValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -104131,7 +104131,7 @@ - (void)writeAttributeEnum8WithValue:(NSNumber * _Nonnull)value params:(MTRWrite ListFreer listFreer; using TypeInfo = UnitTesting::Attributes::Enum8::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; + cppValue = value.unsignedCharValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -104195,7 +104195,7 @@ - (void)writeAttributeEnum16WithValue:(NSNumber * _Nonnull)value params:(MTRWrit ListFreer listFreer; using TypeInfo = UnitTesting::Attributes::Enum16::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; + cppValue = value.unsignedShortValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -104259,7 +104259,7 @@ - (void)writeAttributeFloatSingleWithValue:(NSNumber * _Nonnull)value params:(MT ListFreer listFreer; using TypeInfo = UnitTesting::Attributes::FloatSingle::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.floatValue; + cppValue = value.floatValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -104323,7 +104323,7 @@ - (void)writeAttributeFloatDoubleWithValue:(NSNumber * _Nonnull)value params:(MT ListFreer listFreer; using TypeInfo = UnitTesting::Attributes::FloatDouble::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.doubleValue; + cppValue = value.doubleValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -104467,7 +104467,7 @@ - (void)writeAttributeListInt8uWithValue:(NSArray * _Nonnull)value params:(MTRWr MTR_LOG_ERROR("%@ incorrectly present in list of %@", value[i_0], NSStringFromClass(NSNumber.class)); return CHIP_ERROR_INVALID_ARGUMENT; } - listHolder_0->mList[i_0] = element_0.unsignedCharValue; + listHolder_0->mList[i_0] = element_0.unsignedCharValue; } cppValue = ListType_0(listHolder_0->mList, value.count); } else { @@ -104639,8 +104639,8 @@ - (void)writeAttributeListStructOctetStringWithValue:(NSArray * _Nonnull)value p MTR_LOG_ERROR("%@ incorrectly present in list of %@", value[i_0], NSStringFromClass(MTRUnitTestingClusterTestListStructOctet.class)); return CHIP_ERROR_INVALID_ARGUMENT; } - listHolder_0->mList[i_0].member1 = element_0.member1.unsignedLongLongValue; - listHolder_0->mList[i_0].member2 = AsByteSpan(element_0.member2); + listHolder_0->mList[i_0].member1 = element_0.member1.unsignedLongLongValue; + listHolder_0->mList[i_0].member2 = AsByteSpan(element_0.member2); } cppValue = ListType_0(listHolder_0->mList, value.count); } else { @@ -104902,7 +104902,7 @@ - (void)writeAttributeEpochUsWithValue:(NSNumber * _Nonnull)value params:(MTRWri ListFreer listFreer; using TypeInfo = UnitTesting::Attributes::EpochUs::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedLongLongValue; + cppValue = value.unsignedLongLongValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -104966,7 +104966,7 @@ - (void)writeAttributeEpochSWithValue:(NSNumber * _Nonnull)value params:(MTRWrit ListFreer listFreer; using TypeInfo = UnitTesting::Attributes::EpochS::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedIntValue; + cppValue = value.unsignedIntValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -105030,7 +105030,7 @@ - (void)writeAttributeVendorIdWithValue:(NSNumber * _Nonnull)value params:(MTRWr ListFreer listFreer; using TypeInfo = UnitTesting::Attributes::VendorId::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedShortValue); + cppValue = static_cast>(value.unsignedShortValue); chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -105110,181 +105110,215 @@ - (void)writeAttributeListNullablesAndOptionalsStructWithValue:(NSArray * _Nonnu MTR_LOG_ERROR("%@ incorrectly present in list of %@", value[i_0], NSStringFromClass(MTRUnitTestingClusterNullablesAndOptionalsStruct.class)); return CHIP_ERROR_INVALID_ARGUMENT; } - if (element_0.nullableInt == nil) { - listHolder_0->mList[i_0].nullableInt.SetNull(); - } else { - auto & nonNullValue_2 = listHolder_0->mList[i_0].nullableInt.SetNonNull(); - nonNullValue_2 = element_0.nullableInt.unsignedShortValue; + if (element_0.nullableInt == nil) { + listHolder_0->mList[i_0].nullableInt.SetNull(); + } else { + auto & nonNullValue_2 = listHolder_0->mList[i_0].nullableInt.SetNonNull(); + nonNullValue_2 = element_0.nullableInt.unsignedShortValue; } - if (element_0.optionalInt != nil) { - auto & definedValue_2 = listHolder_0->mList[i_0].optionalInt.Emplace(); - definedValue_2 = element_0.optionalInt.unsignedShortValue; + if (element_0.optionalInt != nil) { + auto & definedValue_2 = listHolder_0->mList[i_0].optionalInt.Emplace(); + definedValue_2 = element_0.optionalInt.unsignedShortValue; } - if (element_0.nullableOptionalInt != nil) { - auto & definedValue_2 = listHolder_0->mList[i_0].nullableOptionalInt.Emplace(); - if (element_0.nullableOptionalInt == nil) { - definedValue_2.SetNull(); - } else { - auto & nonNullValue_3 = definedValue_2.SetNonNull(); - nonNullValue_3 = element_0.nullableOptionalInt.unsignedShortValue; + if (element_0.nullableOptionalInt != nil) { + auto & definedValue_2 = listHolder_0->mList[i_0].nullableOptionalInt.Emplace(); + if (element_0.nullableOptionalInt == nil) { + definedValue_2.SetNull(); + } else { + auto & nonNullValue_3 = definedValue_2.SetNonNull(); + nonNullValue_3 = element_0.nullableOptionalInt.unsignedShortValue; } - } - if (element_0.nullableString == nil) { - listHolder_0->mList[i_0].nullableString.SetNull(); - } else { - auto & nonNullValue_2 = listHolder_0->mList[i_0].nullableString.SetNonNull(); - nonNullValue_2 = AsCharSpan(element_0.nullableString); - } - if (element_0.optionalString != nil) { - auto & definedValue_2 = listHolder_0->mList[i_0].optionalString.Emplace(); - definedValue_2 = AsCharSpan(element_0.optionalString); - } - if (element_0.nullableOptionalString != nil) { - auto & definedValue_2 = listHolder_0->mList[i_0].nullableOptionalString.Emplace(); - if (element_0.nullableOptionalString == nil) { - definedValue_2.SetNull(); - } else { - auto & nonNullValue_3 = definedValue_2.SetNonNull(); - nonNullValue_3 = AsCharSpan(element_0.nullableOptionalString); - } - } - if (element_0.nullableStruct == nil) { - listHolder_0->mList[i_0].nullableStruct.SetNull(); - } else { - auto & nonNullValue_2 = listHolder_0->mList[i_0].nullableStruct.SetNonNull(); - nonNullValue_2.a = element_0.nullableStruct.a.unsignedCharValue; - nonNullValue_2.b = element_0.nullableStruct.b.boolValue; - nonNullValue_2.c = static_cast>(element_0.nullableStruct.c.unsignedCharValue); - nonNullValue_2.d = AsByteSpan(element_0.nullableStruct.d); - nonNullValue_2.e = AsCharSpan(element_0.nullableStruct.e); - nonNullValue_2.f = static_cast>(element_0.nullableStruct.f.unsignedCharValue); - nonNullValue_2.g = element_0.nullableStruct.g.floatValue; - nonNullValue_2.h = element_0.nullableStruct.h.doubleValue; - if (element_0.nullableStruct.i != nil) { - auto & definedValue_4 = nonNullValue_2.i.Emplace(); - definedValue_4 = static_cast>(element_0.nullableStruct.i.unsignedCharValue); + } + if (element_0.nullableString == nil) { + listHolder_0->mList[i_0].nullableString.SetNull(); + } else { + auto & nonNullValue_2 = listHolder_0->mList[i_0].nullableString.SetNonNull(); + nonNullValue_2 = AsCharSpan(element_0.nullableString); + } + if (element_0.optionalString != nil) { + auto & definedValue_2 = listHolder_0->mList[i_0].optionalString.Emplace(); + definedValue_2 = AsCharSpan(element_0.optionalString); + } + if (element_0.nullableOptionalString != nil) { + auto & definedValue_2 = listHolder_0->mList[i_0].nullableOptionalString.Emplace(); + if (element_0.nullableOptionalString == nil) { + definedValue_2.SetNull(); + } else { + auto & nonNullValue_3 = definedValue_2.SetNonNull(); + nonNullValue_3 = AsCharSpan(element_0.nullableOptionalString); + } + } + if (element_0.nullableStruct == nil) { + listHolder_0->mList[i_0].nullableStruct.SetNull(); + } else { + auto & nonNullValue_2 = listHolder_0->mList[i_0].nullableStruct.SetNonNull(); + nonNullValue_2.a = element_0.nullableStruct.a.unsignedCharValue; + nonNullValue_2.b = element_0.nullableStruct.b.boolValue; + nonNullValue_2.c = static_cast>(element_0.nullableStruct.c.unsignedCharValue); + nonNullValue_2.d = AsByteSpan(element_0.nullableStruct.d); + nonNullValue_2.e = AsCharSpan(element_0.nullableStruct.e); + nonNullValue_2.f = static_cast>(element_0.nullableStruct.f.unsignedCharValue); + nonNullValue_2.g = element_0.nullableStruct.g.floatValue; + nonNullValue_2.h = element_0.nullableStruct.h.doubleValue; + if (element_0.nullableStruct.i != nil) { + auto & definedValue_4 = nonNullValue_2.i.Emplace(); + definedValue_4 = static_cast>(element_0.nullableStruct.i.unsignedCharValue); } + if (element_0.nullableStruct.j != nil) { + auto & definedValue_4 = nonNullValue_2.j.Emplace(); + definedValue_4 = element_0.nullableStruct.j.unsignedLongLongValue; } - if (element_0.optionalStruct != nil) { - auto & definedValue_2 = listHolder_0->mList[i_0].optionalStruct.Emplace(); - definedValue_2.a = element_0.optionalStruct.a.unsignedCharValue; - definedValue_2.b = element_0.optionalStruct.b.boolValue; - definedValue_2.c = static_cast>(element_0.optionalStruct.c.unsignedCharValue); - definedValue_2.d = AsByteSpan(element_0.optionalStruct.d); - definedValue_2.e = AsCharSpan(element_0.optionalStruct.e); - definedValue_2.f = static_cast>(element_0.optionalStruct.f.unsignedCharValue); - definedValue_2.g = element_0.optionalStruct.g.floatValue; - definedValue_2.h = element_0.optionalStruct.h.doubleValue; - if (element_0.optionalStruct.i != nil) { - auto & definedValue_4 = definedValue_2.i.Emplace(); - definedValue_4 = static_cast>(element_0.optionalStruct.i.unsignedCharValue); + nonNullValue_2.k = element_0.nullableStruct.k.unsignedIntValue; } + if (element_0.optionalStruct != nil) { + auto & definedValue_2 = listHolder_0->mList[i_0].optionalStruct.Emplace(); + definedValue_2.a = element_0.optionalStruct.a.unsignedCharValue; + definedValue_2.b = element_0.optionalStruct.b.boolValue; + definedValue_2.c = static_cast>(element_0.optionalStruct.c.unsignedCharValue); + definedValue_2.d = AsByteSpan(element_0.optionalStruct.d); + definedValue_2.e = AsCharSpan(element_0.optionalStruct.e); + definedValue_2.f = static_cast>(element_0.optionalStruct.f.unsignedCharValue); + definedValue_2.g = element_0.optionalStruct.g.floatValue; + definedValue_2.h = element_0.optionalStruct.h.doubleValue; + if (element_0.optionalStruct.i != nil) { + auto & definedValue_4 = definedValue_2.i.Emplace(); + definedValue_4 = static_cast>(element_0.optionalStruct.i.unsignedCharValue); } - if (element_0.nullableOptionalStruct != nil) { - auto & definedValue_2 = listHolder_0->mList[i_0].nullableOptionalStruct.Emplace(); - if (element_0.nullableOptionalStruct == nil) { - definedValue_2.SetNull(); - } else { - auto & nonNullValue_3 = definedValue_2.SetNonNull(); - nonNullValue_3.a = element_0.nullableOptionalStruct.a.unsignedCharValue; - nonNullValue_3.b = element_0.nullableOptionalStruct.b.boolValue; - nonNullValue_3.c = static_cast>(element_0.nullableOptionalStruct.c.unsignedCharValue); - nonNullValue_3.d = AsByteSpan(element_0.nullableOptionalStruct.d); - nonNullValue_3.e = AsCharSpan(element_0.nullableOptionalStruct.e); - nonNullValue_3.f = static_cast>(element_0.nullableOptionalStruct.f.unsignedCharValue); - nonNullValue_3.g = element_0.nullableOptionalStruct.g.floatValue; - nonNullValue_3.h = element_0.nullableOptionalStruct.h.doubleValue; - if (element_0.nullableOptionalStruct.i != nil) { - auto & definedValue_5 = nonNullValue_3.i.Emplace(); - definedValue_5 = static_cast>(element_0.nullableOptionalStruct.i.unsignedCharValue); + if (element_0.optionalStruct.j != nil) { + auto & definedValue_4 = definedValue_2.j.Emplace(); + definedValue_4 = element_0.optionalStruct.j.unsignedLongLongValue; } + definedValue_2.k = element_0.optionalStruct.k.unsignedIntValue; } - } - if (element_0.nullableList == nil) { - listHolder_0->mList[i_0].nullableList.SetNull(); - } else { - auto & nonNullValue_2 = listHolder_0->mList[i_0].nullableList.SetNonNull(); - { - using ListType_3 = std::remove_reference_t; - using ListMemberType_3 = ListMemberTypeGetter::Type; - if (element_0.nullableList.count != 0) { - auto * listHolder_3 = new ListHolder(element_0.nullableList.count); - if (listHolder_3 == nullptr || listHolder_3->mList == nullptr) { + if (element_0.nullableOptionalStruct != nil) { + auto & definedValue_2 = listHolder_0->mList[i_0].nullableOptionalStruct.Emplace(); + if (element_0.nullableOptionalStruct == nil) { + definedValue_2.SetNull(); + } else { + auto & nonNullValue_3 = definedValue_2.SetNonNull(); + nonNullValue_3.a = element_0.nullableOptionalStruct.a.unsignedCharValue; + nonNullValue_3.b = element_0.nullableOptionalStruct.b.boolValue; + nonNullValue_3.c = static_cast>(element_0.nullableOptionalStruct.c.unsignedCharValue); + nonNullValue_3.d = AsByteSpan(element_0.nullableOptionalStruct.d); + nonNullValue_3.e = AsCharSpan(element_0.nullableOptionalStruct.e); + nonNullValue_3.f = static_cast>(element_0.nullableOptionalStruct.f.unsignedCharValue); + nonNullValue_3.g = element_0.nullableOptionalStruct.g.floatValue; + nonNullValue_3.h = element_0.nullableOptionalStruct.h.doubleValue; + if (element_0.nullableOptionalStruct.i != nil) { + auto & definedValue_5 = nonNullValue_3.i.Emplace(); + definedValue_5 = static_cast>(element_0.nullableOptionalStruct.i.unsignedCharValue); + } + if (element_0.nullableOptionalStruct.j != nil) { + auto & definedValue_5 = nonNullValue_3.j.Emplace(); + definedValue_5 = element_0.nullableOptionalStruct.j.unsignedLongLongValue; + } + nonNullValue_3.k = element_0.nullableOptionalStruct.k.unsignedIntValue; + } + } + if (element_0.nullableList == nil) { + listHolder_0->mList[i_0].nullableList.SetNull(); + } else { + auto & nonNullValue_2 = listHolder_0->mList[i_0].nullableList.SetNonNull(); + { + using ListType_3 = std::remove_reference_t; + using ListMemberType_3 = ListMemberTypeGetter::Type; + if (element_0.nullableList.count != 0) { + auto * listHolder_3 = new ListHolder(element_0.nullableList.count); + if (listHolder_3 == nullptr || listHolder_3->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_3); + for (size_t i_3 = 0; i_3 < element_0.nullableList.count; ++i_3) { + auto element_3 = MTR_SAFE_CAST(element_0.nullableList[i_3], NSNumber); + if (!element_3) { + // Wrong kind of value. + MTR_LOG_ERROR("%@ incorrectly present in list of %@", element_0.nullableList[i_3], NSStringFromClass(NSNumber.class)); return CHIP_ERROR_INVALID_ARGUMENT; } - listFreer.add(listHolder_3); - for (size_t i_3 = 0; i_3 < element_0.nullableList.count; ++i_3) { - auto element_3 = MTR_SAFE_CAST(element_0.nullableList[i_3], NSNumber); - if (!element_3) { - // Wrong kind of value. - MTR_LOG_ERROR("%@ incorrectly present in list of %@", element_0.nullableList[i_3], NSStringFromClass(NSNumber.class)); - return CHIP_ERROR_INVALID_ARGUMENT; - } - listHolder_3->mList[i_3] = static_castmList[i_3])>>(element_3.unsignedCharValue); + listHolder_3->mList[i_3] = static_castmList[i_3])>>(element_3.unsignedCharValue); } - nonNullValue_2 = ListType_3(listHolder_3->mList, element_0.nullableList.count); - } else { - nonNullValue_2 = ListType_3(); - } + nonNullValue_2 = ListType_3(listHolder_3->mList, element_0.nullableList.count); + } else { + nonNullValue_2 = ListType_3(); } - } - if (element_0.optionalList != nil) { - auto & definedValue_2 = listHolder_0->mList[i_0].optionalList.Emplace(); - { - using ListType_3 = std::remove_reference_t; - using ListMemberType_3 = ListMemberTypeGetter::Type; - if (element_0.optionalList.count != 0) { - auto * listHolder_3 = new ListHolder(element_0.optionalList.count); - if (listHolder_3 == nullptr || listHolder_3->mList == nullptr) { + } + } + if (element_0.optionalList != nil) { + auto & definedValue_2 = listHolder_0->mList[i_0].optionalList.Emplace(); + { + using ListType_3 = std::remove_reference_t; + using ListMemberType_3 = ListMemberTypeGetter::Type; + if (element_0.optionalList.count != 0) { + auto * listHolder_3 = new ListHolder(element_0.optionalList.count); + if (listHolder_3 == nullptr || listHolder_3->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_3); + for (size_t i_3 = 0; i_3 < element_0.optionalList.count; ++i_3) { + auto element_3 = MTR_SAFE_CAST(element_0.optionalList[i_3], NSNumber); + if (!element_3) { + // Wrong kind of value. + MTR_LOG_ERROR("%@ incorrectly present in list of %@", element_0.optionalList[i_3], NSStringFromClass(NSNumber.class)); return CHIP_ERROR_INVALID_ARGUMENT; } - listFreer.add(listHolder_3); - for (size_t i_3 = 0; i_3 < element_0.optionalList.count; ++i_3) { - auto element_3 = MTR_SAFE_CAST(element_0.optionalList[i_3], NSNumber); - if (!element_3) { - // Wrong kind of value. - MTR_LOG_ERROR("%@ incorrectly present in list of %@", element_0.optionalList[i_3], NSStringFromClass(NSNumber.class)); - return CHIP_ERROR_INVALID_ARGUMENT; - } - listHolder_3->mList[i_3] = static_castmList[i_3])>>(element_3.unsignedCharValue); + listHolder_3->mList[i_3] = static_castmList[i_3])>>(element_3.unsignedCharValue); } - definedValue_2 = ListType_3(listHolder_3->mList, element_0.optionalList.count); - } else { - definedValue_2 = ListType_3(); - } - } - } - if (element_0.nullableOptionalList != nil) { - auto & definedValue_2 = listHolder_0->mList[i_0].nullableOptionalList.Emplace(); - if (element_0.nullableOptionalList == nil) { - definedValue_2.SetNull(); + definedValue_2 = ListType_3(listHolder_3->mList, element_0.optionalList.count); } else { - auto & nonNullValue_3 = definedValue_2.SetNonNull(); - { - using ListType_4 = std::remove_reference_t; - using ListMemberType_4 = ListMemberTypeGetter::Type; - if (element_0.nullableOptionalList.count != 0) { - auto * listHolder_4 = new ListHolder(element_0.nullableOptionalList.count); - if (listHolder_4 == nullptr || listHolder_4->mList == nullptr) { + definedValue_2 = ListType_3(); + } + } + } + if (element_0.nullableOptionalList != nil) { + auto & definedValue_2 = listHolder_0->mList[i_0].nullableOptionalList.Emplace(); + if (element_0.nullableOptionalList == nil) { + definedValue_2.SetNull(); + } else { + auto & nonNullValue_3 = definedValue_2.SetNonNull(); + { + using ListType_4 = std::remove_reference_t; + using ListMemberType_4 = ListMemberTypeGetter::Type; + if (element_0.nullableOptionalList.count != 0) { + auto * listHolder_4 = new ListHolder(element_0.nullableOptionalList.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_0.nullableOptionalList.count; ++i_4) { + auto element_4 = MTR_SAFE_CAST(element_0.nullableOptionalList[i_4], NSNumber); + if (!element_4) { + // Wrong kind of value. + MTR_LOG_ERROR("%@ incorrectly present in list of %@", element_0.nullableOptionalList[i_4], NSStringFromClass(NSNumber.class)); return CHIP_ERROR_INVALID_ARGUMENT; } - listFreer.add(listHolder_4); - for (size_t i_4 = 0; i_4 < element_0.nullableOptionalList.count; ++i_4) { - auto element_4 = MTR_SAFE_CAST(element_0.nullableOptionalList[i_4], NSNumber); - if (!element_4) { - // Wrong kind of value. - MTR_LOG_ERROR("%@ incorrectly present in list of %@", element_0.nullableOptionalList[i_4], NSStringFromClass(NSNumber.class)); - return CHIP_ERROR_INVALID_ARGUMENT; - } - listHolder_4->mList[i_4] = static_castmList[i_4])>>(element_4.unsignedCharValue); + listHolder_4->mList[i_4] = static_castmList[i_4])>>(element_4.unsignedCharValue); } - nonNullValue_3 = ListType_4(listHolder_4->mList, element_0.nullableOptionalList.count); - } else { - nonNullValue_3 = ListType_4(); - } + nonNullValue_3 = ListType_4(listHolder_4->mList, element_0.nullableOptionalList.count); + } else { + nonNullValue_3 = ListType_4(); } - } - } + } + } + } + if (element_0.nullableTypedef == nil) { + listHolder_0->mList[i_0].nullableTypedef.SetNull(); + } else { + auto & nonNullValue_2 = listHolder_0->mList[i_0].nullableTypedef.SetNonNull(); + nonNullValue_2 = element_0.nullableTypedef.unsignedLongLongValue; + } + if (element_0.optionalTypedef != nil) { + auto & definedValue_2 = listHolder_0->mList[i_0].optionalTypedef.Emplace(); + definedValue_2 = element_0.optionalTypedef.unsignedLongLongValue; + } + if (element_0.nullableOptionalTypedef != nil) { + auto & definedValue_2 = listHolder_0->mList[i_0].nullableOptionalTypedef.Emplace(); + if (element_0.nullableOptionalTypedef == nil) { + definedValue_2.SetNull(); + } else { + auto & nonNullValue_3 = definedValue_2.SetNonNull(); + nonNullValue_3 = element_0.nullableOptionalTypedef.unsignedLongLongValue; + } + } } cppValue = ListType_0(listHolder_0->mList, value.count); } else { @@ -105354,7 +105388,7 @@ - (void)writeAttributeEnumAttrWithValue:(NSNumber * _Nonnull)value params:(MTRWr ListFreer listFreer; using TypeInfo = UnitTesting::Attributes::EnumAttr::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedCharValue); + cppValue = static_cast>(value.unsignedCharValue); chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -105418,18 +105452,23 @@ - (void)writeAttributeStructAttrWithValue:(MTRUnitTestingClusterSimpleStruct * _ ListFreer listFreer; using TypeInfo = UnitTesting::Attributes::StructAttr::TypeInfo; TypeInfo::Type cppValue; - cppValue.a = value.a.unsignedCharValue; - cppValue.b = value.b.boolValue; - cppValue.c = static_cast>(value.c.unsignedCharValue); - cppValue.d = AsByteSpan(value.d); - cppValue.e = AsCharSpan(value.e); - cppValue.f = static_cast>(value.f.unsignedCharValue); - cppValue.g = value.g.floatValue; - cppValue.h = value.h.doubleValue; - if (value.i != nil) { - auto & definedValue_1 = cppValue.i.Emplace(); - definedValue_1 = static_cast>(value.i.unsignedCharValue); + cppValue.a = value.a.unsignedCharValue; + cppValue.b = value.b.boolValue; + cppValue.c = static_cast>(value.c.unsignedCharValue); + cppValue.d = AsByteSpan(value.d); + cppValue.e = AsCharSpan(value.e); + cppValue.f = static_cast>(value.f.unsignedCharValue); + cppValue.g = value.g.floatValue; + cppValue.h = value.h.doubleValue; + if (value.i != nil) { + auto & definedValue_1 = cppValue.i.Emplace(); + definedValue_1 = static_cast>(value.i.unsignedCharValue); + } + if (value.j != nil) { + auto & definedValue_1 = cppValue.j.Emplace(); + definedValue_1 = value.j.unsignedLongLongValue; } + cppValue.k = value.k.unsignedIntValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -105493,7 +105532,7 @@ - (void)writeAttributeRangeRestrictedInt8uWithValue:(NSNumber * _Nonnull)value p ListFreer listFreer; using TypeInfo = UnitTesting::Attributes::RangeRestrictedInt8u::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; + cppValue = value.unsignedCharValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -105557,7 +105596,7 @@ - (void)writeAttributeRangeRestrictedInt8sWithValue:(NSNumber * _Nonnull)value p ListFreer listFreer; using TypeInfo = UnitTesting::Attributes::RangeRestrictedInt8s::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.charValue; + cppValue = value.charValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -105621,7 +105660,7 @@ - (void)writeAttributeRangeRestrictedInt16uWithValue:(NSNumber * _Nonnull)value ListFreer listFreer; using TypeInfo = UnitTesting::Attributes::RangeRestrictedInt16u::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; + cppValue = value.unsignedShortValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -105685,7 +105724,7 @@ - (void)writeAttributeRangeRestrictedInt16sWithValue:(NSNumber * _Nonnull)value ListFreer listFreer; using TypeInfo = UnitTesting::Attributes::RangeRestrictedInt16s::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.shortValue; + cppValue = value.shortValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -105851,63 +105890,68 @@ - (void)writeAttributeListFabricScopedWithValue:(NSArray * _Nonnull)value params MTR_LOG_ERROR("%@ incorrectly present in list of %@", value[i_0], NSStringFromClass(MTRUnitTestingClusterTestFabricScoped.class)); return CHIP_ERROR_INVALID_ARGUMENT; } - listHolder_0->mList[i_0].fabricSensitiveInt8u = element_0.fabricSensitiveInt8u.unsignedCharValue; - if (element_0.optionalFabricSensitiveInt8u != nil) { - auto & definedValue_2 = listHolder_0->mList[i_0].optionalFabricSensitiveInt8u.Emplace(); - definedValue_2 = element_0.optionalFabricSensitiveInt8u.unsignedCharValue; + listHolder_0->mList[i_0].fabricSensitiveInt8u = element_0.fabricSensitiveInt8u.unsignedCharValue; + if (element_0.optionalFabricSensitiveInt8u != nil) { + auto & definedValue_2 = listHolder_0->mList[i_0].optionalFabricSensitiveInt8u.Emplace(); + definedValue_2 = element_0.optionalFabricSensitiveInt8u.unsignedCharValue; } - if (element_0.nullableFabricSensitiveInt8u == nil) { - listHolder_0->mList[i_0].nullableFabricSensitiveInt8u.SetNull(); - } else { - auto & nonNullValue_2 = listHolder_0->mList[i_0].nullableFabricSensitiveInt8u.SetNonNull(); - nonNullValue_2 = element_0.nullableFabricSensitiveInt8u.unsignedCharValue; + if (element_0.nullableFabricSensitiveInt8u == nil) { + listHolder_0->mList[i_0].nullableFabricSensitiveInt8u.SetNull(); + } else { + auto & nonNullValue_2 = listHolder_0->mList[i_0].nullableFabricSensitiveInt8u.SetNonNull(); + nonNullValue_2 = element_0.nullableFabricSensitiveInt8u.unsignedCharValue; } - if (element_0.nullableOptionalFabricSensitiveInt8u != nil) { - auto & definedValue_2 = listHolder_0->mList[i_0].nullableOptionalFabricSensitiveInt8u.Emplace(); - if (element_0.nullableOptionalFabricSensitiveInt8u == nil) { - definedValue_2.SetNull(); - } else { - auto & nonNullValue_3 = definedValue_2.SetNonNull(); - nonNullValue_3 = element_0.nullableOptionalFabricSensitiveInt8u.unsignedCharValue; + if (element_0.nullableOptionalFabricSensitiveInt8u != nil) { + auto & definedValue_2 = listHolder_0->mList[i_0].nullableOptionalFabricSensitiveInt8u.Emplace(); + if (element_0.nullableOptionalFabricSensitiveInt8u == nil) { + definedValue_2.SetNull(); + } else { + auto & nonNullValue_3 = definedValue_2.SetNonNull(); + nonNullValue_3 = element_0.nullableOptionalFabricSensitiveInt8u.unsignedCharValue; } - } - listHolder_0->mList[i_0].fabricSensitiveCharString = AsCharSpan(element_0.fabricSensitiveCharString); - listHolder_0->mList[i_0].fabricSensitiveStruct.a = element_0.fabricSensitiveStruct.a.unsignedCharValue; - listHolder_0->mList[i_0].fabricSensitiveStruct.b = element_0.fabricSensitiveStruct.b.boolValue; - listHolder_0->mList[i_0].fabricSensitiveStruct.c = static_castmList[i_0].fabricSensitiveStruct.c)>>(element_0.fabricSensitiveStruct.c.unsignedCharValue); - listHolder_0->mList[i_0].fabricSensitiveStruct.d = AsByteSpan(element_0.fabricSensitiveStruct.d); - listHolder_0->mList[i_0].fabricSensitiveStruct.e = AsCharSpan(element_0.fabricSensitiveStruct.e); - listHolder_0->mList[i_0].fabricSensitiveStruct.f = static_castmList[i_0].fabricSensitiveStruct.f)>>(element_0.fabricSensitiveStruct.f.unsignedCharValue); - listHolder_0->mList[i_0].fabricSensitiveStruct.g = element_0.fabricSensitiveStruct.g.floatValue; - listHolder_0->mList[i_0].fabricSensitiveStruct.h = element_0.fabricSensitiveStruct.h.doubleValue; - if (element_0.fabricSensitiveStruct.i != nil) { - auto & definedValue_3 = listHolder_0->mList[i_0].fabricSensitiveStruct.i.Emplace(); - definedValue_3 = static_cast>(element_0.fabricSensitiveStruct.i.unsignedCharValue); + } + listHolder_0->mList[i_0].fabricSensitiveCharString = AsCharSpan(element_0.fabricSensitiveCharString); + listHolder_0->mList[i_0].fabricSensitiveStruct.a = element_0.fabricSensitiveStruct.a.unsignedCharValue; + listHolder_0->mList[i_0].fabricSensitiveStruct.b = element_0.fabricSensitiveStruct.b.boolValue; + listHolder_0->mList[i_0].fabricSensitiveStruct.c = static_castmList[i_0].fabricSensitiveStruct.c)>>(element_0.fabricSensitiveStruct.c.unsignedCharValue); + listHolder_0->mList[i_0].fabricSensitiveStruct.d = AsByteSpan(element_0.fabricSensitiveStruct.d); + listHolder_0->mList[i_0].fabricSensitiveStruct.e = AsCharSpan(element_0.fabricSensitiveStruct.e); + listHolder_0->mList[i_0].fabricSensitiveStruct.f = static_castmList[i_0].fabricSensitiveStruct.f)>>(element_0.fabricSensitiveStruct.f.unsignedCharValue); + listHolder_0->mList[i_0].fabricSensitiveStruct.g = element_0.fabricSensitiveStruct.g.floatValue; + listHolder_0->mList[i_0].fabricSensitiveStruct.h = element_0.fabricSensitiveStruct.h.doubleValue; + if (element_0.fabricSensitiveStruct.i != nil) { + auto & definedValue_3 = listHolder_0->mList[i_0].fabricSensitiveStruct.i.Emplace(); + definedValue_3 = static_cast>(element_0.fabricSensitiveStruct.i.unsignedCharValue); } - { - using ListType_2 = std::remove_reference_tmList[i_0].fabricSensitiveInt8uList)>; - using ListMemberType_2 = ListMemberTypeGetter::Type; - if (element_0.fabricSensitiveInt8uList.count != 0) { - auto * listHolder_2 = new ListHolder(element_0.fabricSensitiveInt8uList.count); - if (listHolder_2 == nullptr || listHolder_2->mList == nullptr) { + if (element_0.fabricSensitiveStruct.j != nil) { + auto & definedValue_3 = listHolder_0->mList[i_0].fabricSensitiveStruct.j.Emplace(); + definedValue_3 = element_0.fabricSensitiveStruct.j.unsignedLongLongValue; + } + listHolder_0->mList[i_0].fabricSensitiveStruct.k = element_0.fabricSensitiveStruct.k.unsignedIntValue; + { + using ListType_2 = std::remove_reference_tmList[i_0].fabricSensitiveInt8uList)>; + using ListMemberType_2 = ListMemberTypeGetter::Type; + if (element_0.fabricSensitiveInt8uList.count != 0) { + auto * listHolder_2 = new ListHolder(element_0.fabricSensitiveInt8uList.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.fabricSensitiveInt8uList.count; ++i_2) { + auto element_2 = MTR_SAFE_CAST(element_0.fabricSensitiveInt8uList[i_2], NSNumber); + if (!element_2) { + // Wrong kind of value. + MTR_LOG_ERROR("%@ incorrectly present in list of %@", element_0.fabricSensitiveInt8uList[i_2], NSStringFromClass(NSNumber.class)); return CHIP_ERROR_INVALID_ARGUMENT; } - listFreer.add(listHolder_2); - for (size_t i_2 = 0; i_2 < element_0.fabricSensitiveInt8uList.count; ++i_2) { - auto element_2 = MTR_SAFE_CAST(element_0.fabricSensitiveInt8uList[i_2], NSNumber); - if (!element_2) { - // Wrong kind of value. - MTR_LOG_ERROR("%@ incorrectly present in list of %@", element_0.fabricSensitiveInt8uList[i_2], NSStringFromClass(NSNumber.class)); - return CHIP_ERROR_INVALID_ARGUMENT; - } - listHolder_2->mList[i_2] = element_2.unsignedCharValue; + listHolder_2->mList[i_2] = element_2.unsignedCharValue; } - listHolder_0->mList[i_0].fabricSensitiveInt8uList = ListType_2(listHolder_2->mList, element_0.fabricSensitiveInt8uList.count); - } else { - listHolder_0->mList[i_0].fabricSensitiveInt8uList = ListType_2(); - } + listHolder_0->mList[i_0].fabricSensitiveInt8uList = ListType_2(listHolder_2->mList, element_0.fabricSensitiveInt8uList.count); + } else { + listHolder_0->mList[i_0].fabricSensitiveInt8uList = ListType_2(); } - listHolder_0->mList[i_0].fabricIndex = element_0.fabricIndex.unsignedCharValue; + } + listHolder_0->mList[i_0].fabricIndex = element_0.fabricIndex.unsignedCharValue; } cppValue = ListType_0(listHolder_0->mList, value.count); } else { @@ -105980,7 +106024,7 @@ - (void)writeAttributeTimedWriteBooleanWithValue:(NSNumber * _Nonnull)value para ListFreer listFreer; using TypeInfo = UnitTesting::Attributes::TimedWriteBoolean::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.boolValue; + cppValue = value.boolValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -106044,7 +106088,7 @@ - (void)writeAttributeGeneralErrorBooleanWithValue:(NSNumber * _Nonnull)value pa ListFreer listFreer; using TypeInfo = UnitTesting::Attributes::GeneralErrorBoolean::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.boolValue; + cppValue = value.boolValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -106108,7 +106152,7 @@ - (void)writeAttributeClusterErrorBooleanWithValue:(NSNumber * _Nonnull)value pa ListFreer listFreer; using TypeInfo = UnitTesting::Attributes::ClusterErrorBoolean::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.boolValue; + cppValue = value.boolValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -106172,7 +106216,7 @@ - (void)writeAttributeGlobalEnumWithValue:(NSNumber * _Nonnull)value params:(MTR ListFreer listFreer; using TypeInfo = UnitTesting::Attributes::GlobalEnum::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedCharValue); + cppValue = static_cast>(value.unsignedCharValue); chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -106236,22 +106280,31 @@ - (void)writeAttributeGlobalStructWithValue:(MTRDataTypeTestGlobalStruct * _Nonn ListFreer listFreer; using TypeInfo = UnitTesting::Attributes::GlobalStruct::TypeInfo; TypeInfo::Type cppValue; - cppValue.name = AsCharSpan(value.name); - if (value.myBitmap == nil) { - cppValue.myBitmap.SetNull(); - } else { - auto & nonNullValue_1 = cppValue.myBitmap.SetNonNull(); - nonNullValue_1 = static_cast>(value.myBitmap.unsignedIntValue); + cppValue.name = AsCharSpan(value.name); + if (value.myBitmap == nil) { + cppValue.myBitmap.SetNull(); + } else { + auto & nonNullValue_1 = cppValue.myBitmap.SetNonNull(); + nonNullValue_1 = static_cast>(value.myBitmap.unsignedIntValue); } - if (value.myEnum != nil) { - auto & definedValue_1 = cppValue.myEnum.Emplace(); - if (value.myEnum == nil) { - definedValue_1.SetNull(); - } else { - auto & nonNullValue_2 = definedValue_1.SetNonNull(); - nonNullValue_2 = static_cast>(value.myEnum.unsignedCharValue); + if (value.myEnum != nil) { + auto & definedValue_1 = cppValue.myEnum.Emplace(); + if (value.myEnum == nil) { + definedValue_1.SetNull(); + } else { + auto & nonNullValue_2 = definedValue_1.SetNonNull(); + nonNullValue_2 = static_cast>(value.myEnum.unsignedCharValue); } - } + } + if (value.myTypedef != nil) { + auto & definedValue_1 = cppValue.myTypedef.Emplace(); + if (value.myTypedef == nil) { + definedValue_1.SetNull(); + } else { + auto & nonNullValue_2 = definedValue_1.SetNonNull(); + nonNullValue_2 = value.myTypedef.unsignedIntValue; + } + } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -106315,7 +106368,7 @@ - (void)writeAttributeUnsupportedWithValue:(NSNumber * _Nonnull)value params:(MT ListFreer listFreer; using TypeInfo = UnitTesting::Attributes::Unsupported::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.boolValue; + cppValue = value.boolValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -106379,7 +106432,7 @@ - (void)writeAttributeReadFailureCodeWithValue:(NSNumber * _Nonnull)value params ListFreer listFreer; using TypeInfo = UnitTesting::Attributes::ReadFailureCode::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; + cppValue = value.unsignedCharValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -106443,7 +106496,7 @@ - (void)writeAttributeFailureInt32UWithValue:(NSNumber * _Nonnull)value params:( ListFreer listFreer; using TypeInfo = UnitTesting::Attributes::FailureInt32U::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedIntValue; + cppValue = value.unsignedIntValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -106511,7 +106564,7 @@ - (void)writeAttributeNullableBooleanWithValue:(NSNumber * _Nullable)value param cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.boolValue; + nonNullValue_0 = value.boolValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -106580,7 +106633,7 @@ - (void)writeAttributeNullableBitmap8WithValue:(NSNumber * _Nullable)value param cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = static_cast>(value.unsignedCharValue); + nonNullValue_0 = static_cast>(value.unsignedCharValue); } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -106649,7 +106702,7 @@ - (void)writeAttributeNullableBitmap16WithValue:(NSNumber * _Nullable)value para cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = static_cast>(value.unsignedShortValue); + nonNullValue_0 = static_cast>(value.unsignedShortValue); } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -106718,7 +106771,7 @@ - (void)writeAttributeNullableBitmap32WithValue:(NSNumber * _Nullable)value para cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = static_cast>(value.unsignedIntValue); + nonNullValue_0 = static_cast>(value.unsignedIntValue); } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -106787,7 +106840,7 @@ - (void)writeAttributeNullableBitmap64WithValue:(NSNumber * _Nullable)value para cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = static_cast>(value.unsignedLongLongValue); + nonNullValue_0 = static_cast>(value.unsignedLongLongValue); } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -106856,7 +106909,7 @@ - (void)writeAttributeNullableInt8uWithValue:(NSNumber * _Nullable)value params: cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedCharValue; + nonNullValue_0 = value.unsignedCharValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -106925,7 +106978,7 @@ - (void)writeAttributeNullableInt16uWithValue:(NSNumber * _Nullable)value params cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedShortValue; + nonNullValue_0 = value.unsignedShortValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -106994,7 +107047,7 @@ - (void)writeAttributeNullableInt24uWithValue:(NSNumber * _Nullable)value params cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedIntValue; + nonNullValue_0 = value.unsignedIntValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -107063,7 +107116,7 @@ - (void)writeAttributeNullableInt32uWithValue:(NSNumber * _Nullable)value params cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedIntValue; + nonNullValue_0 = value.unsignedIntValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -107132,7 +107185,7 @@ - (void)writeAttributeNullableInt40uWithValue:(NSNumber * _Nullable)value params cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedLongLongValue; + nonNullValue_0 = value.unsignedLongLongValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -107201,7 +107254,7 @@ - (void)writeAttributeNullableInt48uWithValue:(NSNumber * _Nullable)value params cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedLongLongValue; + nonNullValue_0 = value.unsignedLongLongValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -107270,7 +107323,7 @@ - (void)writeAttributeNullableInt56uWithValue:(NSNumber * _Nullable)value params cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedLongLongValue; + nonNullValue_0 = value.unsignedLongLongValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -107339,7 +107392,7 @@ - (void)writeAttributeNullableInt64uWithValue:(NSNumber * _Nullable)value params cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedLongLongValue; + nonNullValue_0 = value.unsignedLongLongValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -107408,7 +107461,7 @@ - (void)writeAttributeNullableInt8sWithValue:(NSNumber * _Nullable)value params: cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.charValue; + nonNullValue_0 = value.charValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -107477,7 +107530,7 @@ - (void)writeAttributeNullableInt16sWithValue:(NSNumber * _Nullable)value params cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.shortValue; + nonNullValue_0 = value.shortValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -107546,7 +107599,7 @@ - (void)writeAttributeNullableInt24sWithValue:(NSNumber * _Nullable)value params cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.intValue; + nonNullValue_0 = value.intValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -107615,7 +107668,7 @@ - (void)writeAttributeNullableInt32sWithValue:(NSNumber * _Nullable)value params cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.intValue; + nonNullValue_0 = value.intValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -107684,7 +107737,7 @@ - (void)writeAttributeNullableInt40sWithValue:(NSNumber * _Nullable)value params cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.longLongValue; + nonNullValue_0 = value.longLongValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -107753,7 +107806,7 @@ - (void)writeAttributeNullableInt48sWithValue:(NSNumber * _Nullable)value params cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.longLongValue; + nonNullValue_0 = value.longLongValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -107822,7 +107875,7 @@ - (void)writeAttributeNullableInt56sWithValue:(NSNumber * _Nullable)value params cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.longLongValue; + nonNullValue_0 = value.longLongValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -107891,7 +107944,7 @@ - (void)writeAttributeNullableInt64sWithValue:(NSNumber * _Nullable)value params cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.longLongValue; + nonNullValue_0 = value.longLongValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -107960,7 +108013,7 @@ - (void)writeAttributeNullableEnum8WithValue:(NSNumber * _Nullable)value params: cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedCharValue; + nonNullValue_0 = value.unsignedCharValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -108029,7 +108082,7 @@ - (void)writeAttributeNullableEnum16WithValue:(NSNumber * _Nullable)value params cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedShortValue; + nonNullValue_0 = value.unsignedShortValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -108098,7 +108151,7 @@ - (void)writeAttributeNullableFloatSingleWithValue:(NSNumber * _Nullable)value p cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.floatValue; + nonNullValue_0 = value.floatValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -108167,7 +108220,7 @@ - (void)writeAttributeNullableFloatDoubleWithValue:(NSNumber * _Nullable)value p cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.doubleValue; + nonNullValue_0 = value.doubleValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -108374,7 +108427,7 @@ - (void)writeAttributeNullableEnumAttrWithValue:(NSNumber * _Nullable)value para cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = static_cast>(value.unsignedCharValue); + nonNullValue_0 = static_cast>(value.unsignedCharValue); } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -108443,18 +108496,23 @@ - (void)writeAttributeNullableStructWithValue:(MTRUnitTestingClusterSimpleStruct cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0.a = value.a.unsignedCharValue; - nonNullValue_0.b = value.b.boolValue; - nonNullValue_0.c = static_cast>(value.c.unsignedCharValue); - nonNullValue_0.d = AsByteSpan(value.d); - nonNullValue_0.e = AsCharSpan(value.e); - nonNullValue_0.f = static_cast>(value.f.unsignedCharValue); - nonNullValue_0.g = value.g.floatValue; - nonNullValue_0.h = value.h.doubleValue; - if (value.i != nil) { - auto & definedValue_2 = nonNullValue_0.i.Emplace(); - definedValue_2 = static_cast>(value.i.unsignedCharValue); + nonNullValue_0.a = value.a.unsignedCharValue; + nonNullValue_0.b = value.b.boolValue; + nonNullValue_0.c = static_cast>(value.c.unsignedCharValue); + nonNullValue_0.d = AsByteSpan(value.d); + nonNullValue_0.e = AsCharSpan(value.e); + nonNullValue_0.f = static_cast>(value.f.unsignedCharValue); + nonNullValue_0.g = value.g.floatValue; + nonNullValue_0.h = value.h.doubleValue; + if (value.i != nil) { + auto & definedValue_2 = nonNullValue_0.i.Emplace(); + definedValue_2 = static_cast>(value.i.unsignedCharValue); + } + if (value.j != nil) { + auto & definedValue_2 = nonNullValue_0.j.Emplace(); + definedValue_2 = value.j.unsignedLongLongValue; } + nonNullValue_0.k = value.k.unsignedIntValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -108523,7 +108581,7 @@ - (void)writeAttributeNullableRangeRestrictedInt8uWithValue:(NSNumber * _Nullabl cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedCharValue; + nonNullValue_0 = value.unsignedCharValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -108592,7 +108650,7 @@ - (void)writeAttributeNullableRangeRestrictedInt8sWithValue:(NSNumber * _Nullabl cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.charValue; + nonNullValue_0 = value.charValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -108661,7 +108719,7 @@ - (void)writeAttributeNullableRangeRestrictedInt16uWithValue:(NSNumber * _Nullab cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedShortValue; + nonNullValue_0 = value.unsignedShortValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -108730,7 +108788,7 @@ - (void)writeAttributeNullableRangeRestrictedInt16sWithValue:(NSNumber * _Nullab cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.shortValue; + nonNullValue_0 = value.shortValue; } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -108795,7 +108853,7 @@ - (void)writeAttributeWriteOnlyInt8uWithValue:(NSNumber * _Nonnull)value params: ListFreer listFreer; using TypeInfo = UnitTesting::Attributes::WriteOnlyInt8u::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; + cppValue = value.unsignedCharValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -108863,7 +108921,7 @@ - (void)writeAttributeNullableGlobalEnumWithValue:(NSNumber * _Nullable)value pa cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = static_cast>(value.unsignedCharValue); + nonNullValue_0 = static_cast>(value.unsignedCharValue); } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -108932,22 +108990,31 @@ - (void)writeAttributeNullableGlobalStructWithValue:(MTRDataTypeTestGlobalStruct cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0.name = AsCharSpan(value.name); - if (value.myBitmap == nil) { - nonNullValue_0.myBitmap.SetNull(); - } else { - auto & nonNullValue_2 = nonNullValue_0.myBitmap.SetNonNull(); - nonNullValue_2 = static_cast>(value.myBitmap.unsignedIntValue); + nonNullValue_0.name = AsCharSpan(value.name); + if (value.myBitmap == nil) { + nonNullValue_0.myBitmap.SetNull(); + } else { + auto & nonNullValue_2 = nonNullValue_0.myBitmap.SetNonNull(); + nonNullValue_2 = static_cast>(value.myBitmap.unsignedIntValue); } - if (value.myEnum != nil) { - auto & definedValue_2 = nonNullValue_0.myEnum.Emplace(); - if (value.myEnum == nil) { - definedValue_2.SetNull(); - } else { - auto & nonNullValue_3 = definedValue_2.SetNonNull(); - nonNullValue_3 = static_cast>(value.myEnum.unsignedCharValue); + if (value.myEnum != nil) { + auto & definedValue_2 = nonNullValue_0.myEnum.Emplace(); + if (value.myEnum == nil) { + definedValue_2.SetNull(); + } else { + auto & nonNullValue_3 = definedValue_2.SetNonNull(); + nonNullValue_3 = static_cast>(value.myEnum.unsignedCharValue); } - } + } + if (value.myTypedef != nil) { + auto & definedValue_2 = nonNullValue_0.myTypedef.Emplace(); + if (value.myTypedef == nil) { + definedValue_2.SetNull(); + } else { + auto & nonNullValue_3 = definedValue_2.SetNonNull(); + nonNullValue_3 = value.myTypedef.unsignedIntValue; + } + } } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -108980,6 +109047,144 @@ + (void)readAttributeNullableGlobalStructWithClusterStateCache:(MTRClusterStateC completion:completion]; } +- (void)readAttributeNullableTypedefAttrWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = UnitTesting::Attributes::NullableTypedefAttr::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)writeAttributeNullableTypedefAttrWithValue:(NSNumber * _Nullable)value completion:(MTRStatusCompletion)completion +{ + [self writeAttributeNullableTypedefAttrWithValue:(NSNumber * _Nullable) value params:nil completion:completion]; +} +- (void)writeAttributeNullableTypedefAttrWithValue:(NSNumber * _Nullable)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion +{ + // Make a copy of params before we go async. + params = [params copy]; + value = [value copy]; + + auto * bridge = new MTRDefaultSuccessCallbackBridge(self.callbackQueue, ^(id _Nullable ignored, NSError * _Nullable error) { completion(error); }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, DefaultSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { + chip::Optional timedWriteTimeout; + if (params != nil) { + if (params.timedWriteTimeout != nil){ + timedWriteTimeout.SetValue(params.timedWriteTimeout.unsignedShortValue); + } + } + + ListFreer listFreer; + using TypeInfo = UnitTesting::Attributes::NullableTypedefAttr::TypeInfo; + TypeInfo::Type cppValue; + if (value == nil) { + cppValue.SetNull(); + } else { + auto & nonNullValue_0 = cppValue.SetNonNull(); + nonNullValue_0 = value.unsignedLongLongValue; + } + + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); + return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); + std::move(*bridge).DispatchAction(self.device); +} + +- (void)subscribeAttributeNullableTypedefAttrWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = UnitTesting::Attributes::NullableTypedefAttr::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeNullableTypedefAttrWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = UnitTesting::Attributes::NullableTypedefAttr::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeNullableGlobalTypedefWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = UnitTesting::Attributes::NullableGlobalTypedef::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)writeAttributeNullableGlobalTypedefWithValue:(NSNumber * _Nullable)value completion:(MTRStatusCompletion)completion +{ + [self writeAttributeNullableGlobalTypedefWithValue:(NSNumber * _Nullable) value params:nil completion:completion]; +} +- (void)writeAttributeNullableGlobalTypedefWithValue:(NSNumber * _Nullable)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion +{ + // Make a copy of params before we go async. + params = [params copy]; + value = [value copy]; + + auto * bridge = new MTRDefaultSuccessCallbackBridge(self.callbackQueue, ^(id _Nullable ignored, NSError * _Nullable error) { completion(error); }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, DefaultSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { + chip::Optional timedWriteTimeout; + if (params != nil) { + if (params.timedWriteTimeout != nil){ + timedWriteTimeout.SetValue(params.timedWriteTimeout.unsignedShortValue); + } + } + + ListFreer listFreer; + using TypeInfo = UnitTesting::Attributes::NullableGlobalTypedef::TypeInfo; + TypeInfo::Type cppValue; + if (value == nil) { + cppValue.SetNull(); + } else { + auto & nonNullValue_0 = cppValue.SetNonNull(); + nonNullValue_0 = value.unsignedIntValue; + } + + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); + return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); + std::move(*bridge).DispatchAction(self.device); +} + +- (void)subscribeAttributeNullableGlobalTypedefWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = UnitTesting::Attributes::NullableGlobalTypedef::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeNullableGlobalTypedefWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = UnitTesting::Attributes::NullableGlobalTypedef::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + - (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { using TypeInfo = UnitTesting::Attributes::GeneratedCommandList::TypeInfo; @@ -109192,7 +109397,7 @@ - (void)writeAttributeMeiInt8uWithValue:(NSNumber * _Nonnull)value params:(MTRWr ListFreer listFreer; using TypeInfo = UnitTesting::Attributes::MeiInt8u::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; + cppValue = value.unsignedCharValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -113218,7 +113423,7 @@ - (void)writeAttributeFlipFlopWithValue:(NSNumber * _Nonnull)value params:(MTRWr ListFreer listFreer; using TypeInfo = SampleMei::Attributes::FlipFlop::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.boolValue; + cppValue = value.boolValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm b/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm index 96b2c0cd3bf3e6..aed38af5a68b4b 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm @@ -8461,6 +8461,14 @@ result = @"NullableGlobalStruct"; break; + case MTRAttributeIDTypeClusterUnitTestingAttributeNullableTypedefAttrID: + result = @"NullableTypedefAttr"; + break; + + case MTRAttributeIDTypeClusterUnitTestingAttributeNullableGlobalTypedefID: + result = @"NullableGlobalTypedef"; + break; + case MTRAttributeIDTypeClusterUnitTestingAttributeGeneratedCommandListID: result = @"GeneratedCommandList"; break; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm index 1d6828deddb868..336a73d0f3acdf 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm @@ -22454,6 +22454,38 @@ - (void)writeAttributeNullableGlobalStructWithValue:(NSDictionary * _Nullable)readAttributeNullableTypedefAttrWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeUnitTestingID) attributeID:@(MTRAttributeIDTypeClusterUnitTestingAttributeNullableTypedefAttrID) params:params]; +} + +- (void)writeAttributeNullableTypedefAttrWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeNullableTypedefAttrWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeNullableTypedefAttrWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params +{ + NSNumber * timedWriteTimeout = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeUnitTestingID) attributeID:@(MTRAttributeIDTypeClusterUnitTestingAttributeNullableTypedefAttrID) value:dataValueDictionary expectedValueInterval:expectedValueIntervalMs timedWriteTimeout:timedWriteTimeout]; +} + +- (NSDictionary * _Nullable)readAttributeNullableGlobalTypedefWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeUnitTestingID) attributeID:@(MTRAttributeIDTypeClusterUnitTestingAttributeNullableGlobalTypedefID) params:params]; +} + +- (void)writeAttributeNullableGlobalTypedefWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeNullableGlobalTypedefWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeNullableGlobalTypedefWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params +{ + NSNumber * timedWriteTimeout = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeUnitTestingID) attributeID:@(MTRAttributeIDTypeClusterUnitTestingAttributeNullableGlobalTypedefID) value:dataValueDictionary expectedValueInterval:expectedValueIntervalMs timedWriteTimeout:timedWriteTimeout]; +} + - (NSDictionary * _Nullable)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params { return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeUnitTestingID) attributeID:@(MTRAttributeIDTypeClusterUnitTestingAttributeGeneratedCommandListID) params:params]; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm index 318455a23b9210..f0301da956d454 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm @@ -35508,6 +35508,12 @@ - (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::UnitTest } else { newElement_0.c.i = nil; } + if (entry_0.c.j.HasValue()) { + newElement_0.c.j = [NSNumber numberWithUnsignedLongLong:entry_0.c.j.Value()]; + } else { + newElement_0.c.j = nil; + } + newElement_0.c.k = [NSNumber numberWithUnsignedInt:entry_0.c.k]; { // Scope for our temporary variables auto * array_2 = [NSMutableArray new]; auto iter_2 = entry_0.d.begin(); @@ -35532,6 +35538,12 @@ - (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::UnitTest } else { newElement_2.i = nil; } + if (entry_2.j.HasValue()) { + newElement_2.j = [NSNumber numberWithUnsignedLongLong:entry_2.j.Value()]; + } else { + newElement_2.j = nil; + } + newElement_2.k = [NSNumber numberWithUnsignedInt:entry_2.k]; [array_2 addObject:newElement_2]; } CHIP_ERROR err = iter_2.GetStatus(); @@ -35619,6 +35631,12 @@ - (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::UnitTest } else { newElement_0.i = nil; } + if (entry_0.j.HasValue()) { + newElement_0.j = [NSNumber numberWithUnsignedLongLong:entry_0.j.Value()]; + } else { + newElement_0.j = nil; + } + newElement_0.k = [NSNumber numberWithUnsignedInt:entry_0.k]; [array_0 addObject:newElement_0]; } CHIP_ERROR err = iter_0.GetStatus(); @@ -35668,6 +35686,23 @@ - (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::UnitTest { self.arg6 = [NSNumber numberWithBool:decodableStruct.arg6]; } + { + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = decodableStruct.arg7.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithUnsignedLongLong:entry_0]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + return err; + } + self.arg7 = array_0; + } + } return CHIP_NO_ERROR; } @@ -36136,6 +36171,11 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader auto & definedValue_3 = listHolder_0->mList[i_0].c.i.Emplace(); definedValue_3 = static_cast>(element_0.c.i.unsignedCharValue); } + if (element_0.c.j != nil) { + auto & definedValue_3 = listHolder_0->mList[i_0].c.j.Emplace(); + definedValue_3 = element_0.c.j.unsignedLongLongValue; + } + listHolder_0->mList[i_0].c.k = element_0.c.k.unsignedIntValue; { using ListType_2 = std::remove_reference_tmList[i_0].d)>; using ListMemberType_2 = ListMemberTypeGetter::Type; @@ -36164,6 +36204,11 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader auto & definedValue_4 = listHolder_2->mList[i_2].i.Emplace(); definedValue_4 = static_cast>(element_2.i.unsignedCharValue); } + if (element_2.j != nil) { + auto & definedValue_4 = listHolder_2->mList[i_2].j.Emplace(); + definedValue_4 = element_2.j.unsignedLongLongValue; + } + listHolder_2->mList[i_2].k = element_2.k.unsignedIntValue; } listHolder_0->mList[i_0].d = ListType_2(listHolder_2->mList, element_0.d.count); } else { @@ -36275,6 +36320,11 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader auto & definedValue_2 = listHolder_0->mList[i_0].i.Emplace(); definedValue_2 = static_cast>(element_0.i.unsignedCharValue); } + if (element_0.j != nil) { + auto & definedValue_2 = listHolder_0->mList[i_0].j.Emplace(); + definedValue_2 = element_0.j.unsignedLongLongValue; + } + listHolder_0->mList[i_0].k = element_0.k.unsignedIntValue; } encodableStruct.arg2 = ListType_0(listHolder_0->mList, self.arg2.count); } else { @@ -36338,6 +36388,31 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader { encodableStruct.arg6 = self.arg6.boolValue; } + { + { + using ListType_0 = std::remove_reference_t; + using ListMemberType_0 = ListMemberTypeGetter::Type; + if (self.arg7.count != 0) { + auto * listHolder_0 = new ListHolder(self.arg7.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 < self.arg7.count; ++i_0) { + auto element_0 = MTR_SAFE_CAST(self.arg7[i_0], NSNumber); + if (!element_0) { + // Wrong kind of value. + MTR_LOG_ERROR("%@ incorrectly present in list of %@", self.arg7[i_0], NSStringFromClass(NSNumber.class)); + return CHIP_ERROR_INVALID_ARGUMENT; + } + listHolder_0->mList[i_0] = element_0.unsignedLongLongValue; + } + encodableStruct.arg7 = ListType_0(listHolder_0->mList, self.arg7.count); + } else { + encodableStruct.arg7 = ListType_0(); + } + } + } auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); if (buffer.IsNull()) { @@ -36561,6 +36636,11 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader auto & definedValue_1 = encodableStruct.arg1.i.Emplace(); definedValue_1 = static_cast>(self.arg1.i.unsignedCharValue); } + if (self.arg1.j != nil) { + auto & definedValue_1 = encodableStruct.arg1.j.Emplace(); + definedValue_1 = self.arg1.j.unsignedLongLongValue; + } + encodableStruct.arg1.k = self.arg1.k.unsignedIntValue; } auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); @@ -36870,6 +36950,12 @@ - (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::UnitTest } else { self.nullableStructValue.i = nil; } + if (decodableStruct.nullableStructValue.Value().j.HasValue()) { + self.nullableStructValue.j = [NSNumber numberWithUnsignedLongLong:decodableStruct.nullableStructValue.Value().j.Value()]; + } else { + self.nullableStructValue.j = nil; + } + self.nullableStructValue.k = [NSNumber numberWithUnsignedInt:decodableStruct.nullableStructValue.Value().k]; } else { self.nullableStructValue = nil; } @@ -36897,6 +36983,12 @@ - (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::UnitTest } else { self.optionalStructValue.i = nil; } + if (decodableStruct.optionalStructValue.Value().j.HasValue()) { + self.optionalStructValue.j = [NSNumber numberWithUnsignedLongLong:decodableStruct.optionalStructValue.Value().j.Value()]; + } else { + self.optionalStructValue.j = nil; + } + self.optionalStructValue.k = [NSNumber numberWithUnsignedInt:decodableStruct.optionalStructValue.Value().k]; } else { self.optionalStructValue = nil; } @@ -36931,6 +37023,12 @@ - (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::UnitTest } else { self.nullableOptionalStructValue.i = nil; } + if (decodableStruct.nullableOptionalStructValue.Value().j.HasValue()) { + self.nullableOptionalStructValue.j = [NSNumber numberWithUnsignedLongLong:decodableStruct.nullableOptionalStructValue.Value().j.Value()]; + } else { + self.nullableOptionalStructValue.j = nil; + } + self.nullableOptionalStructValue.k = [NSNumber numberWithUnsignedInt:decodableStruct.nullableOptionalStructValue.Value().k]; } else { self.nullableOptionalStructValue = nil; } @@ -37014,6 +37112,36 @@ - (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::UnitTest self.nullableOptionalListValue = nil; } } + { + self.nullableTypedefWasNull = [NSNumber numberWithBool:decodableStruct.nullableTypedefWasNull]; + } + { + if (decodableStruct.nullableTypedefValue.HasValue()) { + self.nullableTypedefValue = [NSNumber numberWithUnsignedLongLong:decodableStruct.nullableTypedefValue.Value()]; + } else { + self.nullableTypedefValue = nil; + } + } + { + self.optionalTypedefWasPresent = [NSNumber numberWithBool:decodableStruct.optionalTypedefWasPresent]; + } + { + if (decodableStruct.optionalTypedefValue.HasValue()) { + self.optionalTypedefValue = [NSNumber numberWithUnsignedLongLong:decodableStruct.optionalTypedefValue.Value()]; + } else { + self.optionalTypedefValue = nil; + } + } + { + self.nullableOptionalTypedefWasPresent = [NSNumber numberWithBool:decodableStruct.nullableOptionalTypedefWasPresent]; + } + { + if (decodableStruct.nullableOptionalTypedefWasNull.HasValue()) { + self.nullableOptionalTypedefWasNull = [NSNumber numberWithBool:decodableStruct.nullableOptionalTypedefWasNull.Value()]; + } else { + self.nullableOptionalTypedefWasNull = nil; + } + } return CHIP_NO_ERROR; } @@ -37103,6 +37231,11 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader auto & definedValue_2 = encodableStruct.arg1.c.i.Emplace(); definedValue_2 = static_cast>(self.arg1.c.i.unsignedCharValue); } + if (self.arg1.c.j != nil) { + auto & definedValue_2 = encodableStruct.arg1.c.j.Emplace(); + definedValue_2 = self.arg1.c.j.unsignedLongLongValue; + } + encodableStruct.arg1.c.k = self.arg1.c.k.unsignedIntValue; if (self.arg1.d != nil) { auto & definedValue_1 = encodableStruct.arg1.d.Emplace(); definedValue_1.name = AsCharSpan(self.arg1.d.name); @@ -37121,6 +37254,15 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader nonNullValue_4 = static_cast>(self.arg1.d.myEnum.unsignedCharValue); } } + if (self.arg1.d.myTypedef != nil) { + auto & definedValue_3 = definedValue_1.myTypedef.Emplace(); + if (self.arg1.d.myTypedef == nil) { + definedValue_3.SetNull(); + } else { + auto & nonNullValue_4 = definedValue_3.SetNonNull(); + nonNullValue_4 = self.arg1.d.myTypedef.unsignedIntValue; + } + } } } @@ -37320,6 +37462,11 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader auto & definedValue_2 = listHolder_0->mList[i_0].i.Emplace(); definedValue_2 = static_cast>(element_0.i.unsignedCharValue); } + if (element_0.j != nil) { + auto & definedValue_2 = listHolder_0->mList[i_0].j.Emplace(); + definedValue_2 = element_0.j.unsignedLongLongValue; + } + listHolder_0->mList[i_0].k = element_0.k.unsignedIntValue; } encodableStruct.arg1 = ListType_0(listHolder_0->mList, self.arg1.count); } else { @@ -37464,6 +37611,12 @@ - (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::UnitTest } else { self.arg1.i = nil; } + if (decodableStruct.arg1.j.HasValue()) { + self.arg1.j = [NSNumber numberWithUnsignedLongLong:decodableStruct.arg1.j.Value()]; + } else { + self.arg1.j = nil; + } + self.arg1.k = [NSNumber numberWithUnsignedInt:decodableStruct.arg1.k]; } return CHIP_NO_ERROR; } @@ -37720,6 +37873,11 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader auto & definedValue_2 = encodableStruct.arg1.c.i.Emplace(); definedValue_2 = static_cast>(self.arg1.c.i.unsignedCharValue); } + if (self.arg1.c.j != nil) { + auto & definedValue_2 = encodableStruct.arg1.c.j.Emplace(); + definedValue_2 = self.arg1.c.j.unsignedLongLongValue; + } + encodableStruct.arg1.c.k = self.arg1.c.k.unsignedIntValue; { using ListType_1 = std::remove_reference_t; using ListMemberType_1 = ListMemberTypeGetter::Type; @@ -37748,6 +37906,11 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader auto & definedValue_3 = listHolder_1->mList[i_1].i.Emplace(); definedValue_3 = static_cast>(element_1.i.unsignedCharValue); } + if (element_1.j != nil) { + auto & definedValue_3 = listHolder_1->mList[i_1].j.Emplace(); + definedValue_3 = element_1.j.unsignedLongLongValue; + } + listHolder_1->mList[i_1].k = element_1.k.unsignedIntValue; } encodableStruct.arg1.d = ListType_1(listHolder_1->mList, self.arg1.d.count); } else { @@ -38023,6 +38186,11 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader auto & definedValue_3 = listHolder_0->mList[i_0].c.i.Emplace(); definedValue_3 = static_cast>(element_0.c.i.unsignedCharValue); } + if (element_0.c.j != nil) { + auto & definedValue_3 = listHolder_0->mList[i_0].c.j.Emplace(); + definedValue_3 = element_0.c.j.unsignedLongLongValue; + } + listHolder_0->mList[i_0].c.k = element_0.c.k.unsignedIntValue; { using ListType_2 = std::remove_reference_tmList[i_0].d)>; using ListMemberType_2 = ListMemberTypeGetter::Type; @@ -38051,6 +38219,11 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader auto & definedValue_4 = listHolder_2->mList[i_2].i.Emplace(); definedValue_4 = static_cast>(element_2.i.unsignedCharValue); } + if (element_2.j != nil) { + auto & definedValue_4 = listHolder_2->mList[i_2].j.Emplace(); + definedValue_4 = element_2.j.unsignedLongLongValue; + } + listHolder_2->mList[i_2].k = element_2.k.unsignedIntValue; } listHolder_0->mList[i_0].d = ListType_2(listHolder_2->mList, element_0.d.count); } else { @@ -38630,10 +38803,22 @@ - (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::UnitTest } else { self.field1.myEnum = nil; } + if (decodableStruct.field1.myTypedef.HasValue()) { + if (decodableStruct.field1.myTypedef.Value().IsNull()) { + self.field1.myTypedef = nil; + } else { + self.field1.myTypedef = [NSNumber numberWithUnsignedInt:decodableStruct.field1.myTypedef.Value().Value()]; + } + } else { + self.field1.myTypedef = nil; + } } { self.field2 = [NSNumber numberWithUnsignedChar:chip::to_underlying(decodableStruct.field2)]; } + { + self.field3 = [NSNumber numberWithUnsignedInt:decodableStruct.field3]; + } return CHIP_NO_ERROR; } @@ -38869,6 +39054,11 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader auto & definedValue_2 = nonNullValue_0.i.Emplace(); definedValue_2 = static_cast>(self.nullableStruct.i.unsignedCharValue); } + if (self.nullableStruct.j != nil) { + auto & definedValue_2 = nonNullValue_0.j.Emplace(); + definedValue_2 = self.nullableStruct.j.unsignedLongLongValue; + } + nonNullValue_0.k = self.nullableStruct.k.unsignedIntValue; } } { @@ -38886,6 +39076,11 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader auto & definedValue_2 = definedValue_0.i.Emplace(); definedValue_2 = static_cast>(self.optionalStruct.i.unsignedCharValue); } + if (self.optionalStruct.j != nil) { + auto & definedValue_2 = definedValue_0.j.Emplace(); + definedValue_2 = self.optionalStruct.j.unsignedLongLongValue; + } + definedValue_0.k = self.optionalStruct.k.unsignedIntValue; } } { @@ -38907,6 +39102,11 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader auto & definedValue_3 = nonNullValue_1.i.Emplace(); definedValue_3 = static_cast>(self.nullableOptionalStruct.i.unsignedCharValue); } + if (self.nullableOptionalStruct.j != nil) { + auto & definedValue_3 = nonNullValue_1.j.Emplace(); + definedValue_3 = self.nullableOptionalStruct.j.unsignedLongLongValue; + } + nonNullValue_1.k = self.nullableOptionalStruct.k.unsignedIntValue; } } } @@ -39107,6 +39307,11 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader auto & definedValue_1 = encodableStruct.arg1.i.Emplace(); definedValue_1 = static_cast>(self.arg1.i.unsignedCharValue); } + if (self.arg1.j != nil) { + auto & definedValue_1 = encodableStruct.arg1.j.Emplace(); + definedValue_1 = self.arg1.j.unsignedLongLongValue; + } + encodableStruct.arg1.k = self.arg1.k.unsignedIntValue; } auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); @@ -39821,10 +40026,22 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader nonNullValue_2 = static_cast>(self.field1.myEnum.unsignedCharValue); } } + if (self.field1.myTypedef != nil) { + auto & definedValue_1 = encodableStruct.field1.myTypedef.Emplace(); + if (self.field1.myTypedef == nil) { + definedValue_1.SetNull(); + } else { + auto & nonNullValue_2 = definedValue_1.SetNonNull(); + nonNullValue_2 = self.field1.myTypedef.unsignedIntValue; + } + } } { encodableStruct.field2 = static_cast>(self.field2.unsignedCharValue); } + { + encodableStruct.field3 = self.field3.unsignedIntValue; + } auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); if (buffer.IsNull()) { diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm index ddc22861202fc1..e5ccc86214dd6c 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm @@ -29,6 +29,8 @@ - (instancetype)init _myBitmap = nil; _myEnum = nil; + + _myTypedef = nil; } return self; } @@ -40,13 +42,14 @@ - (id)copyWithZone:(NSZone * _Nullable)zone other.name = self.name; other.myBitmap = self.myBitmap; other.myEnum = self.myEnum; + other.myTypedef = self.myTypedef; return other; } - (NSString *)description { - NSString * descriptionString = [NSString stringWithFormat:@"<%@: name:%@; myBitmap:%@; myEnum:%@; >", NSStringFromClass([self class]), _name, _myBitmap, _myEnum]; + NSString * descriptionString = [NSString stringWithFormat:@"<%@: name:%@; myBitmap:%@; myEnum:%@; myTypedef:%@; >", NSStringFromClass([self class]), _name, _myBitmap, _myEnum, _myTypedef]; return descriptionString; } @@ -9846,6 +9849,10 @@ - (instancetype)init _h = @(0); _i = nil; + + _j = nil; + + _k = @(0); } return self; } @@ -9863,13 +9870,15 @@ - (id)copyWithZone:(NSZone * _Nullable)zone other.g = self.g; other.h = self.h; other.i = self.i; + other.j = self.j; + other.k = self.k; return other; } - (NSString *)description { - NSString * descriptionString = [NSString stringWithFormat:@"<%@: a:%@; b:%@; c:%@; d:%@; e:%@; f:%@; g:%@; h:%@; i:%@; >", NSStringFromClass([self class]), _a, _b, _c, [_d base64EncodedStringWithOptions:0], _e, _f, _g, _h, _i]; + NSString * descriptionString = [NSString stringWithFormat:@"<%@: a:%@; b:%@; c:%@; d:%@; e:%@; f:%@; g:%@; h:%@; i:%@; j:%@; k:%@; >", NSStringFromClass([self class]), _a, _b, _c, [_d base64EncodedStringWithOptions:0], _e, _f, _g, _h, _i, _j, _k]; return descriptionString; } @@ -9973,6 +9982,12 @@ - (instancetype)init _optionalList = nil; _nullableOptionalList = nil; + + _nullableTypedef = nil; + + _optionalTypedef = nil; + + _nullableOptionalTypedef = nil; } return self; } @@ -9993,13 +10008,16 @@ - (id)copyWithZone:(NSZone * _Nullable)zone other.nullableList = self.nullableList; other.optionalList = self.optionalList; other.nullableOptionalList = self.nullableOptionalList; + other.nullableTypedef = self.nullableTypedef; + other.optionalTypedef = self.optionalTypedef; + other.nullableOptionalTypedef = self.nullableOptionalTypedef; return other; } - (NSString *)description { - NSString * descriptionString = [NSString stringWithFormat:@"<%@: nullableInt:%@; optionalInt:%@; nullableOptionalInt:%@; nullableString:%@; optionalString:%@; nullableOptionalString:%@; nullableStruct:%@; optionalStruct:%@; nullableOptionalStruct:%@; nullableList:%@; optionalList:%@; nullableOptionalList:%@; >", NSStringFromClass([self class]), _nullableInt, _optionalInt, _nullableOptionalInt, _nullableString, _optionalString, _nullableOptionalString, _nullableStruct, _optionalStruct, _nullableOptionalStruct, _nullableList, _optionalList, _nullableOptionalList]; + NSString * descriptionString = [NSString stringWithFormat:@"<%@: nullableInt:%@; optionalInt:%@; nullableOptionalInt:%@; nullableString:%@; optionalString:%@; nullableOptionalString:%@; nullableStruct:%@; optionalStruct:%@; nullableOptionalStruct:%@; nullableList:%@; optionalList:%@; nullableOptionalList:%@; nullableTypedef:%@; optionalTypedef:%@; nullableOptionalTypedef:%@; >", NSStringFromClass([self class]), _nullableInt, _optionalInt, _nullableOptionalInt, _nullableString, _optionalString, _nullableOptionalString, _nullableStruct, _optionalStruct, _nullableOptionalStruct, _nullableList, _optionalList, _nullableOptionalList, _nullableTypedef, _optionalTypedef, _nullableOptionalTypedef]; return descriptionString; } diff --git a/src/lib/core/BUILD.gn b/src/lib/core/BUILD.gn index 265f5fea7fc5b8..80ee711934ea96 100644 --- a/src/lib/core/BUILD.gn +++ b/src/lib/core/BUILD.gn @@ -190,6 +190,7 @@ static_library("core") { ":chip_config_header", ":error", "${chip_root}/src/app/common:enums", + "${chip_root}/src/app/common:typedefs", "${chip_root}/src/ble", "${chip_root}/src/inet", "${chip_root}/src/lib/support", diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h index 2357a87dd9d9fa..a7c98799c40732 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h @@ -19,6 +19,7 @@ #pragma once +#include #include #include #include @@ -397,9 +398,10 @@ namespace Structs { namespace TestGlobalStruct { enum class Fields : uint8_t { - kName = 0, - kMyBitmap = 1, - kMyEnum = 2, + kName = 0, + kMyBitmap = 1, + kMyEnum = 2, + kMyTypedef = 3, }; struct Type @@ -408,6 +410,7 @@ struct Type chip::CharSpan name; DataModel::Nullable> myBitmap; Optional> myEnum; + Optional> myTypedef; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -43777,6 +43780,8 @@ enum class Fields : uint8_t kG = 6, kH = 7, kI = 8, + kJ = 9, + kK = 10, }; struct Type @@ -43791,6 +43796,8 @@ struct Type float g = static_cast(0); double h = static_cast(0); Optional i; + Optional j; + uint32_t k = static_cast(0); CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -43865,18 +43872,21 @@ struct DecodableType namespace NullablesAndOptionalsStruct { enum class Fields : uint8_t { - kNullableInt = 0, - kOptionalInt = 1, - kNullableOptionalInt = 2, - kNullableString = 3, - kOptionalString = 4, - kNullableOptionalString = 5, - kNullableStruct = 6, - kOptionalStruct = 7, - kNullableOptionalStruct = 8, - kNullableList = 9, - kOptionalList = 10, - kNullableOptionalList = 11, + kNullableInt = 0, + kOptionalInt = 1, + kNullableOptionalInt = 2, + kNullableString = 3, + kOptionalString = 4, + kNullableOptionalString = 5, + kNullableStruct = 6, + kOptionalStruct = 7, + kNullableOptionalStruct = 8, + kNullableList = 9, + kOptionalList = 10, + kNullableOptionalList = 11, + kNullableTypedef = 12, + kOptionalTypedef = 13, + kNullableOptionalTypedef = 14, }; struct Type @@ -43894,6 +43904,9 @@ struct Type DataModel::Nullable> nullableList; Optional> optionalList; Optional>> nullableOptionalList; + DataModel::Nullable nullableTypedef; + Optional optionalTypedef; + Optional> nullableOptionalTypedef; static constexpr bool kIsFabricScoped = false; @@ -43915,6 +43928,9 @@ struct DecodableType DataModel::Nullable> nullableList; Optional> optionalList; Optional>> nullableOptionalList; + DataModel::Nullable nullableTypedef; + Optional optionalTypedef; + Optional> nullableOptionalTypedef; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -44484,6 +44500,7 @@ enum class Fields : uint8_t kArg4 = 3, kArg5 = 4, kArg6 = 5, + kArg7 = 6, }; struct Type @@ -44499,6 +44516,7 @@ struct Type DataModel::List arg4; SimpleEnum arg5 = static_cast(0); bool arg6 = static_cast(0); + DataModel::List arg7; CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; @@ -44519,6 +44537,7 @@ struct DecodableType DataModel::DecodableList arg4; SimpleEnum arg5 = static_cast(0); bool arg6 = static_cast(0); + DataModel::DecodableList arg7; CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace TestStructArrayArgumentResponse @@ -44665,6 +44684,7 @@ enum class Fields : uint8_t kArg4 = 3, kArg5 = 4, kArg6 = 5, + kArg7 = 6, }; struct Type @@ -44680,6 +44700,7 @@ struct Type DataModel::List arg4; SimpleEnum arg5 = static_cast(0); bool arg6 = static_cast(0); + DataModel::List arg7; CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; @@ -44700,6 +44721,7 @@ struct DecodableType DataModel::DecodableList arg4; SimpleEnum arg5 = static_cast(0); bool arg6 = static_cast(0); + DataModel::DecodableList arg7; CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace TestStructArrayArgumentRequest @@ -44779,34 +44801,40 @@ struct DecodableType namespace TestComplexNullableOptionalResponse { enum class Fields : uint8_t { - kNullableIntWasNull = 0, - kNullableIntValue = 1, - kOptionalIntWasPresent = 2, - kOptionalIntValue = 3, - kNullableOptionalIntWasPresent = 4, - kNullableOptionalIntWasNull = 5, - kNullableOptionalIntValue = 6, - kNullableStringWasNull = 7, - kNullableStringValue = 8, - kOptionalStringWasPresent = 9, - kOptionalStringValue = 10, - kNullableOptionalStringWasPresent = 11, - kNullableOptionalStringWasNull = 12, - kNullableOptionalStringValue = 13, - kNullableStructWasNull = 14, - kNullableStructValue = 15, - kOptionalStructWasPresent = 16, - kOptionalStructValue = 17, - kNullableOptionalStructWasPresent = 18, - kNullableOptionalStructWasNull = 19, - kNullableOptionalStructValue = 20, - kNullableListWasNull = 21, - kNullableListValue = 22, - kOptionalListWasPresent = 23, - kOptionalListValue = 24, - kNullableOptionalListWasPresent = 25, - kNullableOptionalListWasNull = 26, - kNullableOptionalListValue = 27, + kNullableIntWasNull = 0, + kNullableIntValue = 1, + kOptionalIntWasPresent = 2, + kOptionalIntValue = 3, + kNullableOptionalIntWasPresent = 4, + kNullableOptionalIntWasNull = 5, + kNullableOptionalIntValue = 6, + kNullableStringWasNull = 7, + kNullableStringValue = 8, + kOptionalStringWasPresent = 9, + kOptionalStringValue = 10, + kNullableOptionalStringWasPresent = 11, + kNullableOptionalStringWasNull = 12, + kNullableOptionalStringValue = 13, + kNullableStructWasNull = 14, + kNullableStructValue = 15, + kOptionalStructWasPresent = 16, + kOptionalStructValue = 17, + kNullableOptionalStructWasPresent = 18, + kNullableOptionalStructWasNull = 19, + kNullableOptionalStructValue = 20, + kNullableListWasNull = 21, + kNullableListValue = 22, + kOptionalListWasPresent = 23, + kOptionalListValue = 24, + kNullableOptionalListWasPresent = 25, + kNullableOptionalListWasNull = 26, + kNullableOptionalListValue = 27, + kNullableTypedefWasNull = 28, + kNullableTypedefValue = 29, + kOptionalTypedefWasPresent = 30, + kOptionalTypedefValue = 31, + kNullableOptionalTypedefWasPresent = 32, + kNullableOptionalTypedefWasNull = 33, }; struct Type @@ -44844,6 +44872,12 @@ struct Type bool nullableOptionalListWasPresent = static_cast(0); Optional nullableOptionalListWasNull; Optional> nullableOptionalListValue; + bool nullableTypedefWasNull = static_cast(0); + Optional nullableTypedefValue; + bool optionalTypedefWasPresent = static_cast(0); + Optional optionalTypedefValue; + bool nullableOptionalTypedefWasPresent = static_cast(0); + Optional nullableOptionalTypedefWasNull; CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; @@ -44886,6 +44920,12 @@ struct DecodableType bool nullableOptionalListWasPresent = static_cast(0); Optional nullableOptionalListWasNull; Optional> nullableOptionalListValue; + bool nullableTypedefWasNull = static_cast(0); + Optional nullableTypedefValue; + bool optionalTypedefWasPresent = static_cast(0); + Optional optionalTypedefValue; + bool nullableOptionalTypedefWasPresent = static_cast(0); + Optional nullableOptionalTypedefWasNull; CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace TestComplexNullableOptionalResponse @@ -45313,6 +45353,7 @@ enum class Fields : uint8_t { kField1 = 0, kField2 = 1, + kField3 = 2, }; struct Type @@ -45324,6 +45365,7 @@ struct Type Globals::Structs::TestGlobalStruct::Type field1; Globals::TestGlobalEnum field2 = static_cast(0); + uint32_t field3 = static_cast(0); CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; @@ -45340,6 +45382,7 @@ struct DecodableType Globals::Structs::TestGlobalStruct::DecodableType field1; Globals::TestGlobalEnum field2 = static_cast(0); + uint32_t field3 = static_cast(0); CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace GlobalEchoResponse @@ -45715,6 +45758,7 @@ enum class Fields : uint8_t { kField1 = 0, kField2 = 1, + kField3 = 2, }; struct Type @@ -45726,6 +45770,7 @@ struct Type Globals::Structs::TestGlobalStruct::Type field1; Globals::TestGlobalEnum field2 = static_cast(0); + uint32_t field3 = static_cast(0); CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; @@ -45742,6 +45787,7 @@ struct DecodableType Globals::Structs::TestGlobalStruct::DecodableType field1; Globals::TestGlobalEnum field2 = static_cast(0); + uint32_t field3 = static_cast(0); CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace GlobalEchoRequest @@ -46890,6 +46936,30 @@ struct TypeInfo static constexpr bool MustUseTimedWrite() { return false; } }; } // namespace NullableGlobalStruct +namespace NullableTypedefAttr { +struct TypeInfo +{ + using Type = chip::app::DataModel::Nullable; + using DecodableType = chip::app::DataModel::Nullable; + using DecodableArgType = const chip::app::DataModel::Nullable &; + + static constexpr ClusterId GetClusterId() { return Clusters::UnitTesting::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::NullableTypedefAttr::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace NullableTypedefAttr +namespace NullableGlobalTypedef { +struct TypeInfo +{ + using Type = chip::app::DataModel::Nullable; + using DecodableType = chip::app::DataModel::Nullable; + using DecodableArgType = const chip::app::DataModel::Nullable &; + + static constexpr ClusterId GetClusterId() { return Clusters::UnitTesting::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::NullableGlobalTypedef::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace NullableGlobalTypedef namespace GeneratedCommandList { struct TypeInfo : public Clusters::Globals::Attributes::GeneratedCommandList::TypeInfo { @@ -47033,6 +47103,8 @@ struct TypeInfo Attributes::WriteOnlyInt8u::TypeInfo::DecodableType writeOnlyInt8u = static_cast(0); Attributes::NullableGlobalEnum::TypeInfo::DecodableType nullableGlobalEnum; Attributes::NullableGlobalStruct::TypeInfo::DecodableType nullableGlobalStruct; + Attributes::NullableTypedefAttr::TypeInfo::DecodableType nullableTypedefAttr; + Attributes::NullableGlobalTypedef::TypeInfo::DecodableType nullableGlobalTypedef; Attributes::GeneratedCommandList::TypeInfo::DecodableType generatedCommandList; Attributes::AcceptedCommandList::TypeInfo::DecodableType acceptedCommandList; Attributes::AttributeList::TypeInfo::DecodableType attributeList; From dde82394fbfc4ce8b55d5d83efee8cf35ead57ff Mon Sep 17 00:00:00 2001 From: marcos <15697303+gmarcosb@users.noreply.github.com> Date: Thu, 5 Dec 2024 16:11:58 -0700 Subject: [PATCH 20/20] Revert generated file --- .../zap-generated/cluster-objects.h | 158 +++++------------- 1 file changed, 43 insertions(+), 115 deletions(-) diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h index a7c98799c40732..2357a87dd9d9fa 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h @@ -19,7 +19,6 @@ #pragma once -#include #include #include #include @@ -398,10 +397,9 @@ namespace Structs { namespace TestGlobalStruct { enum class Fields : uint8_t { - kName = 0, - kMyBitmap = 1, - kMyEnum = 2, - kMyTypedef = 3, + kName = 0, + kMyBitmap = 1, + kMyEnum = 2, }; struct Type @@ -410,7 +408,6 @@ struct Type chip::CharSpan name; DataModel::Nullable> myBitmap; Optional> myEnum; - Optional> myTypedef; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -43780,8 +43777,6 @@ enum class Fields : uint8_t kG = 6, kH = 7, kI = 8, - kJ = 9, - kK = 10, }; struct Type @@ -43796,8 +43791,6 @@ struct Type float g = static_cast(0); double h = static_cast(0); Optional i; - Optional j; - uint32_t k = static_cast(0); CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -43872,21 +43865,18 @@ struct DecodableType namespace NullablesAndOptionalsStruct { enum class Fields : uint8_t { - kNullableInt = 0, - kOptionalInt = 1, - kNullableOptionalInt = 2, - kNullableString = 3, - kOptionalString = 4, - kNullableOptionalString = 5, - kNullableStruct = 6, - kOptionalStruct = 7, - kNullableOptionalStruct = 8, - kNullableList = 9, - kOptionalList = 10, - kNullableOptionalList = 11, - kNullableTypedef = 12, - kOptionalTypedef = 13, - kNullableOptionalTypedef = 14, + kNullableInt = 0, + kOptionalInt = 1, + kNullableOptionalInt = 2, + kNullableString = 3, + kOptionalString = 4, + kNullableOptionalString = 5, + kNullableStruct = 6, + kOptionalStruct = 7, + kNullableOptionalStruct = 8, + kNullableList = 9, + kOptionalList = 10, + kNullableOptionalList = 11, }; struct Type @@ -43904,9 +43894,6 @@ struct Type DataModel::Nullable> nullableList; Optional> optionalList; Optional>> nullableOptionalList; - DataModel::Nullable nullableTypedef; - Optional optionalTypedef; - Optional> nullableOptionalTypedef; static constexpr bool kIsFabricScoped = false; @@ -43928,9 +43915,6 @@ struct DecodableType DataModel::Nullable> nullableList; Optional> optionalList; Optional>> nullableOptionalList; - DataModel::Nullable nullableTypedef; - Optional optionalTypedef; - Optional> nullableOptionalTypedef; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -44500,7 +44484,6 @@ enum class Fields : uint8_t kArg4 = 3, kArg5 = 4, kArg6 = 5, - kArg7 = 6, }; struct Type @@ -44516,7 +44499,6 @@ struct Type DataModel::List arg4; SimpleEnum arg5 = static_cast(0); bool arg6 = static_cast(0); - DataModel::List arg7; CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; @@ -44537,7 +44519,6 @@ struct DecodableType DataModel::DecodableList arg4; SimpleEnum arg5 = static_cast(0); bool arg6 = static_cast(0); - DataModel::DecodableList arg7; CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace TestStructArrayArgumentResponse @@ -44684,7 +44665,6 @@ enum class Fields : uint8_t kArg4 = 3, kArg5 = 4, kArg6 = 5, - kArg7 = 6, }; struct Type @@ -44700,7 +44680,6 @@ struct Type DataModel::List arg4; SimpleEnum arg5 = static_cast(0); bool arg6 = static_cast(0); - DataModel::List arg7; CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; @@ -44721,7 +44700,6 @@ struct DecodableType DataModel::DecodableList arg4; SimpleEnum arg5 = static_cast(0); bool arg6 = static_cast(0); - DataModel::DecodableList arg7; CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace TestStructArrayArgumentRequest @@ -44801,40 +44779,34 @@ struct DecodableType namespace TestComplexNullableOptionalResponse { enum class Fields : uint8_t { - kNullableIntWasNull = 0, - kNullableIntValue = 1, - kOptionalIntWasPresent = 2, - kOptionalIntValue = 3, - kNullableOptionalIntWasPresent = 4, - kNullableOptionalIntWasNull = 5, - kNullableOptionalIntValue = 6, - kNullableStringWasNull = 7, - kNullableStringValue = 8, - kOptionalStringWasPresent = 9, - kOptionalStringValue = 10, - kNullableOptionalStringWasPresent = 11, - kNullableOptionalStringWasNull = 12, - kNullableOptionalStringValue = 13, - kNullableStructWasNull = 14, - kNullableStructValue = 15, - kOptionalStructWasPresent = 16, - kOptionalStructValue = 17, - kNullableOptionalStructWasPresent = 18, - kNullableOptionalStructWasNull = 19, - kNullableOptionalStructValue = 20, - kNullableListWasNull = 21, - kNullableListValue = 22, - kOptionalListWasPresent = 23, - kOptionalListValue = 24, - kNullableOptionalListWasPresent = 25, - kNullableOptionalListWasNull = 26, - kNullableOptionalListValue = 27, - kNullableTypedefWasNull = 28, - kNullableTypedefValue = 29, - kOptionalTypedefWasPresent = 30, - kOptionalTypedefValue = 31, - kNullableOptionalTypedefWasPresent = 32, - kNullableOptionalTypedefWasNull = 33, + kNullableIntWasNull = 0, + kNullableIntValue = 1, + kOptionalIntWasPresent = 2, + kOptionalIntValue = 3, + kNullableOptionalIntWasPresent = 4, + kNullableOptionalIntWasNull = 5, + kNullableOptionalIntValue = 6, + kNullableStringWasNull = 7, + kNullableStringValue = 8, + kOptionalStringWasPresent = 9, + kOptionalStringValue = 10, + kNullableOptionalStringWasPresent = 11, + kNullableOptionalStringWasNull = 12, + kNullableOptionalStringValue = 13, + kNullableStructWasNull = 14, + kNullableStructValue = 15, + kOptionalStructWasPresent = 16, + kOptionalStructValue = 17, + kNullableOptionalStructWasPresent = 18, + kNullableOptionalStructWasNull = 19, + kNullableOptionalStructValue = 20, + kNullableListWasNull = 21, + kNullableListValue = 22, + kOptionalListWasPresent = 23, + kOptionalListValue = 24, + kNullableOptionalListWasPresent = 25, + kNullableOptionalListWasNull = 26, + kNullableOptionalListValue = 27, }; struct Type @@ -44872,12 +44844,6 @@ struct Type bool nullableOptionalListWasPresent = static_cast(0); Optional nullableOptionalListWasNull; Optional> nullableOptionalListValue; - bool nullableTypedefWasNull = static_cast(0); - Optional nullableTypedefValue; - bool optionalTypedefWasPresent = static_cast(0); - Optional optionalTypedefValue; - bool nullableOptionalTypedefWasPresent = static_cast(0); - Optional nullableOptionalTypedefWasNull; CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; @@ -44920,12 +44886,6 @@ struct DecodableType bool nullableOptionalListWasPresent = static_cast(0); Optional nullableOptionalListWasNull; Optional> nullableOptionalListValue; - bool nullableTypedefWasNull = static_cast(0); - Optional nullableTypedefValue; - bool optionalTypedefWasPresent = static_cast(0); - Optional optionalTypedefValue; - bool nullableOptionalTypedefWasPresent = static_cast(0); - Optional nullableOptionalTypedefWasNull; CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace TestComplexNullableOptionalResponse @@ -45353,7 +45313,6 @@ enum class Fields : uint8_t { kField1 = 0, kField2 = 1, - kField3 = 2, }; struct Type @@ -45365,7 +45324,6 @@ struct Type Globals::Structs::TestGlobalStruct::Type field1; Globals::TestGlobalEnum field2 = static_cast(0); - uint32_t field3 = static_cast(0); CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; @@ -45382,7 +45340,6 @@ struct DecodableType Globals::Structs::TestGlobalStruct::DecodableType field1; Globals::TestGlobalEnum field2 = static_cast(0); - uint32_t field3 = static_cast(0); CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace GlobalEchoResponse @@ -45758,7 +45715,6 @@ enum class Fields : uint8_t { kField1 = 0, kField2 = 1, - kField3 = 2, }; struct Type @@ -45770,7 +45726,6 @@ struct Type Globals::Structs::TestGlobalStruct::Type field1; Globals::TestGlobalEnum field2 = static_cast(0); - uint32_t field3 = static_cast(0); CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; @@ -45787,7 +45742,6 @@ struct DecodableType Globals::Structs::TestGlobalStruct::DecodableType field1; Globals::TestGlobalEnum field2 = static_cast(0); - uint32_t field3 = static_cast(0); CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace GlobalEchoRequest @@ -46936,30 +46890,6 @@ struct TypeInfo static constexpr bool MustUseTimedWrite() { return false; } }; } // namespace NullableGlobalStruct -namespace NullableTypedefAttr { -struct TypeInfo -{ - using Type = chip::app::DataModel::Nullable; - using DecodableType = chip::app::DataModel::Nullable; - using DecodableArgType = const chip::app::DataModel::Nullable &; - - static constexpr ClusterId GetClusterId() { return Clusters::UnitTesting::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::NullableTypedefAttr::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace NullableTypedefAttr -namespace NullableGlobalTypedef { -struct TypeInfo -{ - using Type = chip::app::DataModel::Nullable; - using DecodableType = chip::app::DataModel::Nullable; - using DecodableArgType = const chip::app::DataModel::Nullable &; - - static constexpr ClusterId GetClusterId() { return Clusters::UnitTesting::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::NullableGlobalTypedef::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace NullableGlobalTypedef namespace GeneratedCommandList { struct TypeInfo : public Clusters::Globals::Attributes::GeneratedCommandList::TypeInfo { @@ -47103,8 +47033,6 @@ struct TypeInfo Attributes::WriteOnlyInt8u::TypeInfo::DecodableType writeOnlyInt8u = static_cast(0); Attributes::NullableGlobalEnum::TypeInfo::DecodableType nullableGlobalEnum; Attributes::NullableGlobalStruct::TypeInfo::DecodableType nullableGlobalStruct; - Attributes::NullableTypedefAttr::TypeInfo::DecodableType nullableTypedefAttr; - Attributes::NullableGlobalTypedef::TypeInfo::DecodableType nullableGlobalTypedef; Attributes::GeneratedCommandList::TypeInfo::DecodableType generatedCommandList; Attributes::AcceptedCommandList::TypeInfo::DecodableType acceptedCommandList; Attributes::AttributeList::TypeInfo::DecodableType attributeList;