Skip to content

Commit 41feb3d

Browse files
committed
Generated using ./scripts/tools/zap_regen_all.py
1 parent f12c7d8 commit 41feb3d

10 files changed

+3119
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
/*
2+
*
3+
* Copyright (c) 2023 Project CHIP Authors
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
package chip.devicecontroller.cluster.eventstructs
18+
19+
import chip.devicecontroller.cluster.*
20+
import matter.tlv.ContextSpecificTag
21+
import matter.tlv.Tag
22+
import matter.tlv.TlvReader
23+
import matter.tlv.TlvWriter
24+
25+
class TlsClientManagementClusterEndpointProvisionedEvent(val endpointID: UInt) {
26+
override fun toString(): String = buildString {
27+
append("TlsClientManagementClusterEndpointProvisionedEvent {\n")
28+
append("\tendpointID : $endpointID\n")
29+
append("}\n")
30+
}
31+
32+
fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) {
33+
tlvWriter.apply {
34+
startStructure(tlvTag)
35+
put(ContextSpecificTag(TAG_ENDPOINT_ID), endpointID)
36+
endStructure()
37+
}
38+
}
39+
40+
companion object {
41+
private const val TAG_ENDPOINT_ID = 0
42+
43+
fun fromTlv(
44+
tlvTag: Tag,
45+
tlvReader: TlvReader,
46+
): TlsClientManagementClusterEndpointProvisionedEvent {
47+
tlvReader.enterStructure(tlvTag)
48+
val endpointID = tlvReader.getUInt(ContextSpecificTag(TAG_ENDPOINT_ID))
49+
50+
tlvReader.exitContainer()
51+
52+
return TlsClientManagementClusterEndpointProvisionedEvent(endpointID)
53+
}
54+
}
55+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
/*
2+
*
3+
* Copyright (c) 2023 Project CHIP Authors
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
package chip.devicecontroller.cluster.structs
18+
19+
import chip.devicecontroller.cluster.*
20+
import matter.tlv.ContextSpecificTag
21+
import matter.tlv.Tag
22+
import matter.tlv.TlvReader
23+
import matter.tlv.TlvWriter
24+
25+
class TlsCertificateManagementClusterTLSCertStruct(val caid: UInt, val certificate: ByteArray) {
26+
override fun toString(): String = buildString {
27+
append("TlsCertificateManagementClusterTLSCertStruct {\n")
28+
append("\tcaid : $caid\n")
29+
append("\tcertificate : $certificate\n")
30+
append("}\n")
31+
}
32+
33+
fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) {
34+
tlvWriter.apply {
35+
startStructure(tlvTag)
36+
put(ContextSpecificTag(TAG_CAID), caid)
37+
put(ContextSpecificTag(TAG_CERTIFICATE), certificate)
38+
endStructure()
39+
}
40+
}
41+
42+
companion object {
43+
private const val TAG_CAID = 0
44+
private const val TAG_CERTIFICATE = 1
45+
46+
fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): TlsCertificateManagementClusterTLSCertStruct {
47+
tlvReader.enterStructure(tlvTag)
48+
val caid = tlvReader.getUInt(ContextSpecificTag(TAG_CAID))
49+
val certificate = tlvReader.getByteArray(ContextSpecificTag(TAG_CERTIFICATE))
50+
51+
tlvReader.exitContainer()
52+
53+
return TlsCertificateManagementClusterTLSCertStruct(caid, certificate)
54+
}
55+
}
56+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
/*
2+
*
3+
* Copyright (c) 2023 Project CHIP Authors
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
package chip.devicecontroller.cluster.structs
18+
19+
import chip.devicecontroller.cluster.*
20+
import matter.tlv.AnonymousTag
21+
import matter.tlv.ContextSpecificTag
22+
import matter.tlv.Tag
23+
import matter.tlv.TlvReader
24+
import matter.tlv.TlvWriter
25+
26+
class TlsCertificateManagementClusterTLSClientCertificateDetailStruct(
27+
val ccdid: UInt,
28+
val clientCertificate: ByteArray,
29+
val intermediateCerts: List<ByteArray>,
30+
) {
31+
override fun toString(): String = buildString {
32+
append("TlsCertificateManagementClusterTLSClientCertificateDetailStruct {\n")
33+
append("\tccdid : $ccdid\n")
34+
append("\tclientCertificate : $clientCertificate\n")
35+
append("\tintermediateCerts : $intermediateCerts\n")
36+
append("}\n")
37+
}
38+
39+
fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) {
40+
tlvWriter.apply {
41+
startStructure(tlvTag)
42+
put(ContextSpecificTag(TAG_CCDID), ccdid)
43+
put(ContextSpecificTag(TAG_CLIENT_CERTIFICATE), clientCertificate)
44+
startArray(ContextSpecificTag(TAG_INTERMEDIATE_CERTS))
45+
for (item in intermediateCerts.iterator()) {
46+
put(AnonymousTag, item)
47+
}
48+
endArray()
49+
endStructure()
50+
}
51+
}
52+
53+
companion object {
54+
private const val TAG_CCDID = 0
55+
private const val TAG_CLIENT_CERTIFICATE = 1
56+
private const val TAG_INTERMEDIATE_CERTS = 2
57+
58+
fun fromTlv(
59+
tlvTag: Tag,
60+
tlvReader: TlvReader,
61+
): TlsCertificateManagementClusterTLSClientCertificateDetailStruct {
62+
tlvReader.enterStructure(tlvTag)
63+
val ccdid = tlvReader.getUInt(ContextSpecificTag(TAG_CCDID))
64+
val clientCertificate = tlvReader.getByteArray(ContextSpecificTag(TAG_CLIENT_CERTIFICATE))
65+
val intermediateCerts =
66+
buildList<ByteArray> {
67+
tlvReader.enterArray(ContextSpecificTag(TAG_INTERMEDIATE_CERTS))
68+
while (!tlvReader.isEndOfContainer()) {
69+
add(tlvReader.getByteArray(AnonymousTag))
70+
}
71+
tlvReader.exitContainer()
72+
}
73+
74+
tlvReader.exitContainer()
75+
76+
return TlsCertificateManagementClusterTLSClientCertificateDetailStruct(
77+
ccdid,
78+
clientCertificate,
79+
intermediateCerts,
80+
)
81+
}
82+
}
83+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
/*
2+
*
3+
* Copyright (c) 2023 Project CHIP Authors
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
package chip.devicecontroller.cluster.structs
18+
19+
import chip.devicecontroller.cluster.*
20+
import java.util.Optional
21+
import matter.tlv.ContextSpecificTag
22+
import matter.tlv.Tag
23+
import matter.tlv.TlvReader
24+
import matter.tlv.TlvWriter
25+
26+
class TlsClientManagementClusterTLSEndpointStruct(
27+
val endpointID: UInt,
28+
val hostname: ByteArray,
29+
val port: UInt,
30+
val caid: UInt,
31+
val ccdid: Optional<UInt>?,
32+
val status: UInt,
33+
) {
34+
override fun toString(): String = buildString {
35+
append("TlsClientManagementClusterTLSEndpointStruct {\n")
36+
append("\tendpointID : $endpointID\n")
37+
append("\thostname : $hostname\n")
38+
append("\tport : $port\n")
39+
append("\tcaid : $caid\n")
40+
append("\tccdid : $ccdid\n")
41+
append("\tstatus : $status\n")
42+
append("}\n")
43+
}
44+
45+
fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) {
46+
tlvWriter.apply {
47+
startStructure(tlvTag)
48+
put(ContextSpecificTag(TAG_ENDPOINT_ID), endpointID)
49+
put(ContextSpecificTag(TAG_HOSTNAME), hostname)
50+
put(ContextSpecificTag(TAG_PORT), port)
51+
put(ContextSpecificTag(TAG_CAID), caid)
52+
if (ccdid != null) {
53+
if (ccdid.isPresent) {
54+
val optccdid = ccdid.get()
55+
put(ContextSpecificTag(TAG_CCDID), optccdid)
56+
}
57+
} else {
58+
putNull(ContextSpecificTag(TAG_CCDID))
59+
}
60+
put(ContextSpecificTag(TAG_STATUS), status)
61+
endStructure()
62+
}
63+
}
64+
65+
companion object {
66+
private const val TAG_ENDPOINT_ID = 0
67+
private const val TAG_HOSTNAME = 1
68+
private const val TAG_PORT = 2
69+
private const val TAG_CAID = 3
70+
private const val TAG_CCDID = 4
71+
private const val TAG_STATUS = 5
72+
73+
fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): TlsClientManagementClusterTLSEndpointStruct {
74+
tlvReader.enterStructure(tlvTag)
75+
val endpointID = tlvReader.getUInt(ContextSpecificTag(TAG_ENDPOINT_ID))
76+
val hostname = tlvReader.getByteArray(ContextSpecificTag(TAG_HOSTNAME))
77+
val port = tlvReader.getUInt(ContextSpecificTag(TAG_PORT))
78+
val caid = tlvReader.getUInt(ContextSpecificTag(TAG_CAID))
79+
val ccdid =
80+
if (!tlvReader.isNull()) {
81+
if (tlvReader.isNextTag(ContextSpecificTag(TAG_CCDID))) {
82+
Optional.of(tlvReader.getUInt(ContextSpecificTag(TAG_CCDID)))
83+
} else {
84+
Optional.empty()
85+
}
86+
} else {
87+
tlvReader.getNull(ContextSpecificTag(TAG_CCDID))
88+
null
89+
}
90+
val status = tlvReader.getUInt(ContextSpecificTag(TAG_STATUS))
91+
92+
tlvReader.exitContainer()
93+
94+
return TlsClientManagementClusterTLSEndpointStruct(
95+
endpointID,
96+
hostname,
97+
port,
98+
caid,
99+
ccdid,
100+
status,
101+
)
102+
}
103+
}
104+
}

0 commit comments

Comments
 (0)