From f5e32c102089146d5441275fb16d43d42d073327 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Tue, 21 Mar 2023 09:22:21 -0400 Subject: [PATCH 01/23] Fix integer/long detection for codegen (#25757) * Fix integer/long detection for codegen * Remove duplicate import --- .../matter_idl/generators/java/__init__.py | 26 ++++++++++++++----- 1 file changed, 20 insertions(+), 6 deletions(-) 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 ed47f7137d06d4..02dda6997c5eef 100644 --- a/scripts/py_matter_idl/matter_idl/generators/java/__init__.py +++ b/scripts/py_matter_idl/matter_idl/generators/java/__init__.py @@ -241,7 +241,8 @@ def boxed_java_type(self): else: raise Exception("Unknown fundamental type") elif type(t) == BasicInteger: - if t.byte_count >= 4: + # the >= 3 will include int24_t to be considered "long" + if t.byte_count >= 3: return "Long" else: return "Integer" @@ -251,9 +252,15 @@ def boxed_java_type(self): else: return "String" elif type(t) == IdlEnumType: - return "Integer" + if t.base_type.byte_count >= 3: + return "Long" + else: + return "Integer" elif type(t) == IdlBitmapType: - return "Integer" + if t.base_type.byte_count >= 3: + return "Long" + else: + return "Integer" else: return "Object" @@ -278,7 +285,7 @@ def boxed_java_signature(self): else: raise Exception("Unknown fundamental type") elif type(t) == BasicInteger: - if t.byte_count >= 4: + if t.byte_count >= 3: return "Ljava/lang/Long;" else: return "Ljava/lang/Integer;" @@ -288,9 +295,15 @@ def boxed_java_signature(self): else: return "Ljava/lang/String;" elif type(t) == IdlEnumType: - return "Ljava/lang/Integer;" + if t.base_type.byte_count >= 3: + return "Ljava/lang/Long;" + else: + return "Ljava/lang/Integer;" elif type(t) == IdlBitmapType: - return "Ljava/lang/Integer;" + if t.base_type.byte_count >= 3: + return "Ljava/lang/Long;" + else: + return "Ljava/lang/Integer;" else: return "Lchip/devicecontroller/ChipStructs${}Cluster{};".format(self.context.cluster.name, self.data_type.name) @@ -369,6 +382,7 @@ def internal_render_all(self): """ Renders .CPP files required for JNI support. """ + # Every cluster has its own impl, to avoid # very large compilations (running out of RAM) for cluster in self.idl.clusters: From f459a4e20559706960dc98eebc8ffc1362382592 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Tue, 21 Mar 2023 10:33:30 -0400 Subject: [PATCH 02/23] Add `timed write attributes` support in IDL (#25756) * Parser support for timed writes * Small doc update * Matter idl support for timed write * Fix indent and codegen all * Remove extra line from readme * Fix conditional in requires_timed_write --- .../all-clusters-app.matter | 2 +- .../all-clusters-minimal-app.matter | 2 +- scripts/py_matter_idl/matter_idl/README.md | 3 +++ .../matter_idl/matter_grammar.lark | 1 + .../matter_idl/matter_idl_parser.py | 3 +++ .../matter_idl/matter_idl_types.py | 5 ++++ .../matter_idl/test_matter_idl_parser.py | 27 +++++++++++++++++++ .../templates/app/MatterIDL.zapt | 5 +++- .../data_model/controller-clusters.matter | 2 +- 9 files changed, 46 insertions(+), 4 deletions(-) diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter index 0624c2d2eca7fd..99acb67bc867a9 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter @@ -4208,7 +4208,7 @@ server cluster UnitTesting = 4294048773 { attribute int16s rangeRestrictedInt16s = 41; attribute LONG_OCTET_STRING listLongOctetString[] = 42; attribute TestFabricScoped listFabricScoped[] = 43; - attribute boolean timedWriteBoolean = 48; + timedwrite attribute boolean timedWriteBoolean = 48; attribute boolean generalErrorBoolean = 49; attribute boolean clusterErrorBoolean = 50; attribute nullable boolean nullableBoolean = 16384; diff --git a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter index 0b9400d1f4c62b..6a8b066ef5148a 100644 --- a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter +++ b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter @@ -3528,7 +3528,7 @@ server cluster UnitTesting = 4294048773 { attribute int16s rangeRestrictedInt16s = 41; attribute LONG_OCTET_STRING listLongOctetString[] = 42; attribute TestFabricScoped listFabricScoped[] = 43; - attribute boolean timedWriteBoolean = 48; + timedwrite attribute boolean timedWriteBoolean = 48; attribute boolean generalErrorBoolean = 49; attribute boolean clusterErrorBoolean = 50; attribute nullable boolean nullableBoolean = 16384; diff --git a/scripts/py_matter_idl/matter_idl/README.md b/scripts/py_matter_idl/matter_idl/README.md index e46fb4d00c853a..4446760bc5dc90 100644 --- a/scripts/py_matter_idl/matter_idl/README.md +++ b/scripts/py_matter_idl/matter_idl/README.md @@ -89,6 +89,9 @@ server cluster AccessControl = 31 { attribute AccessControlEntry acl[] = 0; // attributes are read-write by default attribute ExtensionEntry extension[] = 1; // and require a (spec defined) number + // attributes may require timed writes + timedwrite attribute int16u require_timed_writes = 3; + // Access control privileges on attributes default to: // // access(read: view, write: operate) diff --git a/scripts/py_matter_idl/matter_idl/matter_grammar.lark b/scripts/py_matter_idl/matter_idl/matter_grammar.lark index 14c0ffbb1baf55..e31e5a5cc2b700 100644 --- a/scripts/py_matter_idl/matter_idl/matter_grammar.lark +++ b/scripts/py_matter_idl/matter_idl/matter_grammar.lark @@ -35,6 +35,7 @@ attribute_with_access: attribute_access? struct_field attribute: attribute_qualities "attribute"i attribute_with_access ";" attribute_quality: "readonly"i -> attr_readonly | "nosubscribe"i -> attr_nosubscribe + | "timedwrite"i -> attr_timed attribute_qualities: attribute_quality* -> attribute_qualities request_struct: "request"i struct 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 8683965743ffe8..0bbea23c1688bd 100755 --- a/scripts/py_matter_idl/matter_idl/matter_idl_parser.py +++ b/scripts/py_matter_idl/matter_idl/matter_idl_parser.py @@ -175,6 +175,9 @@ def attr_readonly(self, _): def attr_nosubscribe(self, _): return AttributeQuality.NOSUBSCRIBE + def attr_timed(self, _): + return AttributeQuality.TIMED_WRITE + def attribute_qualities(self, qualities): return UnionOfAllFlags(qualities) or AttributeQuality.NONE 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 11df3b17771778..b4a47218a4d6d2 100644 --- a/scripts/py_matter_idl/matter_idl/matter_idl_types.py +++ b/scripts/py_matter_idl/matter_idl/matter_idl_types.py @@ -44,6 +44,7 @@ class AttributeQuality(enum.Flag): READABLE = enum.auto() WRITABLE = enum.auto() NOSUBSCRIBE = enum.auto() + TIMED_WRITE = enum.auto() class AttributeStorage(enum.Enum): @@ -135,6 +136,10 @@ def is_writable(self): def is_subscribable(self): return not (AttributeQuality.NOSUBSCRIBE & self.qualities) + @property + def requires_timed_write(self): + return AttributeQuality.TIMED_WRITE & self.qualities + @dataclass class Struct: 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 4d429bd22e3a07..00b8bce8193510 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 @@ -165,6 +165,33 @@ def test_sized_attribute(self): )]) self.assertEqual(actual, expected) + def test_timed_attributes(self): + actual = parseText(""" + server cluster MyCluster = 1 { + attribute int32u attr1 = 1; + timedwrite attribute int32u attr2 = 2; + attribute int32u attr3 = 3; + timedwrite attribute octet_string<44> attr4[] = 4; + } + """) + + expected = Idl(clusters=[ + Cluster(side=ClusterSide.SERVER, + name="MyCluster", + code=1, + attributes=[ + Attribute(qualities=AttributeQuality.READABLE | AttributeQuality.WRITABLE, definition=Field( + data_type=DataType(name="int32u"), code=1, name="attr1")), + Attribute(qualities=AttributeQuality.READABLE | AttributeQuality.WRITABLE | AttributeQuality.TIMED_WRITE, definition=Field( + data_type=DataType(name="int32u"), code=2, name="attr2")), + Attribute(qualities=AttributeQuality.READABLE | AttributeQuality.WRITABLE, definition=Field( + data_type=DataType(name="int32u"), code=3, name="attr3")), + Attribute(qualities=AttributeQuality.READABLE | AttributeQuality.WRITABLE | AttributeQuality.TIMED_WRITE, definition=Field( + data_type=DataType(name="octet_string", max_length=44), code=4, name="attr4", is_list=True)), + ] + )]) + self.assertEqual(actual, expected) + def test_attribute_access(self): actual = parseText(""" server cluster MyCluster = 1 { diff --git a/src/app/zap-templates/templates/app/MatterIDL.zapt b/src/app/zap-templates/templates/app/MatterIDL.zapt index 9f67be02284118..cfe40d71f5dbd4 100644 --- a/src/app/zap-templates/templates/app/MatterIDL.zapt +++ b/src/app/zap-templates/templates/app/MatterIDL.zapt @@ -47,7 +47,10 @@ {{/zcl_events}} {{#chip_server_cluster_attributes}} {{#unless isGlobalAttribute}} - {{! ensure indent }}{{#unless isWritableAttribute~}} + {{! ensure indent }}{{#if mustUseTimedWrite~}} + timedwrite {{!marker to place a space even with whitespace removal~}} + {{~/if~}} + {{~#unless isWritableAttribute~}} readonly {{!marker to place a space even with whitespace removal~}} {{~/unless~}} {{~!TODO: write only attributes should also be supported~}} diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index cb4df8c85b8b09..5bdcbb9d25d207 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -4539,7 +4539,7 @@ client cluster UnitTesting = 4294048773 { attribute int16s rangeRestrictedInt16s = 41; attribute LONG_OCTET_STRING listLongOctetString[] = 42; attribute TestFabricScoped listFabricScoped[] = 43; - attribute boolean timedWriteBoolean = 48; + timedwrite attribute boolean timedWriteBoolean = 48; attribute boolean generalErrorBoolean = 49; attribute boolean clusterErrorBoolean = 50; attribute boolean unsupported = 255; From 934a6b1d58a7af07829a335bddbc325c642da58f Mon Sep 17 00:00:00 2001 From: Bharat Raju Date: Tue, 21 Mar 2023 10:38:31 -0400 Subject: [PATCH 03/23] Deprecating chip_server_cluster_attributes (#25687) * Replacing a state helper such as chip_server_cluster_attributes with a stateless helper zcl_attributes_server such that we can get deprecate the stateful helpers one by one. Updating the zap being used Github: ZAP#898 * Updating min version to 3.16 instead of 3.17 Github: ZAP#898 --- .../templates/commands.zapt | 10 ++++---- .../docker/images/chip-cert-bins/Dockerfile | 2 +- scripts/setup/zap.json | 2 +- .../app-templates/CHIPClientCallbacks.h | 8 +++++++ .../app-templates/CHIPClientCallbacks.h | 8 +++++++ scripts/tools/zap/zap_execution.py | 2 +- .../templates/app/CHIPClientCallbacks.zapt | 4 ++-- .../zap-templates/templates/app/access.zapt | 24 +++++++++---------- .../templates/app/attributes/Accessors.zapt | 2 +- .../MTRAttributeTLVValueDecoder-src.zapt | 4 ++-- .../CHIP/templates/MTRBaseClusters-src.zapt | 8 +++---- .../CHIP/templates/MTRBaseClusters.zapt | 8 +++---- .../CHIP/templates/MTRCallbackBridge-src.zapt | 4 ++-- .../CHIP/templates/MTRCallbackBridge.zapt | 8 +++---- .../CHIP/templates/MTRClusters-src.zapt | 8 +++---- .../Framework/CHIP/templates/MTRClusters.zapt | 8 +++---- .../attribute_data_callback_name.zapt | 15 ++++++++++-- 17 files changed, 76 insertions(+), 49 deletions(-) diff --git a/examples/darwin-framework-tool/templates/commands.zapt b/examples/darwin-framework-tool/templates/commands.zapt index 9db578ce5a1134..fceae9ed451276 100644 --- a/examples/darwin-framework-tool/templates/commands.zapt +++ b/examples/darwin-framework-tool/templates/commands.zapt @@ -92,7 +92,7 @@ private: {{/unless}} {{/chip_cluster_commands}} -{{#chip_server_cluster_attributes}} +{{#zcl_attributes_server removeKeys='isOptional'}} {{#unless (wasRemoved (asUpperCamelCase parent.name preserveAcronyms=true) attribute=(asUpperCamelCase name preserveAcronyms=true))}} {{#*inline "cluster"}}Cluster{{asUpperCamelCase parent.name preserveAcronyms=true}}{{/inline}} {{#*inline "attribute"}}Attribute{{asUpperCamelCase name preserveAcronyms=true}}{{/inline}} @@ -201,7 +201,7 @@ private: {{else if (isCharString type)}} chip::ByteSpan mValue; {{else}} - {{chipType}} mValue; + {{as_underlying_zcl_type type}} mValue; {{/if_chip_complex}} }; @@ -246,7 +246,7 @@ public: {{/if}} {{/unless}} -{{/chip_server_cluster_attributes}} +{{/zcl_attributes_server}} {{/unless}} {{/chip_client_clusters}} @@ -268,7 +268,7 @@ void registerCluster{{asUpperCamelCase name}}(Commands & commands) make_unique<{{asUpperCamelCase clusterName}}{{asUpperCamelCase name}}>(), // {{/unless}} {{/chip_cluster_commands}} - {{#chip_server_cluster_attributes}} + {{#zcl_attributes_server removeKeys='isOptional'}} {{#first}} make_unique(Id), // {{/first}} @@ -291,7 +291,7 @@ void registerCluster{{asUpperCamelCase name}}(Commands & commands) make_unique(), // {{/if}} {{/unless}} - {{/chip_server_cluster_attributes}} + {{/zcl_attributes_server}} {{#zcl_events}} {{#first}} make_unique(Id), // diff --git a/integrations/docker/images/chip-cert-bins/Dockerfile b/integrations/docker/images/chip-cert-bins/Dockerfile index 9b47477e2aed40..82e88a28b0df5e 100644 --- a/integrations/docker/images/chip-cert-bins/Dockerfile +++ b/integrations/docker/images/chip-cert-bins/Dockerfile @@ -7,7 +7,7 @@ ARG COMMITHASH=7b99e6399c6069037c613782d78132c69b9dcabb # ZAP Development install, so that it runs on both x64 and arm64 # Generally this should match with the ZAP version that is used for codegen within the # specified SHA -ARG ZAP_VERSION=v2023.03.06-nightly +ARG ZAP_VERSION=v2023.03.17-nightly # Ensure TARGETPLATFORM is set RUN case ${TARGETPLATFORM} in \ diff --git a/scripts/setup/zap.json b/scripts/setup/zap.json index d5df23d69583ed..47ca7cdc8ce2b1 100644 --- a/scripts/setup/zap.json +++ b/scripts/setup/zap.json @@ -8,7 +8,7 @@ "mac-arm64", "windows-amd64" ], - "tags": ["version:2@v2023.03.06-nightly.1"] + "tags": ["version:2@v2023.03.17-nightly.1"] } ] } diff --git a/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/CHIPClientCallbacks.h b/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/CHIPClientCallbacks.h index 3be02a7d723acc..fba215552b81e7 100644 --- a/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/CHIPClientCallbacks.h +++ b/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/CHIPClientCallbacks.h @@ -29,3 +29,11 @@ #include // List specific responses +typedef void (*OtaSoftwareUpdateProviderGeneratedCommandListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +typedef void (*OtaSoftwareUpdateProviderAcceptedCommandListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +typedef void (*OtaSoftwareUpdateProviderEventListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +typedef void (*OtaSoftwareUpdateProviderAttributeListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); diff --git a/scripts/tools/zap/tests/outputs/lighting-app/app-templates/CHIPClientCallbacks.h b/scripts/tools/zap/tests/outputs/lighting-app/app-templates/CHIPClientCallbacks.h index 3be02a7d723acc..fba215552b81e7 100644 --- a/scripts/tools/zap/tests/outputs/lighting-app/app-templates/CHIPClientCallbacks.h +++ b/scripts/tools/zap/tests/outputs/lighting-app/app-templates/CHIPClientCallbacks.h @@ -29,3 +29,11 @@ #include // List specific responses +typedef void (*OtaSoftwareUpdateProviderGeneratedCommandListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +typedef void (*OtaSoftwareUpdateProviderAcceptedCommandListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +typedef void (*OtaSoftwareUpdateProviderEventListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +typedef void (*OtaSoftwareUpdateProviderAttributeListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); diff --git a/scripts/tools/zap/zap_execution.py b/scripts/tools/zap/zap_execution.py index aca1c43e10b512..f22291262ba647 100644 --- a/scripts/tools/zap/zap_execution.py +++ b/scripts/tools/zap/zap_execution.py @@ -23,7 +23,7 @@ # Use scripts/tools/zap/version_update.py to manage ZAP versioning as many # files may need updating for versions # -MIN_ZAP_VERSION = '2023.3.6' +MIN_ZAP_VERSION = '2023.3.16' class ZapTool: diff --git a/src/app/zap-templates/templates/app/CHIPClientCallbacks.zapt b/src/app/zap-templates/templates/app/CHIPClientCallbacks.zapt index 2f584a6e4638b0..4601597f501343 100644 --- a/src/app/zap-templates/templates/app/CHIPClientCallbacks.zapt +++ b/src/app/zap-templates/templates/app/CHIPClientCallbacks.zapt @@ -14,11 +14,11 @@ // List specific responses {{#chip_client_clusters}} -{{#chip_server_cluster_attributes}} +{{#zcl_attributes_server removeKeys='isOptional'}} {{#if isArray}} typedef void (*{{asUpperCamelCase parent.name}}{{asUpperCamelCase name}}ListAttributeCallback)(void * context, {{zapTypeToDecodableClusterObjectType type ns=parent.name isArgument=true}} data); {{/if}} -{{/chip_server_cluster_attributes}} +{{/zcl_attributes_server}} {{/chip_client_clusters}} {{/if}} \ No newline at end of file diff --git a/src/app/zap-templates/templates/app/access.zapt b/src/app/zap-templates/templates/app/access.zapt index 9a8e400df83d17..fca0bd9b4a20d1 100644 --- a/src/app/zap-templates/templates/app/access.zapt +++ b/src/app/zap-templates/templates/app/access.zapt @@ -15,7 +15,7 @@ // Parallel array data (*cluster*, attribute, privilege) for read attribute #define GENERATED_ACCESS_READ_ATTRIBUTE__CLUSTER { \ {{/first}} - {{#chip_server_cluster_attributes}} + {{#enabled_attributes_for_cluster_and_side name 'server'}} {{#access entity="attribute"}} {{#if hasOperation}} {{#if (isStrEqual operation "read")}} @@ -37,7 +37,7 @@ {{/if}} {{/if}} {{/access}} - {{/chip_server_cluster_attributes}} + {{/enabled_attributes_for_cluster_and_side}} {{#last}} } {{/last}} @@ -48,7 +48,7 @@ // Parallel array data (cluster, *attribute*, privilege) for read attribute #define GENERATED_ACCESS_READ_ATTRIBUTE__ATTRIBUTE { \ {{/first}} - {{#chip_server_cluster_attributes}} + {{#enabled_attributes_for_cluster_and_side name 'server'}} {{#access entity="attribute"}} {{#if hasOperation}} {{#if (isStrEqual operation "read")}} @@ -70,7 +70,7 @@ {{/if}} {{/if}} {{/access}} - {{/chip_server_cluster_attributes}} + {{/enabled_attributes_for_cluster_and_side}} {{#last}} } {{/last}} @@ -81,7 +81,7 @@ // Parallel array data (cluster, attribute, *privilege*) for read attribute #define GENERATED_ACCESS_READ_ATTRIBUTE__PRIVILEGE { \ {{/first}} - {{#chip_server_cluster_attributes}} + {{#enabled_attributes_for_cluster_and_side name 'server'}} {{#access entity="attribute"}} {{#if hasOperation}} {{#if (isStrEqual operation "read")}} @@ -103,7 +103,7 @@ {{/if}} {{/if}} {{/access}} - {{/chip_server_cluster_attributes}} + {{/enabled_attributes_for_cluster_and_side}} {{#last}} } {{/last}} @@ -116,7 +116,7 @@ // Parallel array data (*cluster*, attribute, privilege) for write attribute #define GENERATED_ACCESS_WRITE_ATTRIBUTE__CLUSTER { \ {{/first}} - {{#chip_server_cluster_attributes}} + {{#enabled_attributes_for_cluster_and_side name 'server'}} {{#access entity="attribute"}} {{#if hasOperation}} {{#if (isStrEqual operation "write")}} @@ -138,7 +138,7 @@ {{/if}} {{/if}} {{/access}} - {{/chip_server_cluster_attributes}} + {{/enabled_attributes_for_cluster_and_side}} {{#last}} } {{/last}} @@ -149,7 +149,7 @@ // Parallel array data (cluster, *attribute*, privilege) for write attribute #define GENERATED_ACCESS_WRITE_ATTRIBUTE__ATTRIBUTE { \ {{/first}} - {{#chip_server_cluster_attributes}} + {{#enabled_attributes_for_cluster_and_side name 'server'}} {{#access entity="attribute"}} {{#if hasOperation}} {{#if (isStrEqual operation "write")}} @@ -171,7 +171,7 @@ {{/if}} {{/if}} {{/access}} - {{/chip_server_cluster_attributes}} + {{/enabled_attributes_for_cluster_and_side}} {{#last}} } {{/last}} @@ -182,7 +182,7 @@ // Parallel array data (cluster, attribute, *privilege*) for write attribute #define GENERATED_ACCESS_WRITE_ATTRIBUTE__PRIVILEGE { \ {{/first}} - {{#chip_server_cluster_attributes}} + {{#enabled_attributes_for_cluster_and_side name 'server'}} {{#access entity="attribute"}} {{#if hasOperation}} {{#if (isStrEqual operation "write")}} @@ -204,7 +204,7 @@ {{/if}} {{/if}} {{/access}} - {{/chip_server_cluster_attributes}} + {{/enabled_attributes_for_cluster_and_side}} {{#last}} } {{/last}} diff --git a/src/app/zap-templates/templates/app/attributes/Accessors.zapt b/src/app/zap-templates/templates/app/attributes/Accessors.zapt index a9d96ae336c88a..8854633c99d33b 100644 --- a/src/app/zap-templates/templates/app/attributes/Accessors.zapt +++ b/src/app/zap-templates/templates/app/attributes/Accessors.zapt @@ -26,7 +26,7 @@ namespace Attributes { {{#if_is_struct type}} {{else if (canHaveSimpleAccessors this)}} namespace {{asUpperCamelCase label}} { -EmberAfStatus Get(chip::EndpointId endpoint, {{accessorGetterType this}} value); // {{type}} {{isArray}} +EmberAfStatus Get(chip::EndpointId endpoint, {{accessorGetterType this}} value); // {{type}} EmberAfStatus Set(chip::EndpointId endpoint, {{zapTypeToEncodableClusterObjectType type ns=parent.name forceNotNullable=true forceNotOptional=true}} value); {{#if isNullable}} EmberAfStatus SetNull(chip::EndpointId endpoint); diff --git a/src/darwin/Framework/CHIP/templates/MTRAttributeTLVValueDecoder-src.zapt b/src/darwin/Framework/CHIP/templates/MTRAttributeTLVValueDecoder-src.zapt index 3b28b6e15651d1..d3f631cd72ee3f 100644 --- a/src/darwin/Framework/CHIP/templates/MTRAttributeTLVValueDecoder-src.zapt +++ b/src/darwin/Framework/CHIP/templates/MTRAttributeTLVValueDecoder-src.zapt @@ -24,7 +24,7 @@ id MTRDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader & using namespace Clusters::{{asUpperCamelCase name}}; switch (aPath.mAttributeId) { - {{#chip_server_cluster_attributes}} + {{#zcl_attributes_server removeKeys='isOptional'}} {{#unless (wasRemoved (asUpperCamelCase ../name preserveAcronyms=true) attribute=(asUpperCamelCase name preserveAcronyms=true))}} case Attributes::{{asUpperCamelCase name}}::Id: { using TypeInfo = Attributes::{{asUpperCamelCase name}}::TypeInfo; @@ -39,7 +39,7 @@ id MTRDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader & return value; } {{/unless}} - {{/chip_server_cluster_attributes}} + {{/zcl_attributes_server}} default: *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; diff --git a/src/darwin/Framework/CHIP/templates/MTRBaseClusters-src.zapt b/src/darwin/Framework/CHIP/templates/MTRBaseClusters-src.zapt index ebd787febabe6c..086eff27135f0e 100644 --- a/src/darwin/Framework/CHIP/templates/MTRBaseClusters-src.zapt +++ b/src/darwin/Framework/CHIP/templates/MTRBaseClusters-src.zapt @@ -129,7 +129,7 @@ MTR{{cluster}}Cluster{{command}}Params command=(asUpperCamelCase name preserveAcronyms=true)}} {{/chip_cluster_commands}} -{{#chip_server_cluster_attributes}} +{{#zcl_attributes_server removeKeys='isOptional'}} {{! This is used as the implementation for both the new-name and old-name bits, so check for both here. }} {{#unless (and (wasRemoved (asUpperCamelCase parent.name preserveAcronyms=true) attribute=(asUpperCamelCase name preserveAcronyms=true)) (or (wasRemoved (compatClusterNameRemapping parent.name) attribute=(compatAttributeNameRemapping parent.name name)) @@ -232,7 +232,7 @@ reportHandler:(void (^)({{asObjectiveCClass type parent.name}} * _Nullable value {{/if}} {{/unless}} -{{/chip_server_cluster_attributes}} +{{/zcl_attributes_server}} @end {{/unless}} @@ -277,7 +277,7 @@ reportHandler:(void (^)({{asObjectiveCClass type parent.name}} * _Nullable value command=(compatCommandNameRemapping parent.name name)}} {{/chip_cluster_commands}} -{{#chip_server_cluster_attributes}} +{{#zcl_attributes_server removeKeys='isOptional'}} {{#if (and (wasIntroducedBeforeRelease "First major API revamp" (compatClusterNameRemapping parent.name) attribute=(compatAttributeNameRemapping parent.name name)) (not (wasRemoved (compatClusterNameRemapping parent.name) attribute=(compatAttributeNameRemapping parent.name name))))}} {{#*inline "attribute"}}Attribute{{compatAttributeNameRemapping parent.name name}}{{/inline}} @@ -333,7 +333,7 @@ subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptio } {{/if}} {{/if}} -{{/chip_server_cluster_attributes}} +{{/zcl_attributes_server}} - (nullable instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint diff --git a/src/darwin/Framework/CHIP/templates/MTRBaseClusters.zapt b/src/darwin/Framework/CHIP/templates/MTRBaseClusters.zapt index 7fa8c4ebc81593..83f7a9719f5b15 100644 --- a/src/darwin/Framework/CHIP/templates/MTRBaseClusters.zapt +++ b/src/darwin/Framework/CHIP/templates/MTRBaseClusters.zapt @@ -42,7 +42,7 @@ NS_ASSUME_NONNULL_BEGIN command=(asUpperCamelCase name preserveAcronyms=true)}} {{/chip_cluster_commands}} -{{#chip_server_cluster_attributes}} +{{#zcl_attributes_server removeKeys='isOptional'}} {{#unless (wasRemoved (asUpperCamelCase parent.name preserveAcronyms=true) attribute=(asUpperCamelCase name preserveAcronyms=true))}} {{#*inline "attribute"}}Attribute{{asUpperCamelCase name preserveAcronyms=true}}{{/inline}} - (void)read{{>attribute}}With @@ -62,7 +62,7 @@ subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptio + (void) read{{>attribute}}WithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)({{asObjectiveCClass type parent.name}} * _Nullable value, NSError * _Nullable error))completion {{availability (asUpperCamelCase parent.name preserveAcronyms=true) attribute=(asUpperCamelCase name preserveAcronyms=true) minimalRelease="First major API revamp"}}; {{/if}} {{/unless}} -{{/chip_server_cluster_attributes}} +{{/zcl_attributes_server}} - (instancetype)init NS_UNAVAILABLE; + (instancetype)new NS_UNAVAILABLE; @@ -203,7 +203,7 @@ typedef NS_OPTIONS({{asUnderlyingZclType name}}, {{objCEnumName clusterName bitm command=(compatCommandNameRemapping parent.name name)}} {{/chip_cluster_commands}} -{{#chip_server_cluster_attributes}} +{{#zcl_attributes_server removeKeys='isOptional'}} {{#if (and (wasIntroducedBeforeRelease "First major API revamp" (compatClusterNameRemapping parent.name) attribute=(compatAttributeNameRemapping parent.name name)) (not (wasRemoved (compatClusterNameRemapping parent.name) attribute=(compatAttributeNameRemapping parent.name name))))}} {{#*inline "attribute"}}Attribute{{compatAttributeNameRemapping parent.name name}}{{/inline}} @@ -225,7 +225,7 @@ subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptio + (void) read{{>attribute}}WithAttributeCache:(MTRAttributeCacheContainer *)attributeCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completionHandler:(void (^)({{asObjectiveCClass type parent.name compatRemapClusterName=true}} * _Nullable value, NSError * _Nullable error))completionHandler {{availability (compatClusterNameRemapping parent.name) attribute=(compatAttributeNameRemapping parent.name name) deprecatedRelease="First major API revamp" deprecationMessage=(concat "Please use readAttribute" (asUpperCamelCase name preserveAcronyms=true) "WithAttributeCache:endpoint:queue:completion:")}}; {{/if}} {{/if}} -{{/chip_server_cluster_attributes}} +{{/zcl_attributes_server}} @end diff --git a/src/darwin/Framework/CHIP/templates/MTRCallbackBridge-src.zapt b/src/darwin/Framework/CHIP/templates/MTRCallbackBridge-src.zapt index 5ddf8c083944df..fe89a2eb4f5ba4 100644 --- a/src/darwin/Framework/CHIP/templates/MTRCallbackBridge-src.zapt +++ b/src/darwin/Framework/CHIP/templates/MTRCallbackBridge-src.zapt @@ -38,7 +38,7 @@ {{#>MTRCallbackBridge type="vendor_id" isNullable=true ns="chip"}}NullableVendorIdAttributeCallback{{/MTRCallbackBridge}} {{#chip_client_clusters includeAll=true}} -{{#chip_server_cluster_attributes}} +{{#zcl_attributes_server removeKeys='isOptional'}} {{#unless (wasRemoved (asUpperCamelCase ../name preserveAcronyms=true) attribute=(asUpperCamelCase name preserveAcronyms=true))}} {{#if isArray}} {{#>MTRCallbackBridge ns=parent.name }}{{asUpperCamelCase ../../name preserveAcronyms=true}}{{asUpperCamelCase ../name preserveAcronyms=true}}ListAttributeCallback{{/MTRCallbackBridge}} @@ -51,7 +51,7 @@ {{/if_is_strongly_typed_bitmap}} {{/if}} {{/unless}} -{{/chip_server_cluster_attributes}} +{{/zcl_attributes_server}} {{/chip_client_clusters}} {{#chip_client_clusters includeAll=true}} diff --git a/src/darwin/Framework/CHIP/templates/MTRCallbackBridge.zapt b/src/darwin/Framework/CHIP/templates/MTRCallbackBridge.zapt index 5249fb152d89cd..7c3f2bb92b120c 100644 --- a/src/darwin/Framework/CHIP/templates/MTRCallbackBridge.zapt +++ b/src/darwin/Framework/CHIP/templates/MTRCallbackBridge.zapt @@ -32,7 +32,7 @@ typedef void (*Nullable{{asUpperCamelCase parent.name preserveAcronyms=true}}Clu {{/zcl_clusters}} {{#chip_client_clusters includeAll=true}} -{{#chip_server_cluster_attributes}} +{{#zcl_attributes_server removeKeys='isOptional'}} {{#unless (wasRemoved (asUpperCamelCase parent.name preserveAcronyms=true) attribute=(asUpperCamelCase name preserveAcronyms=true))}} {{#if isArray}} typedef void (*{{asUpperCamelCase parent.name preserveAcronyms=true}}{{asUpperCamelCase name preserveAcronyms=true}}ListAttributeCallback)(void * context, {{zapTypeToDecodableClusterObjectType type ns=parent.name isArgument=true}} data); @@ -45,7 +45,7 @@ typedef void (*{{asUpperCamelCase parent.name preserveAcronyms=true}}{{asUpperCa {{/if_is_strongly_typed_bitmap}} {{/if}} {{/unless}} -{{/chip_server_cluster_attributes}} +{{/zcl_attributes_server}} {{/chip_client_clusters}} {{#>MTRCallbackBridge header="1" partial-type="Status" }}DefaultSuccessCallback{{/MTRCallbackBridge}} @@ -80,7 +80,7 @@ typedef void (*{{asUpperCamelCase parent.name preserveAcronyms=true}}{{asUpperCa {{#>MTRCallbackBridge header="1" type="vendor_id" isNullable=true ns="chip"}}NullableVendorIdAttributeCallback{{/MTRCallbackBridge}} {{#chip_client_clusters includeAll=true}} -{{#chip_server_cluster_attributes}} +{{#zcl_attributes_server removeKeys='isOptional'}} {{#unless (wasRemoved (asUpperCamelCase parent.name preserveAcronyms=true) attribute=(asUpperCamelCase name preserveAcronyms=true))}} {{#if isArray}} {{#>MTRCallbackBridge header="1" ns=parent.name }}{{asUpperCamelCase ../../name preserveAcronyms=true}}{{asUpperCamelCase ../name preserveAcronyms=true}}ListAttributeCallback{{/MTRCallbackBridge}} @@ -93,7 +93,7 @@ typedef void (*{{asUpperCamelCase parent.name preserveAcronyms=true}}{{asUpperCa {{/if_is_strongly_typed_bitmap}} {{/if}} {{/unless}} -{{/chip_server_cluster_attributes}} +{{/zcl_attributes_server}} {{/chip_client_clusters}} {{#chip_client_clusters includeAll=true}} diff --git a/src/darwin/Framework/CHIP/templates/MTRClusters-src.zapt b/src/darwin/Framework/CHIP/templates/MTRClusters-src.zapt index 8f5fc64c741b2a..9f7efaeaf89209 100644 --- a/src/darwin/Framework/CHIP/templates/MTRClusters-src.zapt +++ b/src/darwin/Framework/CHIP/templates/MTRClusters-src.zapt @@ -182,7 +182,7 @@ MTRCommandIDTypeCluster{{cluster}}Command{{command}}ID command=(asUpperCamelCase name preserveAcronyms=true)}} {{/chip_cluster_commands}} -{{#chip_server_cluster_attributes}} +{{#zcl_attributes_server}} {{! This is used as the implementation for both the new-name and old-name bits, so check for both here. }} {{#unless (and (wasRemoved (asUpperCamelCase parent.name preserveAcronyms=true) attribute=(asUpperCamelCase name preserveAcronyms=true)) (or (wasRemoved (compatClusterNameRemapping parent.name) attribute=(compatAttributeNameRemapping parent.name name)) @@ -214,7 +214,7 @@ MTRCommandIDTypeCluster{{cluster}}Command{{command}}ID {{/if}} {{/unless}} -{{/chip_server_cluster_attributes}} +{{/zcl_attributes_server}} @end {{/unless}} @@ -262,7 +262,7 @@ MTRCommandIDTypeCluster{{cluster}}Command{{command}}ID {{> commandImpl cluster=(compatClusterNameRemapping parent.name) command=(compatCommandNameRemapping parent.name name)}} {{/chip_cluster_commands}} -{{~#chip_server_cluster_attributes}} +{{~#zcl_attributes_server}} {{~#*inline "attributeImpls"}} {{#unless (or (isStrEqual attribute (asUpperCamelCase name preserveAcronyms=true)) (wasRemoved (compatClusterNameRemapping parent.name) attribute=attribute))}} @@ -283,7 +283,7 @@ MTRCommandIDTypeCluster{{cluster}}Command{{command}}ID {{/unless}} {{/inline~}} {{> attributeImpls attribute=(compatAttributeNameRemapping parent.name name)}} -{{/chip_server_cluster_attributes}} +{{/zcl_attributes_server}} @end {{/if}} diff --git a/src/darwin/Framework/CHIP/templates/MTRClusters.zapt b/src/darwin/Framework/CHIP/templates/MTRClusters.zapt index 9124b89df0c7fc..b8c0650cb11d54 100644 --- a/src/darwin/Framework/CHIP/templates/MTRClusters.zapt +++ b/src/darwin/Framework/CHIP/templates/MTRClusters.zapt @@ -37,7 +37,7 @@ NS_ASSUME_NONNULL_BEGIN command=(asUpperCamelCase name preserveAcronyms=true)}} {{/chip_cluster_commands}} -{{#chip_server_cluster_attributes}} +{{#zcl_attributes_server}} {{#unless (wasRemoved (asUpperCamelCase parent.name preserveAcronyms=true) attribute=(asUpperCamelCase name preserveAcronyms=true))}} {{#*inline "attribute"}}Attribute{{asUpperCamelCase name preserveAcronyms=true}}{{/inline}} {{#*inline "availability"}} @@ -49,7 +49,7 @@ NS_ASSUME_NONNULL_BEGIN - (void)write{{>attribute}}WithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params {{> availability}}; {{/if}} {{/unless}} -{{/chip_server_cluster_attributes}} +{{/zcl_attributes_server}} - (instancetype)init NS_UNAVAILABLE; + (instancetype)new NS_UNAVAILABLE; @@ -93,7 +93,7 @@ NS_ASSUME_NONNULL_BEGIN {{> commandDecl cluster=(compatClusterNameRemapping parent.name) command=(compatCommandNameRemapping parent.name name)}} {{/chip_cluster_commands}} -{{~#chip_server_cluster_attributes}} +{{~#zcl_attributes_server}} {{~#*inline "attributeDecls"}} {{#unless (isStrEqual attribute (asUpperCamelCase name preserveAcronyms=true))}} - (NSDictionary *)readAttribute{{attribute}}WithParams:(MTRReadParams * _Nullable)params {{availability cluster attribute=attribute deprecatedRelease="First major API revamp" deprecationMessage=(concat "Please use readAttribute" (asUpperCamelCase name preserveAcronyms=true) "WithParams on MTRCluster" (asUpperCamelCase parent.name preserveAcronyms=true))}}; @@ -105,7 +105,7 @@ NS_ASSUME_NONNULL_BEGIN {{/inline~}} {{> attributeDecls cluster=(compatClusterNameRemapping parent.name) attribute=(compatAttributeNameRemapping parent.name name)}} -{{/chip_server_cluster_attributes}} +{{/zcl_attributes_server}} @end {{/if}} diff --git a/src/darwin/Framework/CHIP/templates/partials/attribute_data_callback_name.zapt b/src/darwin/Framework/CHIP/templates/partials/attribute_data_callback_name.zapt index 28ec591edb7a44..ada5f127ffd0b1 100644 --- a/src/darwin/Framework/CHIP/templates/partials/attribute_data_callback_name.zapt +++ b/src/darwin/Framework/CHIP/templates/partials/attribute_data_callback_name.zapt @@ -13,9 +13,20 @@ {{~#if (isStrEqual (asUpperCamelCase type) (asUpperCamelCase "vendor_id"))~}} VendorId {{~else if_is_strongly_typed_chip_enum type~}} - {{asUpperCamelCase parent.name preserveAcronyms=true}}Cluster{{asUpperCamelCase type preserveAcronyms=true}} + {{asUpperCamelCase parent.name preserveAcronyms=true}}Cluster{{asUpperCamelCase type preserveAcronyms=true}} + {{~else if (isOctetString type)~}} + OctetString + {{~else if (isCharString type)~}} + CharString + {{~else if (or (is_str_equal type "float") + (is_str_equal type "single"))~}} + Float + {{~else if (is_str_equal type "double")~}} + Double + {{~else if (is_str_equal type "boolean")~}} + Boolean {{~else~}} - {{chipCallback.name}} + Int{{as_zcl_data_type_size type parent.id sizeIn='bits' roundUpToPowerOfTwo=1}}{{~#if_is_data_type_signed type parent.id~}}s{{else}}u{{/if_is_data_type_signed}} {{~/if~}} {{~/if_is_struct~}} {{~/if~}} From 5a0811e056fdef8b12783671c48926267d271ae5 Mon Sep 17 00:00:00 2001 From: Jakub Date: Tue, 21 Mar 2023 18:25:08 +0100 Subject: [PATCH 04/23] [Tizen] Bluetooth add advertising flags setup (#25764) * Add call bt_adapter_le_set_advertising_flags * Add missing include files * Reformat --- src/platform/Tizen/BLEManagerImpl.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/platform/Tizen/BLEManagerImpl.cpp b/src/platform/Tizen/BLEManagerImpl.cpp index 55144ba1b68985..1ce4d49829ea2d 100644 --- a/src/platform/Tizen/BLEManagerImpl.cpp +++ b/src/platform/Tizen/BLEManagerImpl.cpp @@ -42,6 +42,8 @@ #include #include +#include +#include #include #include @@ -677,6 +679,10 @@ int BLEManagerImpl::StartBLEAdvertising() VerifyOrExit(ret == BT_ERROR_NONE, ChipLogError(DeviceLayer, "bt_adapter_le_add_advertising_service_data() failed. ret: %d", ret)); + ret = bt_adapter_le_set_advertising_flags( + mAdvertiser, BT_ADAPTER_LE_ADVERTISING_FLAGS_GEN_DISC | BT_ADAPTER_LE_ADVERTISING_FLAGS_BREDR_UNSUP); + VerifyOrExit(ret == BT_ERROR_NONE, ChipLogError(DeviceLayer, "bt_adapter_le_set_advertising_flags() failed. ret: %d", ret)); + ret = bt_adapter_le_set_advertising_device_name(mAdvertiser, BT_ADAPTER_LE_PACKET_ADVERTISING, true); VerifyOrExit(ret == BT_ERROR_NONE, ChipLogError(DeviceLayer, "bt_adapter_le_set_advertising_device_name() failed. ret: %d", ret)); From abac35a345763a161525047399fee99a91c6233c Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Tue, 21 Mar 2023 14:16:26 -0400 Subject: [PATCH 05/23] Enable all thermostat client attributes in controller clusters (#25753) * Enable a bunch of thermostat client attributes * Zap regen --------- Co-authored-by: Andrei Litvin --- .../data_model/controller-clusters.matter | 32 + .../data_model/controller-clusters.zap | 489 +++++++- .../CHIPAttributeTLVValueDecoder.cpp | 550 +++++++++ .../java/zap-generated/CHIPCallbackTypes.h | 64 ++ .../zap-generated/CHIPClustersWrite-JNI.cpp | 959 ++++++++++++++++ .../java/zap-generated/CHIPReadCallbacks.cpp | 670 +++++++++++ .../java/zap-generated/CHIPReadCallbacks.h | 301 +++++ .../chip/devicecontroller/ChipClusters.java | 1012 +++++++++++++++-- .../chip/devicecontroller/ChipIdLookup.java | 96 ++ .../devicecontroller/ClusterInfoMapping.java | 240 ++++ .../devicecontroller/ClusterReadMapping.java | 451 ++++++++ .../devicecontroller/ClusterWriteMapping.java | 314 +++++ .../python/chip/clusters/CHIPClusters.py | 210 ++++ 13 files changed, 5318 insertions(+), 70 deletions(-) diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index 5bdcbb9d25d207..69c0d930e81436 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -3167,22 +3167,54 @@ client cluster Thermostat = 513 { } readonly attribute nullable int16s localTemperature = 0; + readonly attribute nullable int16s outdoorTemperature = 1; + readonly attribute bitmap8 occupancy = 2; readonly attribute int16s absMinHeatSetpointLimit = 3; readonly attribute int16s absMaxHeatSetpointLimit = 4; readonly attribute int16s absMinCoolSetpointLimit = 5; readonly attribute int16s absMaxCoolSetpointLimit = 6; + readonly attribute int8u PICoolingDemand = 7; + readonly attribute int8u PIHeatingDemand = 8; + attribute access(write: manage) bitmap8 HVACSystemTypeConfiguration = 9; + attribute access(write: manage) int8s localTemperatureCalibration = 16; attribute int16s occupiedCoolingSetpoint = 17; attribute int16s occupiedHeatingSetpoint = 18; + attribute int16s unoccupiedCoolingSetpoint = 19; + attribute int16s unoccupiedHeatingSetpoint = 20; attribute access(write: manage) int16s minHeatSetpointLimit = 21; attribute access(write: manage) int16s maxHeatSetpointLimit = 22; attribute access(write: manage) int16s minCoolSetpointLimit = 23; attribute access(write: manage) int16s maxCoolSetpointLimit = 24; attribute access(write: manage) int8s minSetpointDeadBand = 25; + attribute access(write: manage) bitmap8 remoteSensing = 26; attribute access(write: manage) ThermostatControlSequence controlSequenceOfOperation = 27; attribute access(write: manage) enum8 systemMode = 28; + readonly attribute enum8 thermostatRunningMode = 30; readonly attribute enum8 startOfWeek = 32; readonly attribute int8u numberOfWeeklyTransitions = 33; readonly attribute int8u numberOfDailyTransitions = 34; + attribute access(write: manage) enum8 temperatureSetpointHold = 35; + attribute access(write: manage) nullable int16u temperatureSetpointHoldDuration = 36; + attribute access(write: manage) bitmap8 thermostatProgrammingOperationMode = 37; + readonly attribute bitmap16 thermostatRunningState = 41; + readonly attribute enum8 setpointChangeSource = 48; + readonly attribute nullable int16s setpointChangeAmount = 49; + readonly attribute epoch_s setpointChangeSourceTimestamp = 50; + attribute access(write: manage) nullable int8u occupiedSetback = 52; + readonly attribute nullable int8u occupiedSetbackMin = 53; + readonly attribute nullable int8u occupiedSetbackMax = 54; + attribute access(write: manage) nullable int8u unoccupiedSetback = 55; + readonly attribute nullable int8u unoccupiedSetbackMin = 56; + readonly attribute nullable int8u unoccupiedSetbackMax = 57; + attribute access(write: manage) int8u emergencyHeatDelta = 58; + attribute access(write: manage) enum8 ACType = 64; + attribute access(write: manage) int16u ACCapacity = 65; + attribute access(write: manage) enum8 ACRefrigerantType = 66; + attribute access(write: manage) enum8 ACCompressorType = 67; + attribute access(write: manage) bitmap32 ACErrorCode = 68; + attribute access(write: manage) enum8 ACLouverPosition = 69; + readonly attribute nullable int16s ACCoilTemperature = 70; + attribute access(write: manage) enum8 ACCapacityformat = 71; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/src/controller/data_model/controller-clusters.zap b/src/controller/data_model/controller-clusters.zap index 05922a5e047f32..b9da13cdd78caf 100644 --- a/src/controller/data_model/controller-clusters.zap +++ b/src/controller/data_model/controller-clusters.zap @@ -1,5 +1,5 @@ { - "featureLevel": 92, + "featureLevel": 94, "creator": "zap", "keyValuePairs": [ { @@ -12362,6 +12362,38 @@ "maxInterval": 65344, "reportableChange": 0 }, + { + "name": "OutdoorTemperature", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int16s", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Occupancy", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "bitmap8", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x01", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "AbsMinHeatSetpointLimit", "code": 3, @@ -12432,7 +12464,7 @@ "mfgCode": null, "side": "server", "type": "int8u", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, @@ -12448,7 +12480,7 @@ "mfgCode": null, "side": "server", "type": "int8u", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, @@ -12458,6 +12490,38 @@ "maxInterval": 65344, "reportableChange": 0 }, + { + "name": "HVACSystemTypeConfiguration", + "code": 9, + "mfgCode": null, + "side": "server", + "type": "bitmap8", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LocalTemperatureCalibration", + "code": 16, + "mfgCode": null, + "side": "server", + "type": "int8s", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "OccupiedCoolingSetpoint", "code": 17, @@ -12490,6 +12554,38 @@ "maxInterval": 65344, "reportableChange": 0 }, + { + "name": "UnoccupiedCoolingSetpoint", + "code": 19, + "mfgCode": null, + "side": "server", + "type": "int16s", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "2600", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "UnoccupiedHeatingSetpoint", + "code": 20, + "mfgCode": null, + "side": "server", + "type": "int16s", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "2000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "MinHeatSetpointLimit", "code": 21, @@ -12570,6 +12666,22 @@ "maxInterval": 65534, "reportableChange": 0 }, + { + "name": "RemoteSensing", + "code": 26, + "mfgCode": null, + "side": "server", + "type": "bitmap8", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ControlSequenceOfOperation", "code": 27, @@ -12602,6 +12714,22 @@ "maxInterval": 65344, "reportableChange": 0 }, + { + "name": "ThermostatRunningMode", + "code": 30, + "mfgCode": null, + "side": "server", + "type": "enum8", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "StartOfWeek", "code": 32, @@ -12650,6 +12778,358 @@ "maxInterval": 65344, "reportableChange": 0 }, + { + "name": "TemperatureSetpointHold", + "code": 35, + "mfgCode": null, + "side": "server", + "type": "enum8", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "TemperatureSetpointHoldDuration", + "code": 36, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0xFFFF", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ThermostatProgrammingOperationMode", + "code": 37, + "mfgCode": null, + "side": "server", + "type": "bitmap8", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ThermostatRunningState", + "code": 41, + "mfgCode": null, + "side": "server", + "type": "bitmap16", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SetpointChangeSource", + "code": 48, + "mfgCode": null, + "side": "server", + "type": "enum8", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SetpointChangeAmount", + "code": 49, + "mfgCode": null, + "side": "server", + "type": "int16s", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x8000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SetpointChangeSourceTimestamp", + "code": 50, + "mfgCode": null, + "side": "server", + "type": "epoch_s", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OccupiedSetback", + "code": 52, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OccupiedSetbackMin", + "code": 53, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OccupiedSetbackMax", + "code": 54, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "UnoccupiedSetback", + "code": 55, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "UnoccupiedSetbackMin", + "code": 56, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "UnoccupiedSetbackMax", + "code": 57, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EmergencyHeatDelta", + "code": 58, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ACType", + "code": 64, + "mfgCode": null, + "side": "server", + "type": "enum8", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ACCapacity", + "code": 65, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ACRefrigerantType", + "code": 66, + "mfgCode": null, + "side": "server", + "type": "enum8", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ACCompressorType", + "code": 67, + "mfgCode": null, + "side": "server", + "type": "enum8", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ACErrorCode", + "code": 68, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ACLouverPosition", + "code": 69, + "mfgCode": null, + "side": "server", + "type": "enum8", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ACCoilTemperature", + "code": 70, + "mfgCode": null, + "side": "server", + "type": "int16s", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x8000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ACCapacityformat", + "code": 71, + "mfgCode": null, + "side": "server", + "type": "enum8", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "GeneratedCommandList", "code": 65528, @@ -21035,5 +21515,6 @@ "endpointVersion": 1, "deviceIdentifier": 22 } - ] + ], + "log": [] } \ No newline at end of file diff --git a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp index 841f21a8272e37..c58f7ab0e26bbf 100644 --- a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp @@ -12536,6 +12536,43 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR } return value; } + case Attributes::OutdoorTemperature::Id: { + using TypeInfo = Attributes::OutdoorTemperature::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + if (cppValue.IsNull()) + { + value = nullptr; + } + else + { + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue.Value(), value); + } + return value; + } + case Attributes::Occupancy::Id: { + using TypeInfo = Attributes::Occupancy::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue, value); + return value; + } case Attributes::AbsMinHeatSetpointLimit::Id: { using TypeInfo = Attributes::AbsMinHeatSetpointLimit::TypeInfo; TypeInfo::DecodableType cppValue; @@ -12596,6 +12633,66 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR cppValue, value); return value; } + case Attributes::PICoolingDemand::Id: { + using TypeInfo = Attributes::PICoolingDemand::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue, value); + return value; + } + case Attributes::PIHeatingDemand::Id: { + using TypeInfo = Attributes::PIHeatingDemand::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue, value); + return value; + } + case Attributes::HVACSystemTypeConfiguration::Id: { + using TypeInfo = Attributes::HVACSystemTypeConfiguration::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue, value); + return value; + } + case Attributes::LocalTemperatureCalibration::Id: { + using TypeInfo = Attributes::LocalTemperatureCalibration::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue, value); + return value; + } case Attributes::OccupiedCoolingSetpoint::Id: { using TypeInfo = Attributes::OccupiedCoolingSetpoint::TypeInfo; TypeInfo::DecodableType cppValue; @@ -12626,6 +12723,36 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR cppValue, value); return value; } + case Attributes::UnoccupiedCoolingSetpoint::Id: { + using TypeInfo = Attributes::UnoccupiedCoolingSetpoint::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue, value); + return value; + } + case Attributes::UnoccupiedHeatingSetpoint::Id: { + using TypeInfo = Attributes::UnoccupiedHeatingSetpoint::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue, value); + return value; + } case Attributes::MinHeatSetpointLimit::Id: { using TypeInfo = Attributes::MinHeatSetpointLimit::TypeInfo; TypeInfo::DecodableType cppValue; @@ -12701,6 +12828,21 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR cppValue, value); return value; } + case Attributes::RemoteSensing::Id: { + using TypeInfo = Attributes::RemoteSensing::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue, value); + return value; + } case Attributes::ControlSequenceOfOperation::Id: { using TypeInfo = Attributes::ControlSequenceOfOperation::TypeInfo; TypeInfo::DecodableType cppValue; @@ -12731,6 +12873,21 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR cppValue, value); return value; } + case Attributes::ThermostatRunningMode::Id: { + using TypeInfo = Attributes::ThermostatRunningMode::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue, value); + return value; + } case Attributes::StartOfWeek::Id: { using TypeInfo = Attributes::StartOfWeek::TypeInfo; TypeInfo::DecodableType cppValue; @@ -12776,6 +12933,399 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR cppValue, value); return value; } + case Attributes::TemperatureSetpointHold::Id: { + using TypeInfo = Attributes::TemperatureSetpointHold::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue, value); + return value; + } + case Attributes::TemperatureSetpointHoldDuration::Id: { + using TypeInfo = Attributes::TemperatureSetpointHoldDuration::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + if (cppValue.IsNull()) + { + value = nullptr; + } + else + { + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue.Value(), value); + } + return value; + } + case Attributes::ThermostatProgrammingOperationMode::Id: { + using TypeInfo = Attributes::ThermostatProgrammingOperationMode::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue, value); + return value; + } + case Attributes::ThermostatRunningState::Id: { + using TypeInfo = Attributes::ThermostatRunningState::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue, value); + return value; + } + case Attributes::SetpointChangeSource::Id: { + using TypeInfo = Attributes::SetpointChangeSource::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue, value); + return value; + } + case Attributes::SetpointChangeAmount::Id: { + using TypeInfo = Attributes::SetpointChangeAmount::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + if (cppValue.IsNull()) + { + value = nullptr; + } + else + { + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue.Value(), value); + } + return value; + } + case Attributes::SetpointChangeSourceTimestamp::Id: { + using TypeInfo = Attributes::SetpointChangeSourceTimestamp::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Long"; + std::string valueCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue, value); + return value; + } + case Attributes::OccupiedSetback::Id: { + using TypeInfo = Attributes::OccupiedSetback::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + if (cppValue.IsNull()) + { + value = nullptr; + } + else + { + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue.Value(), value); + } + return value; + } + case Attributes::OccupiedSetbackMin::Id: { + using TypeInfo = Attributes::OccupiedSetbackMin::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + if (cppValue.IsNull()) + { + value = nullptr; + } + else + { + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue.Value(), value); + } + return value; + } + case Attributes::OccupiedSetbackMax::Id: { + using TypeInfo = Attributes::OccupiedSetbackMax::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + if (cppValue.IsNull()) + { + value = nullptr; + } + else + { + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue.Value(), value); + } + return value; + } + case Attributes::UnoccupiedSetback::Id: { + using TypeInfo = Attributes::UnoccupiedSetback::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + if (cppValue.IsNull()) + { + value = nullptr; + } + else + { + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue.Value(), value); + } + return value; + } + case Attributes::UnoccupiedSetbackMin::Id: { + using TypeInfo = Attributes::UnoccupiedSetbackMin::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + if (cppValue.IsNull()) + { + value = nullptr; + } + else + { + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue.Value(), value); + } + return value; + } + case Attributes::UnoccupiedSetbackMax::Id: { + using TypeInfo = Attributes::UnoccupiedSetbackMax::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + if (cppValue.IsNull()) + { + value = nullptr; + } + else + { + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue.Value(), value); + } + return value; + } + case Attributes::EmergencyHeatDelta::Id: { + using TypeInfo = Attributes::EmergencyHeatDelta::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue, value); + return value; + } + case Attributes::ACType::Id: { + using TypeInfo = Attributes::ACType::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue, value); + return value; + } + case Attributes::ACCapacity::Id: { + using TypeInfo = Attributes::ACCapacity::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue, value); + return value; + } + case Attributes::ACRefrigerantType::Id: { + using TypeInfo = Attributes::ACRefrigerantType::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue, value); + return value; + } + case Attributes::ACCompressorType::Id: { + using TypeInfo = Attributes::ACCompressorType::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue, value); + return value; + } + case Attributes::ACErrorCode::Id: { + using TypeInfo = Attributes::ACErrorCode::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Long"; + std::string valueCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue, value); + return value; + } + case Attributes::ACLouverPosition::Id: { + using TypeInfo = Attributes::ACLouverPosition::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue, value); + return value; + } + case Attributes::ACCoilTemperature::Id: { + using TypeInfo = Attributes::ACCoilTemperature::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + if (cppValue.IsNull()) + { + value = nullptr; + } + else + { + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue.Value(), value); + } + return value; + } + case Attributes::ACCapacityformat::Id: { + using TypeInfo = Attributes::ACCapacityformat::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue, value); + return value; + } case Attributes::GeneratedCommandList::Id: { using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; TypeInfo::DecodableType cppValue; diff --git a/src/controller/java/zap-generated/CHIPCallbackTypes.h b/src/controller/java/zap-generated/CHIPCallbackTypes.h index 9e05325655140e..dd8c901e3afa27 100644 --- a/src/controller/java/zap-generated/CHIPCallbackTypes.h +++ b/src/controller/java/zap-generated/CHIPCallbackTypes.h @@ -1274,6 +1274,10 @@ typedef void (*CHIPThermostatClusterGetWeeklyScheduleResponseCallbackType)( typedef void (*CHIPThermostatClusterLocalTemperatureAttributeCallbackType)( void *, chip::app::Clusters::Thermostat::Attributes::LocalTemperature::TypeInfo::DecodableArgType); +typedef void (*CHIPThermostatClusterOutdoorTemperatureAttributeCallbackType)( + void *, chip::app::Clusters::Thermostat::Attributes::OutdoorTemperature::TypeInfo::DecodableArgType); +typedef void (*CHIPThermostatClusterOccupancyAttributeCallbackType)( + void *, chip::app::Clusters::Thermostat::Attributes::Occupancy::TypeInfo::DecodableArgType); typedef void (*CHIPThermostatClusterAbsMinHeatSetpointLimitAttributeCallbackType)( void *, chip::app::Clusters::Thermostat::Attributes::AbsMinHeatSetpointLimit::TypeInfo::DecodableArgType); typedef void (*CHIPThermostatClusterAbsMaxHeatSetpointLimitAttributeCallbackType)( @@ -1282,10 +1286,22 @@ typedef void (*CHIPThermostatClusterAbsMinCoolSetpointLimitAttributeCallbackType void *, chip::app::Clusters::Thermostat::Attributes::AbsMinCoolSetpointLimit::TypeInfo::DecodableArgType); typedef void (*CHIPThermostatClusterAbsMaxCoolSetpointLimitAttributeCallbackType)( void *, chip::app::Clusters::Thermostat::Attributes::AbsMaxCoolSetpointLimit::TypeInfo::DecodableArgType); +typedef void (*CHIPThermostatClusterPICoolingDemandAttributeCallbackType)( + void *, chip::app::Clusters::Thermostat::Attributes::PICoolingDemand::TypeInfo::DecodableArgType); +typedef void (*CHIPThermostatClusterPIHeatingDemandAttributeCallbackType)( + void *, chip::app::Clusters::Thermostat::Attributes::PIHeatingDemand::TypeInfo::DecodableArgType); +typedef void (*CHIPThermostatClusterHVACSystemTypeConfigurationAttributeCallbackType)( + void *, chip::app::Clusters::Thermostat::Attributes::HVACSystemTypeConfiguration::TypeInfo::DecodableArgType); +typedef void (*CHIPThermostatClusterLocalTemperatureCalibrationAttributeCallbackType)( + void *, chip::app::Clusters::Thermostat::Attributes::LocalTemperatureCalibration::TypeInfo::DecodableArgType); typedef void (*CHIPThermostatClusterOccupiedCoolingSetpointAttributeCallbackType)( void *, chip::app::Clusters::Thermostat::Attributes::OccupiedCoolingSetpoint::TypeInfo::DecodableArgType); typedef void (*CHIPThermostatClusterOccupiedHeatingSetpointAttributeCallbackType)( void *, chip::app::Clusters::Thermostat::Attributes::OccupiedHeatingSetpoint::TypeInfo::DecodableArgType); +typedef void (*CHIPThermostatClusterUnoccupiedCoolingSetpointAttributeCallbackType)( + void *, chip::app::Clusters::Thermostat::Attributes::UnoccupiedCoolingSetpoint::TypeInfo::DecodableArgType); +typedef void (*CHIPThermostatClusterUnoccupiedHeatingSetpointAttributeCallbackType)( + void *, chip::app::Clusters::Thermostat::Attributes::UnoccupiedHeatingSetpoint::TypeInfo::DecodableArgType); typedef void (*CHIPThermostatClusterMinHeatSetpointLimitAttributeCallbackType)( void *, chip::app::Clusters::Thermostat::Attributes::MinHeatSetpointLimit::TypeInfo::DecodableArgType); typedef void (*CHIPThermostatClusterMaxHeatSetpointLimitAttributeCallbackType)( @@ -1296,16 +1312,64 @@ typedef void (*CHIPThermostatClusterMaxCoolSetpointLimitAttributeCallbackType)( void *, chip::app::Clusters::Thermostat::Attributes::MaxCoolSetpointLimit::TypeInfo::DecodableArgType); typedef void (*CHIPThermostatClusterMinSetpointDeadBandAttributeCallbackType)( void *, chip::app::Clusters::Thermostat::Attributes::MinSetpointDeadBand::TypeInfo::DecodableArgType); +typedef void (*CHIPThermostatClusterRemoteSensingAttributeCallbackType)( + void *, chip::app::Clusters::Thermostat::Attributes::RemoteSensing::TypeInfo::DecodableArgType); typedef void (*CHIPThermostatClusterControlSequenceOfOperationAttributeCallbackType)( void *, chip::app::Clusters::Thermostat::Attributes::ControlSequenceOfOperation::TypeInfo::DecodableArgType); typedef void (*CHIPThermostatClusterSystemModeAttributeCallbackType)( void *, chip::app::Clusters::Thermostat::Attributes::SystemMode::TypeInfo::DecodableArgType); +typedef void (*CHIPThermostatClusterThermostatRunningModeAttributeCallbackType)( + void *, chip::app::Clusters::Thermostat::Attributes::ThermostatRunningMode::TypeInfo::DecodableArgType); typedef void (*CHIPThermostatClusterStartOfWeekAttributeCallbackType)( void *, chip::app::Clusters::Thermostat::Attributes::StartOfWeek::TypeInfo::DecodableArgType); typedef void (*CHIPThermostatClusterNumberOfWeeklyTransitionsAttributeCallbackType)( void *, chip::app::Clusters::Thermostat::Attributes::NumberOfWeeklyTransitions::TypeInfo::DecodableArgType); typedef void (*CHIPThermostatClusterNumberOfDailyTransitionsAttributeCallbackType)( void *, chip::app::Clusters::Thermostat::Attributes::NumberOfDailyTransitions::TypeInfo::DecodableArgType); +typedef void (*CHIPThermostatClusterTemperatureSetpointHoldAttributeCallbackType)( + void *, chip::app::Clusters::Thermostat::Attributes::TemperatureSetpointHold::TypeInfo::DecodableArgType); +typedef void (*CHIPThermostatClusterTemperatureSetpointHoldDurationAttributeCallbackType)( + void *, chip::app::Clusters::Thermostat::Attributes::TemperatureSetpointHoldDuration::TypeInfo::DecodableArgType); +typedef void (*CHIPThermostatClusterThermostatProgrammingOperationModeAttributeCallbackType)( + void *, chip::app::Clusters::Thermostat::Attributes::ThermostatProgrammingOperationMode::TypeInfo::DecodableArgType); +typedef void (*CHIPThermostatClusterThermostatRunningStateAttributeCallbackType)( + void *, chip::app::Clusters::Thermostat::Attributes::ThermostatRunningState::TypeInfo::DecodableArgType); +typedef void (*CHIPThermostatClusterSetpointChangeSourceAttributeCallbackType)( + void *, chip::app::Clusters::Thermostat::Attributes::SetpointChangeSource::TypeInfo::DecodableArgType); +typedef void (*CHIPThermostatClusterSetpointChangeAmountAttributeCallbackType)( + void *, chip::app::Clusters::Thermostat::Attributes::SetpointChangeAmount::TypeInfo::DecodableArgType); +typedef void (*CHIPThermostatClusterSetpointChangeSourceTimestampAttributeCallbackType)( + void *, chip::app::Clusters::Thermostat::Attributes::SetpointChangeSourceTimestamp::TypeInfo::DecodableArgType); +typedef void (*CHIPThermostatClusterOccupiedSetbackAttributeCallbackType)( + void *, chip::app::Clusters::Thermostat::Attributes::OccupiedSetback::TypeInfo::DecodableArgType); +typedef void (*CHIPThermostatClusterOccupiedSetbackMinAttributeCallbackType)( + void *, chip::app::Clusters::Thermostat::Attributes::OccupiedSetbackMin::TypeInfo::DecodableArgType); +typedef void (*CHIPThermostatClusterOccupiedSetbackMaxAttributeCallbackType)( + void *, chip::app::Clusters::Thermostat::Attributes::OccupiedSetbackMax::TypeInfo::DecodableArgType); +typedef void (*CHIPThermostatClusterUnoccupiedSetbackAttributeCallbackType)( + void *, chip::app::Clusters::Thermostat::Attributes::UnoccupiedSetback::TypeInfo::DecodableArgType); +typedef void (*CHIPThermostatClusterUnoccupiedSetbackMinAttributeCallbackType)( + void *, chip::app::Clusters::Thermostat::Attributes::UnoccupiedSetbackMin::TypeInfo::DecodableArgType); +typedef void (*CHIPThermostatClusterUnoccupiedSetbackMaxAttributeCallbackType)( + void *, chip::app::Clusters::Thermostat::Attributes::UnoccupiedSetbackMax::TypeInfo::DecodableArgType); +typedef void (*CHIPThermostatClusterEmergencyHeatDeltaAttributeCallbackType)( + void *, chip::app::Clusters::Thermostat::Attributes::EmergencyHeatDelta::TypeInfo::DecodableArgType); +typedef void (*CHIPThermostatClusterACTypeAttributeCallbackType)( + void *, chip::app::Clusters::Thermostat::Attributes::ACType::TypeInfo::DecodableArgType); +typedef void (*CHIPThermostatClusterACCapacityAttributeCallbackType)( + void *, chip::app::Clusters::Thermostat::Attributes::ACCapacity::TypeInfo::DecodableArgType); +typedef void (*CHIPThermostatClusterACRefrigerantTypeAttributeCallbackType)( + void *, chip::app::Clusters::Thermostat::Attributes::ACRefrigerantType::TypeInfo::DecodableArgType); +typedef void (*CHIPThermostatClusterACCompressorTypeAttributeCallbackType)( + void *, chip::app::Clusters::Thermostat::Attributes::ACCompressorType::TypeInfo::DecodableArgType); +typedef void (*CHIPThermostatClusterACErrorCodeAttributeCallbackType)( + void *, chip::app::Clusters::Thermostat::Attributes::ACErrorCode::TypeInfo::DecodableArgType); +typedef void (*CHIPThermostatClusterACLouverPositionAttributeCallbackType)( + void *, chip::app::Clusters::Thermostat::Attributes::ACLouverPosition::TypeInfo::DecodableArgType); +typedef void (*CHIPThermostatClusterACCoilTemperatureAttributeCallbackType)( + void *, chip::app::Clusters::Thermostat::Attributes::ACCoilTemperature::TypeInfo::DecodableArgType); +typedef void (*CHIPThermostatClusterACCapacityformatAttributeCallbackType)( + void *, chip::app::Clusters::Thermostat::Attributes::ACCapacityformat::TypeInfo::DecodableArgType); typedef void (*CHIPThermostatClusterGeneratedCommandListAttributeCallbackType)( void *, const chip::app::Clusters::Thermostat::Attributes::GeneratedCommandList::TypeInfo::DecodableType &); typedef void (*CHIPThermostatClusterAcceptedCommandListAttributeCallbackType)( diff --git a/src/controller/java/zap-generated/CHIPClustersWrite-JNI.cpp b/src/controller/java/zap-generated/CHIPClustersWrite-JNI.cpp index 3aab4f95f4c2a6..581c721f43c10c 100644 --- a/src/controller/java/zap-generated/CHIPClustersWrite-JNI.cpp +++ b/src/controller/java/zap-generated/CHIPClustersWrite-JNI.cpp @@ -2877,6 +2877,110 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, writeControlModeAttribute) onFailure.release(); } +JNI_METHOD(void, ThermostatCluster, writeHVACSystemTypeConfigurationAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + ListFreer listFreer; + using TypeInfo = chip::app::Clusters::Thermostat::Attributes::HVACSystemTypeConfiguration::TypeInfo; + TypeInfo::Type cppValue; + + std::vector> cleanupByteArrays; + std::vector> cleanupStrings; + + cppValue = + static_cast>(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, ThermostatCluster, writeLocalTemperatureCalibrationAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + ListFreer listFreer; + using TypeInfo = chip::app::Clusters::Thermostat::Attributes::LocalTemperatureCalibration::TypeInfo; + TypeInfo::Type cppValue; + + std::vector> cleanupByteArrays; + std::vector> cleanupStrings; + + cppValue = + static_cast>(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + JNI_METHOD(void, ThermostatCluster, writeOccupiedCoolingSetpointAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) { @@ -2981,6 +3085,110 @@ JNI_METHOD(void, ThermostatCluster, writeOccupiedHeatingSetpointAttribute) onFailure.release(); } +JNI_METHOD(void, ThermostatCluster, writeUnoccupiedCoolingSetpointAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + ListFreer listFreer; + using TypeInfo = chip::app::Clusters::Thermostat::Attributes::UnoccupiedCoolingSetpoint::TypeInfo; + TypeInfo::Type cppValue; + + std::vector> cleanupByteArrays; + std::vector> cleanupStrings; + + cppValue = + static_cast>(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, ThermostatCluster, writeUnoccupiedHeatingSetpointAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + ListFreer listFreer; + using TypeInfo = chip::app::Clusters::Thermostat::Attributes::UnoccupiedHeatingSetpoint::TypeInfo; + TypeInfo::Type cppValue; + + std::vector> cleanupByteArrays; + std::vector> cleanupStrings; + + cppValue = + static_cast>(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + JNI_METHOD(void, ThermostatCluster, writeMinHeatSetpointLimitAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) { @@ -3241,6 +3449,58 @@ JNI_METHOD(void, ThermostatCluster, writeMinSetpointDeadBandAttribute) onFailure.release(); } +JNI_METHOD(void, ThermostatCluster, writeRemoteSensingAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + ListFreer listFreer; + using TypeInfo = chip::app::Clusters::Thermostat::Attributes::RemoteSensing::TypeInfo; + TypeInfo::Type cppValue; + + std::vector> cleanupByteArrays; + std::vector> cleanupStrings; + + cppValue = + static_cast>(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + JNI_METHOD(void, ThermostatCluster, writeControlSequenceOfOperationAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) { @@ -3345,6 +3605,705 @@ JNI_METHOD(void, ThermostatCluster, writeSystemModeAttribute) onFailure.release(); } +JNI_METHOD(void, ThermostatCluster, writeTemperatureSetpointHoldAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + ListFreer listFreer; + using TypeInfo = chip::app::Clusters::Thermostat::Attributes::TemperatureSetpointHold::TypeInfo; + TypeInfo::Type cppValue; + + std::vector> cleanupByteArrays; + std::vector> cleanupStrings; + + cppValue = + static_cast>(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, ThermostatCluster, writeTemperatureSetpointHoldDurationAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + ListFreer listFreer; + using TypeInfo = chip::app::Clusters::Thermostat::Attributes::TemperatureSetpointHoldDuration::TypeInfo; + TypeInfo::Type cppValue; + + std::vector> cleanupByteArrays; + std::vector> cleanupStrings; + + if (value == nullptr) + { + cppValue.SetNull(); + } + else + { + auto & nonNullValue_0 = cppValue.SetNonNull(); + nonNullValue_0 = static_cast>( + chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + } + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, ThermostatCluster, writeThermostatProgrammingOperationModeAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + ListFreer listFreer; + using TypeInfo = chip::app::Clusters::Thermostat::Attributes::ThermostatProgrammingOperationMode::TypeInfo; + TypeInfo::Type cppValue; + + std::vector> cleanupByteArrays; + std::vector> cleanupStrings; + + cppValue = + static_cast>(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, ThermostatCluster, writeOccupiedSetbackAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + ListFreer listFreer; + using TypeInfo = chip::app::Clusters::Thermostat::Attributes::OccupiedSetback::TypeInfo; + TypeInfo::Type cppValue; + + std::vector> cleanupByteArrays; + std::vector> cleanupStrings; + + if (value == nullptr) + { + cppValue.SetNull(); + } + else + { + auto & nonNullValue_0 = cppValue.SetNonNull(); + nonNullValue_0 = static_cast>( + chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + } + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, ThermostatCluster, writeUnoccupiedSetbackAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + ListFreer listFreer; + using TypeInfo = chip::app::Clusters::Thermostat::Attributes::UnoccupiedSetback::TypeInfo; + TypeInfo::Type cppValue; + + std::vector> cleanupByteArrays; + std::vector> cleanupStrings; + + if (value == nullptr) + { + cppValue.SetNull(); + } + else + { + auto & nonNullValue_0 = cppValue.SetNonNull(); + nonNullValue_0 = static_cast>( + chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + } + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, ThermostatCluster, writeEmergencyHeatDeltaAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + ListFreer listFreer; + using TypeInfo = chip::app::Clusters::Thermostat::Attributes::EmergencyHeatDelta::TypeInfo; + TypeInfo::Type cppValue; + + std::vector> cleanupByteArrays; + std::vector> cleanupStrings; + + cppValue = + static_cast>(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, ThermostatCluster, writeACTypeAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + ListFreer listFreer; + using TypeInfo = chip::app::Clusters::Thermostat::Attributes::ACType::TypeInfo; + TypeInfo::Type cppValue; + + std::vector> cleanupByteArrays; + std::vector> cleanupStrings; + + cppValue = + static_cast>(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, ThermostatCluster, writeACCapacityAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + ListFreer listFreer; + using TypeInfo = chip::app::Clusters::Thermostat::Attributes::ACCapacity::TypeInfo; + TypeInfo::Type cppValue; + + std::vector> cleanupByteArrays; + std::vector> cleanupStrings; + + cppValue = + static_cast>(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, ThermostatCluster, writeACRefrigerantTypeAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + ListFreer listFreer; + using TypeInfo = chip::app::Clusters::Thermostat::Attributes::ACRefrigerantType::TypeInfo; + TypeInfo::Type cppValue; + + std::vector> cleanupByteArrays; + std::vector> cleanupStrings; + + cppValue = + static_cast>(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, ThermostatCluster, writeACCompressorTypeAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + ListFreer listFreer; + using TypeInfo = chip::app::Clusters::Thermostat::Attributes::ACCompressorType::TypeInfo; + TypeInfo::Type cppValue; + + std::vector> cleanupByteArrays; + std::vector> cleanupStrings; + + cppValue = + static_cast>(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, ThermostatCluster, writeACErrorCodeAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + ListFreer listFreer; + using TypeInfo = chip::app::Clusters::Thermostat::Attributes::ACErrorCode::TypeInfo; + TypeInfo::Type cppValue; + + std::vector> cleanupByteArrays; + std::vector> cleanupStrings; + + cppValue = static_cast>(chip::JniReferences::GetInstance().LongToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, ThermostatCluster, writeACLouverPositionAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + ListFreer listFreer; + using TypeInfo = chip::app::Clusters::Thermostat::Attributes::ACLouverPosition::TypeInfo; + TypeInfo::Type cppValue; + + std::vector> cleanupByteArrays; + std::vector> cleanupStrings; + + cppValue = + static_cast>(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, ThermostatCluster, writeACCapacityformatAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + ListFreer listFreer; + using TypeInfo = chip::app::Clusters::Thermostat::Attributes::ACCapacityformat::TypeInfo; + TypeInfo::Type cppValue; + + std::vector> cleanupByteArrays; + std::vector> cleanupStrings; + + cppValue = + static_cast>(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + JNI_METHOD(void, FanControlCluster, writeFanModeAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) { diff --git a/src/controller/java/zap-generated/CHIPReadCallbacks.cpp b/src/controller/java/zap-generated/CHIPReadCallbacks.cpp index 9190ebb0086b71..c18d259c722f14 100644 --- a/src/controller/java/zap-generated/CHIPReadCallbacks.cpp +++ b/src/controller/java/zap-generated/CHIPReadCallbacks.cpp @@ -21189,6 +21189,676 @@ void CHIPThermostatLocalTemperatureAttributeCallback::CallbackFn(void * context, env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); } +CHIPThermostatOutdoorTemperatureAttributeCallback::CHIPThermostatOutdoorTemperatureAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPThermostatOutdoorTemperatureAttributeCallback::~CHIPThermostatOutdoorTemperatureAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPThermostatOutdoorTemperatureAttributeCallback::CallbackFn(void * context, + const chip::app::DataModel::Nullable & value) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject javaValue; + if (value.IsNull()) + { + javaValue = nullptr; + } + else + { + std::string javaValueClassName = "java/lang/Integer"; + std::string javaValueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(javaValueClassName.c_str(), javaValueCtorSignature.c_str(), + value.Value(), javaValue); + } + + env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); +} + +CHIPThermostatTemperatureSetpointHoldDurationAttributeCallback::CHIPThermostatTemperatureSetpointHoldDurationAttributeCallback( + jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPThermostatTemperatureSetpointHoldDurationAttributeCallback::~CHIPThermostatTemperatureSetpointHoldDurationAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPThermostatTemperatureSetpointHoldDurationAttributeCallback::CallbackFn( + void * context, const chip::app::DataModel::Nullable & value) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject javaValue; + if (value.IsNull()) + { + javaValue = nullptr; + } + else + { + std::string javaValueClassName = "java/lang/Integer"; + std::string javaValueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(javaValueClassName.c_str(), javaValueCtorSignature.c_str(), + value.Value(), javaValue); + } + + env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); +} + +CHIPThermostatSetpointChangeAmountAttributeCallback::CHIPThermostatSetpointChangeAmountAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPThermostatSetpointChangeAmountAttributeCallback::~CHIPThermostatSetpointChangeAmountAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPThermostatSetpointChangeAmountAttributeCallback::CallbackFn(void * context, + const chip::app::DataModel::Nullable & value) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject javaValue; + if (value.IsNull()) + { + javaValue = nullptr; + } + else + { + std::string javaValueClassName = "java/lang/Integer"; + std::string javaValueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(javaValueClassName.c_str(), javaValueCtorSignature.c_str(), + value.Value(), javaValue); + } + + env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); +} + +CHIPThermostatOccupiedSetbackAttributeCallback::CHIPThermostatOccupiedSetbackAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPThermostatOccupiedSetbackAttributeCallback::~CHIPThermostatOccupiedSetbackAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPThermostatOccupiedSetbackAttributeCallback::CallbackFn(void * context, + const chip::app::DataModel::Nullable & value) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject javaValue; + if (value.IsNull()) + { + javaValue = nullptr; + } + else + { + std::string javaValueClassName = "java/lang/Integer"; + std::string javaValueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(javaValueClassName.c_str(), javaValueCtorSignature.c_str(), + value.Value(), javaValue); + } + + env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); +} + +CHIPThermostatOccupiedSetbackMinAttributeCallback::CHIPThermostatOccupiedSetbackMinAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPThermostatOccupiedSetbackMinAttributeCallback::~CHIPThermostatOccupiedSetbackMinAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPThermostatOccupiedSetbackMinAttributeCallback::CallbackFn(void * context, + const chip::app::DataModel::Nullable & value) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject javaValue; + if (value.IsNull()) + { + javaValue = nullptr; + } + else + { + std::string javaValueClassName = "java/lang/Integer"; + std::string javaValueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(javaValueClassName.c_str(), javaValueCtorSignature.c_str(), + value.Value(), javaValue); + } + + env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); +} + +CHIPThermostatOccupiedSetbackMaxAttributeCallback::CHIPThermostatOccupiedSetbackMaxAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPThermostatOccupiedSetbackMaxAttributeCallback::~CHIPThermostatOccupiedSetbackMaxAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPThermostatOccupiedSetbackMaxAttributeCallback::CallbackFn(void * context, + const chip::app::DataModel::Nullable & value) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject javaValue; + if (value.IsNull()) + { + javaValue = nullptr; + } + else + { + std::string javaValueClassName = "java/lang/Integer"; + std::string javaValueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(javaValueClassName.c_str(), javaValueCtorSignature.c_str(), + value.Value(), javaValue); + } + + env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); +} + +CHIPThermostatUnoccupiedSetbackAttributeCallback::CHIPThermostatUnoccupiedSetbackAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPThermostatUnoccupiedSetbackAttributeCallback::~CHIPThermostatUnoccupiedSetbackAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPThermostatUnoccupiedSetbackAttributeCallback::CallbackFn(void * context, + const chip::app::DataModel::Nullable & value) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject javaValue; + if (value.IsNull()) + { + javaValue = nullptr; + } + else + { + std::string javaValueClassName = "java/lang/Integer"; + std::string javaValueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(javaValueClassName.c_str(), javaValueCtorSignature.c_str(), + value.Value(), javaValue); + } + + env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); +} + +CHIPThermostatUnoccupiedSetbackMinAttributeCallback::CHIPThermostatUnoccupiedSetbackMinAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPThermostatUnoccupiedSetbackMinAttributeCallback::~CHIPThermostatUnoccupiedSetbackMinAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPThermostatUnoccupiedSetbackMinAttributeCallback::CallbackFn(void * context, + const chip::app::DataModel::Nullable & value) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject javaValue; + if (value.IsNull()) + { + javaValue = nullptr; + } + else + { + std::string javaValueClassName = "java/lang/Integer"; + std::string javaValueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(javaValueClassName.c_str(), javaValueCtorSignature.c_str(), + value.Value(), javaValue); + } + + env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); +} + +CHIPThermostatUnoccupiedSetbackMaxAttributeCallback::CHIPThermostatUnoccupiedSetbackMaxAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPThermostatUnoccupiedSetbackMaxAttributeCallback::~CHIPThermostatUnoccupiedSetbackMaxAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPThermostatUnoccupiedSetbackMaxAttributeCallback::CallbackFn(void * context, + const chip::app::DataModel::Nullable & value) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject javaValue; + if (value.IsNull()) + { + javaValue = nullptr; + } + else + { + std::string javaValueClassName = "java/lang/Integer"; + std::string javaValueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(javaValueClassName.c_str(), javaValueCtorSignature.c_str(), + value.Value(), javaValue); + } + + env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); +} + +CHIPThermostatACCoilTemperatureAttributeCallback::CHIPThermostatACCoilTemperatureAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPThermostatACCoilTemperatureAttributeCallback::~CHIPThermostatACCoilTemperatureAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPThermostatACCoilTemperatureAttributeCallback::CallbackFn(void * context, + const chip::app::DataModel::Nullable & value) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject javaValue; + if (value.IsNull()) + { + javaValue = nullptr; + } + else + { + std::string javaValueClassName = "java/lang/Integer"; + std::string javaValueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(javaValueClassName.c_str(), javaValueCtorSignature.c_str(), + value.Value(), javaValue); + } + + env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); +} + CHIPThermostatGeneratedCommandListAttributeCallback::CHIPThermostatGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), diff --git a/src/controller/java/zap-generated/CHIPReadCallbacks.h b/src/controller/java/zap-generated/CHIPReadCallbacks.h index 341a8fffd2284b..d775d78b98b981 100644 --- a/src/controller/java/zap-generated/CHIPReadCallbacks.h +++ b/src/controller/java/zap-generated/CHIPReadCallbacks.h @@ -8939,6 +8939,307 @@ class CHIPThermostatLocalTemperatureAttributeCallback bool keepAlive; }; +class CHIPThermostatOutdoorTemperatureAttributeCallback + : public chip::Callback::Callback +{ +public: + CHIPThermostatOutdoorTemperatureAttributeCallback(jobject javaCallback, bool keepAlive = false); + + ~CHIPThermostatOutdoorTemperatureAttributeCallback(); + + static void maybeDestroy(CHIPThermostatOutdoorTemperatureAttributeCallback * callback) + { + if (!callback->keepAlive) + { + callback->Cancel(); + chip::Platform::Delete(callback); + } + } + + static void CallbackFn(void * context, const chip::app::DataModel::Nullable & value); + static void OnSubscriptionEstablished(void * context, chip::SubscriptionId subscriptionId) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef, subscriptionId); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; + +private: + jobject javaCallbackRef; + bool keepAlive; +}; + +class CHIPThermostatTemperatureSetpointHoldDurationAttributeCallback + : public chip::Callback::Callback +{ +public: + CHIPThermostatTemperatureSetpointHoldDurationAttributeCallback(jobject javaCallback, bool keepAlive = false); + + ~CHIPThermostatTemperatureSetpointHoldDurationAttributeCallback(); + + static void maybeDestroy(CHIPThermostatTemperatureSetpointHoldDurationAttributeCallback * callback) + { + if (!callback->keepAlive) + { + callback->Cancel(); + chip::Platform::Delete(callback); + } + } + + static void CallbackFn(void * context, const chip::app::DataModel::Nullable & value); + static void OnSubscriptionEstablished(void * context, chip::SubscriptionId subscriptionId) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef, + subscriptionId); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; + +private: + jobject javaCallbackRef; + bool keepAlive; +}; + +class CHIPThermostatSetpointChangeAmountAttributeCallback + : public chip::Callback::Callback +{ +public: + CHIPThermostatSetpointChangeAmountAttributeCallback(jobject javaCallback, bool keepAlive = false); + + ~CHIPThermostatSetpointChangeAmountAttributeCallback(); + + static void maybeDestroy(CHIPThermostatSetpointChangeAmountAttributeCallback * callback) + { + if (!callback->keepAlive) + { + callback->Cancel(); + chip::Platform::Delete(callback); + } + } + + static void CallbackFn(void * context, const chip::app::DataModel::Nullable & value); + static void OnSubscriptionEstablished(void * context, chip::SubscriptionId subscriptionId) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef, subscriptionId); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; + +private: + jobject javaCallbackRef; + bool keepAlive; +}; + +class CHIPThermostatOccupiedSetbackAttributeCallback + : public chip::Callback::Callback +{ +public: + CHIPThermostatOccupiedSetbackAttributeCallback(jobject javaCallback, bool keepAlive = false); + + ~CHIPThermostatOccupiedSetbackAttributeCallback(); + + static void maybeDestroy(CHIPThermostatOccupiedSetbackAttributeCallback * callback) + { + if (!callback->keepAlive) + { + callback->Cancel(); + chip::Platform::Delete(callback); + } + } + + static void CallbackFn(void * context, const chip::app::DataModel::Nullable & value); + static void OnSubscriptionEstablished(void * context, chip::SubscriptionId subscriptionId) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef, subscriptionId); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; + +private: + jobject javaCallbackRef; + bool keepAlive; +}; + +class CHIPThermostatOccupiedSetbackMinAttributeCallback + : public chip::Callback::Callback +{ +public: + CHIPThermostatOccupiedSetbackMinAttributeCallback(jobject javaCallback, bool keepAlive = false); + + ~CHIPThermostatOccupiedSetbackMinAttributeCallback(); + + static void maybeDestroy(CHIPThermostatOccupiedSetbackMinAttributeCallback * callback) + { + if (!callback->keepAlive) + { + callback->Cancel(); + chip::Platform::Delete(callback); + } + } + + static void CallbackFn(void * context, const chip::app::DataModel::Nullable & value); + static void OnSubscriptionEstablished(void * context, chip::SubscriptionId subscriptionId) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef, subscriptionId); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; + +private: + jobject javaCallbackRef; + bool keepAlive; +}; + +class CHIPThermostatOccupiedSetbackMaxAttributeCallback + : public chip::Callback::Callback +{ +public: + CHIPThermostatOccupiedSetbackMaxAttributeCallback(jobject javaCallback, bool keepAlive = false); + + ~CHIPThermostatOccupiedSetbackMaxAttributeCallback(); + + static void maybeDestroy(CHIPThermostatOccupiedSetbackMaxAttributeCallback * callback) + { + if (!callback->keepAlive) + { + callback->Cancel(); + chip::Platform::Delete(callback); + } + } + + static void CallbackFn(void * context, const chip::app::DataModel::Nullable & value); + static void OnSubscriptionEstablished(void * context, chip::SubscriptionId subscriptionId) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef, subscriptionId); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; + +private: + jobject javaCallbackRef; + bool keepAlive; +}; + +class CHIPThermostatUnoccupiedSetbackAttributeCallback + : public chip::Callback::Callback +{ +public: + CHIPThermostatUnoccupiedSetbackAttributeCallback(jobject javaCallback, bool keepAlive = false); + + ~CHIPThermostatUnoccupiedSetbackAttributeCallback(); + + static void maybeDestroy(CHIPThermostatUnoccupiedSetbackAttributeCallback * callback) + { + if (!callback->keepAlive) + { + callback->Cancel(); + chip::Platform::Delete(callback); + } + } + + static void CallbackFn(void * context, const chip::app::DataModel::Nullable & value); + static void OnSubscriptionEstablished(void * context, chip::SubscriptionId subscriptionId) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef, subscriptionId); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; + +private: + jobject javaCallbackRef; + bool keepAlive; +}; + +class CHIPThermostatUnoccupiedSetbackMinAttributeCallback + : public chip::Callback::Callback +{ +public: + CHIPThermostatUnoccupiedSetbackMinAttributeCallback(jobject javaCallback, bool keepAlive = false); + + ~CHIPThermostatUnoccupiedSetbackMinAttributeCallback(); + + static void maybeDestroy(CHIPThermostatUnoccupiedSetbackMinAttributeCallback * callback) + { + if (!callback->keepAlive) + { + callback->Cancel(); + chip::Platform::Delete(callback); + } + } + + static void CallbackFn(void * context, const chip::app::DataModel::Nullable & value); + static void OnSubscriptionEstablished(void * context, chip::SubscriptionId subscriptionId) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef, subscriptionId); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; + +private: + jobject javaCallbackRef; + bool keepAlive; +}; + +class CHIPThermostatUnoccupiedSetbackMaxAttributeCallback + : public chip::Callback::Callback +{ +public: + CHIPThermostatUnoccupiedSetbackMaxAttributeCallback(jobject javaCallback, bool keepAlive = false); + + ~CHIPThermostatUnoccupiedSetbackMaxAttributeCallback(); + + static void maybeDestroy(CHIPThermostatUnoccupiedSetbackMaxAttributeCallback * callback) + { + if (!callback->keepAlive) + { + callback->Cancel(); + chip::Platform::Delete(callback); + } + } + + static void CallbackFn(void * context, const chip::app::DataModel::Nullable & value); + static void OnSubscriptionEstablished(void * context, chip::SubscriptionId subscriptionId) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef, subscriptionId); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; + +private: + jobject javaCallbackRef; + bool keepAlive; +}; + +class CHIPThermostatACCoilTemperatureAttributeCallback + : public chip::Callback::Callback +{ +public: + CHIPThermostatACCoilTemperatureAttributeCallback(jobject javaCallback, bool keepAlive = false); + + ~CHIPThermostatACCoilTemperatureAttributeCallback(); + + static void maybeDestroy(CHIPThermostatACCoilTemperatureAttributeCallback * callback) + { + if (!callback->keepAlive) + { + callback->Cancel(); + chip::Platform::Delete(callback); + } + } + + static void CallbackFn(void * context, const chip::app::DataModel::Nullable & value); + static void OnSubscriptionEstablished(void * context, chip::SubscriptionId subscriptionId) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef, subscriptionId); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; + +private: + jobject javaCallbackRef; + bool keepAlive; +}; + class CHIPThermostatGeneratedCommandListAttributeCallback : public chip::Callback::Callback { diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java b/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java index 8d06f1fe945e94..124f92fb8ed419 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java @@ -15420,6 +15420,86 @@ public interface LocalTemperatureAttributeCallback { default void onSubscriptionEstablished(long subscriptionId) {} } + public interface OutdoorTemperatureAttributeCallback { + void onSuccess(@Nullable Integer value); + + void onError(Exception ex); + + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public interface TemperatureSetpointHoldDurationAttributeCallback { + void onSuccess(@Nullable Integer value); + + void onError(Exception ex); + + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public interface SetpointChangeAmountAttributeCallback { + void onSuccess(@Nullable Integer value); + + void onError(Exception ex); + + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public interface OccupiedSetbackAttributeCallback { + void onSuccess(@Nullable Integer value); + + void onError(Exception ex); + + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public interface OccupiedSetbackMinAttributeCallback { + void onSuccess(@Nullable Integer value); + + void onError(Exception ex); + + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public interface OccupiedSetbackMaxAttributeCallback { + void onSuccess(@Nullable Integer value); + + void onError(Exception ex); + + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public interface UnoccupiedSetbackAttributeCallback { + void onSuccess(@Nullable Integer value); + + void onError(Exception ex); + + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public interface UnoccupiedSetbackMinAttributeCallback { + void onSuccess(@Nullable Integer value); + + void onError(Exception ex); + + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public interface UnoccupiedSetbackMaxAttributeCallback { + void onSuccess(@Nullable Integer value); + + void onError(Exception ex); + + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public interface ACCoilTemperatureAttributeCallback { + void onSuccess(@Nullable Integer value); + + void onError(Exception ex); + + default void onSubscriptionEstablished(long subscriptionId) {} + } + public interface GeneratedCommandListAttributeCallback { void onSuccess(List valueList); @@ -15461,6 +15541,24 @@ public void subscribeLocalTemperatureAttribute( subscribeLocalTemperatureAttribute(chipClusterPtr, callback, minInterval, maxInterval); } + public void readOutdoorTemperatureAttribute(OutdoorTemperatureAttributeCallback callback) { + readOutdoorTemperatureAttribute(chipClusterPtr, callback); + } + + public void subscribeOutdoorTemperatureAttribute( + OutdoorTemperatureAttributeCallback callback, int minInterval, int maxInterval) { + subscribeOutdoorTemperatureAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readOccupancyAttribute(IntegerAttributeCallback callback) { + readOccupancyAttribute(chipClusterPtr, callback); + } + + public void subscribeOccupancyAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeOccupancyAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + public void readAbsMinHeatSetpointLimitAttribute(IntegerAttributeCallback callback) { readAbsMinHeatSetpointLimitAttribute(chipClusterPtr, callback); } @@ -15497,6 +15595,66 @@ public void subscribeAbsMaxCoolSetpointLimitAttribute( subscribeAbsMaxCoolSetpointLimitAttribute(chipClusterPtr, callback, minInterval, maxInterval); } + public void readPICoolingDemandAttribute(IntegerAttributeCallback callback) { + readPICoolingDemandAttribute(chipClusterPtr, callback); + } + + public void subscribePICoolingDemandAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribePICoolingDemandAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readPIHeatingDemandAttribute(IntegerAttributeCallback callback) { + readPIHeatingDemandAttribute(chipClusterPtr, callback); + } + + public void subscribePIHeatingDemandAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribePIHeatingDemandAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readHVACSystemTypeConfigurationAttribute(IntegerAttributeCallback callback) { + readHVACSystemTypeConfigurationAttribute(chipClusterPtr, callback); + } + + public void writeHVACSystemTypeConfigurationAttribute( + DefaultClusterCallback callback, Integer value) { + writeHVACSystemTypeConfigurationAttribute(chipClusterPtr, callback, value, null); + } + + public void writeHVACSystemTypeConfigurationAttribute( + DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { + writeHVACSystemTypeConfigurationAttribute( + chipClusterPtr, callback, value, timedWriteTimeoutMs); + } + + public void subscribeHVACSystemTypeConfigurationAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeHVACSystemTypeConfigurationAttribute( + chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readLocalTemperatureCalibrationAttribute(IntegerAttributeCallback callback) { + readLocalTemperatureCalibrationAttribute(chipClusterPtr, callback); + } + + public void writeLocalTemperatureCalibrationAttribute( + DefaultClusterCallback callback, Integer value) { + writeLocalTemperatureCalibrationAttribute(chipClusterPtr, callback, value, null); + } + + public void writeLocalTemperatureCalibrationAttribute( + DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { + writeLocalTemperatureCalibrationAttribute( + chipClusterPtr, callback, value, timedWriteTimeoutMs); + } + + public void subscribeLocalTemperatureCalibrationAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeLocalTemperatureCalibrationAttribute( + chipClusterPtr, callback, minInterval, maxInterval); + } + public void readOccupiedCoolingSetpointAttribute(IntegerAttributeCallback callback) { readOccupiedCoolingSetpointAttribute(chipClusterPtr, callback); } @@ -15535,6 +15693,46 @@ public void subscribeOccupiedHeatingSetpointAttribute( subscribeOccupiedHeatingSetpointAttribute(chipClusterPtr, callback, minInterval, maxInterval); } + public void readUnoccupiedCoolingSetpointAttribute(IntegerAttributeCallback callback) { + readUnoccupiedCoolingSetpointAttribute(chipClusterPtr, callback); + } + + public void writeUnoccupiedCoolingSetpointAttribute( + DefaultClusterCallback callback, Integer value) { + writeUnoccupiedCoolingSetpointAttribute(chipClusterPtr, callback, value, null); + } + + public void writeUnoccupiedCoolingSetpointAttribute( + DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { + writeUnoccupiedCoolingSetpointAttribute(chipClusterPtr, callback, value, timedWriteTimeoutMs); + } + + public void subscribeUnoccupiedCoolingSetpointAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeUnoccupiedCoolingSetpointAttribute( + chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readUnoccupiedHeatingSetpointAttribute(IntegerAttributeCallback callback) { + readUnoccupiedHeatingSetpointAttribute(chipClusterPtr, callback); + } + + public void writeUnoccupiedHeatingSetpointAttribute( + DefaultClusterCallback callback, Integer value) { + writeUnoccupiedHeatingSetpointAttribute(chipClusterPtr, callback, value, null); + } + + public void writeUnoccupiedHeatingSetpointAttribute( + DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { + writeUnoccupiedHeatingSetpointAttribute(chipClusterPtr, callback, value, timedWriteTimeoutMs); + } + + public void subscribeUnoccupiedHeatingSetpointAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeUnoccupiedHeatingSetpointAttribute( + chipClusterPtr, callback, minInterval, maxInterval); + } + public void readMinHeatSetpointLimitAttribute(IntegerAttributeCallback callback) { readMinHeatSetpointLimitAttribute(chipClusterPtr, callback); } @@ -15625,6 +15823,24 @@ public void subscribeMinSetpointDeadBandAttribute( subscribeMinSetpointDeadBandAttribute(chipClusterPtr, callback, minInterval, maxInterval); } + public void readRemoteSensingAttribute(IntegerAttributeCallback callback) { + readRemoteSensingAttribute(chipClusterPtr, callback); + } + + public void writeRemoteSensingAttribute(DefaultClusterCallback callback, Integer value) { + writeRemoteSensingAttribute(chipClusterPtr, callback, value, null); + } + + public void writeRemoteSensingAttribute( + DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { + writeRemoteSensingAttribute(chipClusterPtr, callback, value, timedWriteTimeoutMs); + } + + public void subscribeRemoteSensingAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeRemoteSensingAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + public void readControlSequenceOfOperationAttribute(IntegerAttributeCallback callback) { readControlSequenceOfOperationAttribute(chipClusterPtr, callback); } @@ -15664,6 +15880,15 @@ public void subscribeSystemModeAttribute( subscribeSystemModeAttribute(chipClusterPtr, callback, minInterval, maxInterval); } + public void readThermostatRunningModeAttribute(IntegerAttributeCallback callback) { + readThermostatRunningModeAttribute(chipClusterPtr, callback); + } + + public void subscribeThermostatRunningModeAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeThermostatRunningModeAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + public void readStartOfWeekAttribute(IntegerAttributeCallback callback) { readStartOfWeekAttribute(chipClusterPtr, callback); } @@ -15693,117 +15918,518 @@ public void subscribeNumberOfDailyTransitionsAttribute( chipClusterPtr, callback, minInterval, maxInterval); } - public void readGeneratedCommandListAttribute(GeneratedCommandListAttributeCallback callback) { - readGeneratedCommandListAttribute(chipClusterPtr, callback); + public void readTemperatureSetpointHoldAttribute(IntegerAttributeCallback callback) { + readTemperatureSetpointHoldAttribute(chipClusterPtr, callback); } - public void subscribeGeneratedCommandListAttribute( - GeneratedCommandListAttributeCallback callback, int minInterval, int maxInterval) { - subscribeGeneratedCommandListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + public void writeTemperatureSetpointHoldAttribute( + DefaultClusterCallback callback, Integer value) { + writeTemperatureSetpointHoldAttribute(chipClusterPtr, callback, value, null); } - public void readAcceptedCommandListAttribute(AcceptedCommandListAttributeCallback callback) { - readAcceptedCommandListAttribute(chipClusterPtr, callback); + public void writeTemperatureSetpointHoldAttribute( + DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { + writeTemperatureSetpointHoldAttribute(chipClusterPtr, callback, value, timedWriteTimeoutMs); } - public void subscribeAcceptedCommandListAttribute( - AcceptedCommandListAttributeCallback callback, int minInterval, int maxInterval) { - subscribeAcceptedCommandListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + public void subscribeTemperatureSetpointHoldAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeTemperatureSetpointHoldAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void readEventListAttribute(EventListAttributeCallback callback) { - readEventListAttribute(chipClusterPtr, callback); + public void readTemperatureSetpointHoldDurationAttribute( + TemperatureSetpointHoldDurationAttributeCallback callback) { + readTemperatureSetpointHoldDurationAttribute(chipClusterPtr, callback); } - public void subscribeEventListAttribute( - EventListAttributeCallback callback, int minInterval, int maxInterval) { - subscribeEventListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + public void writeTemperatureSetpointHoldDurationAttribute( + DefaultClusterCallback callback, Integer value) { + writeTemperatureSetpointHoldDurationAttribute(chipClusterPtr, callback, value, null); } - public void readAttributeListAttribute(AttributeListAttributeCallback callback) { - readAttributeListAttribute(chipClusterPtr, callback); + public void writeTemperatureSetpointHoldDurationAttribute( + DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { + writeTemperatureSetpointHoldDurationAttribute( + chipClusterPtr, callback, value, timedWriteTimeoutMs); } - public void subscribeAttributeListAttribute( - AttributeListAttributeCallback callback, int minInterval, int maxInterval) { - subscribeAttributeListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + public void subscribeTemperatureSetpointHoldDurationAttribute( + TemperatureSetpointHoldDurationAttributeCallback callback, + int minInterval, + int maxInterval) { + subscribeTemperatureSetpointHoldDurationAttribute( + chipClusterPtr, callback, minInterval, maxInterval); } - public void readFeatureMapAttribute(LongAttributeCallback callback) { - readFeatureMapAttribute(chipClusterPtr, callback); + public void readThermostatProgrammingOperationModeAttribute(IntegerAttributeCallback callback) { + readThermostatProgrammingOperationModeAttribute(chipClusterPtr, callback); } - public void subscribeFeatureMapAttribute( - LongAttributeCallback callback, int minInterval, int maxInterval) { - subscribeFeatureMapAttribute(chipClusterPtr, callback, minInterval, maxInterval); + public void writeThermostatProgrammingOperationModeAttribute( + DefaultClusterCallback callback, Integer value) { + writeThermostatProgrammingOperationModeAttribute(chipClusterPtr, callback, value, null); } - public void readClusterRevisionAttribute(IntegerAttributeCallback callback) { - readClusterRevisionAttribute(chipClusterPtr, callback); + public void writeThermostatProgrammingOperationModeAttribute( + DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { + writeThermostatProgrammingOperationModeAttribute( + chipClusterPtr, callback, value, timedWriteTimeoutMs); } - public void subscribeClusterRevisionAttribute( + public void subscribeThermostatProgrammingOperationModeAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); + subscribeThermostatProgrammingOperationModeAttribute( + chipClusterPtr, callback, minInterval, maxInterval); } - private native void readLocalTemperatureAttribute( - long chipClusterPtr, LocalTemperatureAttributeCallback callback); + public void readThermostatRunningStateAttribute(IntegerAttributeCallback callback) { + readThermostatRunningStateAttribute(chipClusterPtr, callback); + } - private native void subscribeLocalTemperatureAttribute( - long chipClusterPtr, - LocalTemperatureAttributeCallback callback, - int minInterval, - int maxInterval); + public void subscribeThermostatRunningStateAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeThermostatRunningStateAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } - private native void readAbsMinHeatSetpointLimitAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + public void readSetpointChangeSourceAttribute(IntegerAttributeCallback callback) { + readSetpointChangeSourceAttribute(chipClusterPtr, callback); + } - private native void subscribeAbsMinHeatSetpointLimitAttribute( - long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + public void subscribeSetpointChangeSourceAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeSetpointChangeSourceAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } - private native void readAbsMaxHeatSetpointLimitAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + public void readSetpointChangeAmountAttribute(SetpointChangeAmountAttributeCallback callback) { + readSetpointChangeAmountAttribute(chipClusterPtr, callback); + } - private native void subscribeAbsMaxHeatSetpointLimitAttribute( - long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + public void subscribeSetpointChangeAmountAttribute( + SetpointChangeAmountAttributeCallback callback, int minInterval, int maxInterval) { + subscribeSetpointChangeAmountAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } - private native void readAbsMinCoolSetpointLimitAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + public void readSetpointChangeSourceTimestampAttribute(LongAttributeCallback callback) { + readSetpointChangeSourceTimestampAttribute(chipClusterPtr, callback); + } - private native void subscribeAbsMinCoolSetpointLimitAttribute( - long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + public void subscribeSetpointChangeSourceTimestampAttribute( + LongAttributeCallback callback, int minInterval, int maxInterval) { + subscribeSetpointChangeSourceTimestampAttribute( + chipClusterPtr, callback, minInterval, maxInterval); + } - private native void readAbsMaxCoolSetpointLimitAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + public void readOccupiedSetbackAttribute(OccupiedSetbackAttributeCallback callback) { + readOccupiedSetbackAttribute(chipClusterPtr, callback); + } - private native void subscribeAbsMaxCoolSetpointLimitAttribute( - long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + public void writeOccupiedSetbackAttribute(DefaultClusterCallback callback, Integer value) { + writeOccupiedSetbackAttribute(chipClusterPtr, callback, value, null); + } - private native void readOccupiedCoolingSetpointAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + public void writeOccupiedSetbackAttribute( + DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { + writeOccupiedSetbackAttribute(chipClusterPtr, callback, value, timedWriteTimeoutMs); + } - private native void writeOccupiedCoolingSetpointAttribute( - long chipClusterPtr, - DefaultClusterCallback callback, - Integer value, - @Nullable Integer timedWriteTimeoutMs); + public void subscribeOccupiedSetbackAttribute( + OccupiedSetbackAttributeCallback callback, int minInterval, int maxInterval) { + subscribeOccupiedSetbackAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } - private native void subscribeOccupiedCoolingSetpointAttribute( - long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + public void readOccupiedSetbackMinAttribute(OccupiedSetbackMinAttributeCallback callback) { + readOccupiedSetbackMinAttribute(chipClusterPtr, callback); + } - private native void readOccupiedHeatingSetpointAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + public void subscribeOccupiedSetbackMinAttribute( + OccupiedSetbackMinAttributeCallback callback, int minInterval, int maxInterval) { + subscribeOccupiedSetbackMinAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } - private native void writeOccupiedHeatingSetpointAttribute( - long chipClusterPtr, - DefaultClusterCallback callback, + public void readOccupiedSetbackMaxAttribute(OccupiedSetbackMaxAttributeCallback callback) { + readOccupiedSetbackMaxAttribute(chipClusterPtr, callback); + } + + public void subscribeOccupiedSetbackMaxAttribute( + OccupiedSetbackMaxAttributeCallback callback, int minInterval, int maxInterval) { + subscribeOccupiedSetbackMaxAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readUnoccupiedSetbackAttribute(UnoccupiedSetbackAttributeCallback callback) { + readUnoccupiedSetbackAttribute(chipClusterPtr, callback); + } + + public void writeUnoccupiedSetbackAttribute(DefaultClusterCallback callback, Integer value) { + writeUnoccupiedSetbackAttribute(chipClusterPtr, callback, value, null); + } + + public void writeUnoccupiedSetbackAttribute( + DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { + writeUnoccupiedSetbackAttribute(chipClusterPtr, callback, value, timedWriteTimeoutMs); + } + + public void subscribeUnoccupiedSetbackAttribute( + UnoccupiedSetbackAttributeCallback callback, int minInterval, int maxInterval) { + subscribeUnoccupiedSetbackAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readUnoccupiedSetbackMinAttribute(UnoccupiedSetbackMinAttributeCallback callback) { + readUnoccupiedSetbackMinAttribute(chipClusterPtr, callback); + } + + public void subscribeUnoccupiedSetbackMinAttribute( + UnoccupiedSetbackMinAttributeCallback callback, int minInterval, int maxInterval) { + subscribeUnoccupiedSetbackMinAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readUnoccupiedSetbackMaxAttribute(UnoccupiedSetbackMaxAttributeCallback callback) { + readUnoccupiedSetbackMaxAttribute(chipClusterPtr, callback); + } + + public void subscribeUnoccupiedSetbackMaxAttribute( + UnoccupiedSetbackMaxAttributeCallback callback, int minInterval, int maxInterval) { + subscribeUnoccupiedSetbackMaxAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readEmergencyHeatDeltaAttribute(IntegerAttributeCallback callback) { + readEmergencyHeatDeltaAttribute(chipClusterPtr, callback); + } + + public void writeEmergencyHeatDeltaAttribute(DefaultClusterCallback callback, Integer value) { + writeEmergencyHeatDeltaAttribute(chipClusterPtr, callback, value, null); + } + + public void writeEmergencyHeatDeltaAttribute( + DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { + writeEmergencyHeatDeltaAttribute(chipClusterPtr, callback, value, timedWriteTimeoutMs); + } + + public void subscribeEmergencyHeatDeltaAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeEmergencyHeatDeltaAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readACTypeAttribute(IntegerAttributeCallback callback) { + readACTypeAttribute(chipClusterPtr, callback); + } + + public void writeACTypeAttribute(DefaultClusterCallback callback, Integer value) { + writeACTypeAttribute(chipClusterPtr, callback, value, null); + } + + public void writeACTypeAttribute( + DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { + writeACTypeAttribute(chipClusterPtr, callback, value, timedWriteTimeoutMs); + } + + public void subscribeACTypeAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeACTypeAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readACCapacityAttribute(IntegerAttributeCallback callback) { + readACCapacityAttribute(chipClusterPtr, callback); + } + + public void writeACCapacityAttribute(DefaultClusterCallback callback, Integer value) { + writeACCapacityAttribute(chipClusterPtr, callback, value, null); + } + + public void writeACCapacityAttribute( + DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { + writeACCapacityAttribute(chipClusterPtr, callback, value, timedWriteTimeoutMs); + } + + public void subscribeACCapacityAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeACCapacityAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readACRefrigerantTypeAttribute(IntegerAttributeCallback callback) { + readACRefrigerantTypeAttribute(chipClusterPtr, callback); + } + + public void writeACRefrigerantTypeAttribute(DefaultClusterCallback callback, Integer value) { + writeACRefrigerantTypeAttribute(chipClusterPtr, callback, value, null); + } + + public void writeACRefrigerantTypeAttribute( + DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { + writeACRefrigerantTypeAttribute(chipClusterPtr, callback, value, timedWriteTimeoutMs); + } + + public void subscribeACRefrigerantTypeAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeACRefrigerantTypeAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readACCompressorTypeAttribute(IntegerAttributeCallback callback) { + readACCompressorTypeAttribute(chipClusterPtr, callback); + } + + public void writeACCompressorTypeAttribute(DefaultClusterCallback callback, Integer value) { + writeACCompressorTypeAttribute(chipClusterPtr, callback, value, null); + } + + public void writeACCompressorTypeAttribute( + DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { + writeACCompressorTypeAttribute(chipClusterPtr, callback, value, timedWriteTimeoutMs); + } + + public void subscribeACCompressorTypeAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeACCompressorTypeAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readACErrorCodeAttribute(LongAttributeCallback callback) { + readACErrorCodeAttribute(chipClusterPtr, callback); + } + + public void writeACErrorCodeAttribute(DefaultClusterCallback callback, Long value) { + writeACErrorCodeAttribute(chipClusterPtr, callback, value, null); + } + + public void writeACErrorCodeAttribute( + DefaultClusterCallback callback, Long value, int timedWriteTimeoutMs) { + writeACErrorCodeAttribute(chipClusterPtr, callback, value, timedWriteTimeoutMs); + } + + public void subscribeACErrorCodeAttribute( + LongAttributeCallback callback, int minInterval, int maxInterval) { + subscribeACErrorCodeAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readACLouverPositionAttribute(IntegerAttributeCallback callback) { + readACLouverPositionAttribute(chipClusterPtr, callback); + } + + public void writeACLouverPositionAttribute(DefaultClusterCallback callback, Integer value) { + writeACLouverPositionAttribute(chipClusterPtr, callback, value, null); + } + + public void writeACLouverPositionAttribute( + DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { + writeACLouverPositionAttribute(chipClusterPtr, callback, value, timedWriteTimeoutMs); + } + + public void subscribeACLouverPositionAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeACLouverPositionAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readACCoilTemperatureAttribute(ACCoilTemperatureAttributeCallback callback) { + readACCoilTemperatureAttribute(chipClusterPtr, callback); + } + + public void subscribeACCoilTemperatureAttribute( + ACCoilTemperatureAttributeCallback callback, int minInterval, int maxInterval) { + subscribeACCoilTemperatureAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readACCapacityformatAttribute(IntegerAttributeCallback callback) { + readACCapacityformatAttribute(chipClusterPtr, callback); + } + + public void writeACCapacityformatAttribute(DefaultClusterCallback callback, Integer value) { + writeACCapacityformatAttribute(chipClusterPtr, callback, value, null); + } + + public void writeACCapacityformatAttribute( + DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { + writeACCapacityformatAttribute(chipClusterPtr, callback, value, timedWriteTimeoutMs); + } + + public void subscribeACCapacityformatAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeACCapacityformatAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readGeneratedCommandListAttribute(GeneratedCommandListAttributeCallback callback) { + readGeneratedCommandListAttribute(chipClusterPtr, callback); + } + + public void subscribeGeneratedCommandListAttribute( + GeneratedCommandListAttributeCallback callback, int minInterval, int maxInterval) { + subscribeGeneratedCommandListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readAcceptedCommandListAttribute(AcceptedCommandListAttributeCallback callback) { + readAcceptedCommandListAttribute(chipClusterPtr, callback); + } + + public void subscribeAcceptedCommandListAttribute( + AcceptedCommandListAttributeCallback callback, int minInterval, int maxInterval) { + subscribeAcceptedCommandListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readEventListAttribute(EventListAttributeCallback callback) { + readEventListAttribute(chipClusterPtr, callback); + } + + public void subscribeEventListAttribute( + EventListAttributeCallback callback, int minInterval, int maxInterval) { + subscribeEventListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readAttributeListAttribute(AttributeListAttributeCallback callback) { + readAttributeListAttribute(chipClusterPtr, callback); + } + + public void subscribeAttributeListAttribute( + AttributeListAttributeCallback callback, int minInterval, int maxInterval) { + subscribeAttributeListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readFeatureMapAttribute(LongAttributeCallback callback) { + readFeatureMapAttribute(chipClusterPtr, callback); + } + + public void subscribeFeatureMapAttribute( + LongAttributeCallback callback, int minInterval, int maxInterval) { + subscribeFeatureMapAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readClusterRevisionAttribute(IntegerAttributeCallback callback) { + readClusterRevisionAttribute(chipClusterPtr, callback); + } + + public void subscribeClusterRevisionAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + private native void readLocalTemperatureAttribute( + long chipClusterPtr, LocalTemperatureAttributeCallback callback); + + private native void subscribeLocalTemperatureAttribute( + long chipClusterPtr, + LocalTemperatureAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readOutdoorTemperatureAttribute( + long chipClusterPtr, OutdoorTemperatureAttributeCallback callback); + + private native void subscribeOutdoorTemperatureAttribute( + long chipClusterPtr, + OutdoorTemperatureAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readOccupancyAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void subscribeOccupancyAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + + private native void readAbsMinHeatSetpointLimitAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void subscribeAbsMinHeatSetpointLimitAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + + private native void readAbsMaxHeatSetpointLimitAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void subscribeAbsMaxHeatSetpointLimitAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + + private native void readAbsMinCoolSetpointLimitAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void subscribeAbsMinCoolSetpointLimitAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + + private native void readAbsMaxCoolSetpointLimitAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void subscribeAbsMaxCoolSetpointLimitAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + + private native void readPICoolingDemandAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void subscribePICoolingDemandAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + + private native void readPIHeatingDemandAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void subscribePIHeatingDemandAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + + private native void readHVACSystemTypeConfigurationAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void writeHVACSystemTypeConfigurationAttribute( + long chipClusterPtr, + DefaultClusterCallback callback, + Integer value, + @Nullable Integer timedWriteTimeoutMs); + + private native void subscribeHVACSystemTypeConfigurationAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + + private native void readLocalTemperatureCalibrationAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void writeLocalTemperatureCalibrationAttribute( + long chipClusterPtr, + DefaultClusterCallback callback, + Integer value, + @Nullable Integer timedWriteTimeoutMs); + + private native void subscribeLocalTemperatureCalibrationAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + + private native void readOccupiedCoolingSetpointAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void writeOccupiedCoolingSetpointAttribute( + long chipClusterPtr, + DefaultClusterCallback callback, + Integer value, + @Nullable Integer timedWriteTimeoutMs); + + private native void subscribeOccupiedCoolingSetpointAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + + private native void readOccupiedHeatingSetpointAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void writeOccupiedHeatingSetpointAttribute( + long chipClusterPtr, + DefaultClusterCallback callback, Integer value, @Nullable Integer timedWriteTimeoutMs); private native void subscribeOccupiedHeatingSetpointAttribute( long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + private native void readUnoccupiedCoolingSetpointAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void writeUnoccupiedCoolingSetpointAttribute( + long chipClusterPtr, + DefaultClusterCallback callback, + Integer value, + @Nullable Integer timedWriteTimeoutMs); + + private native void subscribeUnoccupiedCoolingSetpointAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + + private native void readUnoccupiedHeatingSetpointAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void writeUnoccupiedHeatingSetpointAttribute( + long chipClusterPtr, + DefaultClusterCallback callback, + Integer value, + @Nullable Integer timedWriteTimeoutMs); + + private native void subscribeUnoccupiedHeatingSetpointAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + private native void readMinHeatSetpointLimitAttribute( long chipClusterPtr, IntegerAttributeCallback callback); @@ -15864,6 +16490,18 @@ private native void writeMinSetpointDeadBandAttribute( private native void subscribeMinSetpointDeadBandAttribute( long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + private native void readRemoteSensingAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void writeRemoteSensingAttribute( + long chipClusterPtr, + DefaultClusterCallback callback, + Integer value, + @Nullable Integer timedWriteTimeoutMs); + + private native void subscribeRemoteSensingAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + private native void readControlSequenceOfOperationAttribute( long chipClusterPtr, IntegerAttributeCallback callback); @@ -15888,6 +16526,12 @@ private native void writeSystemModeAttribute( private native void subscribeSystemModeAttribute( long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + private native void readThermostatRunningModeAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void subscribeThermostatRunningModeAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + private native void readStartOfWeekAttribute( long chipClusterPtr, IntegerAttributeCallback callback); @@ -15906,6 +16550,242 @@ private native void readNumberOfDailyTransitionsAttribute( private native void subscribeNumberOfDailyTransitionsAttribute( long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + private native void readTemperatureSetpointHoldAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void writeTemperatureSetpointHoldAttribute( + long chipClusterPtr, + DefaultClusterCallback callback, + Integer value, + @Nullable Integer timedWriteTimeoutMs); + + private native void subscribeTemperatureSetpointHoldAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + + private native void readTemperatureSetpointHoldDurationAttribute( + long chipClusterPtr, TemperatureSetpointHoldDurationAttributeCallback callback); + + private native void writeTemperatureSetpointHoldDurationAttribute( + long chipClusterPtr, + DefaultClusterCallback callback, + Integer value, + @Nullable Integer timedWriteTimeoutMs); + + private native void subscribeTemperatureSetpointHoldDurationAttribute( + long chipClusterPtr, + TemperatureSetpointHoldDurationAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readThermostatProgrammingOperationModeAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void writeThermostatProgrammingOperationModeAttribute( + long chipClusterPtr, + DefaultClusterCallback callback, + Integer value, + @Nullable Integer timedWriteTimeoutMs); + + private native void subscribeThermostatProgrammingOperationModeAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + + private native void readThermostatRunningStateAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void subscribeThermostatRunningStateAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + + private native void readSetpointChangeSourceAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void subscribeSetpointChangeSourceAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + + private native void readSetpointChangeAmountAttribute( + long chipClusterPtr, SetpointChangeAmountAttributeCallback callback); + + private native void subscribeSetpointChangeAmountAttribute( + long chipClusterPtr, + SetpointChangeAmountAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readSetpointChangeSourceTimestampAttribute( + long chipClusterPtr, LongAttributeCallback callback); + + private native void subscribeSetpointChangeSourceTimestampAttribute( + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); + + private native void readOccupiedSetbackAttribute( + long chipClusterPtr, OccupiedSetbackAttributeCallback callback); + + private native void writeOccupiedSetbackAttribute( + long chipClusterPtr, + DefaultClusterCallback callback, + Integer value, + @Nullable Integer timedWriteTimeoutMs); + + private native void subscribeOccupiedSetbackAttribute( + long chipClusterPtr, + OccupiedSetbackAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readOccupiedSetbackMinAttribute( + long chipClusterPtr, OccupiedSetbackMinAttributeCallback callback); + + private native void subscribeOccupiedSetbackMinAttribute( + long chipClusterPtr, + OccupiedSetbackMinAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readOccupiedSetbackMaxAttribute( + long chipClusterPtr, OccupiedSetbackMaxAttributeCallback callback); + + private native void subscribeOccupiedSetbackMaxAttribute( + long chipClusterPtr, + OccupiedSetbackMaxAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readUnoccupiedSetbackAttribute( + long chipClusterPtr, UnoccupiedSetbackAttributeCallback callback); + + private native void writeUnoccupiedSetbackAttribute( + long chipClusterPtr, + DefaultClusterCallback callback, + Integer value, + @Nullable Integer timedWriteTimeoutMs); + + private native void subscribeUnoccupiedSetbackAttribute( + long chipClusterPtr, + UnoccupiedSetbackAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readUnoccupiedSetbackMinAttribute( + long chipClusterPtr, UnoccupiedSetbackMinAttributeCallback callback); + + private native void subscribeUnoccupiedSetbackMinAttribute( + long chipClusterPtr, + UnoccupiedSetbackMinAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readUnoccupiedSetbackMaxAttribute( + long chipClusterPtr, UnoccupiedSetbackMaxAttributeCallback callback); + + private native void subscribeUnoccupiedSetbackMaxAttribute( + long chipClusterPtr, + UnoccupiedSetbackMaxAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readEmergencyHeatDeltaAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void writeEmergencyHeatDeltaAttribute( + long chipClusterPtr, + DefaultClusterCallback callback, + Integer value, + @Nullable Integer timedWriteTimeoutMs); + + private native void subscribeEmergencyHeatDeltaAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + + private native void readACTypeAttribute(long chipClusterPtr, IntegerAttributeCallback callback); + + private native void writeACTypeAttribute( + long chipClusterPtr, + DefaultClusterCallback callback, + Integer value, + @Nullable Integer timedWriteTimeoutMs); + + private native void subscribeACTypeAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + + private native void readACCapacityAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void writeACCapacityAttribute( + long chipClusterPtr, + DefaultClusterCallback callback, + Integer value, + @Nullable Integer timedWriteTimeoutMs); + + private native void subscribeACCapacityAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + + private native void readACRefrigerantTypeAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void writeACRefrigerantTypeAttribute( + long chipClusterPtr, + DefaultClusterCallback callback, + Integer value, + @Nullable Integer timedWriteTimeoutMs); + + private native void subscribeACRefrigerantTypeAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + + private native void readACCompressorTypeAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void writeACCompressorTypeAttribute( + long chipClusterPtr, + DefaultClusterCallback callback, + Integer value, + @Nullable Integer timedWriteTimeoutMs); + + private native void subscribeACCompressorTypeAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + + private native void readACErrorCodeAttribute( + long chipClusterPtr, LongAttributeCallback callback); + + private native void writeACErrorCodeAttribute( + long chipClusterPtr, + DefaultClusterCallback callback, + Long value, + @Nullable Integer timedWriteTimeoutMs); + + private native void subscribeACErrorCodeAttribute( + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); + + private native void readACLouverPositionAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void writeACLouverPositionAttribute( + long chipClusterPtr, + DefaultClusterCallback callback, + Integer value, + @Nullable Integer timedWriteTimeoutMs); + + private native void subscribeACLouverPositionAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + + private native void readACCoilTemperatureAttribute( + long chipClusterPtr, ACCoilTemperatureAttributeCallback callback); + + private native void subscribeACCoilTemperatureAttribute( + long chipClusterPtr, + ACCoilTemperatureAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readACCapacityformatAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void writeACCapacityformatAttribute( + long chipClusterPtr, + DefaultClusterCallback callback, + Integer value, + @Nullable Integer timedWriteTimeoutMs); + + private native void subscribeACCapacityformatAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + private native void readGeneratedCommandListAttribute( long chipClusterPtr, GeneratedCommandListAttributeCallback callback); diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ChipIdLookup.java b/src/controller/java/zap-generated/chip/devicecontroller/ChipIdLookup.java index dea157245477f4..980c4607f533af 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ChipIdLookup.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ChipIdLookup.java @@ -2071,6 +2071,12 @@ public static String attributeIdToName(long clusterId, long attributeId) { if (attributeId == 0L) { return "LocalTemperature"; } + if (attributeId == 1L) { + return "OutdoorTemperature"; + } + if (attributeId == 2L) { + return "Occupancy"; + } if (attributeId == 3L) { return "AbsMinHeatSetpointLimit"; } @@ -2083,12 +2089,30 @@ public static String attributeIdToName(long clusterId, long attributeId) { if (attributeId == 6L) { return "AbsMaxCoolSetpointLimit"; } + if (attributeId == 7L) { + return "PICoolingDemand"; + } + if (attributeId == 8L) { + return "PIHeatingDemand"; + } + if (attributeId == 9L) { + return "HVACSystemTypeConfiguration"; + } + if (attributeId == 16L) { + return "LocalTemperatureCalibration"; + } if (attributeId == 17L) { return "OccupiedCoolingSetpoint"; } if (attributeId == 18L) { return "OccupiedHeatingSetpoint"; } + if (attributeId == 19L) { + return "UnoccupiedCoolingSetpoint"; + } + if (attributeId == 20L) { + return "UnoccupiedHeatingSetpoint"; + } if (attributeId == 21L) { return "MinHeatSetpointLimit"; } @@ -2104,12 +2128,18 @@ public static String attributeIdToName(long clusterId, long attributeId) { if (attributeId == 25L) { return "MinSetpointDeadBand"; } + if (attributeId == 26L) { + return "RemoteSensing"; + } if (attributeId == 27L) { return "ControlSequenceOfOperation"; } if (attributeId == 28L) { return "SystemMode"; } + if (attributeId == 30L) { + return "ThermostatRunningMode"; + } if (attributeId == 32L) { return "StartOfWeek"; } @@ -2119,6 +2149,72 @@ public static String attributeIdToName(long clusterId, long attributeId) { if (attributeId == 34L) { return "NumberOfDailyTransitions"; } + if (attributeId == 35L) { + return "TemperatureSetpointHold"; + } + if (attributeId == 36L) { + return "TemperatureSetpointHoldDuration"; + } + if (attributeId == 37L) { + return "ThermostatProgrammingOperationMode"; + } + if (attributeId == 41L) { + return "ThermostatRunningState"; + } + if (attributeId == 48L) { + return "SetpointChangeSource"; + } + if (attributeId == 49L) { + return "SetpointChangeAmount"; + } + if (attributeId == 50L) { + return "SetpointChangeSourceTimestamp"; + } + if (attributeId == 52L) { + return "OccupiedSetback"; + } + if (attributeId == 53L) { + return "OccupiedSetbackMin"; + } + if (attributeId == 54L) { + return "OccupiedSetbackMax"; + } + if (attributeId == 55L) { + return "UnoccupiedSetback"; + } + if (attributeId == 56L) { + return "UnoccupiedSetbackMin"; + } + if (attributeId == 57L) { + return "UnoccupiedSetbackMax"; + } + if (attributeId == 58L) { + return "EmergencyHeatDelta"; + } + if (attributeId == 64L) { + return "ACType"; + } + if (attributeId == 65L) { + return "ACCapacity"; + } + if (attributeId == 66L) { + return "ACRefrigerantType"; + } + if (attributeId == 67L) { + return "ACCompressorType"; + } + if (attributeId == 68L) { + return "ACErrorCode"; + } + if (attributeId == 69L) { + return "ACLouverPosition"; + } + if (attributeId == 70L) { + return "ACCoilTemperature"; + } + if (attributeId == 71L) { + return "ACCapacityformat"; + } if (attributeId == 65528L) { return "GeneratedCommandList"; } diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java b/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java index 9650a37266b3d9..3911d9f067b7f4 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java @@ -8053,6 +8053,246 @@ public void onError(Exception ex) { } } + public static class DelegatedThermostatClusterOutdoorTemperatureAttributeCallback + implements ChipClusters.ThermostatCluster.OutdoorTemperatureAttributeCallback, + DelegatedClusterCallback { + private ClusterCommandCallback callback; + + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(@Nullable Integer value) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Integer"); + responseValues.put(commandResponseInfo, value); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedThermostatClusterTemperatureSetpointHoldDurationAttributeCallback + implements ChipClusters.ThermostatCluster.TemperatureSetpointHoldDurationAttributeCallback, + DelegatedClusterCallback { + private ClusterCommandCallback callback; + + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(@Nullable Integer value) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Integer"); + responseValues.put(commandResponseInfo, value); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedThermostatClusterSetpointChangeAmountAttributeCallback + implements ChipClusters.ThermostatCluster.SetpointChangeAmountAttributeCallback, + DelegatedClusterCallback { + private ClusterCommandCallback callback; + + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(@Nullable Integer value) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Integer"); + responseValues.put(commandResponseInfo, value); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedThermostatClusterOccupiedSetbackAttributeCallback + implements ChipClusters.ThermostatCluster.OccupiedSetbackAttributeCallback, + DelegatedClusterCallback { + private ClusterCommandCallback callback; + + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(@Nullable Integer value) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Integer"); + responseValues.put(commandResponseInfo, value); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedThermostatClusterOccupiedSetbackMinAttributeCallback + implements ChipClusters.ThermostatCluster.OccupiedSetbackMinAttributeCallback, + DelegatedClusterCallback { + private ClusterCommandCallback callback; + + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(@Nullable Integer value) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Integer"); + responseValues.put(commandResponseInfo, value); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedThermostatClusterOccupiedSetbackMaxAttributeCallback + implements ChipClusters.ThermostatCluster.OccupiedSetbackMaxAttributeCallback, + DelegatedClusterCallback { + private ClusterCommandCallback callback; + + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(@Nullable Integer value) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Integer"); + responseValues.put(commandResponseInfo, value); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedThermostatClusterUnoccupiedSetbackAttributeCallback + implements ChipClusters.ThermostatCluster.UnoccupiedSetbackAttributeCallback, + DelegatedClusterCallback { + private ClusterCommandCallback callback; + + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(@Nullable Integer value) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Integer"); + responseValues.put(commandResponseInfo, value); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedThermostatClusterUnoccupiedSetbackMinAttributeCallback + implements ChipClusters.ThermostatCluster.UnoccupiedSetbackMinAttributeCallback, + DelegatedClusterCallback { + private ClusterCommandCallback callback; + + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(@Nullable Integer value) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Integer"); + responseValues.put(commandResponseInfo, value); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedThermostatClusterUnoccupiedSetbackMaxAttributeCallback + implements ChipClusters.ThermostatCluster.UnoccupiedSetbackMaxAttributeCallback, + DelegatedClusterCallback { + private ClusterCommandCallback callback; + + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(@Nullable Integer value) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Integer"); + responseValues.put(commandResponseInfo, value); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedThermostatClusterACCoilTemperatureAttributeCallback + implements ChipClusters.ThermostatCluster.ACCoilTemperatureAttributeCallback, + DelegatedClusterCallback { + private ClusterCommandCallback callback; + + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(@Nullable Integer value) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Integer"); + responseValues.put(commandResponseInfo, value); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + public static class DelegatedThermostatClusterGeneratedCommandListAttributeCallback implements ChipClusters.ThermostatCluster.GeneratedCommandListAttributeCallback, DelegatedClusterCallback { diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ClusterReadMapping.java b/src/controller/java/zap-generated/chip/devicecontroller/ClusterReadMapping.java index bb436d77a4765d..b8fd297d5c53e6 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ClusterReadMapping.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ClusterReadMapping.java @@ -8387,6 +8387,35 @@ public Map> getReadAttributeMap() { readThermostatLocalTemperatureCommandParams); readThermostatInteractionInfo.put( "readLocalTemperatureAttribute", readThermostatLocalTemperatureAttributeInteractionInfo); + Map readThermostatOutdoorTemperatureCommandParams = + new LinkedHashMap(); + InteractionInfo readThermostatOutdoorTemperatureAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThermostatCluster) cluster) + .readOutdoorTemperatureAttribute( + (ChipClusters.ThermostatCluster.OutdoorTemperatureAttributeCallback) + callback); + }, + () -> + new ClusterInfoMapping + .DelegatedThermostatClusterOutdoorTemperatureAttributeCallback(), + readThermostatOutdoorTemperatureCommandParams); + readThermostatInteractionInfo.put( + "readOutdoorTemperatureAttribute", + readThermostatOutdoorTemperatureAttributeInteractionInfo); + Map readThermostatOccupancyCommandParams = + new LinkedHashMap(); + InteractionInfo readThermostatOccupancyAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThermostatCluster) cluster) + .readOccupancyAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readThermostatOccupancyCommandParams); + readThermostatInteractionInfo.put( + "readOccupancyAttribute", readThermostatOccupancyAttributeInteractionInfo); Map readThermostatAbsMinHeatSetpointLimitCommandParams = new LinkedHashMap(); InteractionInfo readThermostatAbsMinHeatSetpointLimitAttributeInteractionInfo = @@ -8443,6 +8472,58 @@ public Map> getReadAttributeMap() { readThermostatInteractionInfo.put( "readAbsMaxCoolSetpointLimitAttribute", readThermostatAbsMaxCoolSetpointLimitAttributeInteractionInfo); + Map readThermostatPICoolingDemandCommandParams = + new LinkedHashMap(); + InteractionInfo readThermostatPICoolingDemandAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThermostatCluster) cluster) + .readPICoolingDemandAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readThermostatPICoolingDemandCommandParams); + readThermostatInteractionInfo.put( + "readPICoolingDemandAttribute", readThermostatPICoolingDemandAttributeInteractionInfo); + Map readThermostatPIHeatingDemandCommandParams = + new LinkedHashMap(); + InteractionInfo readThermostatPIHeatingDemandAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThermostatCluster) cluster) + .readPIHeatingDemandAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readThermostatPIHeatingDemandCommandParams); + readThermostatInteractionInfo.put( + "readPIHeatingDemandAttribute", readThermostatPIHeatingDemandAttributeInteractionInfo); + Map readThermostatHVACSystemTypeConfigurationCommandParams = + new LinkedHashMap(); + InteractionInfo readThermostatHVACSystemTypeConfigurationAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThermostatCluster) cluster) + .readHVACSystemTypeConfigurationAttribute( + (ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readThermostatHVACSystemTypeConfigurationCommandParams); + readThermostatInteractionInfo.put( + "readHVACSystemTypeConfigurationAttribute", + readThermostatHVACSystemTypeConfigurationAttributeInteractionInfo); + Map readThermostatLocalTemperatureCalibrationCommandParams = + new LinkedHashMap(); + InteractionInfo readThermostatLocalTemperatureCalibrationAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThermostatCluster) cluster) + .readLocalTemperatureCalibrationAttribute( + (ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readThermostatLocalTemperatureCalibrationCommandParams); + readThermostatInteractionInfo.put( + "readLocalTemperatureCalibrationAttribute", + readThermostatLocalTemperatureCalibrationAttributeInteractionInfo); Map readThermostatOccupiedCoolingSetpointCommandParams = new LinkedHashMap(); InteractionInfo readThermostatOccupiedCoolingSetpointAttributeInteractionInfo = @@ -8471,6 +8552,34 @@ public Map> getReadAttributeMap() { readThermostatInteractionInfo.put( "readOccupiedHeatingSetpointAttribute", readThermostatOccupiedHeatingSetpointAttributeInteractionInfo); + Map readThermostatUnoccupiedCoolingSetpointCommandParams = + new LinkedHashMap(); + InteractionInfo readThermostatUnoccupiedCoolingSetpointAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThermostatCluster) cluster) + .readUnoccupiedCoolingSetpointAttribute( + (ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readThermostatUnoccupiedCoolingSetpointCommandParams); + readThermostatInteractionInfo.put( + "readUnoccupiedCoolingSetpointAttribute", + readThermostatUnoccupiedCoolingSetpointAttributeInteractionInfo); + Map readThermostatUnoccupiedHeatingSetpointCommandParams = + new LinkedHashMap(); + InteractionInfo readThermostatUnoccupiedHeatingSetpointAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThermostatCluster) cluster) + .readUnoccupiedHeatingSetpointAttribute( + (ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readThermostatUnoccupiedHeatingSetpointCommandParams); + readThermostatInteractionInfo.put( + "readUnoccupiedHeatingSetpointAttribute", + readThermostatUnoccupiedHeatingSetpointAttributeInteractionInfo); Map readThermostatMinHeatSetpointLimitCommandParams = new LinkedHashMap(); InteractionInfo readThermostatMinHeatSetpointLimitAttributeInteractionInfo = @@ -8541,6 +8650,18 @@ public Map> getReadAttributeMap() { readThermostatInteractionInfo.put( "readMinSetpointDeadBandAttribute", readThermostatMinSetpointDeadBandAttributeInteractionInfo); + Map readThermostatRemoteSensingCommandParams = + new LinkedHashMap(); + InteractionInfo readThermostatRemoteSensingAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThermostatCluster) cluster) + .readRemoteSensingAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readThermostatRemoteSensingCommandParams); + readThermostatInteractionInfo.put( + "readRemoteSensingAttribute", readThermostatRemoteSensingAttributeInteractionInfo); Map readThermostatControlSequenceOfOperationCommandParams = new LinkedHashMap(); InteractionInfo readThermostatControlSequenceOfOperationAttributeInteractionInfo = @@ -8567,6 +8688,20 @@ public Map> getReadAttributeMap() { readThermostatSystemModeCommandParams); readThermostatInteractionInfo.put( "readSystemModeAttribute", readThermostatSystemModeAttributeInteractionInfo); + Map readThermostatThermostatRunningModeCommandParams = + new LinkedHashMap(); + InteractionInfo readThermostatThermostatRunningModeAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThermostatCluster) cluster) + .readThermostatRunningModeAttribute( + (ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readThermostatThermostatRunningModeCommandParams); + readThermostatInteractionInfo.put( + "readThermostatRunningModeAttribute", + readThermostatThermostatRunningModeAttributeInteractionInfo); Map readThermostatStartOfWeekCommandParams = new LinkedHashMap(); InteractionInfo readThermostatStartOfWeekAttributeInteractionInfo = @@ -8607,6 +8742,322 @@ public Map> getReadAttributeMap() { readThermostatInteractionInfo.put( "readNumberOfDailyTransitionsAttribute", readThermostatNumberOfDailyTransitionsAttributeInteractionInfo); + Map readThermostatTemperatureSetpointHoldCommandParams = + new LinkedHashMap(); + InteractionInfo readThermostatTemperatureSetpointHoldAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThermostatCluster) cluster) + .readTemperatureSetpointHoldAttribute( + (ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readThermostatTemperatureSetpointHoldCommandParams); + readThermostatInteractionInfo.put( + "readTemperatureSetpointHoldAttribute", + readThermostatTemperatureSetpointHoldAttributeInteractionInfo); + Map readThermostatTemperatureSetpointHoldDurationCommandParams = + new LinkedHashMap(); + InteractionInfo readThermostatTemperatureSetpointHoldDurationAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThermostatCluster) cluster) + .readTemperatureSetpointHoldDurationAttribute( + (ChipClusters.ThermostatCluster + .TemperatureSetpointHoldDurationAttributeCallback) + callback); + }, + () -> + new ClusterInfoMapping + .DelegatedThermostatClusterTemperatureSetpointHoldDurationAttributeCallback(), + readThermostatTemperatureSetpointHoldDurationCommandParams); + readThermostatInteractionInfo.put( + "readTemperatureSetpointHoldDurationAttribute", + readThermostatTemperatureSetpointHoldDurationAttributeInteractionInfo); + Map + readThermostatThermostatProgrammingOperationModeCommandParams = + new LinkedHashMap(); + InteractionInfo readThermostatThermostatProgrammingOperationModeAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThermostatCluster) cluster) + .readThermostatProgrammingOperationModeAttribute( + (ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readThermostatThermostatProgrammingOperationModeCommandParams); + readThermostatInteractionInfo.put( + "readThermostatProgrammingOperationModeAttribute", + readThermostatThermostatProgrammingOperationModeAttributeInteractionInfo); + Map readThermostatThermostatRunningStateCommandParams = + new LinkedHashMap(); + InteractionInfo readThermostatThermostatRunningStateAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThermostatCluster) cluster) + .readThermostatRunningStateAttribute( + (ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readThermostatThermostatRunningStateCommandParams); + readThermostatInteractionInfo.put( + "readThermostatRunningStateAttribute", + readThermostatThermostatRunningStateAttributeInteractionInfo); + Map readThermostatSetpointChangeSourceCommandParams = + new LinkedHashMap(); + InteractionInfo readThermostatSetpointChangeSourceAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThermostatCluster) cluster) + .readSetpointChangeSourceAttribute( + (ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readThermostatSetpointChangeSourceCommandParams); + readThermostatInteractionInfo.put( + "readSetpointChangeSourceAttribute", + readThermostatSetpointChangeSourceAttributeInteractionInfo); + Map readThermostatSetpointChangeAmountCommandParams = + new LinkedHashMap(); + InteractionInfo readThermostatSetpointChangeAmountAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThermostatCluster) cluster) + .readSetpointChangeAmountAttribute( + (ChipClusters.ThermostatCluster.SetpointChangeAmountAttributeCallback) + callback); + }, + () -> + new ClusterInfoMapping + .DelegatedThermostatClusterSetpointChangeAmountAttributeCallback(), + readThermostatSetpointChangeAmountCommandParams); + readThermostatInteractionInfo.put( + "readSetpointChangeAmountAttribute", + readThermostatSetpointChangeAmountAttributeInteractionInfo); + Map readThermostatSetpointChangeSourceTimestampCommandParams = + new LinkedHashMap(); + InteractionInfo readThermostatSetpointChangeSourceTimestampAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThermostatCluster) cluster) + .readSetpointChangeSourceTimestampAttribute( + (ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readThermostatSetpointChangeSourceTimestampCommandParams); + readThermostatInteractionInfo.put( + "readSetpointChangeSourceTimestampAttribute", + readThermostatSetpointChangeSourceTimestampAttributeInteractionInfo); + Map readThermostatOccupiedSetbackCommandParams = + new LinkedHashMap(); + InteractionInfo readThermostatOccupiedSetbackAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThermostatCluster) cluster) + .readOccupiedSetbackAttribute( + (ChipClusters.ThermostatCluster.OccupiedSetbackAttributeCallback) callback); + }, + () -> + new ClusterInfoMapping.DelegatedThermostatClusterOccupiedSetbackAttributeCallback(), + readThermostatOccupiedSetbackCommandParams); + readThermostatInteractionInfo.put( + "readOccupiedSetbackAttribute", readThermostatOccupiedSetbackAttributeInteractionInfo); + Map readThermostatOccupiedSetbackMinCommandParams = + new LinkedHashMap(); + InteractionInfo readThermostatOccupiedSetbackMinAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThermostatCluster) cluster) + .readOccupiedSetbackMinAttribute( + (ChipClusters.ThermostatCluster.OccupiedSetbackMinAttributeCallback) + callback); + }, + () -> + new ClusterInfoMapping + .DelegatedThermostatClusterOccupiedSetbackMinAttributeCallback(), + readThermostatOccupiedSetbackMinCommandParams); + readThermostatInteractionInfo.put( + "readOccupiedSetbackMinAttribute", + readThermostatOccupiedSetbackMinAttributeInteractionInfo); + Map readThermostatOccupiedSetbackMaxCommandParams = + new LinkedHashMap(); + InteractionInfo readThermostatOccupiedSetbackMaxAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThermostatCluster) cluster) + .readOccupiedSetbackMaxAttribute( + (ChipClusters.ThermostatCluster.OccupiedSetbackMaxAttributeCallback) + callback); + }, + () -> + new ClusterInfoMapping + .DelegatedThermostatClusterOccupiedSetbackMaxAttributeCallback(), + readThermostatOccupiedSetbackMaxCommandParams); + readThermostatInteractionInfo.put( + "readOccupiedSetbackMaxAttribute", + readThermostatOccupiedSetbackMaxAttributeInteractionInfo); + Map readThermostatUnoccupiedSetbackCommandParams = + new LinkedHashMap(); + InteractionInfo readThermostatUnoccupiedSetbackAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThermostatCluster) cluster) + .readUnoccupiedSetbackAttribute( + (ChipClusters.ThermostatCluster.UnoccupiedSetbackAttributeCallback) callback); + }, + () -> + new ClusterInfoMapping + .DelegatedThermostatClusterUnoccupiedSetbackAttributeCallback(), + readThermostatUnoccupiedSetbackCommandParams); + readThermostatInteractionInfo.put( + "readUnoccupiedSetbackAttribute", readThermostatUnoccupiedSetbackAttributeInteractionInfo); + Map readThermostatUnoccupiedSetbackMinCommandParams = + new LinkedHashMap(); + InteractionInfo readThermostatUnoccupiedSetbackMinAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThermostatCluster) cluster) + .readUnoccupiedSetbackMinAttribute( + (ChipClusters.ThermostatCluster.UnoccupiedSetbackMinAttributeCallback) + callback); + }, + () -> + new ClusterInfoMapping + .DelegatedThermostatClusterUnoccupiedSetbackMinAttributeCallback(), + readThermostatUnoccupiedSetbackMinCommandParams); + readThermostatInteractionInfo.put( + "readUnoccupiedSetbackMinAttribute", + readThermostatUnoccupiedSetbackMinAttributeInteractionInfo); + Map readThermostatUnoccupiedSetbackMaxCommandParams = + new LinkedHashMap(); + InteractionInfo readThermostatUnoccupiedSetbackMaxAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThermostatCluster) cluster) + .readUnoccupiedSetbackMaxAttribute( + (ChipClusters.ThermostatCluster.UnoccupiedSetbackMaxAttributeCallback) + callback); + }, + () -> + new ClusterInfoMapping + .DelegatedThermostatClusterUnoccupiedSetbackMaxAttributeCallback(), + readThermostatUnoccupiedSetbackMaxCommandParams); + readThermostatInteractionInfo.put( + "readUnoccupiedSetbackMaxAttribute", + readThermostatUnoccupiedSetbackMaxAttributeInteractionInfo); + Map readThermostatEmergencyHeatDeltaCommandParams = + new LinkedHashMap(); + InteractionInfo readThermostatEmergencyHeatDeltaAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThermostatCluster) cluster) + .readEmergencyHeatDeltaAttribute( + (ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readThermostatEmergencyHeatDeltaCommandParams); + readThermostatInteractionInfo.put( + "readEmergencyHeatDeltaAttribute", + readThermostatEmergencyHeatDeltaAttributeInteractionInfo); + Map readThermostatACTypeCommandParams = + new LinkedHashMap(); + InteractionInfo readThermostatACTypeAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThermostatCluster) cluster) + .readACTypeAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readThermostatACTypeCommandParams); + readThermostatInteractionInfo.put( + "readACTypeAttribute", readThermostatACTypeAttributeInteractionInfo); + Map readThermostatACCapacityCommandParams = + new LinkedHashMap(); + InteractionInfo readThermostatACCapacityAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThermostatCluster) cluster) + .readACCapacityAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readThermostatACCapacityCommandParams); + readThermostatInteractionInfo.put( + "readACCapacityAttribute", readThermostatACCapacityAttributeInteractionInfo); + Map readThermostatACRefrigerantTypeCommandParams = + new LinkedHashMap(); + InteractionInfo readThermostatACRefrigerantTypeAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThermostatCluster) cluster) + .readACRefrigerantTypeAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readThermostatACRefrigerantTypeCommandParams); + readThermostatInteractionInfo.put( + "readACRefrigerantTypeAttribute", readThermostatACRefrigerantTypeAttributeInteractionInfo); + Map readThermostatACCompressorTypeCommandParams = + new LinkedHashMap(); + InteractionInfo readThermostatACCompressorTypeAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThermostatCluster) cluster) + .readACCompressorTypeAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readThermostatACCompressorTypeCommandParams); + readThermostatInteractionInfo.put( + "readACCompressorTypeAttribute", readThermostatACCompressorTypeAttributeInteractionInfo); + Map readThermostatACErrorCodeCommandParams = + new LinkedHashMap(); + InteractionInfo readThermostatACErrorCodeAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThermostatCluster) cluster) + .readACErrorCodeAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readThermostatACErrorCodeCommandParams); + readThermostatInteractionInfo.put( + "readACErrorCodeAttribute", readThermostatACErrorCodeAttributeInteractionInfo); + Map readThermostatACLouverPositionCommandParams = + new LinkedHashMap(); + InteractionInfo readThermostatACLouverPositionAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThermostatCluster) cluster) + .readACLouverPositionAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readThermostatACLouverPositionCommandParams); + readThermostatInteractionInfo.put( + "readACLouverPositionAttribute", readThermostatACLouverPositionAttributeInteractionInfo); + Map readThermostatACCoilTemperatureCommandParams = + new LinkedHashMap(); + InteractionInfo readThermostatACCoilTemperatureAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThermostatCluster) cluster) + .readACCoilTemperatureAttribute( + (ChipClusters.ThermostatCluster.ACCoilTemperatureAttributeCallback) callback); + }, + () -> + new ClusterInfoMapping + .DelegatedThermostatClusterACCoilTemperatureAttributeCallback(), + readThermostatACCoilTemperatureCommandParams); + readThermostatInteractionInfo.put( + "readACCoilTemperatureAttribute", readThermostatACCoilTemperatureAttributeInteractionInfo); + Map readThermostatACCapacityformatCommandParams = + new LinkedHashMap(); + InteractionInfo readThermostatACCapacityformatAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThermostatCluster) cluster) + .readACCapacityformatAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readThermostatACCapacityformatCommandParams); + readThermostatInteractionInfo.put( + "readACCapacityformatAttribute", readThermostatACCapacityformatAttributeInteractionInfo); Map readThermostatGeneratedCommandListCommandParams = new LinkedHashMap(); InteractionInfo readThermostatGeneratedCommandListAttributeInteractionInfo = diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ClusterWriteMapping.java b/src/controller/java/zap-generated/chip/devicecontroller/ClusterWriteMapping.java index c1c505d8a45dd3..571d380673d247 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ClusterWriteMapping.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ClusterWriteMapping.java @@ -816,6 +816,42 @@ public Map> getWriteAttributeMap() { writeAttributeMap.put( "pumpConfigurationAndControl", writePumpConfigurationAndControlInteractionInfo); Map writeThermostatInteractionInfo = new LinkedHashMap<>(); + Map writeThermostatHVACSystemTypeConfigurationCommandParams = + new LinkedHashMap(); + CommandParameterInfo thermostatHVACSystemTypeConfigurationCommandParameterInfo = + new CommandParameterInfo("value", Integer.class, Integer.class); + writeThermostatHVACSystemTypeConfigurationCommandParams.put( + "value", thermostatHVACSystemTypeConfigurationCommandParameterInfo); + InteractionInfo writeThermostatHVACSystemTypeConfigurationAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThermostatCluster) cluster) + .writeHVACSystemTypeConfigurationAttribute( + (DefaultClusterCallback) callback, (Integer) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeThermostatHVACSystemTypeConfigurationCommandParams); + writeThermostatInteractionInfo.put( + "writeHVACSystemTypeConfigurationAttribute", + writeThermostatHVACSystemTypeConfigurationAttributeInteractionInfo); + Map writeThermostatLocalTemperatureCalibrationCommandParams = + new LinkedHashMap(); + CommandParameterInfo thermostatlocalTemperatureCalibrationCommandParameterInfo = + new CommandParameterInfo("value", Integer.class, Integer.class); + writeThermostatLocalTemperatureCalibrationCommandParams.put( + "value", thermostatlocalTemperatureCalibrationCommandParameterInfo); + InteractionInfo writeThermostatLocalTemperatureCalibrationAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThermostatCluster) cluster) + .writeLocalTemperatureCalibrationAttribute( + (DefaultClusterCallback) callback, (Integer) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeThermostatLocalTemperatureCalibrationCommandParams); + writeThermostatInteractionInfo.put( + "writeLocalTemperatureCalibrationAttribute", + writeThermostatLocalTemperatureCalibrationAttributeInteractionInfo); Map writeThermostatOccupiedCoolingSetpointCommandParams = new LinkedHashMap(); CommandParameterInfo thermostatoccupiedCoolingSetpointCommandParameterInfo = @@ -852,6 +888,42 @@ public Map> getWriteAttributeMap() { writeThermostatInteractionInfo.put( "writeOccupiedHeatingSetpointAttribute", writeThermostatOccupiedHeatingSetpointAttributeInteractionInfo); + Map writeThermostatUnoccupiedCoolingSetpointCommandParams = + new LinkedHashMap(); + CommandParameterInfo thermostatunoccupiedCoolingSetpointCommandParameterInfo = + new CommandParameterInfo("value", Integer.class, Integer.class); + writeThermostatUnoccupiedCoolingSetpointCommandParams.put( + "value", thermostatunoccupiedCoolingSetpointCommandParameterInfo); + InteractionInfo writeThermostatUnoccupiedCoolingSetpointAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThermostatCluster) cluster) + .writeUnoccupiedCoolingSetpointAttribute( + (DefaultClusterCallback) callback, (Integer) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeThermostatUnoccupiedCoolingSetpointCommandParams); + writeThermostatInteractionInfo.put( + "writeUnoccupiedCoolingSetpointAttribute", + writeThermostatUnoccupiedCoolingSetpointAttributeInteractionInfo); + Map writeThermostatUnoccupiedHeatingSetpointCommandParams = + new LinkedHashMap(); + CommandParameterInfo thermostatunoccupiedHeatingSetpointCommandParameterInfo = + new CommandParameterInfo("value", Integer.class, Integer.class); + writeThermostatUnoccupiedHeatingSetpointCommandParams.put( + "value", thermostatunoccupiedHeatingSetpointCommandParameterInfo); + InteractionInfo writeThermostatUnoccupiedHeatingSetpointAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThermostatCluster) cluster) + .writeUnoccupiedHeatingSetpointAttribute( + (DefaultClusterCallback) callback, (Integer) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeThermostatUnoccupiedHeatingSetpointCommandParams); + writeThermostatInteractionInfo.put( + "writeUnoccupiedHeatingSetpointAttribute", + writeThermostatUnoccupiedHeatingSetpointAttributeInteractionInfo); Map writeThermostatMinHeatSetpointLimitCommandParams = new LinkedHashMap(); CommandParameterInfo thermostatminHeatSetpointLimitCommandParameterInfo = @@ -942,6 +1014,23 @@ public Map> getWriteAttributeMap() { writeThermostatInteractionInfo.put( "writeMinSetpointDeadBandAttribute", writeThermostatMinSetpointDeadBandAttributeInteractionInfo); + Map writeThermostatRemoteSensingCommandParams = + new LinkedHashMap(); + CommandParameterInfo thermostatremoteSensingCommandParameterInfo = + new CommandParameterInfo("value", Integer.class, Integer.class); + writeThermostatRemoteSensingCommandParams.put( + "value", thermostatremoteSensingCommandParameterInfo); + InteractionInfo writeThermostatRemoteSensingAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThermostatCluster) cluster) + .writeRemoteSensingAttribute( + (DefaultClusterCallback) callback, (Integer) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeThermostatRemoteSensingCommandParams); + writeThermostatInteractionInfo.put( + "writeRemoteSensingAttribute", writeThermostatRemoteSensingAttributeInteractionInfo); Map writeThermostatControlSequenceOfOperationCommandParams = new LinkedHashMap(); CommandParameterInfo thermostatcontrolSequenceOfOperationCommandParameterInfo = @@ -976,6 +1065,231 @@ public Map> getWriteAttributeMap() { writeThermostatSystemModeCommandParams); writeThermostatInteractionInfo.put( "writeSystemModeAttribute", writeThermostatSystemModeAttributeInteractionInfo); + Map writeThermostatTemperatureSetpointHoldCommandParams = + new LinkedHashMap(); + CommandParameterInfo thermostattemperatureSetpointHoldCommandParameterInfo = + new CommandParameterInfo("value", Integer.class, Integer.class); + writeThermostatTemperatureSetpointHoldCommandParams.put( + "value", thermostattemperatureSetpointHoldCommandParameterInfo); + InteractionInfo writeThermostatTemperatureSetpointHoldAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThermostatCluster) cluster) + .writeTemperatureSetpointHoldAttribute( + (DefaultClusterCallback) callback, (Integer) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeThermostatTemperatureSetpointHoldCommandParams); + writeThermostatInteractionInfo.put( + "writeTemperatureSetpointHoldAttribute", + writeThermostatTemperatureSetpointHoldAttributeInteractionInfo); + Map writeThermostatTemperatureSetpointHoldDurationCommandParams = + new LinkedHashMap(); + CommandParameterInfo thermostattemperatureSetpointHoldDurationCommandParameterInfo = + new CommandParameterInfo("value", Integer.class, Integer.class); + writeThermostatTemperatureSetpointHoldDurationCommandParams.put( + "value", thermostattemperatureSetpointHoldDurationCommandParameterInfo); + InteractionInfo writeThermostatTemperatureSetpointHoldDurationAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThermostatCluster) cluster) + .writeTemperatureSetpointHoldDurationAttribute( + (DefaultClusterCallback) callback, (Integer) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeThermostatTemperatureSetpointHoldDurationCommandParams); + writeThermostatInteractionInfo.put( + "writeTemperatureSetpointHoldDurationAttribute", + writeThermostatTemperatureSetpointHoldDurationAttributeInteractionInfo); + Map + writeThermostatThermostatProgrammingOperationModeCommandParams = + new LinkedHashMap(); + CommandParameterInfo thermostatthermostatProgrammingOperationModeCommandParameterInfo = + new CommandParameterInfo("value", Integer.class, Integer.class); + writeThermostatThermostatProgrammingOperationModeCommandParams.put( + "value", thermostatthermostatProgrammingOperationModeCommandParameterInfo); + InteractionInfo writeThermostatThermostatProgrammingOperationModeAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThermostatCluster) cluster) + .writeThermostatProgrammingOperationModeAttribute( + (DefaultClusterCallback) callback, (Integer) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeThermostatThermostatProgrammingOperationModeCommandParams); + writeThermostatInteractionInfo.put( + "writeThermostatProgrammingOperationModeAttribute", + writeThermostatThermostatProgrammingOperationModeAttributeInteractionInfo); + Map writeThermostatOccupiedSetbackCommandParams = + new LinkedHashMap(); + CommandParameterInfo thermostatoccupiedSetbackCommandParameterInfo = + new CommandParameterInfo("value", Integer.class, Integer.class); + writeThermostatOccupiedSetbackCommandParams.put( + "value", thermostatoccupiedSetbackCommandParameterInfo); + InteractionInfo writeThermostatOccupiedSetbackAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThermostatCluster) cluster) + .writeOccupiedSetbackAttribute( + (DefaultClusterCallback) callback, (Integer) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeThermostatOccupiedSetbackCommandParams); + writeThermostatInteractionInfo.put( + "writeOccupiedSetbackAttribute", writeThermostatOccupiedSetbackAttributeInteractionInfo); + Map writeThermostatUnoccupiedSetbackCommandParams = + new LinkedHashMap(); + CommandParameterInfo thermostatunoccupiedSetbackCommandParameterInfo = + new CommandParameterInfo("value", Integer.class, Integer.class); + writeThermostatUnoccupiedSetbackCommandParams.put( + "value", thermostatunoccupiedSetbackCommandParameterInfo); + InteractionInfo writeThermostatUnoccupiedSetbackAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThermostatCluster) cluster) + .writeUnoccupiedSetbackAttribute( + (DefaultClusterCallback) callback, (Integer) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeThermostatUnoccupiedSetbackCommandParams); + writeThermostatInteractionInfo.put( + "writeUnoccupiedSetbackAttribute", + writeThermostatUnoccupiedSetbackAttributeInteractionInfo); + Map writeThermostatEmergencyHeatDeltaCommandParams = + new LinkedHashMap(); + CommandParameterInfo thermostatemergencyHeatDeltaCommandParameterInfo = + new CommandParameterInfo("value", Integer.class, Integer.class); + writeThermostatEmergencyHeatDeltaCommandParams.put( + "value", thermostatemergencyHeatDeltaCommandParameterInfo); + InteractionInfo writeThermostatEmergencyHeatDeltaAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThermostatCluster) cluster) + .writeEmergencyHeatDeltaAttribute( + (DefaultClusterCallback) callback, (Integer) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeThermostatEmergencyHeatDeltaCommandParams); + writeThermostatInteractionInfo.put( + "writeEmergencyHeatDeltaAttribute", + writeThermostatEmergencyHeatDeltaAttributeInteractionInfo); + Map writeThermostatACTypeCommandParams = + new LinkedHashMap(); + CommandParameterInfo thermostatACTypeCommandParameterInfo = + new CommandParameterInfo("value", Integer.class, Integer.class); + writeThermostatACTypeCommandParams.put("value", thermostatACTypeCommandParameterInfo); + InteractionInfo writeThermostatACTypeAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThermostatCluster) cluster) + .writeACTypeAttribute( + (DefaultClusterCallback) callback, (Integer) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeThermostatACTypeCommandParams); + writeThermostatInteractionInfo.put( + "writeACTypeAttribute", writeThermostatACTypeAttributeInteractionInfo); + Map writeThermostatACCapacityCommandParams = + new LinkedHashMap(); + CommandParameterInfo thermostatACCapacityCommandParameterInfo = + new CommandParameterInfo("value", Integer.class, Integer.class); + writeThermostatACCapacityCommandParams.put("value", thermostatACCapacityCommandParameterInfo); + InteractionInfo writeThermostatACCapacityAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThermostatCluster) cluster) + .writeACCapacityAttribute( + (DefaultClusterCallback) callback, (Integer) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeThermostatACCapacityCommandParams); + writeThermostatInteractionInfo.put( + "writeACCapacityAttribute", writeThermostatACCapacityAttributeInteractionInfo); + Map writeThermostatACRefrigerantTypeCommandParams = + new LinkedHashMap(); + CommandParameterInfo thermostatACRefrigerantTypeCommandParameterInfo = + new CommandParameterInfo("value", Integer.class, Integer.class); + writeThermostatACRefrigerantTypeCommandParams.put( + "value", thermostatACRefrigerantTypeCommandParameterInfo); + InteractionInfo writeThermostatACRefrigerantTypeAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThermostatCluster) cluster) + .writeACRefrigerantTypeAttribute( + (DefaultClusterCallback) callback, (Integer) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeThermostatACRefrigerantTypeCommandParams); + writeThermostatInteractionInfo.put( + "writeACRefrigerantTypeAttribute", + writeThermostatACRefrigerantTypeAttributeInteractionInfo); + Map writeThermostatACCompressorTypeCommandParams = + new LinkedHashMap(); + CommandParameterInfo thermostatACCompressorTypeCommandParameterInfo = + new CommandParameterInfo("value", Integer.class, Integer.class); + writeThermostatACCompressorTypeCommandParams.put( + "value", thermostatACCompressorTypeCommandParameterInfo); + InteractionInfo writeThermostatACCompressorTypeAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThermostatCluster) cluster) + .writeACCompressorTypeAttribute( + (DefaultClusterCallback) callback, (Integer) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeThermostatACCompressorTypeCommandParams); + writeThermostatInteractionInfo.put( + "writeACCompressorTypeAttribute", writeThermostatACCompressorTypeAttributeInteractionInfo); + Map writeThermostatACErrorCodeCommandParams = + new LinkedHashMap(); + CommandParameterInfo thermostatACErrorCodeCommandParameterInfo = + new CommandParameterInfo("value", Long.class, Long.class); + writeThermostatACErrorCodeCommandParams.put("value", thermostatACErrorCodeCommandParameterInfo); + InteractionInfo writeThermostatACErrorCodeAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThermostatCluster) cluster) + .writeACErrorCodeAttribute( + (DefaultClusterCallback) callback, (Long) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeThermostatACErrorCodeCommandParams); + writeThermostatInteractionInfo.put( + "writeACErrorCodeAttribute", writeThermostatACErrorCodeAttributeInteractionInfo); + Map writeThermostatACLouverPositionCommandParams = + new LinkedHashMap(); + CommandParameterInfo thermostatACLouverPositionCommandParameterInfo = + new CommandParameterInfo("value", Integer.class, Integer.class); + writeThermostatACLouverPositionCommandParams.put( + "value", thermostatACLouverPositionCommandParameterInfo); + InteractionInfo writeThermostatACLouverPositionAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThermostatCluster) cluster) + .writeACLouverPositionAttribute( + (DefaultClusterCallback) callback, (Integer) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeThermostatACLouverPositionCommandParams); + writeThermostatInteractionInfo.put( + "writeACLouverPositionAttribute", writeThermostatACLouverPositionAttributeInteractionInfo); + Map writeThermostatACCapacityformatCommandParams = + new LinkedHashMap(); + CommandParameterInfo thermostatACCapacityformatCommandParameterInfo = + new CommandParameterInfo("value", Integer.class, Integer.class); + writeThermostatACCapacityformatCommandParams.put( + "value", thermostatACCapacityformatCommandParameterInfo); + InteractionInfo writeThermostatACCapacityformatAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThermostatCluster) cluster) + .writeACCapacityformatAttribute( + (DefaultClusterCallback) callback, (Integer) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeThermostatACCapacityformatCommandParams); + writeThermostatInteractionInfo.put( + "writeACCapacityformatAttribute", writeThermostatACCapacityformatAttributeInteractionInfo); writeAttributeMap.put("thermostat", writeThermostatInteractionInfo); Map writeFanControlInteractionInfo = new LinkedHashMap<>(); Map writeFanControlFanModeCommandParams = diff --git a/src/controller/python/chip/clusters/CHIPClusters.py b/src/controller/python/chip/clusters/CHIPClusters.py index 4d4f173e37b6b3..b643ddef10f3f1 100644 --- a/src/controller/python/chip/clusters/CHIPClusters.py +++ b/src/controller/python/chip/clusters/CHIPClusters.py @@ -4710,6 +4710,18 @@ class ChipClusters: "type": "int", "reportable": True, }, + 0x00000001: { + "attributeName": "OutdoorTemperature", + "attributeId": 0x00000001, + "type": "int", + "reportable": True, + }, + 0x00000002: { + "attributeName": "Occupancy", + "attributeId": 0x00000002, + "type": "int", + "reportable": True, + }, 0x00000003: { "attributeName": "AbsMinHeatSetpointLimit", "attributeId": 0x00000003, @@ -4734,6 +4746,32 @@ class ChipClusters: "type": "int", "reportable": True, }, + 0x00000007: { + "attributeName": "PICoolingDemand", + "attributeId": 0x00000007, + "type": "int", + "reportable": True, + }, + 0x00000008: { + "attributeName": "PIHeatingDemand", + "attributeId": 0x00000008, + "type": "int", + "reportable": True, + }, + 0x00000009: { + "attributeName": "HVACSystemTypeConfiguration", + "attributeId": 0x00000009, + "type": "int", + "reportable": True, + "writable": True, + }, + 0x00000010: { + "attributeName": "LocalTemperatureCalibration", + "attributeId": 0x00000010, + "type": "int", + "reportable": True, + "writable": True, + }, 0x00000011: { "attributeName": "OccupiedCoolingSetpoint", "attributeId": 0x00000011, @@ -4748,6 +4786,20 @@ class ChipClusters: "reportable": True, "writable": True, }, + 0x00000013: { + "attributeName": "UnoccupiedCoolingSetpoint", + "attributeId": 0x00000013, + "type": "int", + "reportable": True, + "writable": True, + }, + 0x00000014: { + "attributeName": "UnoccupiedHeatingSetpoint", + "attributeId": 0x00000014, + "type": "int", + "reportable": True, + "writable": True, + }, 0x00000015: { "attributeName": "MinHeatSetpointLimit", "attributeId": 0x00000015, @@ -4783,6 +4835,13 @@ class ChipClusters: "reportable": True, "writable": True, }, + 0x0000001A: { + "attributeName": "RemoteSensing", + "attributeId": 0x0000001A, + "type": "int", + "reportable": True, + "writable": True, + }, 0x0000001B: { "attributeName": "ControlSequenceOfOperation", "attributeId": 0x0000001B, @@ -4797,6 +4856,12 @@ class ChipClusters: "reportable": True, "writable": True, }, + 0x0000001E: { + "attributeName": "ThermostatRunningMode", + "attributeId": 0x0000001E, + "type": "int", + "reportable": True, + }, 0x00000020: { "attributeName": "StartOfWeek", "attributeId": 0x00000020, @@ -4815,6 +4880,151 @@ class ChipClusters: "type": "int", "reportable": True, }, + 0x00000023: { + "attributeName": "TemperatureSetpointHold", + "attributeId": 0x00000023, + "type": "int", + "reportable": True, + "writable": True, + }, + 0x00000024: { + "attributeName": "TemperatureSetpointHoldDuration", + "attributeId": 0x00000024, + "type": "int", + "reportable": True, + "writable": True, + }, + 0x00000025: { + "attributeName": "ThermostatProgrammingOperationMode", + "attributeId": 0x00000025, + "type": "int", + "reportable": True, + "writable": True, + }, + 0x00000029: { + "attributeName": "ThermostatRunningState", + "attributeId": 0x00000029, + "type": "int", + "reportable": True, + }, + 0x00000030: { + "attributeName": "SetpointChangeSource", + "attributeId": 0x00000030, + "type": "int", + "reportable": True, + }, + 0x00000031: { + "attributeName": "SetpointChangeAmount", + "attributeId": 0x00000031, + "type": "int", + "reportable": True, + }, + 0x00000032: { + "attributeName": "SetpointChangeSourceTimestamp", + "attributeId": 0x00000032, + "type": "int", + "reportable": True, + }, + 0x00000034: { + "attributeName": "OccupiedSetback", + "attributeId": 0x00000034, + "type": "int", + "reportable": True, + "writable": True, + }, + 0x00000035: { + "attributeName": "OccupiedSetbackMin", + "attributeId": 0x00000035, + "type": "int", + "reportable": True, + }, + 0x00000036: { + "attributeName": "OccupiedSetbackMax", + "attributeId": 0x00000036, + "type": "int", + "reportable": True, + }, + 0x00000037: { + "attributeName": "UnoccupiedSetback", + "attributeId": 0x00000037, + "type": "int", + "reportable": True, + "writable": True, + }, + 0x00000038: { + "attributeName": "UnoccupiedSetbackMin", + "attributeId": 0x00000038, + "type": "int", + "reportable": True, + }, + 0x00000039: { + "attributeName": "UnoccupiedSetbackMax", + "attributeId": 0x00000039, + "type": "int", + "reportable": True, + }, + 0x0000003A: { + "attributeName": "EmergencyHeatDelta", + "attributeId": 0x0000003A, + "type": "int", + "reportable": True, + "writable": True, + }, + 0x00000040: { + "attributeName": "ACType", + "attributeId": 0x00000040, + "type": "int", + "reportable": True, + "writable": True, + }, + 0x00000041: { + "attributeName": "ACCapacity", + "attributeId": 0x00000041, + "type": "int", + "reportable": True, + "writable": True, + }, + 0x00000042: { + "attributeName": "ACRefrigerantType", + "attributeId": 0x00000042, + "type": "int", + "reportable": True, + "writable": True, + }, + 0x00000043: { + "attributeName": "ACCompressorType", + "attributeId": 0x00000043, + "type": "int", + "reportable": True, + "writable": True, + }, + 0x00000044: { + "attributeName": "ACErrorCode", + "attributeId": 0x00000044, + "type": "int", + "reportable": True, + "writable": True, + }, + 0x00000045: { + "attributeName": "ACLouverPosition", + "attributeId": 0x00000045, + "type": "int", + "reportable": True, + "writable": True, + }, + 0x00000046: { + "attributeName": "ACCoilTemperature", + "attributeId": 0x00000046, + "type": "int", + "reportable": True, + }, + 0x00000047: { + "attributeName": "ACCapacityformat", + "attributeId": 0x00000047, + "type": "int", + "reportable": True, + "writable": True, + }, 0x0000FFF8: { "attributeName": "GeneratedCommandList", "attributeId": 0x0000FFF8, From deea7f9a188ab2bb0df9b97a17d4e55db20b5d34 Mon Sep 17 00:00:00 2001 From: shgutte <102281713+shgutte@users.noreply.github.com> Date: Tue, 21 Mar 2023 23:54:44 +0530 Subject: [PATCH 06/23] [Silabs] Enabling the sleepy device for EFR32 and WF200 combo (#25690) * enabling the sleepy device for EFR32 and rs911x combo * Restyled by whitespace * Restyled by clang-format * Restyled by gn * addressing review comments * inital wf200 changes * Added changes for power save mode WF200 * Adds fix for power save mode in WF200 * Revert "addressing review comments" This reverts commit 59097655565f18a24c0a377db78fc7d02a3a2a8c. * Revert "Restyled by gn" This reverts commit 8156ea915eeb64351300559a3b2484fb16329c6f. * Revert "Restyled by clang-format" This reverts commit 67861582c75f22fc94f5973436daff023fa9a300. * Revert "Restyled by whitespace" This reverts commit d35ecfd32ff2dc818ed1ac196825aa848dba2bcb. * Revert "enabling the sleepy device for EFR32 and rs911x combo" This reverts commit 2967ff0a4914bf7b8e11277fd22ae3c8f3466975. * Removed the unwanted line * Adds restyle changes * Adds fix for function name changes --------- Co-authored-by: Chirag Bansal Co-authored-by: Restyled.io Co-authored-by: chirag-silabs <100861685+chirag-silabs@users.noreply.github.com> --- .../platform/silabs/efr32/wf200/efr_spi.c | 29 ++++++++++++++----- .../platform/silabs/efr32/wf200/host_if.cpp | 5 ++++ 2 files changed, 26 insertions(+), 8 deletions(-) diff --git a/examples/platform/silabs/efr32/wf200/efr_spi.c b/examples/platform/silabs/efr32/wf200/efr_spi.c index f2a5403cded85a..5d75638b54f49a 100644 --- a/examples/platform/silabs/efr32/wf200/efr_spi.c +++ b/examples/platform/silabs/efr32/wf200/efr_spi.c @@ -33,12 +33,9 @@ #include #include +#include "AppConfig.h" #include "FreeRTOS.h" #include "semphr.h" -#ifdef SLEEP_ENABLED -#include "sl_power_manager.h" -#endif -#include "AppConfig.h" #include "gpiointerrupt.h" @@ -48,6 +45,10 @@ #include "sl_wfx_task.h" #include "wfx_host_events.h" +#if defined(SL_CATALOG_POWER_MANAGER_PRESENT) +#include "sl_power_manager.h" +#endif + #if defined(EFR32MG24) #include "spi_multiplex.h" StaticSemaphore_t spi_sem_peripharal; @@ -166,7 +167,7 @@ sl_status_t sl_wfx_host_spi_cs_deassert() } /**************************************************************************** - * @fn static bool rx_dma_complete(unsigned int channel, unsigned int sequenceNo, void *userParam) + * @fn static bool dma_complete(unsigned int channel, unsigned int sequenceNo, void *userParam) * @brief * function called when the DMA complete * @param[in] channel: @@ -175,7 +176,7 @@ sl_status_t sl_wfx_host_spi_cs_deassert() * @return returns true if suucessful, * false otherwise *****************************************************************************/ -static bool rx_dma_complete(unsigned int channel, unsigned int sequenceNo, void * userParam) +static bool dma_complete(unsigned int channel, unsigned int sequenceNo, void * userParam) { (void) channel; (void) sequenceNo; @@ -185,6 +186,10 @@ static bool rx_dma_complete(unsigned int channel, unsigned int sequenceNo, void xSemaphoreGiveFromISR(spi_sem, &xHigherPriorityTaskWoken); portYIELD_FROM_ISR(xHigherPriorityTaskWoken); +#if defined(SL_CATALOG_POWER_MANAGER_PRESENT) + sl_power_manager_remove_em_requirement(SL_POWER_MANAGER_EM1); +#endif + return true; } @@ -198,9 +203,13 @@ static bool rx_dma_complete(unsigned int channel, unsigned int sequenceNo, void *****************************************************************************/ void receiveDMA(uint8_t * buffer, uint16_t buffer_length) { +#if defined(SL_CATALOG_POWER_MANAGER_PRESENT) + sl_power_manager_add_em_requirement(SL_POWER_MANAGER_EM1); +#endif + // Start receive DMA. DMADRV_PeripheralMemory(rx_dma_channel, MY_USART_RX_SIGNAL, (void *) buffer, (void *) &(MY_USART->RXDATA), true, buffer_length, - dmadrvDataSize1, rx_dma_complete, NULL); + dmadrvDataSize1, dma_complete, NULL); // Start transmit DMA. DMADRV_MemoryPeripheral(tx_dma_channel, MY_USART_TX_SIGNAL, (void *) &(MY_USART->TXDATA), (void *) &(dummy_tx_data), false, @@ -217,10 +226,14 @@ void receiveDMA(uint8_t * buffer, uint16_t buffer_length) *****************************************************************************/ void transmitDMA(uint8_t * buffer, uint16_t buffer_length) { +#if defined(SL_CATALOG_POWER_MANAGER_PRESENT) + sl_power_manager_add_em_requirement(SL_POWER_MANAGER_EM1); +#endif + // Receive DMA runs only to initiate callback // Start receive DMA. DMADRV_PeripheralMemory(rx_dma_channel, MY_USART_RX_SIGNAL, &dummy_rx_data, (void *) &(MY_USART->RXDATA), false, buffer_length, - dmadrvDataSize1, rx_dma_complete, NULL); + dmadrvDataSize1, dma_complete, NULL); // Start transmit DMA. DMADRV_MemoryPeripheral(tx_dma_channel, MY_USART_TX_SIGNAL, (void *) &(MY_USART->TXDATA), (void *) buffer, true, buffer_length, dmadrvDataSize1, NULL, NULL); diff --git a/examples/platform/silabs/efr32/wf200/host_if.cpp b/examples/platform/silabs/efr32/wf200/host_if.cpp index 7e2753a9cdee80..30e2ec1cd53f31 100644 --- a/examples/platform/silabs/efr32/wf200/host_if.cpp +++ b/examples/platform/silabs/efr32/wf200/host_if.cpp @@ -578,6 +578,11 @@ static void wfx_events_task(void * p_arg) { wfx_ipv6_notify(1); hasNotifiedIPV6 = true; + + // send device to power save mode + sl_wfx_set_power_mode(WFM_PM_MODE_DTIM, WFM_PM_POLL_FAST_PS, 0); + sl_wfx_enable_device_power_save(); + if (!hasNotifiedWifiConnectivity) { wfx_connected_notify(CONNECTION_STATUS_SUCCESS, &ap_mac); From 47bf1fa74c90623167b35848016ac2217c7c06b6 Mon Sep 17 00:00:00 2001 From: Joshua Villasenor Date: Tue, 21 Mar 2023 11:43:22 -0700 Subject: [PATCH 07/23] Add simulated app to python builder and update cert docker image (#25754) --- .../docker/images/chip-cert-bins/Dockerfile | 6 ++++-- scripts/build/build/targets.py | 2 ++ scripts/build/builders/host.py | 16 ++++++++++++++++ scripts/build/testdata/all_targets_linux_x64.txt | 2 +- 4 files changed, 23 insertions(+), 3 deletions(-) diff --git a/integrations/docker/images/chip-cert-bins/Dockerfile b/integrations/docker/images/chip-cert-bins/Dockerfile index 82e88a28b0df5e..215cf49e59a58c 100644 --- a/integrations/docker/images/chip-cert-bins/Dockerfile +++ b/integrations/docker/images/chip-cert-bins/Dockerfile @@ -231,6 +231,7 @@ RUN case ${TARGETPLATFORM} in \ --target linux-x64-ota-provider-ipv6only \ --target linux-x64-ota-requestor-ipv6only \ --target linux-x64-lock-ipv6only \ + --target linux-x64-simulated-app1-ipv6only \ build \ && mv out/linux-x64-all-clusters-ipv6only/chip-all-clusters-app out/chip-all-clusters-app \ && mv out/linux-x64-all-clusters-minimal-ipv6only/chip-all-clusters-minimal-app out/chip-all-clusters-minimal-app \ @@ -242,6 +243,7 @@ RUN case ${TARGETPLATFORM} in \ && mv out/linux-x64-ota-provider-ipv6only/chip-ota-provider-app out/chip-ota-provider-app \ && mv out/linux-x64-ota-requestor-ipv6only/chip-ota-requestor-app out/chip-ota-requestor-app \ && mv out/linux-x64-lock-ipv6only/chip-lock-app out/chip-lock-app \ + && mv out/linux-x64-simulated-app1-ipv6only/chip-app1 out/chip-app1 \ ;; \ "linux/arm64")\ set -x \ @@ -257,6 +259,7 @@ RUN case ${TARGETPLATFORM} in \ --target linux-arm64-ota-provider-ipv6only \ --target linux-arm64-ota-requestor-ipv6only \ --target linux-arm64-lock-ipv6only \ + --target linux-arm64-simulated-app1-ipv6only \ build \ && mv out/linux-arm64-all-clusters-ipv6only/chip-all-clusters-app out/chip-all-clusters-app \ && mv out/linux-arm64-all-clusters-minimal-ipv6only/chip-all-clusters-minimal-app out/chip-all-clusters-minimal-app \ @@ -268,12 +271,11 @@ RUN case ${TARGETPLATFORM} in \ && mv out/linux-arm64-ota-provider-ipv6only/chip-ota-provider-app out/chip-ota-provider-app \ && mv out/linux-arm64-ota-requestor-ipv6only/chip-ota-requestor-app out/chip-ota-requestor-app \ && mv out/linux-arm64-lock-ipv6only/chip-lock-app out/chip-lock-app \ + && mv out/linux-arm64-simulated-app1-ipv6only/chip-app1 out/chip-app1 \ ;; \ *) ;; \ esac -RUN scripts/examples/gn_build_test_example.sh app1 - RUN source scripts/activate.sh && scripts/build_python.sh -m platform -d true -i no # Stage 3: Copy relevant cert bins to a minimal image to reduce size. diff --git a/scripts/build/build/targets.py b/scripts/build/build/targets.py index fefec0aa9ec353..6073ffc8aeac6b 100755 --- a/scripts/build/build/targets.py +++ b/scripts/build/build/targets.py @@ -105,6 +105,8 @@ def BuildHostTarget(): TargetPart('shell', app=HostApp.SHELL), TargetPart('ota-provider', app=HostApp.OTA_PROVIDER, enable_ble=False), TargetPart('ota-requestor', app=HostApp.OTA_REQUESTOR, enable_ble=False), + TargetPart('simulated-app1', app=HostApp.SIMULATED_APP1, enable_ble=False), + TargetPart('simulated-app2', app=HostApp.SIMULATED_APP2, enable_ble=False), TargetPart('python-bindings', app=HostApp.PYTHON_BINDINGS), TargetPart('tv-app', app=HostApp.TV_APP), TargetPart('tv-casting-app', app=HostApp.TV_CASTING), diff --git a/scripts/build/builders/host.py b/scripts/build/builders/host.py index ad9f07cf98da61..91fa10d0c36693 100644 --- a/scripts/build/builders/host.py +++ b/scripts/build/builders/host.py @@ -53,6 +53,8 @@ class HostApp(Enum): CERT_TOOL = auto() OTA_PROVIDER = auto() OTA_REQUESTOR = auto() + SIMULATED_APP1 = auto() + SIMULATED_APP2 = auto() PYTHON_BINDINGS = auto() EFR32_TEST_RUNNER = auto() TV_CASTING = auto() @@ -88,6 +90,8 @@ def ExamplePath(self): return 'shell/standalone' elif self == HostApp.OTA_PROVIDER: return 'ota-provider-app/linux' + elif self in [HostApp.SIMULATED_APP1, HostApp.SIMULATED_APP2]: + return 'placeholder/linux/' elif self == HostApp.OTA_REQUESTOR: return 'ota-requestor-app/linux' elif self in [HostApp.ADDRESS_RESOLVE, HostApp.TESTS, HostApp.PYTHON_BINDINGS, HostApp.CERT_TOOL]: @@ -155,6 +159,12 @@ def OutputNames(self): elif self == HostApp.CERT_TOOL: yield 'chip-cert' yield 'chip-cert.map' + elif self == HostApp.SIMULATED_APP1: + yield 'chip-app1' + yield 'chip-app1.map' + elif self == HostApp.SIMULATED_APP2: + yield 'chip-app2' + yield 'chip-app2.map' elif self == HostApp.OTA_PROVIDER: yield 'chip-ota-provider-app' yield 'chip-ota-provider-app.map' @@ -351,6 +361,12 @@ def __init__(self, root, runner, app: HostApp, board=HostBoard.NATIVE, self.extra_gn_options.append('chip_project_config_include_dirs=["//config/python"]') self.build_command = 'chip-repl' + if self.app == HostApp.SIMULATED_APP1: + self.extra_gn_options.append('chip_tests_zap_config="app1"') + + if self.app == HostApp.SIMULATED_APP2: + self.extra_gn_options.append('chip_tests_zap_config="app2"') + def GnBuildArgs(self): if self.board == HostBoard.NATIVE: return self.extra_gn_options diff --git a/scripts/build/testdata/all_targets_linux_x64.txt b/scripts/build/testdata/all_targets_linux_x64.txt index 61ded36b551dfc..a162653f1efc62 100644 --- a/scripts/build/testdata/all_targets_linux_x64.txt +++ b/scripts/build/testdata/all_targets_linux_x64.txt @@ -8,7 +8,7 @@ efr32-{brd4161a,brd4187c,brd4186c,brd4163a,brd4164a,brd4166a,brd4170a,brd4186a,b esp32-{m5stack,c3devkit,devkitc,qemu}-{all-clusters,all-clusters-minimal,ota-provider,ota-requestor,shell,light,lock,bridge,temperature-measurement,ota-requestor,tests}[-rpc][-ipv6only] genio-lighting-app linux-fake-tests[-mbedtls][-boringssl][-asan][-tsan][-ubsan][-libfuzzer][-coverage][-dmalloc][-clang] -linux-{x64,arm64}-{rpc-console,all-clusters,all-clusters-minimal,chip-tool,thermostat,java-matter-controller,minmdns,light,lock,shell,ota-provider,ota-requestor,python-bindings,tv-app,tv-casting-app,bridge,dynamic-bridge,tests,chip-cert,address-resolve-tool,contact-sensor}[-nodeps][-platform-mdns][-minmdns-verbose][-libnl][-same-event-loop][-no-interactive][-ipv6only][-no-ble][-no-wifi][-no-thread][-mbedtls][-boringssl][-asan][-tsan][-ubsan][-libfuzzer][-coverage][-dmalloc][-clang][-test][-rpc][-with-ui] +linux-{x64,arm64}-{rpc-console,all-clusters,all-clusters-minimal,chip-tool,thermostat,java-matter-controller,minmdns,light,lock,shell,ota-provider,ota-requestor,simulated-app1,simulated-app2,python-bindings,tv-app,tv-casting-app,bridge,dynamic-bridge,tests,chip-cert,address-resolve-tool,contact-sensor}[-nodeps][-platform-mdns][-minmdns-verbose][-libnl][-same-event-loop][-no-interactive][-ipv6only][-no-ble][-no-wifi][-no-thread][-mbedtls][-boringssl][-asan][-tsan][-ubsan][-libfuzzer][-coverage][-dmalloc][-clang][-test][-rpc][-with-ui] linux-x64-efr32-test-runner[-clang] imx-{chip-tool,lighting-app,thermostat,all-clusters-app,all-clusters-minimal-app,ota-provider-app}[-release] infineon-psoc6-{lock,light,all-clusters,all-clusters-minimal}[-ota][-updateimage] From 2a9fa2a8b87ecdb70a6ae1c963a8bfce195c0285 Mon Sep 17 00:00:00 2001 From: Arkadiusz Bokowy Date: Tue, 21 Mar 2023 20:56:17 +0100 Subject: [PATCH 08/23] [Tizen] Do not log BLE binary data using "%s" (#25768) * Do not print binary data using "%s" * Improve readability of app preference logging format * Use Uint8:: helpers instead of reinterpret_cast --- src/platform/Tizen/AppPreference.cpp | 6 +++--- src/platform/Tizen/BLEManagerImpl.cpp | 26 ++++++++++++++------------ src/platform/Tizen/BLEManagerImpl.h | 2 ++ 3 files changed, 19 insertions(+), 15 deletions(-) diff --git a/src/platform/Tizen/AppPreference.cpp b/src/platform/Tizen/AppPreference.cpp index 01c4a2b982eae1..ffb36ee6777186 100644 --- a/src/platform/Tizen/AppPreference.cpp +++ b/src/platform/Tizen/AppPreference.cpp @@ -86,7 +86,7 @@ CHIP_ERROR GetData(const char * key, void * data, size_t dataSize, size_t * getD } ::memcpy(data, decodedData.Get() + offset, copySize); - ChipLogDetail(DeviceLayer, "Get data [%s]: %u", key, static_cast(copySize)); + ChipLogDetail(DeviceLayer, "Get preference data: key=%s len=%u", key, static_cast(copySize)); ChipLogByteSpan(DeviceLayer, ByteSpan(reinterpret_cast(data), copySize)); return CHIP_NO_ERROR; @@ -114,7 +114,7 @@ CHIP_ERROR SaveData(const char * key, const void * data, size_t dataSize) return CHIP_ERROR_INCORRECT_STATE; } - ChipLogDetail(DeviceLayer, "Save data [%s]: %u", key, static_cast(dataSize)); + ChipLogDetail(DeviceLayer, "Save preference data: key=%s len=%u", key, static_cast(dataSize)); ChipLogByteSpan(DeviceLayer, ByteSpan(reinterpret_cast(data), dataSize)); return CHIP_NO_ERROR; @@ -133,7 +133,7 @@ CHIP_ERROR RemoveData(const char * key) return CHIP_ERROR_INCORRECT_STATE; } - ChipLogProgress(DeviceLayer, "Remove data [%s]", key); + ChipLogProgress(DeviceLayer, "Remove preference data: key=%s", key); return CHIP_NO_ERROR; } diff --git a/src/platform/Tizen/BLEManagerImpl.cpp b/src/platform/Tizen/BLEManagerImpl.cpp index 1ce4d49829ea2d..ef9c73aed1436b 100644 --- a/src/platform/Tizen/BLEManagerImpl.cpp +++ b/src/platform/Tizen/BLEManagerImpl.cpp @@ -49,10 +49,12 @@ #include #include #include +#include #include #include #include #include +#include #include #include #include @@ -173,8 +175,8 @@ static constexpr const char * __ConvertAttTypeToStr(bt_gatt_type_e type) } } -static void __ReadValueRequestedCb(const char * remoteAddress, int requestId, bt_gatt_server_h server, bt_gatt_h gattHandle, - int offset, void * userData) +void BLEManagerImpl::ReadValueRequestedCb(const char * remoteAddress, int requestId, bt_gatt_server_h server, bt_gatt_h gattHandle, + int offset, void * userData) { int ret, len = 0; bt_gatt_type_e type; @@ -183,13 +185,13 @@ static void __ReadValueRequestedCb(const char * remoteAddress, int requestId, bt VerifyOrReturn(__GetAttInfo(gattHandle, &uuid, &type) == BT_ERROR_NONE, ChipLogError(DeviceLayer, "Failed to fetch GATT Attribute from GATT handle")); - ChipLogProgress(DeviceLayer, "Read Requested on %s: %s", __ConvertAttTypeToStr(type), StringOrNullMarker(uuid)); + ChipLogProgress(DeviceLayer, "Gatt read requested on %s: uuid=%s", __ConvertAttTypeToStr(type), StringOrNullMarker(uuid)); g_free(uuid); ret = bt_gatt_get_value(gattHandle, &value, &len); VerifyOrReturn(ret == BT_ERROR_NONE, ChipLogError(DeviceLayer, "bt_gatt_get_value() failed. ret: %d", ret)); - ChipLogProgress(DeviceLayer, "Read Value (len: %d): %.*s", len, len, value); + ChipLogByteSpan(DeviceLayer, ByteSpan(Uint8::from_const_char(value), len)); ret = bt_gatt_server_send_response(requestId, BT_GATT_REQUEST_TYPE_READ, offset, 0x00, value, len); g_free(value); @@ -209,9 +211,9 @@ void BLEManagerImpl::WriteValueRequestedCb(const char * remoteAddress, int reque VerifyOrReturn(__GetAttInfo(gattHandle, &uuid, &type) == BT_ERROR_NONE, ChipLogError(DeviceLayer, "Failed to fetch GATT Attribute from GATT handle")); - - ChipLogProgress(DeviceLayer, "Write Requested on %s: %s", __ConvertAttTypeToStr(type), StringOrNullMarker(uuid)); - ChipLogProgress(DeviceLayer, "Write Value (len: %d): %.*s ", len, len, value); + ChipLogProgress(DeviceLayer, "Gatt write requested on %s: uuid=%s len=%d", __ConvertAttTypeToStr(type), + StringOrNullMarker(uuid), len); + ChipLogByteSpan(DeviceLayer, ByteSpan(Uint8::from_const_char(value), len)); g_free(uuid); ret = bt_gatt_set_value(gattHandle, value, len); @@ -220,7 +222,7 @@ void BLEManagerImpl::WriteValueRequestedCb(const char * remoteAddress, int reque ret = bt_gatt_server_send_response(requestId, BT_GATT_REQUEST_TYPE_WRITE, offset, 0x00, nullptr, 0); VerifyOrReturn(ret == BT_ERROR_NONE, ChipLogError(DeviceLayer, "bt_gatt_server_send_response() failed. ret: %d", ret)); - sInstance.HandleC1CharWriteEvent(conn, reinterpret_cast(value), len); + sInstance.HandleC1CharWriteEvent(conn, Uint8::from_const_char(value), len); } void BLEManagerImpl::NotificationStateChangedCb(bool notify, bt_gatt_server_h server, bt_gatt_h gattHandle, void * userData) @@ -271,7 +273,7 @@ void BLEManagerImpl::CharacteristicNotificationCb(bt_gatt_h characteristic, char VerifyOrReturn(conn->gattCharC2Handle == characteristic, ChipLogError(DeviceLayer, "Gatt characteristic handle did not match")); ChipLogProgress(DeviceLayer, "Notification Received from CHIP peripheral [%s]", conn->peerAddr); - sInstance.HandleRXCharChanged(conn, reinterpret_cast(value), len); + sInstance.HandleRXCharChanged(conn, Uint8::from_const_char(value), len); } void BLEManagerImpl::IndicationConfirmationCb(int result, const char * remoteAddress, bt_gatt_server_h server, @@ -581,7 +583,7 @@ int BLEManagerImpl::RegisterGATTServer() &char2); VerifyOrExit(ret == BT_ERROR_NONE, ChipLogError(DeviceLayer, "bt_gatt_characteristic_create() failed. ret: %d", ret)); - ret = bt_gatt_server_set_read_value_requested_cb(char2, __ReadValueRequestedCb, nullptr); + ret = bt_gatt_server_set_read_value_requested_cb(char2, ReadValueRequestedCb, nullptr); VerifyOrExit(ret == BT_ERROR_NONE, ChipLogError(DeviceLayer, "bt_gatt_server_set_read_value_requested_cb() failed. ret: %d", ret)); ret = bt_gatt_server_set_characteristic_notification_state_change_cb(char2, NotificationStateChangedCb, nullptr); @@ -1284,7 +1286,7 @@ bool BLEManagerImpl::SendIndication(BLE_CONNECTION_OBJECT conId, const Ble::Chip conn = static_cast(g_hash_table_lookup(sInstance.mConnectionMap, conn->peerAddr)); VerifyOrExit(conn != nullptr, ChipLogError(DeviceLayer, "Failed to find connection info")); - ret = bt_gatt_set_value(mGattCharC2Handle, reinterpret_cast(pBuf->Start()), pBuf->DataLength()); + ret = bt_gatt_set_value(mGattCharC2Handle, Uint8::to_const_char(pBuf->Start()), pBuf->DataLength()); VerifyOrExit(ret == BT_ERROR_NONE, ChipLogError(DeviceLayer, "bt_gatt_set_value() failed. ret: %d", ret)); ChipLogProgress(DeviceLayer, "Sending indication for CHIPoBLE RX characteristic (con %s, len %u)", conn->peerAddr, @@ -1319,7 +1321,7 @@ bool BLEManagerImpl::SendWriteRequest(BLE_CONNECTION_OBJECT conId, const Ble::Ch ChipLogError(DeviceLayer, "SendWriteRequest() called with invalid characteristic ID")); VerifyOrExit(conn->gattCharC1Handle != nullptr, ChipLogError(DeviceLayer, "Char C1 is null")); - ret = bt_gatt_set_value(conn->gattCharC1Handle, reinterpret_cast(pBuf->Start()), pBuf->DataLength()); + ret = bt_gatt_set_value(conn->gattCharC1Handle, Uint8::to_const_char(pBuf->Start()), pBuf->DataLength()); VerifyOrExit(ret == BT_ERROR_NONE, ChipLogError(DeviceLayer, "bt_gatt_set_value() failed. ret: %d", ret)); ChipLogProgress(DeviceLayer, "Sending Write Request for CHIPoBLE TX characteristic (con %s, len %u)", conn->peerAddr, diff --git a/src/platform/Tizen/BLEManagerImpl.h b/src/platform/Tizen/BLEManagerImpl.h index 9610d387ee39c8..629d7208a88c26 100644 --- a/src/platform/Tizen/BLEManagerImpl.h +++ b/src/platform/Tizen/BLEManagerImpl.h @@ -174,6 +174,8 @@ class BLEManagerImpl final : public BLEManager, static void AdvertisingStateChangedCb(int result, bt_advertiser_h advertiser, bt_adapter_le_advertising_state_e advState, void * userData); static void NotificationStateChangedCb(bool notify, bt_gatt_server_h server, bt_gatt_h gattHandle, void * userData); + static void ReadValueRequestedCb(const char * remoteAddress, int requestId, bt_gatt_server_h server, bt_gatt_h gattHandle, + int offset, void * userData); static void WriteValueRequestedCb(const char * remoteAddress, int requestId, bt_gatt_server_h server, bt_gatt_h gattHandle, bool responseNeeded, int offset, const char * value, int len, void * userData); static void IndicationConfirmationCb(int result, const char * remoteAddress, bt_gatt_server_h server, bt_gatt_h characteristic, From 47a216dc2ee970d0a62b460c4ef31301a3eea6b2 Mon Sep 17 00:00:00 2001 From: Thirsrin <108743108+Thirsrin@users.noreply.github.com> Date: Wed, 22 Mar 2023 16:49:09 +0530 Subject: [PATCH 09/23] updated the matter support pointer to latest commit (#25771) --- third_party/silabs/matter_support | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third_party/silabs/matter_support b/third_party/silabs/matter_support index 46133678d495c3..82686c8d241dc3 160000 --- a/third_party/silabs/matter_support +++ b/third_party/silabs/matter_support @@ -1 +1 @@ -Subproject commit 46133678d495c30044f99c92c7570bf443c011e3 +Subproject commit 82686c8d241dc315e8d0a845ba357f81b666da1d From 10712fe23cebeaf57b2898ee102c2a417bd9158c Mon Sep 17 00:00:00 2001 From: Terence Hampson Date: Wed, 22 Mar 2023 08:29:08 -0400 Subject: [PATCH 10/23] Enable EndpointIterator to target search single group ID (#25758) * Enable EndpointIterator to target search single group ID Running RR_1_1 test where we stress test by using max of everything on every fabric, it was found that each iterator step could take up to 21ms. For a large enough group table ReadGroupTable was taking more then 5 second. By targeting the group id for which we want to iterator over endpoints we can reduce time `ReadGroupTable` for large tables by an order of magnitude. * Added comment * Apply suggestions from code review Co-authored-by: Boris Zbarsky * Restyle --------- Co-authored-by: Boris Zbarsky --- .../group-key-mgmt-server.cpp | 7 +--- src/credentials/GroupDataProvider.h | 3 +- src/credentials/GroupDataProviderImpl.cpp | 37 +++++++++++++------ src/credentials/GroupDataProviderImpl.h | 4 +- 4 files changed, 32 insertions(+), 19 deletions(-) diff --git a/src/app/clusters/group-key-mgmt-server/group-key-mgmt-server.cpp b/src/app/clusters/group-key-mgmt-server/group-key-mgmt-server.cpp index 9878058eada76e..359176876220a3 100644 --- a/src/app/clusters/group-key-mgmt-server/group-key-mgmt-server.cpp +++ b/src/app/clusters/group-key-mgmt-server/group-key-mgmt-server.cpp @@ -84,15 +84,12 @@ struct GroupTableCodec TLV::TLVType inner; ReturnErrorOnFailure(writer.StartContainer(TagEndpoints(), TLV::kTLVType_Array, inner)); GroupDataProvider::GroupEndpoint mapping; - auto iter = mProvider->IterateEndpoints(mFabric); + auto iter = mProvider->IterateEndpoints(mFabric, MakeOptional(mInfo.group_id)); if (nullptr != iter) { while (iter->Next(mapping)) { - if (mapping.group_id == mInfo.group_id) - { - ReturnErrorOnFailure(writer.Put(TLV::AnonymousTag(), static_cast(mapping.endpoint_id))); - } + ReturnErrorOnFailure(writer.Put(TLV::AnonymousTag(), static_cast(mapping.endpoint_id))); } iter->Release(); } diff --git a/src/credentials/GroupDataProvider.h b/src/credentials/GroupDataProvider.h index 30d519d9b83dee..ca599296f6a659 100644 --- a/src/credentials/GroupDataProvider.h +++ b/src/credentials/GroupDataProvider.h @@ -249,10 +249,11 @@ class GroupDataProvider * Creates an iterator that may be used to obtain the list of (group, endpoint) pairs associated with the given fabric. * In order to release the allocated memory, the Release() method must be called after the iteration is finished. * Modifying the group table during the iteration is currently not supported, and may yield unexpected behaviour. + * If you wish to iterate only the endpoints of a particular group id you can provide the optional `group_id` to do so. * @retval An instance of EndpointIterator on success * @retval nullptr if no iterator instances are available. */ - virtual EndpointIterator * IterateEndpoints(FabricIndex fabric_index) = 0; + virtual EndpointIterator * IterateEndpoints(FabricIndex fabric_index, Optional group_id = NullOptional) = 0; // // Group-Key map diff --git a/src/credentials/GroupDataProviderImpl.cpp b/src/credentials/GroupDataProviderImpl.cpp index 36e9baaef398aa..90016d7d2f1085 100644 --- a/src/credentials/GroupDataProviderImpl.cpp +++ b/src/credentials/GroupDataProviderImpl.cpp @@ -1207,28 +1207,43 @@ void GroupDataProviderImpl::GroupInfoIteratorImpl::Release() mProvider.mGroupInfoIterators.ReleaseObject(this); } -GroupDataProvider::EndpointIterator * GroupDataProviderImpl::IterateEndpoints(chip::FabricIndex fabric_index) +GroupDataProvider::EndpointIterator * GroupDataProviderImpl::IterateEndpoints(chip::FabricIndex fabric_index, + Optional group_id) { VerifyOrReturnError(IsInitialized(), nullptr); - return mEndpointIterators.CreateObject(*this, fabric_index); + return mEndpointIterators.CreateObject(*this, fabric_index, group_id); } -GroupDataProviderImpl::EndpointIteratorImpl::EndpointIteratorImpl(GroupDataProviderImpl & provider, - chip::FabricIndex fabric_index) : +GroupDataProviderImpl::EndpointIteratorImpl::EndpointIteratorImpl(GroupDataProviderImpl & provider, chip::FabricIndex fabric_index, + Optional group_id) : mProvider(provider), mFabric(fabric_index) { FabricData fabric(fabric_index); VerifyOrReturn(CHIP_NO_ERROR == fabric.Load(provider.mStorage)); - GroupData group(fabric_index, fabric.first_group); - VerifyOrReturn(CHIP_NO_ERROR == group.Load(provider.mStorage)); + if (group_id.HasValue()) + { + GroupData group(fabric_index, group_id.Value()); + VerifyOrReturn(CHIP_NO_ERROR == group.Load(provider.mStorage)); + + mGroup = group_id.Value(); + mFirstGroup = group_id.Value(); + mGroupCount = 1; + mEndpoint = group.first_endpoint; + mEndpointCount = group.endpoint_count; + } + else + { + GroupData group(fabric_index, fabric.first_group); + VerifyOrReturn(CHIP_NO_ERROR == group.Load(provider.mStorage)); - mGroup = fabric.first_group; - mFirstGroup = fabric.first_group; - mGroupCount = fabric.group_count; - mEndpoint = group.first_endpoint; - mEndpointCount = group.endpoint_count; + mGroup = fabric.first_group; + mFirstGroup = fabric.first_group; + mGroupCount = fabric.group_count; + mEndpoint = group.first_endpoint; + mEndpointCount = group.endpoint_count; + } } size_t GroupDataProviderImpl::EndpointIteratorImpl::Count() diff --git a/src/credentials/GroupDataProviderImpl.h b/src/credentials/GroupDataProviderImpl.h index 5c1d0d67e3417f..fad1d87471bc4a 100644 --- a/src/credentials/GroupDataProviderImpl.h +++ b/src/credentials/GroupDataProviderImpl.h @@ -68,7 +68,7 @@ class GroupDataProviderImpl : public GroupDataProvider CHIP_ERROR RemoveEndpoint(FabricIndex fabric_index, EndpointId endpoint_id) override; // Iterators GroupInfoIterator * IterateGroupInfo(FabricIndex fabric_index) override; - EndpointIterator * IterateEndpoints(FabricIndex fabric_index) override; + EndpointIterator * IterateEndpoints(FabricIndex fabric_index, Optional group_id = NullOptional) override; // // Group-Key map @@ -133,7 +133,7 @@ class GroupDataProviderImpl : public GroupDataProvider class EndpointIteratorImpl : public EndpointIterator { public: - EndpointIteratorImpl(GroupDataProviderImpl & provider, FabricIndex fabric_index); + EndpointIteratorImpl(GroupDataProviderImpl & provider, FabricIndex fabric_index, Optional group_id); size_t Count() override; bool Next(GroupEndpoint & output) override; void Release() override; From f0bd8712f39a5a3ff0b00327dda0764c6afeb582 Mon Sep 17 00:00:00 2001 From: TelinkKrystian <121804296+TelinkKrystian@users.noreply.github.com> Date: Wed, 22 Mar 2023 13:55:33 +0100 Subject: [PATCH 11/23] rpc: readme: Fix naming (#25783) It replaces wrong name of Nordic to Telink. Signed-off-by: Krystian Jankowski --- examples/lighting-app/telink/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/lighting-app/telink/README.md b/examples/lighting-app/telink/README.md index 11594c9091855e..e0594e2bb84198 100644 --- a/examples/lighting-app/telink/README.md +++ b/examples/lighting-app/telink/README.md @@ -268,7 +268,7 @@ application of OTA image. The RPCs in `lighting-common/lighting_service/lighting_service.proto` can be used to control various functionalities of the lighting app from a USB-connected host computer. To build the example with the RPC server, run the following -command with _build-target_ replaced with the build target name of the Nordic +command with _build-target_ replaced with the build target name of the Telink Semiconductor's kit you own: ``` From 82af6b5bd062a5430b9ef1ae66a13ffe8157fd41 Mon Sep 17 00:00:00 2001 From: Rohan Sahay Date: Wed, 22 Mar 2023 18:27:10 +0530 Subject: [PATCH 12/23] [Silabs] Adds refactored chip_enable_wifi_ipv4 flag (#25723) * Refactors chip_enable_wifi_ipv4 flag * Porting changes to SiWx917 * Incorporating comments --- scripts/examples/gn_efr32_example.sh | 3 ++- src/platform/silabs/SiWx917/wifi_args.gni | 3 ++- src/platform/silabs/efr32/wifi_args.gni | 3 ++- third_party/silabs/SiWx917_sdk.gni | 3 ++- third_party/silabs/efr32_sdk.gni | 5 +++-- 5 files changed, 11 insertions(+), 6 deletions(-) diff --git a/scripts/examples/gn_efr32_example.sh b/scripts/examples/gn_efr32_example.sh index 7cd465102c22ce..396f9bc3dcced1 100755 --- a/scripts/examples/gn_efr32_example.sh +++ b/scripts/examples/gn_efr32_example.sh @@ -170,7 +170,7 @@ else shift ;; --chip_enable_wifi_ipv4) - optArgs+="chip_enable_wifi_ipv4=true " + ipArgs="chip_enable_wifi_ipv4=true chip_inet_config_enable_ipv4=true " shift ;; --additional_data_advertising) @@ -234,6 +234,7 @@ else BUILD_DIR=$OUTDIR/$SILABS_BOARD echo BUILD_DIR="$BUILD_DIR" if [ "$USE_WIFI" == true ]; then + optArgs+="$ipArgs" gn gen --check --fail-on-unused-args --export-compile-commands --root="$ROOT" --dotfile="$ROOT"/build_for_wifi_gnfile.gn --args="silabs_board=\"$SILABS_BOARD\" $optArgs" "$BUILD_DIR" else # OpenThread build diff --git a/src/platform/silabs/SiWx917/wifi_args.gni b/src/platform/silabs/SiWx917/wifi_args.gni index 4698b4fd1f768b..756b957e116d4b 100644 --- a/src/platform/silabs/SiWx917/wifi_args.gni +++ b/src/platform/silabs/SiWx917/wifi_args.gni @@ -43,7 +43,8 @@ lwip_ethernet = true chip_device_platform = "SiWx917" chip_enable_openthread = false -chip_inet_config_enable_ipv4 = true + +chip_inet_config_enable_ipv4 = false chip_inet_config_enable_dns_resolver = false chip_inet_config_enable_tcp_endpoint = true diff --git a/src/platform/silabs/efr32/wifi_args.gni b/src/platform/silabs/efr32/wifi_args.gni index cb6a8f45fe4478..58fce3f77624c3 100644 --- a/src/platform/silabs/efr32/wifi_args.gni +++ b/src/platform/silabs/efr32/wifi_args.gni @@ -46,7 +46,8 @@ lwip_ethernet = true chip_device_platform = "efr32" chip_enable_openthread = false -chip_inet_config_enable_ipv4 = true + +chip_inet_config_enable_ipv4 = false chip_inet_config_enable_dns_resolver = false chip_inet_config_enable_tcp_endpoint = true diff --git a/third_party/silabs/SiWx917_sdk.gni b/third_party/silabs/SiWx917_sdk.gni index da940d7f39275e..4d4f2e4c0bbf48 100644 --- a/third_party/silabs/SiWx917_sdk.gni +++ b/third_party/silabs/SiWx917_sdk.gni @@ -43,7 +43,8 @@ declare_args() { silabs_log_enabled = true - # Argument to Disable IPv4 for wifi(rs911) + # Argument to enable IPv4 for wifi + # aligning to match chip_inet_config_enable_ipv4 default configuration chip_enable_wifi_ipv4 = false } diff --git a/third_party/silabs/efr32_sdk.gni b/third_party/silabs/efr32_sdk.gni index cabe5a5df66086..54f3a02dfc722f 100644 --- a/third_party/silabs/efr32_sdk.gni +++ b/third_party/silabs/efr32_sdk.gni @@ -47,7 +47,8 @@ declare_args() { # Enable Sleepy end device enable_sleepy_device = false - # Argument to Disable IPv4 for wifi(rs911) + # Argument to enable IPv4 for wifi + # aligning to match chip_inet_config_enable_ipv4 default configuration chip_enable_wifi_ipv4 = false } @@ -247,7 +248,7 @@ template("efr32_sdk") { import("${chip_root}/src/platform/silabs/efr32/wifi_args.gni") defines += [ "LWIP_NETIF_API=1" ] - if (lwip_ipv4) { + if (chip_enable_wifi_ipv4) { defines += [ "LWIP_IPV4=1", From 31e31cce09f44208455055d9137ce4c06e200a2c Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Wed, 22 Mar 2023 09:23:10 -0400 Subject: [PATCH 13/23] Move ClusterWriteMapping.java to be generated from matter.idl (#25773) * Some initial changes * Parser support for timed writes * Small doc update * Matter idl support for timed write * Fix indent and codegen all * Remove extra line from readme * Some fixes * Fix conditional in requires_timed_write * Most codegen looks ok. Java boxing logic is suspect still * More updates, output idential EXCEPT types for boxing * Increase 1000 to 10000 to match original template * Fix byte count comparison when long starts to take effect * Fix length of underlying bitmap type sizing * Fixed files, they are IDENTICAL * Integrate java-jni and java-class since build rules are different between cpp and java files * Fix python syntax * Switch default to not have underscore * Add java codegen via jinja to zap_regen_all * Restyle, fix restyle logic * Fix duplicated generation target * Do not attempt to zap-generate Cluster write mapping * Add golden image unit test for java codegen * Add prettyfy for java output ... makes the input/output files more obviously identical * Remove unused variable * Fix upper/lowercase of acronyms, to be fully backwards compatible * Add license blurb since we checkin generated file (and maybe jinja files should also have licenses * Restyle * Fix unit test --------- Co-authored-by: Andrei Litvin --- .restyled.yaml | 1 + build/chip/chip_codegen.gni | 8 +- scripts/codegen.py | 2 +- scripts/pregenerate/__init__.py | 6 +- scripts/pregenerate/using_codegen.py | 19 +++- scripts/py_matter_idl/BUILD.gn | 1 + scripts/py_matter_idl/files.gni | 1 + .../matter_idl/generators/filters.py | 28 +++++ .../generators/java/ClusterWriteMapping.jinja | 67 ++++++++++++ .../matter_idl/generators/java/__init__.py | 34 +++++- .../matter_idl/generators/registry.py | 14 ++- .../matter_idl/test_generators.py | 8 +- .../matter_idl/tests/available_tests.yaml | 6 +- .../java/ClusterWriteMapping.java | 102 ++++++++++++++++++ scripts/tools/zap_regen_all.py | 80 +++++++++++++- src/controller/data_model/BUILD.gn | 2 +- src/controller/java/BUILD.gn | 2 +- .../devicecontroller/ClusterWriteMapping.java | 5 +- .../ClusterInfo-write-interaction.zapt | 49 --------- src/controller/java/templates/templates.json | 5 - 20 files changed, 358 insertions(+), 82 deletions(-) create mode 100644 scripts/py_matter_idl/matter_idl/generators/java/ClusterWriteMapping.jinja create mode 100644 scripts/py_matter_idl/matter_idl/tests/outputs/several_clusters/java/ClusterWriteMapping.java rename src/controller/java/{zap-generated => generated/java}/chip/devicecontroller/ClusterWriteMapping.java (99%) delete mode 100644 src/controller/java/templates/ClusterInfo-write-interaction.zapt diff --git a/.restyled.yaml b/.restyled.yaml index 8c77704457a15d..33db552694c1f3 100644 --- a/.restyled.yaml +++ b/.restyled.yaml @@ -78,6 +78,7 @@ exclude: - "scripts/run_codegen_targets.sh" # shellharden breaks for loops over command outputs - "src/darwin/Framework/CHIP/zap-generated/*" # already clang-formatted by our zap tooling - "zzz_generated/**/*" # already clang-formatted by our zap tooling + - "src/controller/java/generated/java/**/*" # not formatted: generated files changed_paths: diff --git a/build/chip/chip_codegen.gni b/build/chip/chip_codegen.gni index 49ba661f679e38..88658bcf14eb5c 100644 --- a/build/chip/chip_codegen.gni +++ b/build/chip/chip_codegen.gni @@ -263,7 +263,7 @@ template("_chip_build_time_zapgen") { # The ".matter" file to use to start the code generation # # generator -# Name of the generator to use (e.g. java, cpp-app) +# Name of the generator to use (e.g. java-jni, java-class, cpp-app) # # outputs # Explicit names of the expected outputs. Enforced to validate that @@ -296,7 +296,7 @@ template("_chip_build_time_zapgen") { # # chip_codegen("java-jni-generate") { # input = "controller-clusters.matter" -# generator = "java" +# generator = "java-jni" # # outputs = [ # "jni/IdentifyClient-ReadImpl.cpp", @@ -358,7 +358,7 @@ template("chip_codegen") { # The ".matter" file to use to start the code generation # # generator -# Name of the generator to use (e.g. java, cpp-app) +# Name of the generator to use (e.g. java-jni, java-class, cpp-app) # # outputs # Explicit names of the expected outputs. Enforced to validate that @@ -391,7 +391,7 @@ template("chip_codegen") { # # chip_codegen("java-jni-generate") { # input = "controller-clusters.matter" -# generator = "java" +# generator = "java-jni" # # outputs = [ # "jni/IdentifyClient-ReadImpl.cpp", diff --git a/scripts/codegen.py b/scripts/codegen.py index 60c2ee8d9b6777..564b8eac3c3f19 100755 --- a/scripts/codegen.py +++ b/scripts/codegen.py @@ -69,7 +69,7 @@ def write_new_data(self, relative_path: str, content: str): help='Determines the verbosity of script output') @click.option( '--generator', - default='JAVA', + default='java-jni', help='What code generator to run. The choices are: '+'|'.join(GENERATORS.keys())+'. ' + 'When using custom, provide the plugin path using `--generator custom::` syntax. ' + 'For example, `--generator custom:./my_plugin:my_plugin_module` will load `./my_plugin/my_plugin_module/__init.py__` ' + diff --git a/scripts/pregenerate/__init__.py b/scripts/pregenerate/__init__.py index c5033f406fdf7c..f664f5745b81dc 100644 --- a/scripts/pregenerate/__init__.py +++ b/scripts/pregenerate/__init__.py @@ -20,7 +20,8 @@ from typing import Iterator, List, Optional from .types import IdlFileType, InputIdlFile -from .using_codegen import CodegenBridgePregenerator, CodegenCppAppPregenerator, CodegenJavaPregenerator +from .using_codegen import (CodegenBridgePregenerator, CodegenCppAppPregenerator, CodegenJavaClassPregenerator, + CodegenJavaJNIPregenerator) from .using_zap import ZapApplicationPregenerator @@ -77,7 +78,8 @@ def FindPregenerationTargets(sdk_root: str, filter: TargetFilter, runner): generators = [ # Jinja-based codegen CodegenBridgePregenerator(sdk_root), - CodegenJavaPregenerator(sdk_root), + CodegenJavaJNIPregenerator(sdk_root), + CodegenJavaClassPregenerator(sdk_root), CodegenCppAppPregenerator(sdk_root), # ZAP codegen diff --git a/scripts/pregenerate/using_codegen.py b/scripts/pregenerate/using_codegen.py index 0ca159704b6f4a..1040bb7ac1ae58 100644 --- a/scripts/pregenerate/using_codegen.py +++ b/scripts/pregenerate/using_codegen.py @@ -73,7 +73,7 @@ def CreateTarget(self, idl: InputIdlFile, runner): return CodegenTarget(sdk_root=self.sdk_root, idl=idl, generator="bridge", runner=runner) -class CodegenJavaPregenerator: +class CodegenJavaJNIPregenerator: """Pregeneration logic for "java" codegen.py outputs""" def __init__(self, sdk_root): @@ -85,7 +85,22 @@ def Accept(self, idl: InputIdlFile): return idl.relative_path == "src/controller/data_model/controller-clusters.matter" def CreateTarget(self, idl: InputIdlFile, runner): - return CodegenTarget(sdk_root=self.sdk_root, idl=idl, generator="java", runner=runner) + return CodegenTarget(sdk_root=self.sdk_root, idl=idl, generator="java-jni", runner=runner) + + +class CodegenJavaClassPregenerator: + """Pregeneration logic for "java" codegen.py outputs""" + + def __init__(self, sdk_root): + self.sdk_root = sdk_root + + def Accept(self, idl: InputIdlFile): + # Java is highly specific, a single path is acceptable for dynamic + # bridge codegen + return idl.relative_path == "src/controller/data_model/controller-clusters.matter" + + def CreateTarget(self, idl: InputIdlFile, runner): + return CodegenTarget(sdk_root=self.sdk_root, idl=idl, generator="java-class", runner=runner) class CodegenCppAppPregenerator: diff --git a/scripts/py_matter_idl/BUILD.gn b/scripts/py_matter_idl/BUILD.gn index 7e3254573e9cac..aa0ba2f7899288 100644 --- a/scripts/py_matter_idl/BUILD.gn +++ b/scripts/py_matter_idl/BUILD.gn @@ -56,6 +56,7 @@ pw_python_package("matter_idl") { "matter_idl/tests/outputs/several_clusters/bridge/SecondServer.h", "matter_idl/tests/outputs/several_clusters/bridge/Third.h", "matter_idl/tests/outputs/several_clusters/bridge/ThirdServer.h", + "matter_idl/tests/outputs/several_clusters/java/ClusterWriteMapping.java", "matter_idl/tests/outputs/several_clusters/jni/FirstClient-ReadImpl.cpp", "matter_idl/tests/outputs/several_clusters/jni/SecondClient-ReadImpl.cpp", "matter_idl/tests/outputs/several_clusters/jni/ThirdClient-ReadImpl.cpp", diff --git a/scripts/py_matter_idl/files.gni b/scripts/py_matter_idl/files.gni index aa22f705caff2d..23de251a13b698 100644 --- a/scripts/py_matter_idl/files.gni +++ b/scripts/py_matter_idl/files.gni @@ -8,6 +8,7 @@ matter_idl_generator_templates = [ "${chip_root}/scripts/py_matter_idl/matter_idl/generators/bridge/BridgeClustersGlobalStructs.jinja", "${chip_root}/scripts/py_matter_idl/matter_idl/generators/java/ChipClustersCpp.jinja", "${chip_root}/scripts/py_matter_idl/matter_idl/generators/java/ChipClustersRead.jinja", + "${chip_root}/scripts/py_matter_idl/matter_idl/generators/java/ClusterWriteMapping.jinja", "${chip_root}/scripts/py_matter_idl/matter_idl/generators/cpp/application/CallbackStubSource.jinja", "${chip_root}/scripts/py_matter_idl/matter_idl/generators/cpp/application/PluginApplicationCallbacksHeader.jinja", ] diff --git a/scripts/py_matter_idl/matter_idl/generators/filters.py b/scripts/py_matter_idl/matter_idl/generators/filters.py index 594bcff7a2ecb7..b1ea94a7cd36c6 100644 --- a/scripts/py_matter_idl/matter_idl/generators/filters.py +++ b/scripts/py_matter_idl/matter_idl/generators/filters.py @@ -24,6 +24,31 @@ def normalize_acronyms(s: str) -> str: return s.replace('WiFi', 'Wifi').replace('WI_FI', 'WIFI') +def lowfirst(s: str) -> str: + """Make the first letter lowercase. """ + return s[0].lower() + s[1:] + + +def upfirst(s: str) -> str: + """Make the first letter uppercase """ + return s[0].upper() + s[1:] + + +def lowfirst_except_acronym(s: str) -> str: + """Make the first letter lowercase assuming the string is already in + CamelCase. + + Differs from lowfirst because it checks the string for starting with + several uppercase, which is the case for acronyms (HVAC, ACL, WIFI), + in which case it will NOT lowercase first + """ + if len(s) >= 2: + if s[1].isupper(): + return s + + return lowfirst(s) + + def RegisterCommonFilters(filtermap): """ Register filters that are NOT considered platform-generator specific. @@ -42,3 +67,6 @@ def RegisterCommonFilters(filtermap): filtermap['spinalcase'] = stringcase.spinalcase filtermap['normalize_acronyms'] = normalize_acronyms + filtermap['lowfirst'] = lowfirst + filtermap['lowfirst_except_acronym'] = lowfirst_except_acronym + filtermap['upfirst'] = upfirst diff --git a/scripts/py_matter_idl/matter_idl/generators/java/ClusterWriteMapping.jinja b/scripts/py_matter_idl/matter_idl/generators/java/ClusterWriteMapping.jinja new file mode 100644 index 00000000000000..836267e835d965 --- /dev/null +++ b/scripts/py_matter_idl/matter_idl/generators/java/ClusterWriteMapping.jinja @@ -0,0 +1,67 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package chip.devicecontroller; + +import chip.clusterinfo.CommandParameterInfo; +import chip.clusterinfo.InteractionInfo; +import chip.devicecontroller.ChipClusters.DefaultClusterCallback; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.Map; + +public class ClusterWriteMapping { + public Map> getWriteAttributeMap() { + Map> writeAttributeMap = new HashMap<>(); + + {%- for cluster in clientClusters | sort(attribute='code') %} + {%- set typeLookup = idl | createLookupContext(cluster) %} + Map write{{cluster.name}}InteractionInfo = new LinkedHashMap<>(); + {%- for attribute in cluster.attributes | sort(attribute='name') | attributesWithCallback(typeLookup) %} + {#- TODO: add support for struct-typed attributes -#} + {% if not attribute.definition.is_list and attribute.is_writable %} + Map write{{cluster.name}}{{attribute.definition.name | upfirst}}CommandParams = new LinkedHashMap(); + {%- set encodable = attribute.definition | asEncodable(typeLookup) %} + CommandParameterInfo {{cluster.name | lowfirst_except_acronym}}{{attribute.definition.name | lowfirst_except_acronym}}CommandParameterInfo = + new CommandParameterInfo( + "value", + {{ encodable.boxed_java_type }}.class, {# {{asJavaType type null parent.parent.name removeGenericType=true}}.class, #} + {{ encodable.boxed_java_type }}.class {# {{asJavaType type null parent.parent.name underlyingType=true}}.class #} + ); + write{{cluster.name}}{{attribute.definition.name | upfirst}}CommandParams.put( + "value", + {{cluster.name | lowfirst_except_acronym}}{{attribute.definition.name | lowfirst_except_acronym}}CommandParameterInfo + ); + InteractionInfo write{{cluster.name}}{{attribute.definition.name | upfirst}}AttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.{{cluster.name}}Cluster) cluster).write{{attribute.definition.name | upfirst}}Attribute( + (DefaultClusterCallback) callback, + ({{ encodable.boxed_java_type }}) commandArguments.get("value") + {%- if attribute.requires_timed_write -%}, 10000 {% endif %} + ); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + write{{cluster.name}}{{attribute.definition.name | upfirst}}CommandParams + ); + write{{cluster.name}}InteractionInfo.put("write{{attribute.definition.name | upfirst}}Attribute", write{{cluster.name}}{{attribute.definition.name | upfirst}}AttributeInteractionInfo); + {%- endif %} + {%- endfor %} + writeAttributeMap.put("{{cluster.name | lowfirst_except_acronym}}", write{{cluster.name}}InteractionInfo); + {%- endfor -%} + + return writeAttributeMap; + } +} 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 02dda6997c5eef..562f589301d010 100644 --- a/scripts/py_matter_idl/matter_idl/generators/java/__init__.py +++ b/scripts/py_matter_idl/matter_idl/generators/java/__init__.py @@ -356,9 +356,11 @@ def CanGenerateSubscribe(attr: Attribute, lookup: TypeLookupContext) -> bool: return not lookup.is_struct_type(attr.definition.data_type.name) -class JavaGenerator(CodeGenerator): +class __JavaCodeGenerator(CodeGenerator): """ - Generation of java code for matter. + Code generation for java-specific files. + + Registers filters used by all java generators. """ def __init__(self, storage: GeneratorStorage, idl: Idl, **kargs): @@ -378,6 +380,13 @@ def __init__(self, storage: GeneratorStorage, idl: Idl, **kargs): self.jinja_env.filters['createLookupContext'] = CreateLookupContext self.jinja_env.filters['canGenerateSubscribe'] = CanGenerateSubscribe + +class JavaJNIGenerator(__JavaCodeGenerator): + """Generates JNI java files (i.e. C++ source/headers).""" + + def __init__(self, *args, **kargs): + super().__init__(*args, **kargs) + def internal_render_all(self): """ Renders .CPP files required for JNI support. @@ -406,3 +415,24 @@ def internal_render_all(self): 'typeLookup': TypeLookupContext(self.idl, cluster), } ) + + +class JavaClassGenerator(__JavaCodeGenerator): + """Generates .java files """ + + def __init__(self, *args, **kargs): + super().__init__(*args, **kargs) + + def internal_render_all(self): + """ + Renders .java files required for java matter support + """ + + self.internal_render_one_output( + template_path="java/ClusterWriteMapping.jinja", + output_file_name="java/chip/devicecontroller/ClusterWriteMapping.java", + vars={ + 'idl': self.idl, + 'clientClusters': [c for c in self.idl.clusters if c.side == ClusterSide.CLIENT], + } + ) diff --git a/scripts/py_matter_idl/matter_idl/generators/registry.py b/scripts/py_matter_idl/matter_idl/generators/registry.py index b3aab6df7b4cf0..8caf84c8fded9f 100644 --- a/scripts/py_matter_idl/matter_idl/generators/registry.py +++ b/scripts/py_matter_idl/matter_idl/generators/registry.py @@ -17,7 +17,7 @@ from matter_idl.generators.bridge import BridgeGenerator from matter_idl.generators.cpp.application import CppApplicationGenerator -from matter_idl.generators.java import JavaGenerator +from matter_idl.generators.java import JavaClassGenerator, JavaJNIGenerator class CodeGenerator(enum.Enum): @@ -26,14 +26,17 @@ class CodeGenerator(enum.Enum): the simple enum value (user friendly and can be a command line input) into underlying generators. """ - JAVA = enum.auto() + JAVA_JNI = enum.auto() + JAVA_CLASS = enum.auto() BRIDGE = enum.auto() CPP_APPLICATION = enum.auto() CUSTOM = enum.auto() def Create(self, *args, **kargs): - if self == CodeGenerator.JAVA: - return JavaGenerator(*args, **kargs) + if self == CodeGenerator.JAVA_JNI: + return JavaJNIGenerator(*args, **kargs) + elif self == CodeGenerator.JAVA_CLASS: + return JavaClassGenerator(*args, **kargs) elif self == CodeGenerator.BRIDGE: return BridgeGenerator(*args, **kargs) elif self == CodeGenerator.CPP_APPLICATION: @@ -63,7 +66,8 @@ def FromString(name): # to uniquely identify them when running command line tools or # executing tests GENERATORS = { - 'java': CodeGenerator.JAVA, + 'java-jni': CodeGenerator.JAVA_JNI, + 'java-class': CodeGenerator.JAVA_CLASS, 'bridge': CodeGenerator.BRIDGE, 'cpp-app': CodeGenerator.CPP_APPLICATION, 'custom': CodeGenerator.CUSTOM, diff --git a/scripts/py_matter_idl/matter_idl/test_generators.py b/scripts/py_matter_idl/matter_idl/test_generators.py index 39a42dbe4a0786..3a8d1f472fbe2b 100755 --- a/scripts/py_matter_idl/matter_idl/test_generators.py +++ b/scripts/py_matter_idl/matter_idl/test_generators.py @@ -33,7 +33,7 @@ from matter_idl.generators import GeneratorStorage from matter_idl.generators.bridge import BridgeGenerator from matter_idl.generators.cpp.application import CppApplicationGenerator -from matter_idl.generators.java import JavaGenerator +from matter_idl.generators.java import JavaClassGenerator, JavaJNIGenerator from matter_idl.matter_idl_types import Idl TESTS_DIR = os.path.join(os.path.dirname(__file__), "tests") @@ -116,8 +116,10 @@ def add_test_cases(self, yaml_test_case_dict): self.test_cases.append(test_case) def _create_generator(self, storage: GeneratorStorage, idl: Idl): - if self.generator_name.lower() == 'java': - return JavaGenerator(storage, idl) + if self.generator_name.lower() == 'java-jni': + return JavaJNIGenerator(storage, idl) + if self.generator_name.lower() == 'java-class': + return JavaClassGenerator(storage, idl) if self.generator_name.lower() == 'bridge': return BridgeGenerator(storage, idl) if self.generator_name.lower() == 'cpp-app': diff --git a/scripts/py_matter_idl/matter_idl/tests/available_tests.yaml b/scripts/py_matter_idl/matter_idl/tests/available_tests.yaml index 1b5483588b9b52..c1b253ec23f0f9 100644 --- a/scripts/py_matter_idl/matter_idl/tests/available_tests.yaml +++ b/scripts/py_matter_idl/matter_idl/tests/available_tests.yaml @@ -10,7 +10,7 @@ # - input_file is the input IDL # - output_file/golden_path are the expected output file names # and the expected content for those output files. -java: +java-jni: inputs/simple_attribute.matter: jni/MyClusterClient-ReadImpl.cpp: outputs/simple_attribute/jni/MyClusterClient-ReadImpl.cpp jni/MyClusterClient-InvokeSubscribeImpl.cpp: outputs/simple_attribute/jni/MyClusterClient-InvokeSubscribeImpl.cpp @@ -35,6 +35,10 @@ java: jni/MyClusterClient-ReadImpl.cpp: outputs/optional_argument/jni/MyClusterClient-ReadImpl.cpp jni/MyClusterClient-InvokeSubscribeImpl.cpp: outputs/optional_argument/jni/MyClusterClient-InvokeSubscribeImpl.cpp +java-class: + inputs/several_clusters.matter: + java/chip/devicecontroller/ClusterWriteMapping.java: outputs/several_clusters/java/ClusterWriteMapping.java + bridge: inputs/simple_attribute.matter: bridge/BridgeClustersImpl.h: outputs/simple_attribute/bridge/BridgeClustersImpl.h diff --git a/scripts/py_matter_idl/matter_idl/tests/outputs/several_clusters/java/ClusterWriteMapping.java b/scripts/py_matter_idl/matter_idl/tests/outputs/several_clusters/java/ClusterWriteMapping.java new file mode 100644 index 00000000000000..ff07bb30e4ccff --- /dev/null +++ b/scripts/py_matter_idl/matter_idl/tests/outputs/several_clusters/java/ClusterWriteMapping.java @@ -0,0 +1,102 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package chip.devicecontroller; + +import chip.clusterinfo.CommandParameterInfo; +import chip.clusterinfo.InteractionInfo; +import chip.devicecontroller.ChipClusters.DefaultClusterCallback; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.Map; + +public class ClusterWriteMapping { + public Map> getWriteAttributeMap() { + Map> writeAttributeMap = new HashMap<>(); + Map writeFirstInteractionInfo = new LinkedHashMap<>(); + Map writeFirstSomeIntegerCommandParams = new LinkedHashMap(); + CommandParameterInfo firstsomeIntegerCommandParameterInfo = + new CommandParameterInfo( + "value", + Integer.class, + Integer.class + ); + writeFirstSomeIntegerCommandParams.put( + "value", + firstsomeIntegerCommandParameterInfo + ); + InteractionInfo writeFirstSomeIntegerAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.FirstCluster) cluster).writeSomeIntegerAttribute( + (DefaultClusterCallback) callback, + (Integer) commandArguments.get("value") + ); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeFirstSomeIntegerCommandParams + ); + writeFirstInteractionInfo.put("writeSomeIntegerAttribute", writeFirstSomeIntegerAttributeInteractionInfo); + writeAttributeMap.put("first", writeFirstInteractionInfo); + Map writeSecondInteractionInfo = new LinkedHashMap<>(); + writeAttributeMap.put("second", writeSecondInteractionInfo); + Map writeThirdInteractionInfo = new LinkedHashMap<>(); + Map writeThirdSomeEnumCommandParams = new LinkedHashMap(); + CommandParameterInfo thirdsomeEnumCommandParameterInfo = + new CommandParameterInfo( + "value", + Integer.class, + Integer.class + ); + writeThirdSomeEnumCommandParams.put( + "value", + thirdsomeEnumCommandParameterInfo + ); + InteractionInfo writeThirdSomeEnumAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThirdCluster) cluster).writeSomeEnumAttribute( + (DefaultClusterCallback) callback, + (Integer) commandArguments.get("value") + ); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeThirdSomeEnumCommandParams + ); + writeThirdInteractionInfo.put("writeSomeEnumAttribute", writeThirdSomeEnumAttributeInteractionInfo); + Map writeThirdOptionsCommandParams = new LinkedHashMap(); + CommandParameterInfo thirdoptionsCommandParameterInfo = + new CommandParameterInfo( + "value", + Integer.class, + Integer.class + ); + writeThirdOptionsCommandParams.put( + "value", + thirdoptionsCommandParameterInfo + ); + InteractionInfo writeThirdOptionsAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThirdCluster) cluster).writeOptionsAttribute( + (DefaultClusterCallback) callback, + (Integer) commandArguments.get("value") + ); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeThirdOptionsCommandParams + ); + writeThirdInteractionInfo.put("writeOptionsAttribute", writeThirdOptionsAttributeInteractionInfo); + writeAttributeMap.put("third", writeThirdInteractionInfo);return writeAttributeMap; + } +} diff --git a/scripts/tools/zap_regen_all.py b/scripts/tools/zap_regen_all.py index 0da0969086f4a6..94407cae55b634 100755 --- a/scripts/tools/zap_regen_all.py +++ b/scripts/tools/zap_regen_all.py @@ -24,6 +24,8 @@ import sys import tempfile import time +import traceback +import urllib.request from dataclasses import dataclass from enum import Flag, auto from pathlib import Path @@ -41,6 +43,10 @@ class TargetType(Flag): # Global templates: generally examples and chip controller GLOBAL = auto() + # codgen.py templates (generally java templates, which cannot be built + # at compile time currently) + IDL_CODEGEN = auto() + # App-specific templates (see getSpecificTemplatesTargets) SPECIFIC = auto() @@ -48,12 +54,13 @@ class TargetType(Flag): GOLDEN_TEST_IMAGES = auto() # All possible targets. Convenience constant - ALL = TESTS | GLOBAL | SPECIFIC | GOLDEN_TEST_IMAGES + ALL = TESTS | GLOBAL | IDL_CODEGEN | SPECIFIC | GOLDEN_TEST_IMAGES __TARGET_TYPES__ = { 'tests': TargetType.TESTS, 'global': TargetType.GLOBAL, + 'idl_codegen': TargetType.IDL_CODEGEN, 'specific': TargetType.SPECIFIC, 'golden_test_images': TargetType.GOLDEN_TEST_IMAGES, 'all': TargetType.ALL, @@ -196,6 +203,61 @@ def log_command(self): logging.info(" %s" % " ".join(self.command)) +class JinjaCodegenTarget(): + def __init__(self, generator: str, output_directory: str, idl_path: str): + # This runs a test, but the important bit is we pass `--regenerate` + # to it and this will cause it to OVERWRITE golden images. + self.idl_path = idl_path + self.generator = generator + self.output_directory = output_directory + self.command = ["./scripts/codegen.py", "--output-dir", output_directory, + "--generator", generator, idl_path] + + def runJavaPrettifier(self): + try: + java_outputs = subprocess.check_output(["./scripts/codegen.py", "--name-only", "--generator", + self.generator, "--log-level", "fatal", self.idl_path]).decode("utf8").split("\n") + java_outputs = [os.path.join(self.output_directory, name) for name in java_outputs if name] + + logging.info("Prettifying %d java files:", len(java_outputs)) + for name in java_outputs: + logging.info(" %s" % name) + + # Keep this version in sync with what restyler uses (https://github.com/project-chip/connectedhomeip/blob/master/.restyled.yaml). + FORMAT_VERSION = "1.6" + URL_PREFIX = 'https://github.com/google/google-java-format/releases/download/google-java-format' + JAR_NAME = f"google-java-format-{FORMAT_VERSION}-all-deps.jar" + jar_url = f"{URL_PREFIX}-{FORMAT_VERSION}/{JAR_NAME}" + + path, http_message = urllib.request.urlretrieve(jar_url, Path.home().joinpath(JAR_NAME).as_posix()) + + subprocess.check_call(['java', '-jar', path, '--replace'] + java_outputs) + except Exception as err: + traceback.print_exception(err) + print('google-java-format error:', err) + + def generate(self) -> TargetRunStats: + generate_start = time.time() + + subprocess.check_call(self.command) + self.runJavaPrettifier() + + generate_end = time.time() + + return TargetRunStats( + generate_time=generate_end - generate_start, + config=f'codegen:{self.generator}', + template=self.idl_path, + ) + + def distinct_output(self): + # Fake output - this is a single target that generates golden images + return ZapDistinctOutput(input_template=f'{self.generator}{self.idl_path}', output_directory=self.output_directory) + + def log_command(self): + logging.info(" %s" % " ".join(self.command)) + + def checkPythonVersion(): if sys.version_info[0] < 3: print('Must use Python 3. Current version is ' + @@ -295,7 +357,18 @@ def getGlobalTemplatesTargets(): targets.append(ZAPGenerateTarget( 'src/controller/data_model/controller-clusters.zap', template="src/app/zap-templates/app-templates.json", - output_dir=os.path.join('zzz_generated/darwin/controller-clusters/zap-generated'))) + output_dir='zzz_generated/darwin/controller-clusters/zap-generated')) + + return targets + + +def getCodegenTemplates(): + targets = [] + + targets.append(JinjaCodegenTarget( + generator="java-class", + idl_path="src/controller/data_model/controller-clusters.matter", + output_directory="src/controller/java/generated")) return targets @@ -364,6 +437,9 @@ def getTargets(type, test_target): if type & TargetType.SPECIFIC: targets.extend(getSpecificTemplatesTargets()) + if type & TargetType.IDL_CODEGEN: + targets.extend(getCodegenTemplates()) + if type & TargetType.GOLDEN_TEST_IMAGES: targets.extend(getGoldenTestImageTargets()) diff --git a/src/controller/data_model/BUILD.gn b/src/controller/data_model/BUILD.gn index af701eb6fd43f1..304bd7acea4942 100644 --- a/src/controller/data_model/BUILD.gn +++ b/src/controller/data_model/BUILD.gn @@ -39,7 +39,7 @@ if (current_os == "android" || build_java_matter_controller) { chip_codegen("java-jni-generate") { input = "controller-clusters.matter" - generator = "java" + generator = "java-jni" outputs = [ "jni/IdentifyClient-ReadImpl.cpp", diff --git a/src/controller/java/BUILD.gn b/src/controller/java/BUILD.gn index 27d14372b9c959..9dc043fccc91a8 100644 --- a/src/controller/java/BUILD.gn +++ b/src/controller/java/BUILD.gn @@ -212,6 +212,7 @@ android_library("java") { data_deps = [ ":jni" ] sources = [ + "generated/java/chip/devicecontroller/ClusterWriteMapping.java", "src/chip/clusterinfo/ClusterCommandCallback.java", "src/chip/clusterinfo/ClusterInfo.java", "src/chip/clusterinfo/CommandParameterInfo.java", @@ -262,7 +263,6 @@ android_library("java") { "zap-generated/chip/devicecontroller/ChipStructs.java", "zap-generated/chip/devicecontroller/ClusterInfoMapping.java", "zap-generated/chip/devicecontroller/ClusterReadMapping.java", - "zap-generated/chip/devicecontroller/ClusterWriteMapping.java", ] if (build_java_matter_controller) { diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ClusterWriteMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java similarity index 99% rename from src/controller/java/zap-generated/chip/devicecontroller/ClusterWriteMapping.java rename to src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java index 571d380673d247..23a9b397567695 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ClusterWriteMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java @@ -1,6 +1,6 @@ /* * - * Copyright (c) 2022 Project CHIP Authors + * Copyright (c) 2023 Project CHIP Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,9 +14,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - -// THIS FILE IS GENERATED BY ZAP - package chip.devicecontroller; import chip.clusterinfo.CommandParameterInfo; diff --git a/src/controller/java/templates/ClusterInfo-write-interaction.zapt b/src/controller/java/templates/ClusterInfo-write-interaction.zapt deleted file mode 100644 index 29e52ad07dde67..00000000000000 --- a/src/controller/java/templates/ClusterInfo-write-interaction.zapt +++ /dev/null @@ -1,49 +0,0 @@ -{{> header}} -{{#if (chip_has_client_clusters)}} - -package chip.devicecontroller; - -import chip.clusterinfo.CommandParameterInfo; -import chip.clusterinfo.InteractionInfo; -import chip.devicecontroller.ChipClusters.DefaultClusterCallback; -import java.util.HashMap; -import java.util.LinkedHashMap; -import java.util.Map; - -public class ClusterWriteMapping { - public Map> getWriteAttributeMap() { - Map> writeAttributeMap = new HashMap<>(); - {{#chip_client_clusters}} - Map write{{asUpperCamelCase name}}InteractionInfo = new LinkedHashMap<>(); - {{#chip_server_cluster_attributes}} - {{! TODO: Add support for struct-typed attributes }} - {{#unless (isStrEqual chipCallback.name "Unsupported")}} - {{#if isWritableAttribute}} - {{#unless isArray}} - Map write{{asUpperCamelCase ../name}}{{asUpperCamelCase name}}CommandParams = new LinkedHashMap(); - CommandParameterInfo {{asLowerCamelCase ../name}}{{asLowerCamelCase name}}CommandParameterInfo = new CommandParameterInfo("value", {{asJavaType type null parent.parent.name removeGenericType=true}}.class, {{asJavaType type null parent.parent.name underlyingType=true}}.class); - write{{asUpperCamelCase ../name}}{{asUpperCamelCase name}}CommandParams.put("value",{{asLowerCamelCase ../name}}{{asLowerCamelCase name}}CommandParameterInfo); - InteractionInfo write{{asUpperCamelCase ../name}}{{asUpperCamelCase name}}AttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.{{asUpperCamelCase ../name}}Cluster) cluster).write{{asUpperCamelCase name}}Attribute( - (DefaultClusterCallback) callback, - ({{asJavaBoxedType type chipType}}) - commandArguments.get("value") - {{#if mustUseTimedWrite}}, 10000{{/if}} - ); - }, - () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), - write{{asUpperCamelCase ../name}}{{asUpperCamelCase name}}CommandParams - ); - write{{asUpperCamelCase ../name}}InteractionInfo.put("write{{asUpperCamelCase name}}Attribute", write{{asUpperCamelCase ../name}}{{asUpperCamelCase name}}AttributeInteractionInfo); - {{/unless}} - {{/if}} - {{/unless}} - {{/chip_server_cluster_attributes}} - writeAttributeMap.put("{{asLowerCamelCase name}}", write{{asUpperCamelCase name}}InteractionInfo); - {{/chip_client_clusters}} - return writeAttributeMap; - } -} - -{{/if}} \ No newline at end of file diff --git a/src/controller/java/templates/templates.json b/src/controller/java/templates/templates.json index d839cc4f211a33..744573fa9ca6cd 100644 --- a/src/controller/java/templates/templates.json +++ b/src/controller/java/templates/templates.json @@ -103,11 +103,6 @@ "path": "ClusterInfo-read-interaction.zapt", "name": "Generate read interaction for cluster information map", "output": "src/controller/java/zap-generated/chip/devicecontroller/ClusterReadMapping.java" - }, - { - "path": "ClusterInfo-write-interaction.zapt", - "name": "Generate write interaction for cluster information map", - "output": "src/controller/java/zap-generated/chip/devicecontroller/ClusterWriteMapping.java" } ] } From 6be032d57e46e115cc0c67a873aa27aed776e313 Mon Sep 17 00:00:00 2001 From: Grzegorz Ferenc <41291385+greg-fer@users.noreply.github.com> Date: Wed, 22 Mar 2023 15:08:16 +0100 Subject: [PATCH 14/23] doc: chip_tool_guide: style and consistency edits (#25731) * doc: chip_tool_guide: style and consistency edits Edited the CHIP Tool guide for style and structure consistency. Signed-off-by: Grzegorz Ferenc * Restyled by prettier-markdown --------- Signed-off-by: Grzegorz Ferenc Co-authored-by: Restyled.io --- docs/guides/chip_tool_guide.md | 310 +++++++++++++++++++-------------- 1 file changed, 179 insertions(+), 131 deletions(-) diff --git a/docs/guides/chip_tool_guide.md b/docs/guides/chip_tool_guide.md index 7989c5b927818f..2bc999d9ecc5ac 100644 --- a/docs/guides/chip_tool_guide.md +++ b/docs/guides/chip_tool_guide.md @@ -3,6 +3,7 @@ The CHIP Tool (`chip-tool`) is a Matter controller implementation that allows to commission a Matter device into the network and to communicate with it using Matter messages, which may encode Data Model actions, such as cluster commands. + The tool also provides other utilities specific to Matter, such as parsing of the setup payload or performing discovery actions. @@ -65,11 +66,10 @@ cases are described in the ## Using CHIP Tool for Matter device testing -This section describes how to use CHIP Tool to test the Matter device. The -following steps depend on the application clusters that you implemented on the -device. +The following steps depend on the application clusters that you implemented on +the device. -This tutorial is using the +The steps are using the [Matter Lighting Application Example](https://github.com/project-chip/connectedhomeip/tree/master/examples/lighting-app) with the Bluetooth LE commissioning method support. You can use other Matter examples and still follow this procedure. If you use a different example, the @@ -86,10 +86,10 @@ documentation. Some examples are configured to advertise automatically on boot. Other examples require physical trigger, for example pushing a button. Follow the documentation -of the Matter device example to learn how Bluetooth LE advertising is enabled -for the given example. +of the Matter device example for the chosen platform to learn how Bluetooth LE +advertising is enabled for the given example. -### Step 3: Make sure the IP network is set up +### Step 3: Set up the IP network To follow the next steps, the IP network must be up and running. For instance, the Thread network can be established using @@ -147,10 +147,14 @@ administrator. ### Step 5: Determine Matter device's discriminator and setup PIN code -Matter uses a 12-bit value called _discriminator_ to discern between multiple -commissionable device advertisements and a 27-bit _setup PIN code_ to -authenticate the device. You can find these values in the logging terminal of -the device (for instance, UART) when the device boots up. For example: +Matter uses the following values: + +- Discriminator - A 12-bit value used to discern between multiple + commissionable device advertisements. +- Setup PIN code - A 27-bit value used to authenticate the device. + +You can find these values in the logging terminal of the device (for instance +UART) when the device boots up. For example: ``` I: 254 [DL]Device Configuration: @@ -164,24 +168,28 @@ I: 278 [DL] Manufacturing Date: (not set) I: 281 [DL] Device Type: 65535 (0xFFFF) ``` -In this printout, the _discriminator_ is `3840 (0xF00)` and the _setup PIN code_ -is equal to `20202021`. +In this printout, the discriminator is `3840 (0xF00)` and the setup PIN code is +`20202021`. ### Step 6: Commission Matter device into an existing IP network Before communicating with the Matter device, first it must join an existing IP network. -Matter devices may use different commissioning channel. Typically, devices which -are not yet connected to the target IP network use Bluetooth LE as the -commissioning channel. However, if the device has already joined an IP network, -the only thing needed is to commission it to the Matter network over the IP -protocol. +Matter devices can use different commissioning channels: + +- Devices that are not yet connected to the target IP network use Bluetooth LE + as the commissioning channel. +- Devices that have already joined an IP network only need to use the IP + protocol for commissioning to the Matter network. #### Commissioning over Bluetooth LE -This section describes how your device can join the existing IP network over -Bluetooth LE and then be commissioned into a Matter network. +In this case, your device can join the existing IP network over Bluetooth LE and +then be commissioned into a Matter network. + +Different scenarios are available for Thread and Wi-Fi networks, as described in +the following subsections. After connecting the device over Bluetooth LE, the controller prints the following log: @@ -243,13 +251,14 @@ This option is available when the Matter device is already present in an IP network, but it has not been commissioned to a Matter network yet. To commission the device, you can use either the setup PIN code or the setup PIN -code and the discriminator, both of which you obtained in the step 5. +code and the discriminator, both of which you obtained in the +[step 5](#step-5-determine-matter-devices-discriminator-and-setup-pin-code). Alternatively, you can also use a QR code payload. ##### Commissioning with setup PIN code -Use the following command pattern to discover devices and try to pair with the -first discovered one using the provided setup code: +To discover devices and try to pair with the first discovered device using the +provided setup code, use the following command pattern: ``` $ ./chip-tool pairing onnetwork @@ -264,8 +273,8 @@ In this command: ##### Commissioning with long discriminator -Use the following command pattern to discover devices with a long discriminator -and try to pair with the first discovered one using the provided setup code. +To discover devices with a long discriminator and try to pair with the first +discovered one using the provided setup code, use the following command pattern: ``` $ ./chip-tool pairing onnetwork-long @@ -282,8 +291,9 @@ In this command: Matter devices log the QR code payload and manual pairing code when they boot. -Use the following command pattern to discover devices based on the given QR code -payload or manual pairing code and try to pair with the first discovered one: +To discover devices based on the given QR code payload or manual pairing code +and try to pair with the first discovered one, use the following command +pattern: ``` $ ./chip-tool pairing code @@ -298,8 +308,8 @@ In this command: #### Forgetting the already-commissioned device -The following command removes the device with the given node ID from the list of -commissioned Matter devices: +In case commissioning needs to be retested, the following command removes the +device with the given node ID from the list of commissioned Matter devices: ``` $ ./chip-tool pairing unpair @@ -314,39 +324,43 @@ Having completed all previous steps, you have the Matter device successfully commissioned to the network. You can now test the device by interacting with Data Model clusters. -For instance, in case of the lighting application, the application has the -On/Off and Level Control clusters implemented. This means that you can test it -by toggling the bulb (using the `onoff` cluster commands) or manipulating its -brightness (using the `levelcontrol` cluster commands). +#### Example: Matter Lighting Application Example -Use the following command pattern to toggle the LED state: +In case of the Matter Lighting Application Example we referenced in step 1, the +application implements the On/Off and Level Control clusters. This means that +you can test it by toggling the bulb (using the `onoff` cluster commands) or by +manipulating its brightness (using the `levelcontrol` cluster commands): -``` -$ ./chip-tool onoff toggle -``` +- Use the following command pattern to toggle the OnOff attribute state (e.g. + visualized by the LED state): -In this command: + ``` + $ ./chip-tool onoff toggle + ``` -- __ is the user-defined ID of the commissioned node. -- __ is the ID of the endpoint with OnOff cluster implemented. + In this command: -Alternatively, use the following command pattern to change the brightness of the -LED: + - __ is the user-defined ID of the commissioned node. + - __ is the ID of the endpoint with OnOff cluster + implemented. -``` -$ ./chip-tool levelcontrol move-to-level -``` +- Use the following command pattern to change the value of the CurrentLevel + attribute (e.g. visualized by the LED brightness): -In this command: + ``` + $ ./chip-tool levelcontrol move-to-level + ``` -- __ is the brightness level encoded between `0` and `254`, unless a - custom range is configured in the cluster. -- __ is the transition time. -- __ is the option mask. -- __ is the option override. -- __ is the user-defined ID of the commissioned node. -- __ is the ID of the endpoint with LevelControl cluster - implemented. + In this command: + + - __ is the brightness level encoded between `0` and `254`, unless + a custom range is configured in the cluster. + - __ is the transition time. + - __ is the option mask. + - __ is the option override. + - __ is the user-defined ID of the commissioned node. + - __ is the ID of the endpoint with LevelControl cluster + implemented. ### Step 8: Read basic information from the Matter device @@ -382,34 +396,44 @@ $ ./chip-tool basic This section contains a general list of various CHIP Tool commands and options, not limited to commissioning procedure and cluster interaction. -### Interactive mode versus single command mode +### Interactive mode versus single-command mode -By default, chip-tool runs in single command mode where if any single command -does not complete within a certain timeout period, chip-tool will exit with a -timeout error. +The CHIP Tool can run in one of the following modes: -Example of error: +- Single-command mode (default) - In this mode, the CHIP Tool will exit with a + timeout error if any single command does not complete within a certain + timeout period. -``` -[1650992689511] [32397:1415601] CHIP: [TOO] Run command failure: ../../../examples/chip-tool/commands/common/CHIPCommand.cpp:392: CHIP Error 0x00000032: Timeout -``` + The timeout error will look similar to the following one: + + ``` + [1650992689511] [32397:1415601] CHIP: [TOO] Run command failure: ../../../examples/chip-tool/commands/common/CHIPCommand.cpp:392: CHIP Error 0x00000032: Timeout + ``` + +- Interactive mode - In this mode, a command will terminate with an error if + it does not complete within the timeout period. However, the CHIP Tool will + not be terminated and it will not terminate processes that previous commands + have started. + +#### Modifying timeout duration in single-command mode This timeout can be modified for any command execution by supplying the optional `--timeout` parameter, which takes a value in seconds, with the maximum being 65535 seconds. -Example of command: +**Example of command:** ``` $ ./chip-tool otasoftwareupdaterequestor subscribe-event state-transition 5 10 0x1234567890 0 --timeout 65535 ``` +#### Starting the interactive mode + For commands such as event subscriptions that need to run for an extended period -of time, chip-tool can be started in interactive mode first before running the -command. In interactive mode, there will be no timeout and multiple commands can -be issued. +of time, the CHIP Tool can be started in interactive mode first before running +the command. -Example of command: +**Example of command:** ``` $ ./chip-tool interactive start @@ -599,10 +623,11 @@ $ ./chip-tool pairing ble-thread 1 hex:0e080000000000010000000300001335060004001 ##### Using message tracing -Message tracing allows to capture CHIP Tool secure messages that can be used for -test automation. +Message tracing allows capturing CHIP Tool secure messages that can be used for +test automation. The tracing uses several types of flags that control where the +traces should go. -The following flags that control where the traces should go are available: +The following flags are available: - Trace file flag: @@ -631,43 +656,25 @@ The following flags that control where the traces should go are available: The CHIP Tool allows to run a set of tests, already compiled in the tool, against a paired Matter device. -To get the list of available tests, run the following command: - -``` -$ ./chip-tool tests -``` - -To execute a particular test against the paired device, use the following -command pattern: - -``` -$ ./chip-tool tests -``` - -In this command: - -- __ is the name of the particular test. - -#### Example: running `TestClusters` test +- To get the list of available tests, run the following command: -As an example of running one test suite test: + ``` + $ ./chip-tool tests + ``` -``` -# Clean initialization of state. -rm -fr /tmp/chip_* +- To execute a particular test against the paired device, use the following + command pattern: -# In a shell window, start the DUT device. -./out/debug/standalone/chip-all-clusters-app + ``` + $ ./chip-tool tests + ``` -# In a second shell window, pair the DUT with chip-tool. -./out/debug/standalone/chip-tool pairing onnetwork 333221 20202021 + In this command: -# Now run the test -./out/debug/standalone/chip-tool tests TestCluster --nodeId 333221 -``` + - __ is the name of the particular test. -Developer details on how the test suite is structured can be found -[here](../../src/app/tests/suites/README.md). +See the [Examples](#running-testclusters-test) section for an example of how to +run a test from the test suite. ### Parsing the setup payload @@ -861,19 +868,50 @@ In this command: - __ is the ID of the endpoint on which the `binding` cluster is implemented. +##### Running `TestClusters` test + +Complete the following steps to +[run one test from the test suite](#running-a-test-suite-against-a-paired-peer-device): + +1. Clean the initialization of state using the following command: + ``` + rm -fr /tmp/chip_* + ``` +1. In a shell window, start the DUT device: + ``` + ./out/debug/standalone/chip-all-clusters-app + ``` +1. In a second shell window, pair the DUT with the CHIP Tool: + ``` + ./out/debug/standalone/chip-tool pairing onnetwork 333221 20202021 + ``` +1. Run the test with the following command: + ``` + ./out/debug/standalone/chip-tool tests TestCluster --nodeId 333221 + ``` + +Read the [CHIP Test Suits](../../src/app/tests/suites/README.md) page for more +information about how the test suite is structured. + ### Multi-admin scenario Multi-admin feature allows you to join Matter device to several Matter fabrics -and administer it by several different Matter administrators. First you need to -commission the Matter device to first fabric following the +and have several different Matter administrators administer it. + +Complete the steps mentioned in the following sections. + +#### Step 1: Commission to fabric + +Commission the Matter device to first fabric following the [Using CHIP Tool for Matter device testing](#using-chip-tool-for-matter-device-testing) section. -Before it is possible to commission a Matter device to a new fabric, the -administrator from first fabric must open the commissioning window for a new -administrator from another fabric. +#### Step 2: Open the commissioning window + +Make sure the administrator from the first fabric opens the commissioning window +for a new administrator from another fabric. -To open the commissioning window on the paired Matter device, use the following +Open the commissioning window on the paired Matter device by using the following command pattern: ``` @@ -882,15 +920,15 @@ $ ./chip-tool pairing open-commissioning-window