Skip to content

Commit

Permalink
Generated with ./scripts/tools/zap_regen_all.py
Browse files Browse the repository at this point in the history
  • Loading branch information
gmarcosb committed Dec 18, 2024
1 parent cb81559 commit 2c12ef6
Show file tree
Hide file tree
Showing 18 changed files with 1,782 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
/*
*
* 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 java.util.Optional
import matter.tlv.ContextSpecificTag
import matter.tlv.Tag
import matter.tlv.TlvReader
import matter.tlv.TlvWriter

class PushAvStreamTransportClusterPushTransportBeginEvent(
val connectionID: UInt,
val triggerType: UInt,
val activationReason: Optional<UInt>,
) {
override fun toString(): String = buildString {
append("PushAvStreamTransportClusterPushTransportBeginEvent {\n")
append("\tconnectionID : $connectionID\n")
append("\ttriggerType : $triggerType\n")
append("\tactivationReason : $activationReason\n")
append("}\n")
}

fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) {
tlvWriter.apply {
startStructure(tlvTag)
put(ContextSpecificTag(TAG_CONNECTION_ID), connectionID)
put(ContextSpecificTag(TAG_TRIGGER_TYPE), triggerType)
if (activationReason.isPresent) {
val optactivationReason = activationReason.get()
put(ContextSpecificTag(TAG_ACTIVATION_REASON), optactivationReason)
}
endStructure()
}
}

companion object {
private const val TAG_CONNECTION_ID = 0
private const val TAG_TRIGGER_TYPE = 1
private const val TAG_ACTIVATION_REASON = 2

fun fromTlv(
tlvTag: Tag,
tlvReader: TlvReader,
): PushAvStreamTransportClusterPushTransportBeginEvent {
tlvReader.enterStructure(tlvTag)
val connectionID = tlvReader.getUInt(ContextSpecificTag(TAG_CONNECTION_ID))
val triggerType = tlvReader.getUInt(ContextSpecificTag(TAG_TRIGGER_TYPE))
val activationReason =
if (tlvReader.isNextTag(ContextSpecificTag(TAG_ACTIVATION_REASON))) {
Optional.of(tlvReader.getUInt(ContextSpecificTag(TAG_ACTIVATION_REASON)))
} else {
Optional.empty()
}

tlvReader.exitContainer()

return PushAvStreamTransportClusterPushTransportBeginEvent(
connectionID,
triggerType,
activationReason,
)
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
/*
*
* 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.ContextSpecificTag
import matter.tlv.Tag
import matter.tlv.TlvReader
import matter.tlv.TlvWriter

class PushAvStreamTransportClusterCMAFContainerOptionsStruct(
val chunkDuration: UInt,
val CENCKey: Optional<ByteArray>?,
) {
override fun toString(): String = buildString {
append("PushAvStreamTransportClusterCMAFContainerOptionsStruct {\n")
append("\tchunkDuration : $chunkDuration\n")
append("\tCENCKey : $CENCKey\n")
append("}\n")
}

fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) {
tlvWriter.apply {
startStructure(tlvTag)
put(ContextSpecificTag(TAG_CHUNK_DURATION), chunkDuration)
if (CENCKey != null) {
if (CENCKey.isPresent) {
val optCENCKey = CENCKey.get()
put(ContextSpecificTag(TAG_CENC_KEY), optCENCKey)
}
} else {
putNull(ContextSpecificTag(TAG_CENC_KEY))
}
endStructure()
}
}

companion object {
private const val TAG_CHUNK_DURATION = 0
private const val TAG_CENC_KEY = 1

fun fromTlv(
tlvTag: Tag,
tlvReader: TlvReader,
): PushAvStreamTransportClusterCMAFContainerOptionsStruct {
tlvReader.enterStructure(tlvTag)
val chunkDuration = tlvReader.getUInt(ContextSpecificTag(TAG_CHUNK_DURATION))
val CENCKey =
if (!tlvReader.isNull()) {
if (tlvReader.isNextTag(ContextSpecificTag(TAG_CENC_KEY))) {
Optional.of(tlvReader.getByteArray(ContextSpecificTag(TAG_CENC_KEY)))
} else {
Optional.empty()
}
} else {
tlvReader.getNull(ContextSpecificTag(TAG_CENC_KEY))
null
}

tlvReader.exitContainer()

return PushAvStreamTransportClusterCMAFContainerOptionsStruct(chunkDuration, CENCKey)
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
/*
*
* 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.ContextSpecificTag
import matter.tlv.Tag
import matter.tlv.TlvReader
import matter.tlv.TlvWriter

class PushAvStreamTransportClusterContainerOptionsStruct(
val containerType: UInt,
val CMAFContainerOptions: Optional<PushAvStreamTransportClusterCMAFContainerOptionsStruct>?,
) {
override fun toString(): String = buildString {
append("PushAvStreamTransportClusterContainerOptionsStruct {\n")
append("\tcontainerType : $containerType\n")
append("\tCMAFContainerOptions : $CMAFContainerOptions\n")
append("}\n")
}

fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) {
tlvWriter.apply {
startStructure(tlvTag)
put(ContextSpecificTag(TAG_CONTAINER_TYPE), containerType)
if (CMAFContainerOptions != null) {
if (CMAFContainerOptions.isPresent) {
val optCMAFContainerOptions = CMAFContainerOptions.get()
optCMAFContainerOptions.toTlv(ContextSpecificTag(TAG_CMAF_CONTAINER_OPTIONS), this)
}
} else {
putNull(ContextSpecificTag(TAG_CMAF_CONTAINER_OPTIONS))
}
endStructure()
}
}

companion object {
private const val TAG_CONTAINER_TYPE = 0
private const val TAG_CMAF_CONTAINER_OPTIONS = 1

fun fromTlv(
tlvTag: Tag,
tlvReader: TlvReader,
): PushAvStreamTransportClusterContainerOptionsStruct {
tlvReader.enterStructure(tlvTag)
val containerType = tlvReader.getUInt(ContextSpecificTag(TAG_CONTAINER_TYPE))
val CMAFContainerOptions =
if (!tlvReader.isNull()) {
if (tlvReader.isNextTag(ContextSpecificTag(TAG_CMAF_CONTAINER_OPTIONS))) {
Optional.of(
PushAvStreamTransportClusterCMAFContainerOptionsStruct.fromTlv(
ContextSpecificTag(TAG_CMAF_CONTAINER_OPTIONS),
tlvReader,
)
)
} else {
Optional.empty()
}
} else {
tlvReader.getNull(ContextSpecificTag(TAG_CMAF_CONTAINER_OPTIONS))
null
}

tlvReader.exitContainer()

return PushAvStreamTransportClusterContainerOptionsStruct(containerType, CMAFContainerOptions)
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
/*
*
* 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 PushAvStreamTransportClusterMetadataOptionsStruct(
val multiplexing: UInt,
val includeMotionZones: Boolean,
val enableMetadataPrivacySensitive: Boolean,
) {
override fun toString(): String = buildString {
append("PushAvStreamTransportClusterMetadataOptionsStruct {\n")
append("\tmultiplexing : $multiplexing\n")
append("\tincludeMotionZones : $includeMotionZones\n")
append("\tenableMetadataPrivacySensitive : $enableMetadataPrivacySensitive\n")
append("}\n")
}

fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) {
tlvWriter.apply {
startStructure(tlvTag)
put(ContextSpecificTag(TAG_MULTIPLEXING), multiplexing)
put(ContextSpecificTag(TAG_INCLUDE_MOTION_ZONES), includeMotionZones)
put(ContextSpecificTag(TAG_ENABLE_METADATA_PRIVACY_SENSITIVE), enableMetadataPrivacySensitive)
endStructure()
}
}

companion object {
private const val TAG_MULTIPLEXING = 0
private const val TAG_INCLUDE_MOTION_ZONES = 1
private const val TAG_ENABLE_METADATA_PRIVACY_SENSITIVE = 2

fun fromTlv(
tlvTag: Tag,
tlvReader: TlvReader,
): PushAvStreamTransportClusterMetadataOptionsStruct {
tlvReader.enterStructure(tlvTag)
val multiplexing = tlvReader.getUInt(ContextSpecificTag(TAG_MULTIPLEXING))
val includeMotionZones = tlvReader.getBoolean(ContextSpecificTag(TAG_INCLUDE_MOTION_ZONES))
val enableMetadataPrivacySensitive =
tlvReader.getBoolean(ContextSpecificTag(TAG_ENABLE_METADATA_PRIVACY_SENSITIVE))

tlvReader.exitContainer()

return PushAvStreamTransportClusterMetadataOptionsStruct(
multiplexing,
includeMotionZones,
enableMetadataPrivacySensitive,
)
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
/*
*
* 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 PushAvStreamTransportClusterTransportConfigurationStruct(
val connectionID: UInt,
val transportStatus: UInt,
val transportOptions: PushAvStreamTransportClusterTransportOptionsStruct,
) {
override fun toString(): String = buildString {
append("PushAvStreamTransportClusterTransportConfigurationStruct {\n")
append("\tconnectionID : $connectionID\n")
append("\ttransportStatus : $transportStatus\n")
append("\ttransportOptions : $transportOptions\n")
append("}\n")
}

fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) {
tlvWriter.apply {
startStructure(tlvTag)
put(ContextSpecificTag(TAG_CONNECTION_ID), connectionID)
put(ContextSpecificTag(TAG_TRANSPORT_STATUS), transportStatus)
transportOptions.toTlv(ContextSpecificTag(TAG_TRANSPORT_OPTIONS), this)
endStructure()
}
}

companion object {
private const val TAG_CONNECTION_ID = 0
private const val TAG_TRANSPORT_STATUS = 1
private const val TAG_TRANSPORT_OPTIONS = 2

fun fromTlv(
tlvTag: Tag,
tlvReader: TlvReader,
): PushAvStreamTransportClusterTransportConfigurationStruct {
tlvReader.enterStructure(tlvTag)
val connectionID = tlvReader.getUInt(ContextSpecificTag(TAG_CONNECTION_ID))
val transportStatus = tlvReader.getUInt(ContextSpecificTag(TAG_TRANSPORT_STATUS))
val transportOptions =
PushAvStreamTransportClusterTransportOptionsStruct.fromTlv(
ContextSpecificTag(TAG_TRANSPORT_OPTIONS),
tlvReader,
)

tlvReader.exitContainer()

return PushAvStreamTransportClusterTransportConfigurationStruct(
connectionID,
transportStatus,
transportOptions,
)
}
}
}
Loading

0 comments on commit 2c12ef6

Please sign in to comment.