Make sure kotlin files are kept up to date (#30172)
Co-authored-by: Andrei Litvin <andreilitvin@google.com>
diff --git a/scripts/tools/zap_regen_all.py b/scripts/tools/zap_regen_all.py
index a274ea8..6650740 100755
--- a/scripts/tools/zap_regen_all.py
+++ b/scripts/tools/zap_regen_all.py
@@ -433,6 +433,11 @@
idl_path="src/controller/data_model/controller-clusters.matter",
output_directory="src/controller/java/generated"))
+ targets.append(JinjaCodegenTarget(
+ generator="kotlin-class",
+ idl_path="src/controller/data_model/controller-clusters.matter",
+ output_directory="src/controller/java/generated"))
+
return targets
diff --git a/src/controller/java/generated/java/matter/devicecontroller/cluster/clusters/ApplicationLauncherCluster.kt b/src/controller/java/generated/java/matter/devicecontroller/cluster/clusters/ApplicationLauncherCluster.kt
index 7e07a8e..ceec6c2 100644
--- a/src/controller/java/generated/java/matter/devicecontroller/cluster/clusters/ApplicationLauncherCluster.kt
+++ b/src/controller/java/generated/java/matter/devicecontroller/cluster/clusters/ApplicationLauncherCluster.kt
@@ -83,17 +83,6 @@
// Implementation needs to be added here
}
- suspend fun writeCurrentAppAttribute(value: ApplicationLauncherClusterApplicationEPStruct) {
- // Implementation needs to be added here
- }
-
- suspend fun writeCurrentAppAttribute(
- value: ApplicationLauncherClusterApplicationEPStruct,
- timedWriteTimeoutMs: Int
- ) {
- // Implementation needs to be added here
- }
-
suspend fun subscribeCurrentAppAttribute(
minInterval: Int,
maxInterval: Int
diff --git a/src/controller/java/generated/java/matter/devicecontroller/cluster/clusters/GeneralDiagnosticsCluster.kt b/src/controller/java/generated/java/matter/devicecontroller/cluster/clusters/GeneralDiagnosticsCluster.kt
index 1a3b9d4..5d6b222 100644
--- a/src/controller/java/generated/java/matter/devicecontroller/cluster/clusters/GeneralDiagnosticsCluster.kt
+++ b/src/controller/java/generated/java/matter/devicecontroller/cluster/clusters/GeneralDiagnosticsCluster.kt
@@ -145,14 +145,6 @@
// Implementation needs to be added here
}
- suspend fun readAverageWearCountAttribute(): UInt {
- // Implementation needs to be added here
- }
-
- suspend fun subscribeAverageWearCountAttribute(minInterval: Int, maxInterval: Int): UInt {
- // Implementation needs to be added here
- }
-
suspend fun readGeneratedCommandListAttribute(): GeneratedCommandListAttribute {
// Implementation needs to be added here
}
diff --git a/src/controller/java/generated/java/matter/devicecontroller/cluster/clusters/MicrowaveOvenModeCluster.kt b/src/controller/java/generated/java/matter/devicecontroller/cluster/clusters/MicrowaveOvenModeCluster.kt
new file mode 100644
index 0000000..b09b0be
--- /dev/null
+++ b/src/controller/java/generated/java/matter/devicecontroller/cluster/clusters/MicrowaveOvenModeCluster.kt
@@ -0,0 +1,112 @@
+/*
+ *
+ * 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 matter.devicecontroller.cluster.clusters
+
+import matter.devicecontroller.cluster.structs.*
+
+class MicrowaveOvenModeCluster(private val endpointId: UShort) {
+ class SupportedModesAttribute(val value: List<MicrowaveOvenModeClusterModeOptionStruct>)
+
+ class GeneratedCommandListAttribute(val value: List<UInt>)
+
+ class AcceptedCommandListAttribute(val value: List<UInt>)
+
+ class EventListAttribute(val value: List<UInt>)
+
+ class AttributeListAttribute(val value: List<UInt>)
+
+ suspend fun readSupportedModesAttribute(): SupportedModesAttribute {
+ // Implementation needs to be added here
+ }
+
+ suspend fun subscribeSupportedModesAttribute(
+ minInterval: Int,
+ maxInterval: Int
+ ): SupportedModesAttribute {
+ // Implementation needs to be added here
+ }
+
+ suspend fun readCurrentModeAttribute(): UByte {
+ // Implementation needs to be added here
+ }
+
+ suspend fun subscribeCurrentModeAttribute(minInterval: Int, maxInterval: Int): UByte {
+ // Implementation needs to be added here
+ }
+
+ suspend fun readGeneratedCommandListAttribute(): GeneratedCommandListAttribute {
+ // Implementation needs to be added here
+ }
+
+ suspend fun subscribeGeneratedCommandListAttribute(
+ minInterval: Int,
+ maxInterval: Int
+ ): GeneratedCommandListAttribute {
+ // Implementation needs to be added here
+ }
+
+ suspend fun readAcceptedCommandListAttribute(): AcceptedCommandListAttribute {
+ // Implementation needs to be added here
+ }
+
+ suspend fun subscribeAcceptedCommandListAttribute(
+ minInterval: Int,
+ maxInterval: Int
+ ): AcceptedCommandListAttribute {
+ // Implementation needs to be added here
+ }
+
+ suspend fun readEventListAttribute(): EventListAttribute {
+ // Implementation needs to be added here
+ }
+
+ suspend fun subscribeEventListAttribute(minInterval: Int, maxInterval: Int): EventListAttribute {
+ // Implementation needs to be added here
+ }
+
+ suspend fun readAttributeListAttribute(): AttributeListAttribute {
+ // Implementation needs to be added here
+ }
+
+ suspend fun subscribeAttributeListAttribute(
+ minInterval: Int,
+ maxInterval: Int
+ ): AttributeListAttribute {
+ // Implementation needs to be added here
+ }
+
+ suspend fun readFeatureMapAttribute(): UInt {
+ // Implementation needs to be added here
+ }
+
+ suspend fun subscribeFeatureMapAttribute(minInterval: Int, maxInterval: Int): UInt {
+ // Implementation needs to be added here
+ }
+
+ suspend fun readClusterRevisionAttribute(): UShort {
+ // Implementation needs to be added here
+ }
+
+ suspend fun subscribeClusterRevisionAttribute(minInterval: Int, maxInterval: Int): UShort {
+ // Implementation needs to be added here
+ }
+
+ companion object {
+ const val CLUSTER_ID: UInt = 94u
+ }
+}
diff --git a/src/controller/java/generated/java/matter/devicecontroller/cluster/clusters/OnOffCluster.kt b/src/controller/java/generated/java/matter/devicecontroller/cluster/clusters/OnOffCluster.kt
index 912d623..0a71a64 100644
--- a/src/controller/java/generated/java/matter/devicecontroller/cluster/clusters/OnOffCluster.kt
+++ b/src/controller/java/generated/java/matter/devicecontroller/cluster/clusters/OnOffCluster.kt
@@ -56,7 +56,7 @@
suspend fun offWithEffect(
effectIdentifier: UInt,
- effectVariant: UByte,
+ effectVariant: UInt,
timedInvokeTimeoutMs: Int? = null
) {
if (timedInvokeTimeoutMs != null) {
diff --git a/src/controller/java/generated/java/matter/devicecontroller/cluster/files.gni b/src/controller/java/generated/java/matter/devicecontroller/cluster/files.gni
index 0788d70..25bafdf 100644
--- a/src/controller/java/generated/java/matter/devicecontroller/cluster/files.gni
+++ b/src/controller/java/generated/java/matter/devicecontroller/cluster/files.gni
@@ -41,6 +41,8 @@
"${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/structs/LaundryWasherModeClusterModeTagStruct.kt",
"${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/structs/MediaInputClusterInputInfoStruct.kt",
"${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/structs/MediaPlaybackClusterPlaybackPositionStruct.kt",
+ "${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/structs/MicrowaveOvenModeClusterModeOptionStruct.kt",
+ "${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/structs/MicrowaveOvenModeClusterModeTagStruct.kt",
"${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/structs/ModeSelectClusterModeOptionStruct.kt",
"${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/structs/ModeSelectClusterSemanticTagStruct.kt",
"${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/structs/NetworkCommissioningClusterNetworkInfoStruct.kt",
@@ -192,6 +194,7 @@
"${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/clusters/MediaInputCluster.kt",
"${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/clusters/MediaPlaybackCluster.kt",
"${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/clusters/MicrowaveOvenControlCluster.kt",
+ "${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/clusters/MicrowaveOvenModeCluster.kt",
"${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/clusters/ModeSelectCluster.kt",
"${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/clusters/NetworkCommissioningCluster.kt",
"${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/clusters/NitrogenDioxideConcentrationMeasurementCluster.kt",
diff --git a/src/controller/java/generated/java/matter/devicecontroller/cluster/structs/MicrowaveOvenModeClusterModeOptionStruct.kt b/src/controller/java/generated/java/matter/devicecontroller/cluster/structs/MicrowaveOvenModeClusterModeOptionStruct.kt
new file mode 100644
index 0000000..481ae34
--- /dev/null
+++ b/src/controller/java/generated/java/matter/devicecontroller/cluster/structs/MicrowaveOvenModeClusterModeOptionStruct.kt
@@ -0,0 +1,76 @@
+/*
+ *
+ * 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 matter.devicecontroller.cluster.structs
+
+import matter.devicecontroller.cluster.*
+import matter.tlv.AnonymousTag
+import matter.tlv.ContextSpecificTag
+import matter.tlv.Tag
+import matter.tlv.TlvReader
+import matter.tlv.TlvWriter
+
+class MicrowaveOvenModeClusterModeOptionStruct(
+ val label: String,
+ val mode: UByte,
+ val modeTags: List<MicrowaveOvenModeClusterModeTagStruct>
+) {
+ override fun toString(): String = buildString {
+ append("MicrowaveOvenModeClusterModeOptionStruct {\n")
+ append("\tlabel : $label\n")
+ append("\tmode : $mode\n")
+ append("\tmodeTags : $modeTags\n")
+ append("}\n")
+ }
+
+ fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) {
+ tlvWriter.apply {
+ startStructure(tlvTag)
+ put(ContextSpecificTag(TAG_LABEL), label)
+ put(ContextSpecificTag(TAG_MODE), mode)
+ startArray(ContextSpecificTag(TAG_MODE_TAGS))
+ for (item in modeTags.iterator()) {
+ item.toTlv(AnonymousTag, this)
+ }
+ endArray()
+ endStructure()
+ }
+ }
+
+ companion object {
+ private const val TAG_LABEL = 0
+ private const val TAG_MODE = 1
+ private const val TAG_MODE_TAGS = 2
+
+ fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): MicrowaveOvenModeClusterModeOptionStruct {
+ tlvReader.enterStructure(tlvTag)
+ val label = tlvReader.getString(ContextSpecificTag(TAG_LABEL))
+ val mode = tlvReader.getUByte(ContextSpecificTag(TAG_MODE))
+ val modeTags =
+ buildList<MicrowaveOvenModeClusterModeTagStruct> {
+ tlvReader.enterArray(ContextSpecificTag(TAG_MODE_TAGS))
+ while (!tlvReader.isEndOfContainer()) {
+ add(MicrowaveOvenModeClusterModeTagStruct.fromTlv(AnonymousTag, tlvReader))
+ }
+ tlvReader.exitContainer()
+ }
+
+ tlvReader.exitContainer()
+
+ return MicrowaveOvenModeClusterModeOptionStruct(label, mode, modeTags)
+ }
+ }
+}
diff --git a/src/controller/java/generated/java/matter/devicecontroller/cluster/structs/MicrowaveOvenModeClusterModeTagStruct.kt b/src/controller/java/generated/java/matter/devicecontroller/cluster/structs/MicrowaveOvenModeClusterModeTagStruct.kt
new file mode 100644
index 0000000..d0d088a
--- /dev/null
+++ b/src/controller/java/generated/java/matter/devicecontroller/cluster/structs/MicrowaveOvenModeClusterModeTagStruct.kt
@@ -0,0 +1,65 @@
+/*
+ *
+ * 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 matter.devicecontroller.cluster.structs
+
+import java.util.Optional
+import matter.devicecontroller.cluster.*
+import matter.tlv.ContextSpecificTag
+import matter.tlv.Tag
+import matter.tlv.TlvReader
+import matter.tlv.TlvWriter
+
+class MicrowaveOvenModeClusterModeTagStruct(val mfgCode: Optional<UShort>, val value: UInt) {
+ override fun toString(): String = buildString {
+ append("MicrowaveOvenModeClusterModeTagStruct {\n")
+ append("\tmfgCode : $mfgCode\n")
+ append("\tvalue : $value\n")
+ append("}\n")
+ }
+
+ fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) {
+ tlvWriter.apply {
+ startStructure(tlvTag)
+ if (mfgCode.isPresent) {
+ val optmfgCode = mfgCode.get()
+ put(ContextSpecificTag(TAG_MFG_CODE), optmfgCode)
+ }
+ put(ContextSpecificTag(TAG_VALUE), value)
+ endStructure()
+ }
+ }
+
+ companion object {
+ private const val TAG_MFG_CODE = 0
+ private const val TAG_VALUE = 1
+
+ fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): MicrowaveOvenModeClusterModeTagStruct {
+ tlvReader.enterStructure(tlvTag)
+ val mfgCode =
+ if (tlvReader.isNextTag(ContextSpecificTag(TAG_MFG_CODE))) {
+ Optional.of(tlvReader.getUShort(ContextSpecificTag(TAG_MFG_CODE)))
+ } else {
+ Optional.empty()
+ }
+ val value = tlvReader.getUInt(ContextSpecificTag(TAG_VALUE))
+
+ tlvReader.exitContainer()
+
+ return MicrowaveOvenModeClusterModeTagStruct(mfgCode, value)
+ }
+ }
+}