Skip to content

Commit

Permalink
New files generated using ./scripts/tools/zap_regen_all.py
Browse files Browse the repository at this point in the history
  • Loading branch information
gmarcosb committed Oct 2, 2024
1 parent fb2f2b4 commit 88c809b
Show file tree
Hide file tree
Showing 13 changed files with 2,082 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
/*
*
* 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.cluster.eventstructs

import chip.devicecontroller.cluster.*
import matter.tlv.AnonymousTag
import matter.tlv.ContextSpecificTag
import matter.tlv.Tag
import matter.tlv.TlvReader
import matter.tlv.TlvWriter

class ZoneManagementClusterZoneStoppedEvent(val zones: List<UInt>, val reason: UInt) {
override fun toString(): String = buildString {
append("ZoneManagementClusterZoneStoppedEvent {\n")
append("\tzones : $zones\n")
append("\treason : $reason\n")
append("}\n")
}

fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) {
tlvWriter.apply {
startStructure(tlvTag)
startArray(ContextSpecificTag(TAG_ZONES))
for (item in zones.iterator()) {
put(AnonymousTag, item)
}
endArray()
put(ContextSpecificTag(TAG_REASON), reason)
endStructure()
}
}

companion object {
private const val TAG_ZONES = 0
private const val TAG_REASON = 1

fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): ZoneManagementClusterZoneStoppedEvent {
tlvReader.enterStructure(tlvTag)
val zones =
buildList<UInt> {
tlvReader.enterArray(ContextSpecificTag(TAG_ZONES))
while (!tlvReader.isEndOfContainer()) {
this.add(tlvReader.getUInt(AnonymousTag))
}
tlvReader.exitContainer()
}
val reason = tlvReader.getUInt(ContextSpecificTag(TAG_REASON))

tlvReader.exitContainer()

return ZoneManagementClusterZoneStoppedEvent(zones, reason)
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
/*
*
* 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.cluster.eventstructs

import chip.devicecontroller.cluster.*
import matter.tlv.AnonymousTag
import matter.tlv.ContextSpecificTag
import matter.tlv.Tag
import matter.tlv.TlvReader
import matter.tlv.TlvWriter

class ZoneManagementClusterZoneTriggeredEvent(val zones: List<UInt>, val reason: UInt) {
override fun toString(): String = buildString {
append("ZoneManagementClusterZoneTriggeredEvent {\n")
append("\tzones : $zones\n")
append("\treason : $reason\n")
append("}\n")
}

fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) {
tlvWriter.apply {
startStructure(tlvTag)
startArray(ContextSpecificTag(TAG_ZONES))
for (item in zones.iterator()) {
put(AnonymousTag, item)
}
endArray()
put(ContextSpecificTag(TAG_REASON), reason)
endStructure()
}
}

companion object {
private const val TAG_ZONES = 0
private const val TAG_REASON = 1

fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): ZoneManagementClusterZoneTriggeredEvent {
tlvReader.enterStructure(tlvTag)
val zones =
buildList<UInt> {
tlvReader.enterArray(ContextSpecificTag(TAG_ZONES))
while (!tlvReader.isEndOfContainer()) {
this.add(tlvReader.getUInt(AnonymousTag))
}
tlvReader.exitContainer()
}
val reason = tlvReader.getUInt(ContextSpecificTag(TAG_REASON))

tlvReader.exitContainer()

return ZoneManagementClusterZoneTriggeredEvent(zones, reason)
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/*
*
* 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.cluster.structs

import chip.devicecontroller.cluster.*
import matter.tlv.ContextSpecificTag
import matter.tlv.Tag
import matter.tlv.TlvReader
import matter.tlv.TlvWriter

class ZoneManagementClusterTwoDCartesianVertexStruct(val x: UInt, val y: UInt) {
override fun toString(): String = buildString {
append("ZoneManagementClusterTwoDCartesianVertexStruct {\n")
append("\tx : $x\n")
append("\ty : $y\n")
append("}\n")
}

fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) {
tlvWriter.apply {
startStructure(tlvTag)
put(ContextSpecificTag(TAG_X), x)
put(ContextSpecificTag(TAG_Y), y)
endStructure()
}
}

companion object {
private const val TAG_X = 0
private const val TAG_Y = 1

fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): ZoneManagementClusterTwoDCartesianVertexStruct {
tlvReader.enterStructure(tlvTag)
val x = tlvReader.getUInt(ContextSpecificTag(TAG_X))
val y = tlvReader.getUInt(ContextSpecificTag(TAG_Y))

tlvReader.exitContainer()

return ZoneManagementClusterTwoDCartesianVertexStruct(x, y)
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
/*
*
* 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.cluster.structs

import chip.devicecontroller.cluster.*
import java.util.Optional
import matter.tlv.AnonymousTag
import matter.tlv.ContextSpecificTag
import matter.tlv.Tag
import matter.tlv.TlvReader
import matter.tlv.TlvWriter

class ZoneManagementClusterTwoDCartesianZoneStruct(
val name: String,
val use: UInt,
val vertices: List<ZoneManagementClusterTwoDCartesianVertexStruct>,
val color: Optional<String>,
) {
override fun toString(): String = buildString {
append("ZoneManagementClusterTwoDCartesianZoneStruct {\n")
append("\tname : $name\n")
append("\tuse : $use\n")
append("\tvertices : $vertices\n")
append("\tcolor : $color\n")
append("}\n")
}

fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) {
tlvWriter.apply {
startStructure(tlvTag)
put(ContextSpecificTag(TAG_NAME), name)
put(ContextSpecificTag(TAG_USE), use)
startArray(ContextSpecificTag(TAG_VERTICES))
for (item in vertices.iterator()) {
item.toTlv(AnonymousTag, this)
}
endArray()
if (color.isPresent) {
val optcolor = color.get()
put(ContextSpecificTag(TAG_COLOR), optcolor)
}
endStructure()
}
}

companion object {
private const val TAG_NAME = 0
private const val TAG_USE = 1
private const val TAG_VERTICES = 2
private const val TAG_COLOR = 3

fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): ZoneManagementClusterTwoDCartesianZoneStruct {
tlvReader.enterStructure(tlvTag)
val name = tlvReader.getString(ContextSpecificTag(TAG_NAME))
val use = tlvReader.getUInt(ContextSpecificTag(TAG_USE))
val vertices =
buildList<ZoneManagementClusterTwoDCartesianVertexStruct> {
tlvReader.enterArray(ContextSpecificTag(TAG_VERTICES))
while (!tlvReader.isEndOfContainer()) {
add(ZoneManagementClusterTwoDCartesianVertexStruct.fromTlv(AnonymousTag, tlvReader))
}
tlvReader.exitContainer()
}
val color =
if (tlvReader.isNextTag(ContextSpecificTag(TAG_COLOR))) {
Optional.of(tlvReader.getString(ContextSpecificTag(TAG_COLOR)))
} else {
Optional.empty()
}

tlvReader.exitContainer()

return ZoneManagementClusterTwoDCartesianZoneStruct(name, use, vertices, color)
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
/*
*
* 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.cluster.structs

import chip.devicecontroller.cluster.*
import matter.tlv.ContextSpecificTag
import matter.tlv.Tag
import matter.tlv.TlvReader
import matter.tlv.TlvWriter

class ZoneManagementClusterZoneInformationStruct(
val zoneID: UInt,
val zoneType: UInt,
val zoneSource: UInt,
) {
override fun toString(): String = buildString {
append("ZoneManagementClusterZoneInformationStruct {\n")
append("\tzoneID : $zoneID\n")
append("\tzoneType : $zoneType\n")
append("\tzoneSource : $zoneSource\n")
append("}\n")
}

fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) {
tlvWriter.apply {
startStructure(tlvTag)
put(ContextSpecificTag(TAG_ZONE_ID), zoneID)
put(ContextSpecificTag(TAG_ZONE_TYPE), zoneType)
put(ContextSpecificTag(TAG_ZONE_SOURCE), zoneSource)
endStructure()
}
}

companion object {
private const val TAG_ZONE_ID = 0
private const val TAG_ZONE_TYPE = 1
private const val TAG_ZONE_SOURCE = 2

fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): ZoneManagementClusterZoneInformationStruct {
tlvReader.enterStructure(tlvTag)
val zoneID = tlvReader.getUInt(ContextSpecificTag(TAG_ZONE_ID))
val zoneType = tlvReader.getUInt(ContextSpecificTag(TAG_ZONE_TYPE))
val zoneSource = tlvReader.getUInt(ContextSpecificTag(TAG_ZONE_SOURCE))

tlvReader.exitContainer()

return ZoneManagementClusterZoneInformationStruct(zoneID, zoneType, zoneSource)
}
}
}
Loading

0 comments on commit 88c809b

Please sign in to comment.