From 2c12ef66a1a72035a681534559ba6793c17db18a Mon Sep 17 00:00:00 2001 From: marcos <15697303+gmarcosb@users.noreply.github.com> Date: Wed, 18 Dec 2024 11:10:24 -0700 Subject: [PATCH] Generated with ./scripts/tools/zap_regen_all.py --- ...TransportClusterPushTransportBeginEvent.kt | 80 ++++++++ ...nsportClusterCMAFContainerOptionsStruct.kt | 80 ++++++++ ...mTransportClusterContainerOptionsStruct.kt | 85 ++++++++ ...amTransportClusterMetadataOptionsStruct.kt | 72 +++++++ ...portClusterTransportConfigurationStruct.kt | 75 +++++++ ...TransportMotionTriggerTimeControlStruct.kt | 77 ++++++++ ...mTransportClusterTransportOptionsStruct.kt | 183 ++++++++++++++++++ ...ortClusterTransportTriggerOptionsStruct.kt | 158 +++++++++++++++ ...nsportClusterTransportZoneOptionsStruct.kt | 81 ++++++++ ...TransportClusterPushTransportBeginEvent.kt | 80 ++++++++ ...nsportClusterCMAFContainerOptionsStruct.kt | 80 ++++++++ ...mTransportClusterContainerOptionsStruct.kt | 85 ++++++++ ...amTransportClusterMetadataOptionsStruct.kt | 72 +++++++ ...portClusterTransportConfigurationStruct.kt | 75 +++++++ ...TransportMotionTriggerTimeControlStruct.kt | 77 ++++++++ ...mTransportClusterTransportOptionsStruct.kt | 183 ++++++++++++++++++ ...ortClusterTransportTriggerOptionsStruct.kt | 158 +++++++++++++++ ...nsportClusterTransportZoneOptionsStruct.kt | 81 ++++++++ 18 files changed, 1782 insertions(+) create mode 100644 src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/PushAvStreamTransportClusterPushTransportBeginEvent.kt create mode 100644 src/controller/java/generated/java/chip/devicecontroller/cluster/structs/PushAvStreamTransportClusterCMAFContainerOptionsStruct.kt create mode 100644 src/controller/java/generated/java/chip/devicecontroller/cluster/structs/PushAvStreamTransportClusterContainerOptionsStruct.kt create mode 100644 src/controller/java/generated/java/chip/devicecontroller/cluster/structs/PushAvStreamTransportClusterMetadataOptionsStruct.kt create mode 100644 src/controller/java/generated/java/chip/devicecontroller/cluster/structs/PushAvStreamTransportClusterTransportConfigurationStruct.kt create mode 100644 src/controller/java/generated/java/chip/devicecontroller/cluster/structs/PushAvStreamTransportClusterTransportMotionTriggerTimeControlStruct.kt create mode 100644 src/controller/java/generated/java/chip/devicecontroller/cluster/structs/PushAvStreamTransportClusterTransportOptionsStruct.kt create mode 100644 src/controller/java/generated/java/chip/devicecontroller/cluster/structs/PushAvStreamTransportClusterTransportTriggerOptionsStruct.kt create mode 100644 src/controller/java/generated/java/chip/devicecontroller/cluster/structs/PushAvStreamTransportClusterTransportZoneOptionsStruct.kt create mode 100644 src/controller/java/generated/java/matter/controller/cluster/eventstructs/PushAvStreamTransportClusterPushTransportBeginEvent.kt create mode 100644 src/controller/java/generated/java/matter/controller/cluster/structs/PushAvStreamTransportClusterCMAFContainerOptionsStruct.kt create mode 100644 src/controller/java/generated/java/matter/controller/cluster/structs/PushAvStreamTransportClusterContainerOptionsStruct.kt create mode 100644 src/controller/java/generated/java/matter/controller/cluster/structs/PushAvStreamTransportClusterMetadataOptionsStruct.kt create mode 100644 src/controller/java/generated/java/matter/controller/cluster/structs/PushAvStreamTransportClusterTransportConfigurationStruct.kt create mode 100644 src/controller/java/generated/java/matter/controller/cluster/structs/PushAvStreamTransportClusterTransportMotionTriggerTimeControlStruct.kt create mode 100644 src/controller/java/generated/java/matter/controller/cluster/structs/PushAvStreamTransportClusterTransportOptionsStruct.kt create mode 100644 src/controller/java/generated/java/matter/controller/cluster/structs/PushAvStreamTransportClusterTransportTriggerOptionsStruct.kt create mode 100644 src/controller/java/generated/java/matter/controller/cluster/structs/PushAvStreamTransportClusterTransportZoneOptionsStruct.kt diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/PushAvStreamTransportClusterPushTransportBeginEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/PushAvStreamTransportClusterPushTransportBeginEvent.kt new file mode 100644 index 00000000000000..c95fd429ca29e8 --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/PushAvStreamTransportClusterPushTransportBeginEvent.kt @@ -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, +) { + 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, + ) + } + } +} diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/PushAvStreamTransportClusterCMAFContainerOptionsStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/PushAvStreamTransportClusterCMAFContainerOptionsStruct.kt new file mode 100644 index 00000000000000..f391f94311d1af --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/PushAvStreamTransportClusterCMAFContainerOptionsStruct.kt @@ -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?, +) { + 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) + } + } +} diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/PushAvStreamTransportClusterContainerOptionsStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/PushAvStreamTransportClusterContainerOptionsStruct.kt new file mode 100644 index 00000000000000..7654f816da0799 --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/PushAvStreamTransportClusterContainerOptionsStruct.kt @@ -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?, +) { + 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) + } + } +} diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/PushAvStreamTransportClusterMetadataOptionsStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/PushAvStreamTransportClusterMetadataOptionsStruct.kt new file mode 100644 index 00000000000000..46d1fd77f04778 --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/PushAvStreamTransportClusterMetadataOptionsStruct.kt @@ -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, + ) + } + } +} diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/PushAvStreamTransportClusterTransportConfigurationStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/PushAvStreamTransportClusterTransportConfigurationStruct.kt new file mode 100644 index 00000000000000..ea6f9d8b132563 --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/PushAvStreamTransportClusterTransportConfigurationStruct.kt @@ -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, + ) + } + } +} diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/PushAvStreamTransportClusterTransportMotionTriggerTimeControlStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/PushAvStreamTransportClusterTransportMotionTriggerTimeControlStruct.kt new file mode 100644 index 00000000000000..bcbec51b37d88c --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/PushAvStreamTransportClusterTransportMotionTriggerTimeControlStruct.kt @@ -0,0 +1,77 @@ +/* + * + * 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 PushAvStreamTransportClusterTransportMotionTriggerTimeControlStruct( + val initialDuration: UInt, + val augmentationDuration: UInt, + val maxDuration: ULong, + val blindDuration: UInt, +) { + override fun toString(): String = buildString { + append("PushAvStreamTransportClusterTransportMotionTriggerTimeControlStruct {\n") + append("\tinitialDuration : $initialDuration\n") + append("\taugmentationDuration : $augmentationDuration\n") + append("\tmaxDuration : $maxDuration\n") + append("\tblindDuration : $blindDuration\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_INITIAL_DURATION), initialDuration) + put(ContextSpecificTag(TAG_AUGMENTATION_DURATION), augmentationDuration) + put(ContextSpecificTag(TAG_MAX_DURATION), maxDuration) + put(ContextSpecificTag(TAG_BLIND_DURATION), blindDuration) + endStructure() + } + } + + companion object { + private const val TAG_INITIAL_DURATION = 0 + private const val TAG_AUGMENTATION_DURATION = 1 + private const val TAG_MAX_DURATION = 2 + private const val TAG_BLIND_DURATION = 3 + + fun fromTlv( + tlvTag: Tag, + tlvReader: TlvReader, + ): PushAvStreamTransportClusterTransportMotionTriggerTimeControlStruct { + tlvReader.enterStructure(tlvTag) + val initialDuration = tlvReader.getUInt(ContextSpecificTag(TAG_INITIAL_DURATION)) + val augmentationDuration = tlvReader.getUInt(ContextSpecificTag(TAG_AUGMENTATION_DURATION)) + val maxDuration = tlvReader.getULong(ContextSpecificTag(TAG_MAX_DURATION)) + val blindDuration = tlvReader.getUInt(ContextSpecificTag(TAG_BLIND_DURATION)) + + tlvReader.exitContainer() + + return PushAvStreamTransportClusterTransportMotionTriggerTimeControlStruct( + initialDuration, + augmentationDuration, + maxDuration, + blindDuration, + ) + } + } +} diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/PushAvStreamTransportClusterTransportOptionsStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/PushAvStreamTransportClusterTransportOptionsStruct.kt new file mode 100644 index 00000000000000..8e5eb6dfae5380 --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/PushAvStreamTransportClusterTransportOptionsStruct.kt @@ -0,0 +1,183 @@ +/* + * + * 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 PushAvStreamTransportClusterTransportOptionsStruct( + val streamType: UInt, + val videoStreamID: Optional, + val audioStreamID: Optional, + val endpointID: UInt, + val url: String, + val triggerOptions: PushAvStreamTransportClusterTransportTriggerOptionsStruct, + val ingestMethod: UInt, + val containerFormat: UInt, + val containerOptions: PushAvStreamTransportClusterContainerOptionsStruct, + val metadataOptions: Optional?, + val expiryTime: Optional?, +) { + override fun toString(): String = buildString { + append("PushAvStreamTransportClusterTransportOptionsStruct {\n") + append("\tstreamType : $streamType\n") + append("\tvideoStreamID : $videoStreamID\n") + append("\taudioStreamID : $audioStreamID\n") + append("\tendpointID : $endpointID\n") + append("\turl : $url\n") + append("\ttriggerOptions : $triggerOptions\n") + append("\tingestMethod : $ingestMethod\n") + append("\tcontainerFormat : $containerFormat\n") + append("\tcontainerOptions : $containerOptions\n") + append("\tmetadataOptions : $metadataOptions\n") + append("\texpiryTime : $expiryTime\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_STREAM_TYPE), streamType) + if (videoStreamID.isPresent) { + val optvideoStreamID = videoStreamID.get() + put(ContextSpecificTag(TAG_VIDEO_STREAM_ID), optvideoStreamID) + } + if (audioStreamID.isPresent) { + val optaudioStreamID = audioStreamID.get() + put(ContextSpecificTag(TAG_AUDIO_STREAM_ID), optaudioStreamID) + } + put(ContextSpecificTag(TAG_ENDPOINT_ID), endpointID) + put(ContextSpecificTag(TAG_URL), url) + triggerOptions.toTlv(ContextSpecificTag(TAG_TRIGGER_OPTIONS), this) + put(ContextSpecificTag(TAG_INGEST_METHOD), ingestMethod) + put(ContextSpecificTag(TAG_CONTAINER_FORMAT), containerFormat) + containerOptions.toTlv(ContextSpecificTag(TAG_CONTAINER_OPTIONS), this) + if (metadataOptions != null) { + if (metadataOptions.isPresent) { + val optmetadataOptions = metadataOptions.get() + optmetadataOptions.toTlv(ContextSpecificTag(TAG_METADATA_OPTIONS), this) + } + } else { + putNull(ContextSpecificTag(TAG_METADATA_OPTIONS)) + } + if (expiryTime != null) { + if (expiryTime.isPresent) { + val optexpiryTime = expiryTime.get() + put(ContextSpecificTag(TAG_EXPIRY_TIME), optexpiryTime) + } + } else { + putNull(ContextSpecificTag(TAG_EXPIRY_TIME)) + } + endStructure() + } + } + + companion object { + private const val TAG_STREAM_TYPE = 0 + private const val TAG_VIDEO_STREAM_ID = 1 + private const val TAG_AUDIO_STREAM_ID = 2 + private const val TAG_ENDPOINT_ID = 3 + private const val TAG_URL = 4 + private const val TAG_TRIGGER_OPTIONS = 5 + private const val TAG_INGEST_METHOD = 6 + private const val TAG_CONTAINER_FORMAT = 7 + private const val TAG_CONTAINER_OPTIONS = 8 + private const val TAG_METADATA_OPTIONS = 9 + private const val TAG_EXPIRY_TIME = 10 + + fun fromTlv( + tlvTag: Tag, + tlvReader: TlvReader, + ): PushAvStreamTransportClusterTransportOptionsStruct { + tlvReader.enterStructure(tlvTag) + val streamType = tlvReader.getUInt(ContextSpecificTag(TAG_STREAM_TYPE)) + val videoStreamID = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_VIDEO_STREAM_ID))) { + Optional.of(tlvReader.getUInt(ContextSpecificTag(TAG_VIDEO_STREAM_ID))) + } else { + Optional.empty() + } + val audioStreamID = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_AUDIO_STREAM_ID))) { + Optional.of(tlvReader.getUInt(ContextSpecificTag(TAG_AUDIO_STREAM_ID))) + } else { + Optional.empty() + } + val endpointID = tlvReader.getUInt(ContextSpecificTag(TAG_ENDPOINT_ID)) + val url = tlvReader.getString(ContextSpecificTag(TAG_URL)) + val triggerOptions = + PushAvStreamTransportClusterTransportTriggerOptionsStruct.fromTlv( + ContextSpecificTag(TAG_TRIGGER_OPTIONS), + tlvReader, + ) + val ingestMethod = tlvReader.getUInt(ContextSpecificTag(TAG_INGEST_METHOD)) + val containerFormat = tlvReader.getUInt(ContextSpecificTag(TAG_CONTAINER_FORMAT)) + val containerOptions = + PushAvStreamTransportClusterContainerOptionsStruct.fromTlv( + ContextSpecificTag(TAG_CONTAINER_OPTIONS), + tlvReader, + ) + val metadataOptions = + if (!tlvReader.isNull()) { + if (tlvReader.isNextTag(ContextSpecificTag(TAG_METADATA_OPTIONS))) { + Optional.of( + PushAvStreamTransportClusterMetadataOptionsStruct.fromTlv( + ContextSpecificTag(TAG_METADATA_OPTIONS), + tlvReader, + ) + ) + } else { + Optional.empty() + } + } else { + tlvReader.getNull(ContextSpecificTag(TAG_METADATA_OPTIONS)) + null + } + val expiryTime = + if (!tlvReader.isNull()) { + if (tlvReader.isNextTag(ContextSpecificTag(TAG_EXPIRY_TIME))) { + Optional.of(tlvReader.getULong(ContextSpecificTag(TAG_EXPIRY_TIME))) + } else { + Optional.empty() + } + } else { + tlvReader.getNull(ContextSpecificTag(TAG_EXPIRY_TIME)) + null + } + + tlvReader.exitContainer() + + return PushAvStreamTransportClusterTransportOptionsStruct( + streamType, + videoStreamID, + audioStreamID, + endpointID, + url, + triggerOptions, + ingestMethod, + containerFormat, + containerOptions, + metadataOptions, + expiryTime, + ) + } + } +} diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/PushAvStreamTransportClusterTransportTriggerOptionsStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/PushAvStreamTransportClusterTransportTriggerOptionsStruct.kt new file mode 100644 index 00000000000000..0c02a83ddf521b --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/PushAvStreamTransportClusterTransportTriggerOptionsStruct.kt @@ -0,0 +1,158 @@ +/* + * + * 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 PushAvStreamTransportClusterTransportTriggerOptionsStruct( + val triggerType: UInt, + val motionZones: Optional>?, + val motionSensitivity: Optional?, + val motionTimeControl: + Optional, + val maxPreRollLen: Optional, +) { + override fun toString(): String = buildString { + append("PushAvStreamTransportClusterTransportTriggerOptionsStruct {\n") + append("\ttriggerType : $triggerType\n") + append("\tmotionZones : $motionZones\n") + append("\tmotionSensitivity : $motionSensitivity\n") + append("\tmotionTimeControl : $motionTimeControl\n") + append("\tmaxPreRollLen : $maxPreRollLen\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_TRIGGER_TYPE), triggerType) + if (motionZones != null) { + if (motionZones.isPresent) { + val optmotionZones = motionZones.get() + startArray(ContextSpecificTag(TAG_MOTION_ZONES)) + for (item in optmotionZones.iterator()) { + item.toTlv(AnonymousTag, this) + } + endArray() + } + } else { + putNull(ContextSpecificTag(TAG_MOTION_ZONES)) + } + if (motionSensitivity != null) { + if (motionSensitivity.isPresent) { + val optmotionSensitivity = motionSensitivity.get() + put(ContextSpecificTag(TAG_MOTION_SENSITIVITY), optmotionSensitivity) + } + } else { + putNull(ContextSpecificTag(TAG_MOTION_SENSITIVITY)) + } + if (motionTimeControl.isPresent) { + val optmotionTimeControl = motionTimeControl.get() + optmotionTimeControl.toTlv(ContextSpecificTag(TAG_MOTION_TIME_CONTROL), this) + } + if (maxPreRollLen.isPresent) { + val optmaxPreRollLen = maxPreRollLen.get() + put(ContextSpecificTag(TAG_MAX_PRE_ROLL_LEN), optmaxPreRollLen) + } + endStructure() + } + } + + companion object { + private const val TAG_TRIGGER_TYPE = 0 + private const val TAG_MOTION_ZONES = 1 + private const val TAG_MOTION_SENSITIVITY = 2 + private const val TAG_MOTION_TIME_CONTROL = 3 + private const val TAG_MAX_PRE_ROLL_LEN = 4 + + fun fromTlv( + tlvTag: Tag, + tlvReader: TlvReader, + ): PushAvStreamTransportClusterTransportTriggerOptionsStruct { + tlvReader.enterStructure(tlvTag) + val triggerType = tlvReader.getUInt(ContextSpecificTag(TAG_TRIGGER_TYPE)) + val motionZones = + if (!tlvReader.isNull()) { + if (tlvReader.isNextTag(ContextSpecificTag(TAG_MOTION_ZONES))) { + Optional.of( + buildList { + tlvReader.enterArray(ContextSpecificTag(TAG_MOTION_ZONES)) + while (!tlvReader.isEndOfContainer()) { + add( + PushAvStreamTransportClusterTransportZoneOptionsStruct.fromTlv( + AnonymousTag, + tlvReader, + ) + ) + } + tlvReader.exitContainer() + } + ) + } else { + Optional.empty() + } + } else { + tlvReader.getNull(ContextSpecificTag(TAG_MOTION_ZONES)) + null + } + val motionSensitivity = + if (!tlvReader.isNull()) { + if (tlvReader.isNextTag(ContextSpecificTag(TAG_MOTION_SENSITIVITY))) { + Optional.of(tlvReader.getUInt(ContextSpecificTag(TAG_MOTION_SENSITIVITY))) + } else { + Optional.empty() + } + } else { + tlvReader.getNull(ContextSpecificTag(TAG_MOTION_SENSITIVITY)) + null + } + val motionTimeControl = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_MOTION_TIME_CONTROL))) { + Optional.of( + PushAvStreamTransportClusterTransportMotionTriggerTimeControlStruct.fromTlv( + ContextSpecificTag(TAG_MOTION_TIME_CONTROL), + tlvReader, + ) + ) + } else { + Optional.empty() + } + val maxPreRollLen = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_MAX_PRE_ROLL_LEN))) { + Optional.of(tlvReader.getUInt(ContextSpecificTag(TAG_MAX_PRE_ROLL_LEN))) + } else { + Optional.empty() + } + + tlvReader.exitContainer() + + return PushAvStreamTransportClusterTransportTriggerOptionsStruct( + triggerType, + motionZones, + motionSensitivity, + motionTimeControl, + maxPreRollLen, + ) + } + } +} diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/PushAvStreamTransportClusterTransportZoneOptionsStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/PushAvStreamTransportClusterTransportZoneOptionsStruct.kt new file mode 100644 index 00000000000000..666e4d235fc4db --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/PushAvStreamTransportClusterTransportZoneOptionsStruct.kt @@ -0,0 +1,81 @@ +/* + * + * 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 PushAvStreamTransportClusterTransportZoneOptionsStruct( + val zone: UInt?, + val sensitivity: Optional, +) { + override fun toString(): String = buildString { + append("PushAvStreamTransportClusterTransportZoneOptionsStruct {\n") + append("\tzone : $zone\n") + append("\tsensitivity : $sensitivity\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + if (zone != null) { + put(ContextSpecificTag(TAG_ZONE), zone) + } else { + putNull(ContextSpecificTag(TAG_ZONE)) + } + if (sensitivity.isPresent) { + val optsensitivity = sensitivity.get() + put(ContextSpecificTag(TAG_SENSITIVITY), optsensitivity) + } + endStructure() + } + } + + companion object { + private const val TAG_ZONE = 1 + private const val TAG_SENSITIVITY = 2 + + fun fromTlv( + tlvTag: Tag, + tlvReader: TlvReader, + ): PushAvStreamTransportClusterTransportZoneOptionsStruct { + tlvReader.enterStructure(tlvTag) + val zone = + if (!tlvReader.isNull()) { + tlvReader.getUInt(ContextSpecificTag(TAG_ZONE)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_ZONE)) + null + } + val sensitivity = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_SENSITIVITY))) { + Optional.of(tlvReader.getUInt(ContextSpecificTag(TAG_SENSITIVITY))) + } else { + Optional.empty() + } + + tlvReader.exitContainer() + + return PushAvStreamTransportClusterTransportZoneOptionsStruct(zone, sensitivity) + } + } +} diff --git a/src/controller/java/generated/java/matter/controller/cluster/eventstructs/PushAvStreamTransportClusterPushTransportBeginEvent.kt b/src/controller/java/generated/java/matter/controller/cluster/eventstructs/PushAvStreamTransportClusterPushTransportBeginEvent.kt new file mode 100644 index 00000000000000..0aeaf246b39378 --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/eventstructs/PushAvStreamTransportClusterPushTransportBeginEvent.kt @@ -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 matter.controller.cluster.eventstructs + +import java.util.Optional +import matter.controller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class PushAvStreamTransportClusterPushTransportBeginEvent( + val connectionID: UShort, + val triggerType: UByte, + val activationReason: Optional, +) { + 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.getUShort(ContextSpecificTag(TAG_CONNECTION_ID)) + val triggerType = tlvReader.getUByte(ContextSpecificTag(TAG_TRIGGER_TYPE)) + val activationReason = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_ACTIVATION_REASON))) { + Optional.of(tlvReader.getUByte(ContextSpecificTag(TAG_ACTIVATION_REASON))) + } else { + Optional.empty() + } + + tlvReader.exitContainer() + + return PushAvStreamTransportClusterPushTransportBeginEvent( + connectionID, + triggerType, + activationReason, + ) + } + } +} diff --git a/src/controller/java/generated/java/matter/controller/cluster/structs/PushAvStreamTransportClusterCMAFContainerOptionsStruct.kt b/src/controller/java/generated/java/matter/controller/cluster/structs/PushAvStreamTransportClusterCMAFContainerOptionsStruct.kt new file mode 100644 index 00000000000000..d655eef65aee31 --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/structs/PushAvStreamTransportClusterCMAFContainerOptionsStruct.kt @@ -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 matter.controller.cluster.structs + +import java.util.Optional +import matter.controller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class PushAvStreamTransportClusterCMAFContainerOptionsStruct( + val chunkDuration: UShort, + val CENCKey: Optional?, +) { + 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.getUShort(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) + } + } +} diff --git a/src/controller/java/generated/java/matter/controller/cluster/structs/PushAvStreamTransportClusterContainerOptionsStruct.kt b/src/controller/java/generated/java/matter/controller/cluster/structs/PushAvStreamTransportClusterContainerOptionsStruct.kt new file mode 100644 index 00000000000000..ccdaf602e6f42d --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/structs/PushAvStreamTransportClusterContainerOptionsStruct.kt @@ -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 matter.controller.cluster.structs + +import java.util.Optional +import matter.controller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class PushAvStreamTransportClusterContainerOptionsStruct( + val containerType: UByte, + val CMAFContainerOptions: Optional?, +) { + 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.getUByte(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) + } + } +} diff --git a/src/controller/java/generated/java/matter/controller/cluster/structs/PushAvStreamTransportClusterMetadataOptionsStruct.kt b/src/controller/java/generated/java/matter/controller/cluster/structs/PushAvStreamTransportClusterMetadataOptionsStruct.kt new file mode 100644 index 00000000000000..e9d2004e72ce32 --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/structs/PushAvStreamTransportClusterMetadataOptionsStruct.kt @@ -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 matter.controller.cluster.structs + +import matter.controller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class PushAvStreamTransportClusterMetadataOptionsStruct( + val multiplexing: UByte, + 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.getUByte(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, + ) + } + } +} diff --git a/src/controller/java/generated/java/matter/controller/cluster/structs/PushAvStreamTransportClusterTransportConfigurationStruct.kt b/src/controller/java/generated/java/matter/controller/cluster/structs/PushAvStreamTransportClusterTransportConfigurationStruct.kt new file mode 100644 index 00000000000000..0b353db8ce3e0a --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/structs/PushAvStreamTransportClusterTransportConfigurationStruct.kt @@ -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 matter.controller.cluster.structs + +import matter.controller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class PushAvStreamTransportClusterTransportConfigurationStruct( + val connectionID: UShort, + val transportStatus: UByte, + 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.getUShort(ContextSpecificTag(TAG_CONNECTION_ID)) + val transportStatus = tlvReader.getUByte(ContextSpecificTag(TAG_TRANSPORT_STATUS)) + val transportOptions = + PushAvStreamTransportClusterTransportOptionsStruct.fromTlv( + ContextSpecificTag(TAG_TRANSPORT_OPTIONS), + tlvReader, + ) + + tlvReader.exitContainer() + + return PushAvStreamTransportClusterTransportConfigurationStruct( + connectionID, + transportStatus, + transportOptions, + ) + } + } +} diff --git a/src/controller/java/generated/java/matter/controller/cluster/structs/PushAvStreamTransportClusterTransportMotionTriggerTimeControlStruct.kt b/src/controller/java/generated/java/matter/controller/cluster/structs/PushAvStreamTransportClusterTransportMotionTriggerTimeControlStruct.kt new file mode 100644 index 00000000000000..d60d3525daec65 --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/structs/PushAvStreamTransportClusterTransportMotionTriggerTimeControlStruct.kt @@ -0,0 +1,77 @@ +/* + * + * 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.controller.cluster.structs + +import matter.controller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class PushAvStreamTransportClusterTransportMotionTriggerTimeControlStruct( + val initialDuration: UShort, + val augmentationDuration: UShort, + val maxDuration: UInt, + val blindDuration: UShort, +) { + override fun toString(): String = buildString { + append("PushAvStreamTransportClusterTransportMotionTriggerTimeControlStruct {\n") + append("\tinitialDuration : $initialDuration\n") + append("\taugmentationDuration : $augmentationDuration\n") + append("\tmaxDuration : $maxDuration\n") + append("\tblindDuration : $blindDuration\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_INITIAL_DURATION), initialDuration) + put(ContextSpecificTag(TAG_AUGMENTATION_DURATION), augmentationDuration) + put(ContextSpecificTag(TAG_MAX_DURATION), maxDuration) + put(ContextSpecificTag(TAG_BLIND_DURATION), blindDuration) + endStructure() + } + } + + companion object { + private const val TAG_INITIAL_DURATION = 0 + private const val TAG_AUGMENTATION_DURATION = 1 + private const val TAG_MAX_DURATION = 2 + private const val TAG_BLIND_DURATION = 3 + + fun fromTlv( + tlvTag: Tag, + tlvReader: TlvReader, + ): PushAvStreamTransportClusterTransportMotionTriggerTimeControlStruct { + tlvReader.enterStructure(tlvTag) + val initialDuration = tlvReader.getUShort(ContextSpecificTag(TAG_INITIAL_DURATION)) + val augmentationDuration = tlvReader.getUShort(ContextSpecificTag(TAG_AUGMENTATION_DURATION)) + val maxDuration = tlvReader.getUInt(ContextSpecificTag(TAG_MAX_DURATION)) + val blindDuration = tlvReader.getUShort(ContextSpecificTag(TAG_BLIND_DURATION)) + + tlvReader.exitContainer() + + return PushAvStreamTransportClusterTransportMotionTriggerTimeControlStruct( + initialDuration, + augmentationDuration, + maxDuration, + blindDuration, + ) + } + } +} diff --git a/src/controller/java/generated/java/matter/controller/cluster/structs/PushAvStreamTransportClusterTransportOptionsStruct.kt b/src/controller/java/generated/java/matter/controller/cluster/structs/PushAvStreamTransportClusterTransportOptionsStruct.kt new file mode 100644 index 00000000000000..a83429d27a5938 --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/structs/PushAvStreamTransportClusterTransportOptionsStruct.kt @@ -0,0 +1,183 @@ +/* + * + * 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.controller.cluster.structs + +import java.util.Optional +import matter.controller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class PushAvStreamTransportClusterTransportOptionsStruct( + val streamType: UByte, + val videoStreamID: Optional, + val audioStreamID: Optional, + val endpointID: UShort, + val url: String, + val triggerOptions: PushAvStreamTransportClusterTransportTriggerOptionsStruct, + val ingestMethod: UByte, + val containerFormat: UByte, + val containerOptions: PushAvStreamTransportClusterContainerOptionsStruct, + val metadataOptions: Optional?, + val expiryTime: Optional?, +) { + override fun toString(): String = buildString { + append("PushAvStreamTransportClusterTransportOptionsStruct {\n") + append("\tstreamType : $streamType\n") + append("\tvideoStreamID : $videoStreamID\n") + append("\taudioStreamID : $audioStreamID\n") + append("\tendpointID : $endpointID\n") + append("\turl : $url\n") + append("\ttriggerOptions : $triggerOptions\n") + append("\tingestMethod : $ingestMethod\n") + append("\tcontainerFormat : $containerFormat\n") + append("\tcontainerOptions : $containerOptions\n") + append("\tmetadataOptions : $metadataOptions\n") + append("\texpiryTime : $expiryTime\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_STREAM_TYPE), streamType) + if (videoStreamID.isPresent) { + val optvideoStreamID = videoStreamID.get() + put(ContextSpecificTag(TAG_VIDEO_STREAM_ID), optvideoStreamID) + } + if (audioStreamID.isPresent) { + val optaudioStreamID = audioStreamID.get() + put(ContextSpecificTag(TAG_AUDIO_STREAM_ID), optaudioStreamID) + } + put(ContextSpecificTag(TAG_ENDPOINT_ID), endpointID) + put(ContextSpecificTag(TAG_URL), url) + triggerOptions.toTlv(ContextSpecificTag(TAG_TRIGGER_OPTIONS), this) + put(ContextSpecificTag(TAG_INGEST_METHOD), ingestMethod) + put(ContextSpecificTag(TAG_CONTAINER_FORMAT), containerFormat) + containerOptions.toTlv(ContextSpecificTag(TAG_CONTAINER_OPTIONS), this) + if (metadataOptions != null) { + if (metadataOptions.isPresent) { + val optmetadataOptions = metadataOptions.get() + optmetadataOptions.toTlv(ContextSpecificTag(TAG_METADATA_OPTIONS), this) + } + } else { + putNull(ContextSpecificTag(TAG_METADATA_OPTIONS)) + } + if (expiryTime != null) { + if (expiryTime.isPresent) { + val optexpiryTime = expiryTime.get() + put(ContextSpecificTag(TAG_EXPIRY_TIME), optexpiryTime) + } + } else { + putNull(ContextSpecificTag(TAG_EXPIRY_TIME)) + } + endStructure() + } + } + + companion object { + private const val TAG_STREAM_TYPE = 0 + private const val TAG_VIDEO_STREAM_ID = 1 + private const val TAG_AUDIO_STREAM_ID = 2 + private const val TAG_ENDPOINT_ID = 3 + private const val TAG_URL = 4 + private const val TAG_TRIGGER_OPTIONS = 5 + private const val TAG_INGEST_METHOD = 6 + private const val TAG_CONTAINER_FORMAT = 7 + private const val TAG_CONTAINER_OPTIONS = 8 + private const val TAG_METADATA_OPTIONS = 9 + private const val TAG_EXPIRY_TIME = 10 + + fun fromTlv( + tlvTag: Tag, + tlvReader: TlvReader, + ): PushAvStreamTransportClusterTransportOptionsStruct { + tlvReader.enterStructure(tlvTag) + val streamType = tlvReader.getUByte(ContextSpecificTag(TAG_STREAM_TYPE)) + val videoStreamID = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_VIDEO_STREAM_ID))) { + Optional.of(tlvReader.getUShort(ContextSpecificTag(TAG_VIDEO_STREAM_ID))) + } else { + Optional.empty() + } + val audioStreamID = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_AUDIO_STREAM_ID))) { + Optional.of(tlvReader.getUShort(ContextSpecificTag(TAG_AUDIO_STREAM_ID))) + } else { + Optional.empty() + } + val endpointID = tlvReader.getUShort(ContextSpecificTag(TAG_ENDPOINT_ID)) + val url = tlvReader.getString(ContextSpecificTag(TAG_URL)) + val triggerOptions = + PushAvStreamTransportClusterTransportTriggerOptionsStruct.fromTlv( + ContextSpecificTag(TAG_TRIGGER_OPTIONS), + tlvReader, + ) + val ingestMethod = tlvReader.getUByte(ContextSpecificTag(TAG_INGEST_METHOD)) + val containerFormat = tlvReader.getUByte(ContextSpecificTag(TAG_CONTAINER_FORMAT)) + val containerOptions = + PushAvStreamTransportClusterContainerOptionsStruct.fromTlv( + ContextSpecificTag(TAG_CONTAINER_OPTIONS), + tlvReader, + ) + val metadataOptions = + if (!tlvReader.isNull()) { + if (tlvReader.isNextTag(ContextSpecificTag(TAG_METADATA_OPTIONS))) { + Optional.of( + PushAvStreamTransportClusterMetadataOptionsStruct.fromTlv( + ContextSpecificTag(TAG_METADATA_OPTIONS), + tlvReader, + ) + ) + } else { + Optional.empty() + } + } else { + tlvReader.getNull(ContextSpecificTag(TAG_METADATA_OPTIONS)) + null + } + val expiryTime = + if (!tlvReader.isNull()) { + if (tlvReader.isNextTag(ContextSpecificTag(TAG_EXPIRY_TIME))) { + Optional.of(tlvReader.getUInt(ContextSpecificTag(TAG_EXPIRY_TIME))) + } else { + Optional.empty() + } + } else { + tlvReader.getNull(ContextSpecificTag(TAG_EXPIRY_TIME)) + null + } + + tlvReader.exitContainer() + + return PushAvStreamTransportClusterTransportOptionsStruct( + streamType, + videoStreamID, + audioStreamID, + endpointID, + url, + triggerOptions, + ingestMethod, + containerFormat, + containerOptions, + metadataOptions, + expiryTime, + ) + } + } +} diff --git a/src/controller/java/generated/java/matter/controller/cluster/structs/PushAvStreamTransportClusterTransportTriggerOptionsStruct.kt b/src/controller/java/generated/java/matter/controller/cluster/structs/PushAvStreamTransportClusterTransportTriggerOptionsStruct.kt new file mode 100644 index 00000000000000..7bf4183adfc741 --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/structs/PushAvStreamTransportClusterTransportTriggerOptionsStruct.kt @@ -0,0 +1,158 @@ +/* + * + * 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.controller.cluster.structs + +import java.util.Optional +import matter.controller.cluster.* +import matter.tlv.AnonymousTag +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class PushAvStreamTransportClusterTransportTriggerOptionsStruct( + val triggerType: UByte, + val motionZones: Optional>?, + val motionSensitivity: Optional?, + val motionTimeControl: + Optional, + val maxPreRollLen: Optional, +) { + override fun toString(): String = buildString { + append("PushAvStreamTransportClusterTransportTriggerOptionsStruct {\n") + append("\ttriggerType : $triggerType\n") + append("\tmotionZones : $motionZones\n") + append("\tmotionSensitivity : $motionSensitivity\n") + append("\tmotionTimeControl : $motionTimeControl\n") + append("\tmaxPreRollLen : $maxPreRollLen\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_TRIGGER_TYPE), triggerType) + if (motionZones != null) { + if (motionZones.isPresent) { + val optmotionZones = motionZones.get() + startArray(ContextSpecificTag(TAG_MOTION_ZONES)) + for (item in optmotionZones.iterator()) { + item.toTlv(AnonymousTag, this) + } + endArray() + } + } else { + putNull(ContextSpecificTag(TAG_MOTION_ZONES)) + } + if (motionSensitivity != null) { + if (motionSensitivity.isPresent) { + val optmotionSensitivity = motionSensitivity.get() + put(ContextSpecificTag(TAG_MOTION_SENSITIVITY), optmotionSensitivity) + } + } else { + putNull(ContextSpecificTag(TAG_MOTION_SENSITIVITY)) + } + if (motionTimeControl.isPresent) { + val optmotionTimeControl = motionTimeControl.get() + optmotionTimeControl.toTlv(ContextSpecificTag(TAG_MOTION_TIME_CONTROL), this) + } + if (maxPreRollLen.isPresent) { + val optmaxPreRollLen = maxPreRollLen.get() + put(ContextSpecificTag(TAG_MAX_PRE_ROLL_LEN), optmaxPreRollLen) + } + endStructure() + } + } + + companion object { + private const val TAG_TRIGGER_TYPE = 0 + private const val TAG_MOTION_ZONES = 1 + private const val TAG_MOTION_SENSITIVITY = 2 + private const val TAG_MOTION_TIME_CONTROL = 3 + private const val TAG_MAX_PRE_ROLL_LEN = 4 + + fun fromTlv( + tlvTag: Tag, + tlvReader: TlvReader, + ): PushAvStreamTransportClusterTransportTriggerOptionsStruct { + tlvReader.enterStructure(tlvTag) + val triggerType = tlvReader.getUByte(ContextSpecificTag(TAG_TRIGGER_TYPE)) + val motionZones = + if (!tlvReader.isNull()) { + if (tlvReader.isNextTag(ContextSpecificTag(TAG_MOTION_ZONES))) { + Optional.of( + buildList { + tlvReader.enterArray(ContextSpecificTag(TAG_MOTION_ZONES)) + while (!tlvReader.isEndOfContainer()) { + add( + PushAvStreamTransportClusterTransportZoneOptionsStruct.fromTlv( + AnonymousTag, + tlvReader, + ) + ) + } + tlvReader.exitContainer() + } + ) + } else { + Optional.empty() + } + } else { + tlvReader.getNull(ContextSpecificTag(TAG_MOTION_ZONES)) + null + } + val motionSensitivity = + if (!tlvReader.isNull()) { + if (tlvReader.isNextTag(ContextSpecificTag(TAG_MOTION_SENSITIVITY))) { + Optional.of(tlvReader.getUByte(ContextSpecificTag(TAG_MOTION_SENSITIVITY))) + } else { + Optional.empty() + } + } else { + tlvReader.getNull(ContextSpecificTag(TAG_MOTION_SENSITIVITY)) + null + } + val motionTimeControl = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_MOTION_TIME_CONTROL))) { + Optional.of( + PushAvStreamTransportClusterTransportMotionTriggerTimeControlStruct.fromTlv( + ContextSpecificTag(TAG_MOTION_TIME_CONTROL), + tlvReader, + ) + ) + } else { + Optional.empty() + } + val maxPreRollLen = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_MAX_PRE_ROLL_LEN))) { + Optional.of(tlvReader.getUShort(ContextSpecificTag(TAG_MAX_PRE_ROLL_LEN))) + } else { + Optional.empty() + } + + tlvReader.exitContainer() + + return PushAvStreamTransportClusterTransportTriggerOptionsStruct( + triggerType, + motionZones, + motionSensitivity, + motionTimeControl, + maxPreRollLen, + ) + } + } +} diff --git a/src/controller/java/generated/java/matter/controller/cluster/structs/PushAvStreamTransportClusterTransportZoneOptionsStruct.kt b/src/controller/java/generated/java/matter/controller/cluster/structs/PushAvStreamTransportClusterTransportZoneOptionsStruct.kt new file mode 100644 index 00000000000000..a14896415f0b4f --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/structs/PushAvStreamTransportClusterTransportZoneOptionsStruct.kt @@ -0,0 +1,81 @@ +/* + * + * 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.controller.cluster.structs + +import java.util.Optional +import matter.controller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class PushAvStreamTransportClusterTransportZoneOptionsStruct( + val zone: UShort?, + val sensitivity: Optional, +) { + override fun toString(): String = buildString { + append("PushAvStreamTransportClusterTransportZoneOptionsStruct {\n") + append("\tzone : $zone\n") + append("\tsensitivity : $sensitivity\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + if (zone != null) { + put(ContextSpecificTag(TAG_ZONE), zone) + } else { + putNull(ContextSpecificTag(TAG_ZONE)) + } + if (sensitivity.isPresent) { + val optsensitivity = sensitivity.get() + put(ContextSpecificTag(TAG_SENSITIVITY), optsensitivity) + } + endStructure() + } + } + + companion object { + private const val TAG_ZONE = 1 + private const val TAG_SENSITIVITY = 2 + + fun fromTlv( + tlvTag: Tag, + tlvReader: TlvReader, + ): PushAvStreamTransportClusterTransportZoneOptionsStruct { + tlvReader.enterStructure(tlvTag) + val zone = + if (!tlvReader.isNull()) { + tlvReader.getUShort(ContextSpecificTag(TAG_ZONE)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_ZONE)) + null + } + val sensitivity = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_SENSITIVITY))) { + Optional.of(tlvReader.getUByte(ContextSpecificTag(TAG_SENSITIVITY))) + } else { + Optional.empty() + } + + tlvReader.exitContainer() + + return PushAvStreamTransportClusterTransportZoneOptionsStruct(zone, sensitivity) + } + } +}