forked from project-chip/connectedhomeip
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New files generated using ./scripts/tools/zap_regen_all.py
- Loading branch information
Showing
13 changed files
with
2,082 additions
and
0 deletions.
There are no files selected for viewing
68 changes: 68 additions & 0 deletions
68
.../java/chip/devicecontroller/cluster/eventstructs/ZoneManagementClusterZoneStoppedEvent.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
} | ||
} | ||
} |
68 changes: 68 additions & 0 deletions
68
...ava/chip/devicecontroller/cluster/eventstructs/ZoneManagementClusterZoneTriggeredEvent.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
} | ||
} | ||
} |
56 changes: 56 additions & 0 deletions
56
...a/chip/devicecontroller/cluster/structs/ZoneManagementClusterTwoDCartesianVertexStruct.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
} | ||
} | ||
} |
90 changes: 90 additions & 0 deletions
90
...ava/chip/devicecontroller/cluster/structs/ZoneManagementClusterTwoDCartesianZoneStruct.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
} | ||
} | ||
} |
64 changes: 64 additions & 0 deletions
64
.../java/chip/devicecontroller/cluster/structs/ZoneManagementClusterZoneInformationStruct.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
} | ||
} | ||
} |
Oops, something went wrong.