From 2d54b4b97d59334ce15c27d0c52beec3874c12f7 Mon Sep 17 00:00:00 2001 From: marcos <15697303+gmarcosb@users.noreply.github.com> Date: Wed, 18 Dec 2024 16:41:29 -0700 Subject: [PATCH] Generated with ./scripts/tools/zap_regen_all.py --- docs/ids_and_codes/zap_clusters.md | 1 + .../data_model/controller-clusters.matter | 194 +++ .../chip/devicecontroller/ChipClusters.java | 456 ++++++ .../devicecontroller/ChipEventStructs.java | 152 ++ .../chip/devicecontroller/ChipStructs.java | 728 +++++++++ .../devicecontroller/ClusterIDMapping.java | 216 +++ .../devicecontroller/ClusterInfoMapping.java | 281 ++++ .../devicecontroller/ClusterReadMapping.java | 104 ++ .../devicecontroller/ClusterWriteMapping.java | 2 + ...TransportClusterPushTransportBeginEvent.kt | 80 + ...amTransportClusterPushTransportEndEvent.kt | 80 + .../chip/devicecontroller/cluster/files.gni | 10 + ...nsportClusterCMAFContainerOptionsStruct.kt | 71 + ...mTransportClusterContainerOptionsStruct.kt | 76 + ...amTransportClusterMetadataOptionsStruct.kt | 72 + ...portClusterTransportConfigurationStruct.kt | 75 + ...TransportMotionTriggerTimeControlStruct.kt | 77 + ...mTransportClusterTransportOptionsStruct.kt | 165 ++ ...ortClusterTransportTriggerOptionsStruct.kt | 158 ++ ...nsportClusterTransportZoneOptionsStruct.kt | 81 + .../clusters/PushAvStreamTransportCluster.kt | 1166 ++++++++++++++ ...TransportClusterPushTransportBeginEvent.kt | 80 + ...amTransportClusterPushTransportEndEvent.kt | 80 + .../java/matter/controller/cluster/files.gni | 11 + ...nsportClusterCMAFContainerOptionsStruct.kt | 71 + ...mTransportClusterContainerOptionsStruct.kt | 76 + ...amTransportClusterMetadataOptionsStruct.kt | 72 + ...portClusterTransportConfigurationStruct.kt | 75 + ...TransportMotionTriggerTimeControlStruct.kt | 77 + ...mTransportClusterTransportOptionsStruct.kt | 165 ++ ...ortClusterTransportTriggerOptionsStruct.kt | 158 ++ ...nsportClusterTransportZoneOptionsStruct.kt | 81 + .../CHIPAttributeTLVValueDecoder.cpp | 174 +++ .../CHIPEventTLVValueDecoder.cpp | 143 ++ .../python/chip/clusters/CHIPClusters.py | 104 ++ .../python/chip/clusters/Objects.py | 574 +++++++ .../MTRAttributeSpecifiedCheck.mm | 36 + .../MTRAttributeTLVValueDecoder.mm | 63 + .../CHIP/zap-generated/MTRBaseClusters.h | 172 +++ .../CHIP/zap-generated/MTRBaseClusters.mm | 441 ++++++ .../CHIP/zap-generated/MTRClusterConstants.h | 25 + .../CHIP/zap-generated/MTRClusterNames.mm | 117 ++ .../CHIP/zap-generated/MTRClusters.h | 49 + .../CHIP/zap-generated/MTRClusters.mm | 210 +++ .../zap-generated/MTRCommandPayloadsObjc.h | 230 +++ .../zap-generated/MTRCommandPayloadsObjc.mm | 1089 +++++++++++++ .../MTRCommandPayloads_Internal.h | 48 + .../zap-generated/MTRCommandTimedCheck.mm | 12 + .../zap-generated/MTREventTLVValueDecoder.mm | 77 + .../CHIP/zap-generated/MTRStructsObjc.h | 78 + .../CHIP/zap-generated/MTRStructsObjc.mm | 354 +++++ .../zap-generated/attributes/Accessors.cpp | 205 +++ .../zap-generated/attributes/Accessors.h | 40 + .../app-common/zap-generated/callback.h | 79 + .../zap-generated/cluster-enums-check.h | 91 ++ .../app-common/zap-generated/cluster-enums.h | 113 ++ .../zap-generated/cluster-objects.cpp | 845 +++++++++++ .../zap-generated/cluster-objects.h | 723 +++++++++ .../app-common/zap-generated/ids/Attributes.h | 38 + .../app-common/zap-generated/ids/Clusters.h | 3 + .../app-common/zap-generated/ids/Commands.h | 38 + .../app-common/zap-generated/ids/Events.h | 14 + .../zap-generated/cluster/Commands.h | 341 +++++ .../cluster/ComplexArgumentParser.cpp | 392 +++++ .../cluster/ComplexArgumentParser.h | 49 + .../cluster/logging/DataModelLogger.cpp | 496 ++++++ .../cluster/logging/DataModelLogger.h | 41 + .../cluster/logging/EntryToText.cpp | 55 + .../zap-generated/cluster/Commands.h | 1342 +++++++++++++++++ 69 files changed, 14092 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/eventstructs/PushAvStreamTransportClusterPushTransportEndEvent.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/clusters/PushAvStreamTransportCluster.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/eventstructs/PushAvStreamTransportClusterPushTransportEndEvent.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/docs/ids_and_codes/zap_clusters.md b/docs/ids_and_codes/zap_clusters.md index b37e8b2b8b7781..59785c886cbde3 100644 --- a/docs/ids_and_codes/zap_clusters.md +++ b/docs/ids_and_codes/zap_clusters.md @@ -133,6 +133,7 @@ Generally regenerate using one of: | 1361 | 0x551 | CameraAvStreamManagement | | 1363 | 0x553 | WebRTCTransportProvider | | 1364 | 0x554 | WebRTCTransportRequestor | +| 1365 | 0x555 | PushAvStreamTransport | | 1366 | 0x556 | Chime | | 1872 | 0x750 | EcosystemInformation | | 1873 | 0x751 | CommissionerControl | diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index aa2707931f36d6..4e8918e4ddff9a 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -10040,6 +10040,200 @@ cluster WebRTCTransportRequestor = 1364 { command End(EndRequest): DefaultSuccess = 4; } +/** */ +cluster PushAvStreamTransport = 1365 { + revision 1; + + enum ContainerFormatEnum : enum8 { + kCMAF = 0; + } + + enum IngestMethodsEnum : enum8 { + kCMAFIngest = 0; + } + + enum StatusCodeEnum : enum8 { + kAllocationNotPermitted = 2; + kInvalidTLSEndpoint = 3; + kInvalidStream = 4; + kInvalidURL = 5; + kInvalidZone = 6; + kUnsupportedContainerFormat = 7; + kUnsupportedIngestMethod = 8; + kInvalidTriggerType = 9; + kInvalidTransportStatus = 16; + } + + enum StreamMultiplexingEnum : enum8 { + kInterleaved = 0; + } + + enum StreamTypeEnum : enum8 { + kInternal = 0; + kRecording = 1; + kAnalysis = 2; + kLiveView = 3; + } + + enum TransportStatusEnum : enum8 { + kActive = 0; + kInactive = 1; + } + + enum TransportTriggerTypeEnum : enum8 { + kCommand = 0; + kMotion = 1; + kContinuous = 2; + } + + enum TriggerActivationReasonEnum : enum8 { + kUserInitiated = 0; + kAutomation = 1; + kEmergency = 2; + } + + bitmap Feature : bitmap32 { + kPerZoneSensitivity = 0x1; + } + + bitmap SupportedContainerFormatsBitmap : bitmap8 { + kCMAF = 0x1; + } + + bitmap SupportedIngestMethodsBitmap : bitmap8 { + kCMAFIngest = 0x1; + } + + struct TransportMotionTriggerTimeControlStruct { + int16u initialDuration = 0; + int16u augmentationDuration = 1; + elapsed_s maxDuration = 2; + int16u blindDuration = 3; + } + + struct TransportZoneOptionsStruct { + nullable int16u zone = 1; + optional int8u sensitivity = 2; + } + + struct MetadataOptionsStruct { + StreamMultiplexingEnum multiplexing = 0; + boolean includeMotionZones = 1; + boolean enableMetadataPrivacySensitive = 2; + } + + struct TransportTriggerOptionsStruct { + TransportTriggerTypeEnum triggerType = 0; + optional nullable TransportZoneOptionsStruct motionZones[] = 1; + optional nullable int8u motionSensitivity = 2; + optional TransportMotionTriggerTimeControlStruct motionTimeControl = 3; + optional int16u maxPreRollLen = 4; + } + + struct CMAFContainerOptionsStruct { + int16u chunkDuration = 0; + optional octet_string CENCKey = 1; + } + + struct ContainerOptionsStruct { + ContainerFormatEnum containerType = 0; + optional CMAFContainerOptionsStruct CMAFContainerOptions = 1; + } + + struct TransportOptionsStruct { + StreamTypeEnum streamType = 0; + optional int16u videoStreamID = 1; + optional int16u audioStreamID = 2; + int16u endpointID = 3; + long_char_string<256> url = 4; + TransportTriggerOptionsStruct triggerOptions = 5; + IngestMethodsEnum ingestMethod = 6; + ContainerFormatEnum containerFormat = 7; + ContainerOptionsStruct containerOptions = 8; + optional MetadataOptionsStruct metadataOptions = 9; + optional epoch_s expiryTime = 10; + } + + struct TransportConfigurationStruct { + int16u connectionID = 0; + TransportStatusEnum transportStatus = 1; + TransportOptionsStruct transportOptions = 2; + } + + info event PushTransportBegin = 0 { + int16u connectionID = 0; + TransportTriggerTypeEnum triggerType = 1; + optional TriggerActivationReasonEnum activationReason = 2; + } + + info event PushTransportEnd = 1 { + int16u connectionID = 0; + TransportTriggerTypeEnum triggerType = 1; + optional TriggerActivationReasonEnum activationReason = 2; + } + + readonly attribute SupportedContainerFormatsBitmap supportedContainerFormats = 0; + readonly attribute SupportedIngestMethodsBitmap supportedIngestMethods = 1; + readonly attribute int16u currentConnections[] = 2; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct AllocatePushTransportRequest { + TransportOptionsStruct transportOptions = 0; + } + + response struct AllocatePushTransportResponse = 1 { + int16u connectionID = 0; + TransportOptionsStruct transportOptions = 1; + TransportStatusEnum transportStatus = 2; + } + + request struct DeallocatePushTransportRequest { + int16u connectionID = 0; + } + + request struct ModifyPushTransportRequest { + int16u connectionID = 0; + TransportOptionsStruct transportOptions = 1; + } + + request struct SetTransportStatusRequest { + int16u connectionID = 0; + TransportStatusEnum transportStatus = 1; + } + + request struct ManuallyTriggerTransportRequest { + int16u connectionID = 0; + TriggerActivationReasonEnum activationReason = 1; + optional TransportMotionTriggerTimeControlStruct timeControl = 2; + } + + request struct FindTransportRequest { + optional nullable int16u connectionID = 0; + } + + response struct FindTransportResponse = 7 { + TransportConfigurationStruct streamConfigurations[] = 0; + } + + /** This command SHALL allocate a transport and return a PushTransportConnectionID. */ + command access(invoke: manage) AllocatePushTransport(AllocatePushTransportRequest): AllocatePushTransportResponse = 0; + /** This command SHALL be generated to request the Node deallocates the specified transport. */ + command access(invoke: manage) DeallocatePushTransport(DeallocatePushTransportRequest): DefaultSuccess = 2; + /** This command is used to request the Node modifies the configuration of the specified push transport. */ + command access(invoke: manage) ModifyPushTransport(ModifyPushTransportRequest): DefaultSuccess = 3; + /** This command SHALL be generated to request the Node modifies the Transport Status of the transport. */ + command access(invoke: manage) SetTransportStatus(SetTransportStatusRequest): DefaultSuccess = 4; + /** This command SHALL be generated to request the Node to manually start the specified push transport. */ + command ManuallyTriggerTransport(ManuallyTriggerTransportRequest): DefaultSuccess = 5; + /** This command SHALL return the Stream Options Configuration for the specified push transport. */ + command FindTransport(FindTransportRequest): FindTransportResponse = 6; +} + /** This cluster provides facilities to configure and play Chime sounds, such as those used in a doorbell. */ provisional cluster Chime = 1366 { revision 1; diff --git a/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java b/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java index 228e0236ed0785..651a8076a9cf6b 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java @@ -62328,6 +62328,462 @@ public void onSuccess(byte[] tlv) { } } + public static class PushAvStreamTransportCluster extends BaseChipCluster { + public static final long CLUSTER_ID = 1365L; + + private static final long SUPPORTED_CONTAINER_FORMATS_ATTRIBUTE_ID = 0L; + private static final long SUPPORTED_INGEST_METHODS_ATTRIBUTE_ID = 1L; + private static final long CURRENT_CONNECTIONS_ATTRIBUTE_ID = 2L; + private static final long GENERATED_COMMAND_LIST_ATTRIBUTE_ID = 65528L; + private static final long ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID = 65529L; + private static final long EVENT_LIST_ATTRIBUTE_ID = 65530L; + private static final long ATTRIBUTE_LIST_ATTRIBUTE_ID = 65531L; + private static final long FEATURE_MAP_ATTRIBUTE_ID = 65532L; + private static final long CLUSTER_REVISION_ATTRIBUTE_ID = 65533L; + + public PushAvStreamTransportCluster(long devicePtr, int endpointId) { + super(devicePtr, endpointId, CLUSTER_ID); + } + + @Override + @Deprecated + public long initWithDevice(long devicePtr, int endpointId) { + return 0L; + } + + public void allocatePushTransport(AllocatePushTransportResponseCallback callback, ChipStructs.PushAvStreamTransportClusterTransportOptionsStruct transportOptions) { + allocatePushTransport(callback, transportOptions, 0); + } + + public void allocatePushTransport(AllocatePushTransportResponseCallback callback, ChipStructs.PushAvStreamTransportClusterTransportOptionsStruct transportOptions, int timedInvokeTimeoutMs) { + final long commandId = 0L; + + ArrayList elements = new ArrayList<>(); + final long transportOptionsFieldID = 0L; + BaseTLVType transportOptionstlvValue = transportOptions.encodeTlv(); + elements.add(new StructElement(transportOptionsFieldID, transportOptionstlvValue)); + + StructType commandArgs = new StructType(elements); + invoke(new InvokeCallbackImpl(callback) { + @Override + public void onResponse(StructType invokeStructValue) { + final long connectionIDFieldID = 0L; + Integer connectionID = null; + final long transportOptionsFieldID = 1L; + ChipStructs.PushAvStreamTransportClusterTransportOptionsStruct transportOptions = null; + final long transportStatusFieldID = 2L; + Integer transportStatus = null; + for (StructElement element: invokeStructValue.value()) { + if (element.contextTagNum() == connectionIDFieldID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + connectionID = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == transportOptionsFieldID) { + if (element.value(BaseTLVType.class).type() == TLVType.Struct) { + StructType castingValue = element.value(StructType.class); + transportOptions = ChipStructs.PushAvStreamTransportClusterTransportOptionsStruct.decodeTlv(castingValue); + } + } else if (element.contextTagNum() == transportStatusFieldID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + transportStatus = castingValue.value(Integer.class); + } + } + } + callback.onSuccess(connectionID, transportOptions, transportStatus); + }}, commandId, commandArgs, timedInvokeTimeoutMs); + } + + public void deallocatePushTransport(DefaultClusterCallback callback, Integer connectionID) { + deallocatePushTransport(callback, connectionID, 0); + } + + public void deallocatePushTransport(DefaultClusterCallback callback, Integer connectionID, int timedInvokeTimeoutMs) { + final long commandId = 2L; + + ArrayList elements = new ArrayList<>(); + final long connectionIDFieldID = 0L; + BaseTLVType connectionIDtlvValue = new UIntType(connectionID); + elements.add(new StructElement(connectionIDFieldID, connectionIDtlvValue)); + + StructType commandArgs = new StructType(elements); + invoke(new InvokeCallbackImpl(callback) { + @Override + public void onResponse(StructType invokeStructValue) { + callback.onSuccess(); + }}, commandId, commandArgs, timedInvokeTimeoutMs); + } + + public void modifyPushTransport(DefaultClusterCallback callback, Integer connectionID, ChipStructs.PushAvStreamTransportClusterTransportOptionsStruct transportOptions) { + modifyPushTransport(callback, connectionID, transportOptions, 0); + } + + public void modifyPushTransport(DefaultClusterCallback callback, Integer connectionID, ChipStructs.PushAvStreamTransportClusterTransportOptionsStruct transportOptions, int timedInvokeTimeoutMs) { + final long commandId = 3L; + + ArrayList elements = new ArrayList<>(); + final long connectionIDFieldID = 0L; + BaseTLVType connectionIDtlvValue = new UIntType(connectionID); + elements.add(new StructElement(connectionIDFieldID, connectionIDtlvValue)); + + final long transportOptionsFieldID = 1L; + BaseTLVType transportOptionstlvValue = transportOptions.encodeTlv(); + elements.add(new StructElement(transportOptionsFieldID, transportOptionstlvValue)); + + StructType commandArgs = new StructType(elements); + invoke(new InvokeCallbackImpl(callback) { + @Override + public void onResponse(StructType invokeStructValue) { + callback.onSuccess(); + }}, commandId, commandArgs, timedInvokeTimeoutMs); + } + + public void setTransportStatus(DefaultClusterCallback callback, Integer connectionID, Integer transportStatus) { + setTransportStatus(callback, connectionID, transportStatus, 0); + } + + public void setTransportStatus(DefaultClusterCallback callback, Integer connectionID, Integer transportStatus, int timedInvokeTimeoutMs) { + final long commandId = 4L; + + ArrayList elements = new ArrayList<>(); + final long connectionIDFieldID = 0L; + BaseTLVType connectionIDtlvValue = new UIntType(connectionID); + elements.add(new StructElement(connectionIDFieldID, connectionIDtlvValue)); + + final long transportStatusFieldID = 1L; + BaseTLVType transportStatustlvValue = new UIntType(transportStatus); + elements.add(new StructElement(transportStatusFieldID, transportStatustlvValue)); + + StructType commandArgs = new StructType(elements); + invoke(new InvokeCallbackImpl(callback) { + @Override + public void onResponse(StructType invokeStructValue) { + callback.onSuccess(); + }}, commandId, commandArgs, timedInvokeTimeoutMs); + } + + public void manuallyTriggerTransport(DefaultClusterCallback callback, Integer connectionID, Integer activationReason, Optional timeControl) { + manuallyTriggerTransport(callback, connectionID, activationReason, timeControl, 0); + } + + public void manuallyTriggerTransport(DefaultClusterCallback callback, Integer connectionID, Integer activationReason, Optional timeControl, int timedInvokeTimeoutMs) { + final long commandId = 5L; + + ArrayList elements = new ArrayList<>(); + final long connectionIDFieldID = 0L; + BaseTLVType connectionIDtlvValue = new UIntType(connectionID); + elements.add(new StructElement(connectionIDFieldID, connectionIDtlvValue)); + + final long activationReasonFieldID = 1L; + BaseTLVType activationReasontlvValue = new UIntType(activationReason); + elements.add(new StructElement(activationReasonFieldID, activationReasontlvValue)); + + final long timeControlFieldID = 2L; + BaseTLVType timeControltlvValue = timeControl.map((nonOptionaltimeControl) -> nonOptionaltimeControl.encodeTlv()).orElse(new EmptyType()); + elements.add(new StructElement(timeControlFieldID, timeControltlvValue)); + + StructType commandArgs = new StructType(elements); + invoke(new InvokeCallbackImpl(callback) { + @Override + public void onResponse(StructType invokeStructValue) { + callback.onSuccess(); + }}, commandId, commandArgs, timedInvokeTimeoutMs); + } + + public void findTransport(FindTransportResponseCallback callback, @Nullable Optional connectionID) { + findTransport(callback, connectionID, 0); + } + + public void findTransport(FindTransportResponseCallback callback, @Nullable Optional connectionID, int timedInvokeTimeoutMs) { + final long commandId = 6L; + + ArrayList elements = new ArrayList<>(); + final long connectionIDFieldID = 0L; + BaseTLVType connectionIDtlvValue = connectionID != null ? connectionID.map((nonOptionalconnectionID) -> new UIntType(nonOptionalconnectionID)).orElse(new EmptyType()) : new NullType(); + elements.add(new StructElement(connectionIDFieldID, connectionIDtlvValue)); + + StructType commandArgs = new StructType(elements); + invoke(new InvokeCallbackImpl(callback) { + @Override + public void onResponse(StructType invokeStructValue) { + final long streamConfigurationsFieldID = 0L; + ArrayList streamConfigurations = null; + for (StructElement element: invokeStructValue.value()) { + if (element.contextTagNum() == streamConfigurationsFieldID) { + if (element.value(BaseTLVType.class).type() == TLVType.Array) { + ArrayType castingValue = element.value(ArrayType.class); + streamConfigurations = castingValue.map((elementcastingValue) -> ChipStructs.PushAvStreamTransportClusterTransportConfigurationStruct.decodeTlv(elementcastingValue)); + } + } + } + callback.onSuccess(streamConfigurations); + }}, commandId, commandArgs, timedInvokeTimeoutMs); + } + + public interface AllocatePushTransportResponseCallback extends BaseClusterCallback { + void onSuccess(Integer connectionID, ChipStructs.PushAvStreamTransportClusterTransportOptionsStruct transportOptions, Integer transportStatus); + } + + public interface FindTransportResponseCallback extends BaseClusterCallback { + void onSuccess(ArrayList streamConfigurations); + } + + public interface CurrentConnectionsAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); + } + + public interface GeneratedCommandListAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); + } + + public interface AcceptedCommandListAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); + } + + public interface EventListAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); + } + + public interface AttributeListAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); + } + + public void readSupportedContainerFormatsAttribute( + IntegerAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, SUPPORTED_CONTAINER_FORMATS_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, SUPPORTED_CONTAINER_FORMATS_ATTRIBUTE_ID, true); + } + + public void subscribeSupportedContainerFormatsAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, SUPPORTED_CONTAINER_FORMATS_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, SUPPORTED_CONTAINER_FORMATS_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readSupportedIngestMethodsAttribute( + IntegerAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, SUPPORTED_INGEST_METHODS_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, SUPPORTED_INGEST_METHODS_ATTRIBUTE_ID, true); + } + + public void subscribeSupportedIngestMethodsAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, SUPPORTED_INGEST_METHODS_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, SUPPORTED_INGEST_METHODS_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readCurrentConnectionsAttribute( + CurrentConnectionsAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, CURRENT_CONNECTIONS_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, CURRENT_CONNECTIONS_ATTRIBUTE_ID, true); + } + + public void subscribeCurrentConnectionsAttribute( + CurrentConnectionsAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, CURRENT_CONNECTIONS_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, CURRENT_CONNECTIONS_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readGeneratedCommandListAttribute( + GeneratedCommandListAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, GENERATED_COMMAND_LIST_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, GENERATED_COMMAND_LIST_ATTRIBUTE_ID, true); + } + + public void subscribeGeneratedCommandListAttribute( + GeneratedCommandListAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, GENERATED_COMMAND_LIST_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, GENERATED_COMMAND_LIST_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readAcceptedCommandListAttribute( + AcceptedCommandListAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID, true); + } + + public void subscribeAcceptedCommandListAttribute( + AcceptedCommandListAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readEventListAttribute( + EventListAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, EVENT_LIST_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, EVENT_LIST_ATTRIBUTE_ID, true); + } + + public void subscribeEventListAttribute( + EventListAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, EVENT_LIST_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, EVENT_LIST_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readAttributeListAttribute( + AttributeListAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ATTRIBUTE_LIST_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, ATTRIBUTE_LIST_ATTRIBUTE_ID, true); + } + + public void subscribeAttributeListAttribute( + AttributeListAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ATTRIBUTE_LIST_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, ATTRIBUTE_LIST_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readFeatureMapAttribute( + LongAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, FEATURE_MAP_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, FEATURE_MAP_ATTRIBUTE_ID, true); + } + + public void subscribeFeatureMapAttribute( + LongAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, FEATURE_MAP_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, FEATURE_MAP_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readClusterRevisionAttribute( + IntegerAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, CLUSTER_REVISION_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, CLUSTER_REVISION_ATTRIBUTE_ID, true); + } + + public void subscribeClusterRevisionAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, CLUSTER_REVISION_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, CLUSTER_REVISION_ATTRIBUTE_ID, minInterval, maxInterval); + } + } + public static class ChimeCluster extends BaseChipCluster { public static final long CLUSTER_ID = 1366L; diff --git a/src/controller/java/generated/java/chip/devicecontroller/ChipEventStructs.java b/src/controller/java/generated/java/chip/devicecontroller/ChipEventStructs.java index 59892d05188b8a..4f9e38dddf2c43 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ChipEventStructs.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ChipEventStructs.java @@ -6777,6 +6777,158 @@ public String toString() { return output.toString(); } } +public static class PushAvStreamTransportClusterPushTransportBeginEvent { + public Integer connectionID; + public Integer triggerType; + public Optional activationReason; + private static final long CONNECTION_ID_ID = 0L; + private static final long TRIGGER_TYPE_ID = 1L; + private static final long ACTIVATION_REASON_ID = 2L; + + public PushAvStreamTransportClusterPushTransportBeginEvent( + Integer connectionID, + Integer triggerType, + Optional activationReason + ) { + this.connectionID = connectionID; + this.triggerType = triggerType; + this.activationReason = activationReason; + } + + public StructType encodeTlv() { + ArrayList values = new ArrayList<>(); + values.add(new StructElement(CONNECTION_ID_ID, new UIntType(connectionID))); + values.add(new StructElement(TRIGGER_TYPE_ID, new UIntType(triggerType))); + values.add(new StructElement(ACTIVATION_REASON_ID, activationReason.map((nonOptionalactivationReason) -> new UIntType(nonOptionalactivationReason)).orElse(new EmptyType()))); + + return new StructType(values); + } + + public static PushAvStreamTransportClusterPushTransportBeginEvent decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + Integer connectionID = null; + Integer triggerType = null; + Optional activationReason = Optional.empty(); + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == CONNECTION_ID_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + connectionID = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == TRIGGER_TYPE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + triggerType = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == ACTIVATION_REASON_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + activationReason = Optional.of(castingValue.value(Integer.class)); + } + } + } + return new PushAvStreamTransportClusterPushTransportBeginEvent( + connectionID, + triggerType, + activationReason + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("PushAvStreamTransportClusterPushTransportBeginEvent {\n"); + output.append("\tconnectionID: "); + output.append(connectionID); + output.append("\n"); + output.append("\ttriggerType: "); + output.append(triggerType); + output.append("\n"); + output.append("\tactivationReason: "); + output.append(activationReason); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} +public static class PushAvStreamTransportClusterPushTransportEndEvent { + public Integer connectionID; + public Integer triggerType; + public Optional activationReason; + private static final long CONNECTION_ID_ID = 0L; + private static final long TRIGGER_TYPE_ID = 1L; + private static final long ACTIVATION_REASON_ID = 2L; + + public PushAvStreamTransportClusterPushTransportEndEvent( + Integer connectionID, + Integer triggerType, + Optional activationReason + ) { + this.connectionID = connectionID; + this.triggerType = triggerType; + this.activationReason = activationReason; + } + + public StructType encodeTlv() { + ArrayList values = new ArrayList<>(); + values.add(new StructElement(CONNECTION_ID_ID, new UIntType(connectionID))); + values.add(new StructElement(TRIGGER_TYPE_ID, new UIntType(triggerType))); + values.add(new StructElement(ACTIVATION_REASON_ID, activationReason.map((nonOptionalactivationReason) -> new UIntType(nonOptionalactivationReason)).orElse(new EmptyType()))); + + return new StructType(values); + } + + public static PushAvStreamTransportClusterPushTransportEndEvent decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + Integer connectionID = null; + Integer triggerType = null; + Optional activationReason = Optional.empty(); + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == CONNECTION_ID_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + connectionID = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == TRIGGER_TYPE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + triggerType = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == ACTIVATION_REASON_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + activationReason = Optional.of(castingValue.value(Integer.class)); + } + } + } + return new PushAvStreamTransportClusterPushTransportEndEvent( + connectionID, + triggerType, + activationReason + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("PushAvStreamTransportClusterPushTransportEndEvent {\n"); + output.append("\tconnectionID: "); + output.append(connectionID); + output.append("\n"); + output.append("\ttriggerType: "); + output.append(triggerType); + output.append("\n"); + output.append("\tactivationReason: "); + output.append(activationReason); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} public static class CommissionerControlClusterCommissioningRequestResultEvent { public Long requestID; public Long clientNodeID; diff --git a/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java b/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java index bbb319ba5334ab..f9f7a5b9b9042c 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java @@ -14556,6 +14556,734 @@ public String toString() { return output.toString(); } } +public static class PushAvStreamTransportClusterTransportMotionTriggerTimeControlStruct { + public Integer initialDuration; + public Integer augmentationDuration; + public Long maxDuration; + public Integer blindDuration; + private static final long INITIAL_DURATION_ID = 0L; + private static final long AUGMENTATION_DURATION_ID = 1L; + private static final long MAX_DURATION_ID = 2L; + private static final long BLIND_DURATION_ID = 3L; + + public PushAvStreamTransportClusterTransportMotionTriggerTimeControlStruct( + Integer initialDuration, + Integer augmentationDuration, + Long maxDuration, + Integer blindDuration + ) { + this.initialDuration = initialDuration; + this.augmentationDuration = augmentationDuration; + this.maxDuration = maxDuration; + this.blindDuration = blindDuration; + } + + public StructType encodeTlv() { + ArrayList values = new ArrayList<>(); + values.add(new StructElement(INITIAL_DURATION_ID, new UIntType(initialDuration))); + values.add(new StructElement(AUGMENTATION_DURATION_ID, new UIntType(augmentationDuration))); + values.add(new StructElement(MAX_DURATION_ID, new UIntType(maxDuration))); + values.add(new StructElement(BLIND_DURATION_ID, new UIntType(blindDuration))); + + return new StructType(values); + } + + public static PushAvStreamTransportClusterTransportMotionTriggerTimeControlStruct decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + Integer initialDuration = null; + Integer augmentationDuration = null; + Long maxDuration = null; + Integer blindDuration = null; + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == INITIAL_DURATION_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + initialDuration = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == AUGMENTATION_DURATION_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + augmentationDuration = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == MAX_DURATION_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + maxDuration = castingValue.value(Long.class); + } + } else if (element.contextTagNum() == BLIND_DURATION_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + blindDuration = castingValue.value(Integer.class); + } + } + } + return new PushAvStreamTransportClusterTransportMotionTriggerTimeControlStruct( + initialDuration, + augmentationDuration, + maxDuration, + blindDuration + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("PushAvStreamTransportClusterTransportMotionTriggerTimeControlStruct {\n"); + output.append("\tinitialDuration: "); + output.append(initialDuration); + output.append("\n"); + output.append("\taugmentationDuration: "); + output.append(augmentationDuration); + output.append("\n"); + output.append("\tmaxDuration: "); + output.append(maxDuration); + output.append("\n"); + output.append("\tblindDuration: "); + output.append(blindDuration); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} +public static class PushAvStreamTransportClusterTransportZoneOptionsStruct { + public @Nullable Integer zone; + public Optional sensitivity; + private static final long ZONE_ID = 1L; + private static final long SENSITIVITY_ID = 2L; + + public PushAvStreamTransportClusterTransportZoneOptionsStruct( + @Nullable Integer zone, + Optional sensitivity + ) { + this.zone = zone; + this.sensitivity = sensitivity; + } + + public StructType encodeTlv() { + ArrayList values = new ArrayList<>(); + values.add(new StructElement(ZONE_ID, zone != null ? new UIntType(zone) : new NullType())); + values.add(new StructElement(SENSITIVITY_ID, sensitivity.map((nonOptionalsensitivity) -> new UIntType(nonOptionalsensitivity)).orElse(new EmptyType()))); + + return new StructType(values); + } + + public static PushAvStreamTransportClusterTransportZoneOptionsStruct decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + @Nullable Integer zone = null; + Optional sensitivity = Optional.empty(); + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == ZONE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + zone = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == SENSITIVITY_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + sensitivity = Optional.of(castingValue.value(Integer.class)); + } + } + } + return new PushAvStreamTransportClusterTransportZoneOptionsStruct( + zone, + sensitivity + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("PushAvStreamTransportClusterTransportZoneOptionsStruct {\n"); + output.append("\tzone: "); + output.append(zone); + output.append("\n"); + output.append("\tsensitivity: "); + output.append(sensitivity); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} +public static class PushAvStreamTransportClusterMetadataOptionsStruct { + public Integer multiplexing; + public Boolean includeMotionZones; + public Boolean enableMetadataPrivacySensitive; + private static final long MULTIPLEXING_ID = 0L; + private static final long INCLUDE_MOTION_ZONES_ID = 1L; + private static final long ENABLE_METADATA_PRIVACY_SENSITIVE_ID = 2L; + + public PushAvStreamTransportClusterMetadataOptionsStruct( + Integer multiplexing, + Boolean includeMotionZones, + Boolean enableMetadataPrivacySensitive + ) { + this.multiplexing = multiplexing; + this.includeMotionZones = includeMotionZones; + this.enableMetadataPrivacySensitive = enableMetadataPrivacySensitive; + } + + public StructType encodeTlv() { + ArrayList values = new ArrayList<>(); + values.add(new StructElement(MULTIPLEXING_ID, new UIntType(multiplexing))); + values.add(new StructElement(INCLUDE_MOTION_ZONES_ID, new BooleanType(includeMotionZones))); + values.add(new StructElement(ENABLE_METADATA_PRIVACY_SENSITIVE_ID, new BooleanType(enableMetadataPrivacySensitive))); + + return new StructType(values); + } + + public static PushAvStreamTransportClusterMetadataOptionsStruct decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + Integer multiplexing = null; + Boolean includeMotionZones = null; + Boolean enableMetadataPrivacySensitive = null; + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == MULTIPLEXING_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + multiplexing = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == INCLUDE_MOTION_ZONES_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Boolean) { + BooleanType castingValue = element.value(BooleanType.class); + includeMotionZones = castingValue.value(Boolean.class); + } + } else if (element.contextTagNum() == ENABLE_METADATA_PRIVACY_SENSITIVE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Boolean) { + BooleanType castingValue = element.value(BooleanType.class); + enableMetadataPrivacySensitive = castingValue.value(Boolean.class); + } + } + } + return new PushAvStreamTransportClusterMetadataOptionsStruct( + multiplexing, + includeMotionZones, + enableMetadataPrivacySensitive + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("PushAvStreamTransportClusterMetadataOptionsStruct {\n"); + output.append("\tmultiplexing: "); + output.append(multiplexing); + output.append("\n"); + output.append("\tincludeMotionZones: "); + output.append(includeMotionZones); + output.append("\n"); + output.append("\tenableMetadataPrivacySensitive: "); + output.append(enableMetadataPrivacySensitive); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} +public static class PushAvStreamTransportClusterTransportTriggerOptionsStruct { + public Integer triggerType; + public @Nullable Optional> motionZones; + public @Nullable Optional motionSensitivity; + public Optional motionTimeControl; + public Optional maxPreRollLen; + private static final long TRIGGER_TYPE_ID = 0L; + private static final long MOTION_ZONES_ID = 1L; + private static final long MOTION_SENSITIVITY_ID = 2L; + private static final long MOTION_TIME_CONTROL_ID = 3L; + private static final long MAX_PRE_ROLL_LEN_ID = 4L; + + public PushAvStreamTransportClusterTransportTriggerOptionsStruct( + Integer triggerType, + @Nullable Optional> motionZones, + @Nullable Optional motionSensitivity, + Optional motionTimeControl, + Optional maxPreRollLen + ) { + this.triggerType = triggerType; + this.motionZones = motionZones; + this.motionSensitivity = motionSensitivity; + this.motionTimeControl = motionTimeControl; + this.maxPreRollLen = maxPreRollLen; + } + + public StructType encodeTlv() { + ArrayList values = new ArrayList<>(); + values.add(new StructElement(TRIGGER_TYPE_ID, new UIntType(triggerType))); + values.add(new StructElement(MOTION_ZONES_ID, motionZones != null ? motionZones.map((nonOptionalmotionZones) -> ArrayType.generateArrayType(nonOptionalmotionZones, (elementnonOptionalmotionZones) -> elementnonOptionalmotionZones.encodeTlv())).orElse(new EmptyType()) : new NullType())); + values.add(new StructElement(MOTION_SENSITIVITY_ID, motionSensitivity != null ? motionSensitivity.map((nonOptionalmotionSensitivity) -> new UIntType(nonOptionalmotionSensitivity)).orElse(new EmptyType()) : new NullType())); + values.add(new StructElement(MOTION_TIME_CONTROL_ID, motionTimeControl.map((nonOptionalmotionTimeControl) -> nonOptionalmotionTimeControl.encodeTlv()).orElse(new EmptyType()))); + values.add(new StructElement(MAX_PRE_ROLL_LEN_ID, maxPreRollLen.map((nonOptionalmaxPreRollLen) -> new UIntType(nonOptionalmaxPreRollLen)).orElse(new EmptyType()))); + + return new StructType(values); + } + + public static PushAvStreamTransportClusterTransportTriggerOptionsStruct decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + Integer triggerType = null; + @Nullable Optional> motionZones = null; + @Nullable Optional motionSensitivity = null; + Optional motionTimeControl = Optional.empty(); + Optional maxPreRollLen = Optional.empty(); + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == TRIGGER_TYPE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + triggerType = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == MOTION_ZONES_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Array) { + ArrayType castingValue = element.value(ArrayType.class); + motionZones = Optional.of(castingValue.map((elementcastingValue) -> ChipStructs.PushAvStreamTransportClusterTransportZoneOptionsStruct.decodeTlv(elementcastingValue))); + } + } else if (element.contextTagNum() == MOTION_SENSITIVITY_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + motionSensitivity = Optional.of(castingValue.value(Integer.class)); + } + } else if (element.contextTagNum() == MOTION_TIME_CONTROL_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Struct) { + StructType castingValue = element.value(StructType.class); + motionTimeControl = Optional.of(ChipStructs.PushAvStreamTransportClusterTransportMotionTriggerTimeControlStruct.decodeTlv(castingValue)); + } + } else if (element.contextTagNum() == MAX_PRE_ROLL_LEN_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + maxPreRollLen = Optional.of(castingValue.value(Integer.class)); + } + } + } + return new PushAvStreamTransportClusterTransportTriggerOptionsStruct( + triggerType, + motionZones, + motionSensitivity, + motionTimeControl, + maxPreRollLen + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("PushAvStreamTransportClusterTransportTriggerOptionsStruct {\n"); + output.append("\ttriggerType: "); + output.append(triggerType); + output.append("\n"); + output.append("\tmotionZones: "); + output.append(motionZones); + output.append("\n"); + output.append("\tmotionSensitivity: "); + output.append(motionSensitivity); + output.append("\n"); + output.append("\tmotionTimeControl: "); + output.append(motionTimeControl); + output.append("\n"); + output.append("\tmaxPreRollLen: "); + output.append(maxPreRollLen); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} +public static class PushAvStreamTransportClusterCMAFContainerOptionsStruct { + public Integer chunkDuration; + public Optional CENCKey; + private static final long CHUNK_DURATION_ID = 0L; + private static final long CENC_KEY_ID = 1L; + + public PushAvStreamTransportClusterCMAFContainerOptionsStruct( + Integer chunkDuration, + Optional CENCKey + ) { + this.chunkDuration = chunkDuration; + this.CENCKey = CENCKey; + } + + public StructType encodeTlv() { + ArrayList values = new ArrayList<>(); + values.add(new StructElement(CHUNK_DURATION_ID, new UIntType(chunkDuration))); + values.add(new StructElement(CENC_KEY_ID, CENCKey.map((nonOptionalCENCKey) -> new ByteArrayType(nonOptionalCENCKey)).orElse(new EmptyType()))); + + return new StructType(values); + } + + public static PushAvStreamTransportClusterCMAFContainerOptionsStruct decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + Integer chunkDuration = null; + Optional CENCKey = Optional.empty(); + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == CHUNK_DURATION_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + chunkDuration = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == CENC_KEY_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.ByteArray) { + ByteArrayType castingValue = element.value(ByteArrayType.class); + CENCKey = Optional.of(castingValue.value(byte[].class)); + } + } + } + return new PushAvStreamTransportClusterCMAFContainerOptionsStruct( + chunkDuration, + CENCKey + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("PushAvStreamTransportClusterCMAFContainerOptionsStruct {\n"); + output.append("\tchunkDuration: "); + output.append(chunkDuration); + output.append("\n"); + output.append("\tCENCKey: "); + output.append(CENCKey.isPresent() ? Arrays.toString(CENCKey.get()) : ""); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} +public static class PushAvStreamTransportClusterContainerOptionsStruct { + public Integer containerType; + public Optional CMAFContainerOptions; + private static final long CONTAINER_TYPE_ID = 0L; + private static final long CMAF_CONTAINER_OPTIONS_ID = 1L; + + public PushAvStreamTransportClusterContainerOptionsStruct( + Integer containerType, + Optional CMAFContainerOptions + ) { + this.containerType = containerType; + this.CMAFContainerOptions = CMAFContainerOptions; + } + + public StructType encodeTlv() { + ArrayList values = new ArrayList<>(); + values.add(new StructElement(CONTAINER_TYPE_ID, new UIntType(containerType))); + values.add(new StructElement(CMAF_CONTAINER_OPTIONS_ID, CMAFContainerOptions.map((nonOptionalCMAFContainerOptions) -> nonOptionalCMAFContainerOptions.encodeTlv()).orElse(new EmptyType()))); + + return new StructType(values); + } + + public static PushAvStreamTransportClusterContainerOptionsStruct decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + Integer containerType = null; + Optional CMAFContainerOptions = Optional.empty(); + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == CONTAINER_TYPE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + containerType = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == CMAF_CONTAINER_OPTIONS_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Struct) { + StructType castingValue = element.value(StructType.class); + CMAFContainerOptions = Optional.of(ChipStructs.PushAvStreamTransportClusterCMAFContainerOptionsStruct.decodeTlv(castingValue)); + } + } + } + return new PushAvStreamTransportClusterContainerOptionsStruct( + containerType, + CMAFContainerOptions + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("PushAvStreamTransportClusterContainerOptionsStruct {\n"); + output.append("\tcontainerType: "); + output.append(containerType); + output.append("\n"); + output.append("\tCMAFContainerOptions: "); + output.append(CMAFContainerOptions); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} +public static class PushAvStreamTransportClusterTransportOptionsStruct { + public Integer streamType; + public Optional videoStreamID; + public Optional audioStreamID; + public Integer endpointID; + public String url; + public ChipStructs.PushAvStreamTransportClusterTransportTriggerOptionsStruct triggerOptions; + public Integer ingestMethod; + public Integer containerFormat; + public ChipStructs.PushAvStreamTransportClusterContainerOptionsStruct containerOptions; + public Optional metadataOptions; + public Optional expiryTime; + private static final long STREAM_TYPE_ID = 0L; + private static final long VIDEO_STREAM_ID_ID = 1L; + private static final long AUDIO_STREAM_ID_ID = 2L; + private static final long ENDPOINT_ID_ID = 3L; + private static final long URL_ID = 4L; + private static final long TRIGGER_OPTIONS_ID = 5L; + private static final long INGEST_METHOD_ID = 6L; + private static final long CONTAINER_FORMAT_ID = 7L; + private static final long CONTAINER_OPTIONS_ID = 8L; + private static final long METADATA_OPTIONS_ID = 9L; + private static final long EXPIRY_TIME_ID = 10L; + + public PushAvStreamTransportClusterTransportOptionsStruct( + Integer streamType, + Optional videoStreamID, + Optional audioStreamID, + Integer endpointID, + String url, + ChipStructs.PushAvStreamTransportClusterTransportTriggerOptionsStruct triggerOptions, + Integer ingestMethod, + Integer containerFormat, + ChipStructs.PushAvStreamTransportClusterContainerOptionsStruct containerOptions, + Optional metadataOptions, + Optional expiryTime + ) { + this.streamType = streamType; + this.videoStreamID = videoStreamID; + this.audioStreamID = audioStreamID; + this.endpointID = endpointID; + this.url = url; + this.triggerOptions = triggerOptions; + this.ingestMethod = ingestMethod; + this.containerFormat = containerFormat; + this.containerOptions = containerOptions; + this.metadataOptions = metadataOptions; + this.expiryTime = expiryTime; + } + + public StructType encodeTlv() { + ArrayList values = new ArrayList<>(); + values.add(new StructElement(STREAM_TYPE_ID, new UIntType(streamType))); + values.add(new StructElement(VIDEO_STREAM_ID_ID, videoStreamID.map((nonOptionalvideoStreamID) -> new UIntType(nonOptionalvideoStreamID)).orElse(new EmptyType()))); + values.add(new StructElement(AUDIO_STREAM_ID_ID, audioStreamID.map((nonOptionalaudioStreamID) -> new UIntType(nonOptionalaudioStreamID)).orElse(new EmptyType()))); + values.add(new StructElement(ENDPOINT_ID_ID, new UIntType(endpointID))); + values.add(new StructElement(URL_ID, new StringType(url))); + values.add(new StructElement(TRIGGER_OPTIONS_ID, triggerOptions.encodeTlv())); + values.add(new StructElement(INGEST_METHOD_ID, new UIntType(ingestMethod))); + values.add(new StructElement(CONTAINER_FORMAT_ID, new UIntType(containerFormat))); + values.add(new StructElement(CONTAINER_OPTIONS_ID, containerOptions.encodeTlv())); + values.add(new StructElement(METADATA_OPTIONS_ID, metadataOptions.map((nonOptionalmetadataOptions) -> nonOptionalmetadataOptions.encodeTlv()).orElse(new EmptyType()))); + values.add(new StructElement(EXPIRY_TIME_ID, expiryTime.map((nonOptionalexpiryTime) -> new UIntType(nonOptionalexpiryTime)).orElse(new EmptyType()))); + + return new StructType(values); + } + + public static PushAvStreamTransportClusterTransportOptionsStruct decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + Integer streamType = null; + Optional videoStreamID = Optional.empty(); + Optional audioStreamID = Optional.empty(); + Integer endpointID = null; + String url = null; + ChipStructs.PushAvStreamTransportClusterTransportTriggerOptionsStruct triggerOptions = null; + Integer ingestMethod = null; + Integer containerFormat = null; + ChipStructs.PushAvStreamTransportClusterContainerOptionsStruct containerOptions = null; + Optional metadataOptions = Optional.empty(); + Optional expiryTime = Optional.empty(); + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == STREAM_TYPE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + streamType = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == VIDEO_STREAM_ID_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + videoStreamID = Optional.of(castingValue.value(Integer.class)); + } + } else if (element.contextTagNum() == AUDIO_STREAM_ID_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + audioStreamID = Optional.of(castingValue.value(Integer.class)); + } + } else if (element.contextTagNum() == ENDPOINT_ID_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + endpointID = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == URL_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.String) { + StringType castingValue = element.value(StringType.class); + url = castingValue.value(String.class); + } + } else if (element.contextTagNum() == TRIGGER_OPTIONS_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Struct) { + StructType castingValue = element.value(StructType.class); + triggerOptions = ChipStructs.PushAvStreamTransportClusterTransportTriggerOptionsStruct.decodeTlv(castingValue); + } + } else if (element.contextTagNum() == INGEST_METHOD_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + ingestMethod = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == CONTAINER_FORMAT_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + containerFormat = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == CONTAINER_OPTIONS_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Struct) { + StructType castingValue = element.value(StructType.class); + containerOptions = ChipStructs.PushAvStreamTransportClusterContainerOptionsStruct.decodeTlv(castingValue); + } + } else if (element.contextTagNum() == METADATA_OPTIONS_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Struct) { + StructType castingValue = element.value(StructType.class); + metadataOptions = Optional.of(ChipStructs.PushAvStreamTransportClusterMetadataOptionsStruct.decodeTlv(castingValue)); + } + } else if (element.contextTagNum() == EXPIRY_TIME_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + expiryTime = Optional.of(castingValue.value(Long.class)); + } + } + } + return new PushAvStreamTransportClusterTransportOptionsStruct( + streamType, + videoStreamID, + audioStreamID, + endpointID, + url, + triggerOptions, + ingestMethod, + containerFormat, + containerOptions, + metadataOptions, + expiryTime + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("PushAvStreamTransportClusterTransportOptionsStruct {\n"); + output.append("\tstreamType: "); + output.append(streamType); + output.append("\n"); + output.append("\tvideoStreamID: "); + output.append(videoStreamID); + output.append("\n"); + output.append("\taudioStreamID: "); + output.append(audioStreamID); + output.append("\n"); + output.append("\tendpointID: "); + output.append(endpointID); + output.append("\n"); + output.append("\turl: "); + output.append(url); + output.append("\n"); + output.append("\ttriggerOptions: "); + output.append(triggerOptions); + output.append("\n"); + output.append("\tingestMethod: "); + output.append(ingestMethod); + output.append("\n"); + output.append("\tcontainerFormat: "); + output.append(containerFormat); + output.append("\n"); + output.append("\tcontainerOptions: "); + output.append(containerOptions); + output.append("\n"); + output.append("\tmetadataOptions: "); + output.append(metadataOptions); + output.append("\n"); + output.append("\texpiryTime: "); + output.append(expiryTime); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} +public static class PushAvStreamTransportClusterTransportConfigurationStruct { + public Integer connectionID; + public Integer transportStatus; + public ChipStructs.PushAvStreamTransportClusterTransportOptionsStruct transportOptions; + private static final long CONNECTION_ID_ID = 0L; + private static final long TRANSPORT_STATUS_ID = 1L; + private static final long TRANSPORT_OPTIONS_ID = 2L; + + public PushAvStreamTransportClusterTransportConfigurationStruct( + Integer connectionID, + Integer transportStatus, + ChipStructs.PushAvStreamTransportClusterTransportOptionsStruct transportOptions + ) { + this.connectionID = connectionID; + this.transportStatus = transportStatus; + this.transportOptions = transportOptions; + } + + public StructType encodeTlv() { + ArrayList values = new ArrayList<>(); + values.add(new StructElement(CONNECTION_ID_ID, new UIntType(connectionID))); + values.add(new StructElement(TRANSPORT_STATUS_ID, new UIntType(transportStatus))); + values.add(new StructElement(TRANSPORT_OPTIONS_ID, transportOptions.encodeTlv())); + + return new StructType(values); + } + + public static PushAvStreamTransportClusterTransportConfigurationStruct decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + Integer connectionID = null; + Integer transportStatus = null; + ChipStructs.PushAvStreamTransportClusterTransportOptionsStruct transportOptions = null; + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == CONNECTION_ID_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + connectionID = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == TRANSPORT_STATUS_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + transportStatus = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == TRANSPORT_OPTIONS_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Struct) { + StructType castingValue = element.value(StructType.class); + transportOptions = ChipStructs.PushAvStreamTransportClusterTransportOptionsStruct.decodeTlv(castingValue); + } + } + } + return new PushAvStreamTransportClusterTransportConfigurationStruct( + connectionID, + transportStatus, + transportOptions + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("PushAvStreamTransportClusterTransportConfigurationStruct {\n"); + output.append("\tconnectionID: "); + output.append(connectionID); + output.append("\n"); + output.append("\ttransportStatus: "); + output.append(transportStatus); + output.append("\n"); + output.append("\ttransportOptions: "); + output.append(transportOptions); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} public static class ChimeClusterChimeSoundStruct { public Integer chimeID; public String name; diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java index 86a43781fec889..1b8069862c3aa5 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java @@ -391,6 +391,9 @@ public static BaseCluster getCluster(long clusterId) { if (clusterId == WebRTCTransportRequestor.ID) { return new WebRTCTransportRequestor(); } + if (clusterId == PushAvStreamTransport.ID) { + return new PushAvStreamTransport(); + } if (clusterId == Chime.ID) { return new Chime(); } @@ -17736,6 +17739,219 @@ public long getCommandID(String name) throws IllegalArgumentException { return Command.valueOf(name).getID(); } } + public static class PushAvStreamTransport implements BaseCluster { + public static final long ID = 1365L; + public long getID() { + return ID; + } + + public enum Attribute { + SupportedContainerFormats(0L), + SupportedIngestMethods(1L), + CurrentConnections(2L), + GeneratedCommandList(65528L), + AcceptedCommandList(65529L), + EventList(65530L), + AttributeList(65531L), + FeatureMap(65532L), + ClusterRevision(65533L),; + private final long id; + Attribute(long id) { + this.id = id; + } + + public long getID() { + return id; + } + + public static Attribute value(long id) throws NoSuchFieldError { + for (Attribute attribute : Attribute.values()) { + if (attribute.getID() == id) { + return attribute; + } + } + throw new NoSuchFieldError(); + } + } + + public enum Event { + PushTransportBegin(0L), + PushTransportEnd(1L),; + private final long id; + Event(long id) { + this.id = id; + } + + public long getID() { + return id; + } + + public static Event value(long id) throws NoSuchFieldError { + for (Event event : Event.values()) { + if (event.getID() == id) { + return event; + } + } + throw new NoSuchFieldError(); + } + } + + public enum Command { + AllocatePushTransport(0L), + DeallocatePushTransport(2L), + ModifyPushTransport(3L), + SetTransportStatus(4L), + ManuallyTriggerTransport(5L), + FindTransport(6L),; + private final long id; + Command(long id) { + this.id = id; + } + + public long getID() { + return id; + } + + public static Command value(long id) throws NoSuchFieldError { + for (Command command : Command.values()) { + if (command.getID() == id) { + return command; + } + } + throw new NoSuchFieldError(); + } + }public enum AllocatePushTransportCommandField {TransportOptions(0),; + private final int id; + AllocatePushTransportCommandField(int id) { + this.id = id; + } + + public int getID() { + return id; + } + public static AllocatePushTransportCommandField value(int id) throws NoSuchFieldError { + for (AllocatePushTransportCommandField field : AllocatePushTransportCommandField.values()) { + if (field.getID() == id) { + return field; + } + } + throw new NoSuchFieldError(); + } + }public enum DeallocatePushTransportCommandField {ConnectionID(0),; + private final int id; + DeallocatePushTransportCommandField(int id) { + this.id = id; + } + + public int getID() { + return id; + } + public static DeallocatePushTransportCommandField value(int id) throws NoSuchFieldError { + for (DeallocatePushTransportCommandField field : DeallocatePushTransportCommandField.values()) { + if (field.getID() == id) { + return field; + } + } + throw new NoSuchFieldError(); + } + }public enum ModifyPushTransportCommandField {ConnectionID(0),TransportOptions(1),; + private final int id; + ModifyPushTransportCommandField(int id) { + this.id = id; + } + + public int getID() { + return id; + } + public static ModifyPushTransportCommandField value(int id) throws NoSuchFieldError { + for (ModifyPushTransportCommandField field : ModifyPushTransportCommandField.values()) { + if (field.getID() == id) { + return field; + } + } + throw new NoSuchFieldError(); + } + }public enum SetTransportStatusCommandField {ConnectionID(0),TransportStatus(1),; + private final int id; + SetTransportStatusCommandField(int id) { + this.id = id; + } + + public int getID() { + return id; + } + public static SetTransportStatusCommandField value(int id) throws NoSuchFieldError { + for (SetTransportStatusCommandField field : SetTransportStatusCommandField.values()) { + if (field.getID() == id) { + return field; + } + } + throw new NoSuchFieldError(); + } + }public enum ManuallyTriggerTransportCommandField {ConnectionID(0),ActivationReason(1),TimeControl(2),; + private final int id; + ManuallyTriggerTransportCommandField(int id) { + this.id = id; + } + + public int getID() { + return id; + } + public static ManuallyTriggerTransportCommandField value(int id) throws NoSuchFieldError { + for (ManuallyTriggerTransportCommandField field : ManuallyTriggerTransportCommandField.values()) { + if (field.getID() == id) { + return field; + } + } + throw new NoSuchFieldError(); + } + }public enum FindTransportCommandField {ConnectionID(0),; + private final int id; + FindTransportCommandField(int id) { + this.id = id; + } + + public int getID() { + return id; + } + public static FindTransportCommandField value(int id) throws NoSuchFieldError { + for (FindTransportCommandField field : FindTransportCommandField.values()) { + if (field.getID() == id) { + return field; + } + } + throw new NoSuchFieldError(); + } + }@Override + public String getAttributeName(long id) throws NoSuchFieldError { + return Attribute.value(id).toString(); + } + + @Override + public String getEventName(long id) throws NoSuchFieldError { + return Event.value(id).toString(); + } + + @Override + public String getCommandName(long id) throws NoSuchFieldError { + return Command.value(id).toString(); + } + + @Override + public long getAttributeID(String name) throws IllegalArgumentException { + return Attribute.valueOf(name).getID(); + } + + @Override + public long getEventID(String name) throws IllegalArgumentException { + return Event.valueOf(name).getID(); + } + + @Override + public long getCommandID(String name) throws IllegalArgumentException { + return Command.valueOf(name).getID(); + } + } public static class Chime implements BaseCluster { public static final long ID = 1366L; public long getID() { diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java index 42e96815ef9b43..78ea354adc9d7e 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java @@ -20726,6 +20726,160 @@ public void onError(Exception ex) { } } + + public static class DelegatedPushAvStreamTransportClusterAllocatePushTransportResponseCallback implements ChipClusters.PushAvStreamTransportCluster.AllocatePushTransportResponseCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(Integer connectionID, ChipStructs.PushAvStreamTransportClusterTransportOptionsStruct transportOptions, Integer transportStatus) { + Map responseValues = new LinkedHashMap<>(); + + CommandResponseInfo connectionIDResponseValue = new CommandResponseInfo("connectionID", "Integer"); + responseValues.put(connectionIDResponseValue, connectionID); + // transportOptions: Struct TransportOptionsStruct + // Conversion from this type to Java is not properly implemented yet + CommandResponseInfo transportStatusResponseValue = new CommandResponseInfo("transportStatus", "Integer"); + responseValues.put(transportStatusResponseValue, transportStatus); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception error) { + callback.onFailure(error); + } + } + + public static class DelegatedPushAvStreamTransportClusterFindTransportResponseCallback implements ChipClusters.PushAvStreamTransportCluster.FindTransportResponseCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(ArrayList streamConfigurations) { + Map responseValues = new LinkedHashMap<>(); + + // streamConfigurations: TransportConfigurationStruct + // Conversion from this type to Java is not properly implemented yet + + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception error) { + callback.onFailure(error); + } + } + public static class DelegatedPushAvStreamTransportClusterCurrentConnectionsAttributeCallback implements ChipClusters.PushAvStreamTransportCluster.CurrentConnectionsAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedPushAvStreamTransportClusterGeneratedCommandListAttributeCallback implements ChipClusters.PushAvStreamTransportCluster.GeneratedCommandListAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedPushAvStreamTransportClusterAcceptedCommandListAttributeCallback implements ChipClusters.PushAvStreamTransportCluster.AcceptedCommandListAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedPushAvStreamTransportClusterEventListAttributeCallback implements ChipClusters.PushAvStreamTransportCluster.EventListAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedPushAvStreamTransportClusterAttributeListAttributeCallback implements ChipClusters.PushAvStreamTransportCluster.AttributeListAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + public static class DelegatedChimeClusterInstalledChimeSoundsAttributeCallback implements ChipClusters.ChimeCluster.InstalledChimeSoundsAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override @@ -23183,6 +23337,10 @@ public Map initializeClusterMap() { (ptr, endpointId) -> new ChipClusters.WebRTCTransportRequestorCluster(ptr, endpointId), new HashMap<>()); clusterMap.put("webRTCTransportRequestor", webRTCTransportRequestorClusterInfo); + ClusterInfo pushAvStreamTransportClusterInfo = new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.PushAvStreamTransportCluster(ptr, endpointId), new HashMap<>()); + clusterMap.put("pushAvStreamTransport", pushAvStreamTransportClusterInfo); + ClusterInfo chimeClusterInfo = new ClusterInfo( (ptr, endpointId) -> new ChipClusters.ChimeCluster(ptr, endpointId), new HashMap<>()); clusterMap.put("chime", chimeClusterInfo); @@ -23332,6 +23490,7 @@ public void combineCommand(Map destination, Map> getCommandMap() { commandMap.put("webRTCTransportRequestor", webRTCTransportRequestorClusterInteractionInfoMap); + Map pushAvStreamTransportClusterInteractionInfoMap = new LinkedHashMap<>(); + + Map pushAvStreamTransportallocatePushTransportCommandParams = new LinkedHashMap(); + + InteractionInfo pushAvStreamTransportallocatePushTransportInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.PushAvStreamTransportCluster) cluster) + .allocatePushTransport((ChipClusters.PushAvStreamTransportCluster.AllocatePushTransportResponseCallback) callback + , (ChipStructs.PushAvStreamTransportClusterTransportOptionsStruct) + commandArguments.get("transportOptions") + + ); + }, + () -> new DelegatedPushAvStreamTransportClusterAllocatePushTransportResponseCallback(), + pushAvStreamTransportallocatePushTransportCommandParams + ); + pushAvStreamTransportClusterInteractionInfoMap.put("allocatePushTransport", pushAvStreamTransportallocatePushTransportInteractionInfo); + + Map pushAvStreamTransportdeallocatePushTransportCommandParams = new LinkedHashMap(); + + CommandParameterInfo pushAvStreamTransportdeallocatePushTransportconnectionIDCommandParameterInfo = new CommandParameterInfo("connectionID", Integer.class, Integer.class); + pushAvStreamTransportdeallocatePushTransportCommandParams.put("connectionID",pushAvStreamTransportdeallocatePushTransportconnectionIDCommandParameterInfo); + InteractionInfo pushAvStreamTransportdeallocatePushTransportInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.PushAvStreamTransportCluster) cluster) + .deallocatePushTransport((DefaultClusterCallback) callback + , (Integer) + commandArguments.get("connectionID") + ); + }, + () -> new DelegatedDefaultClusterCallback(), + pushAvStreamTransportdeallocatePushTransportCommandParams + ); + pushAvStreamTransportClusterInteractionInfoMap.put("deallocatePushTransport", pushAvStreamTransportdeallocatePushTransportInteractionInfo); + + Map pushAvStreamTransportmodifyPushTransportCommandParams = new LinkedHashMap(); + + CommandParameterInfo pushAvStreamTransportmodifyPushTransportconnectionIDCommandParameterInfo = new CommandParameterInfo("connectionID", Integer.class, Integer.class); + pushAvStreamTransportmodifyPushTransportCommandParams.put("connectionID",pushAvStreamTransportmodifyPushTransportconnectionIDCommandParameterInfo); + + InteractionInfo pushAvStreamTransportmodifyPushTransportInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.PushAvStreamTransportCluster) cluster) + .modifyPushTransport((DefaultClusterCallback) callback + , (Integer) + commandArguments.get("connectionID") + , (ChipStructs.PushAvStreamTransportClusterTransportOptionsStruct) + commandArguments.get("transportOptions") + ); + }, + () -> new DelegatedDefaultClusterCallback(), + pushAvStreamTransportmodifyPushTransportCommandParams + ); + pushAvStreamTransportClusterInteractionInfoMap.put("modifyPushTransport", pushAvStreamTransportmodifyPushTransportInteractionInfo); + + Map pushAvStreamTransportsetTransportStatusCommandParams = new LinkedHashMap(); + + CommandParameterInfo pushAvStreamTransportsetTransportStatusconnectionIDCommandParameterInfo = new CommandParameterInfo("connectionID", Integer.class, Integer.class); + pushAvStreamTransportsetTransportStatusCommandParams.put("connectionID",pushAvStreamTransportsetTransportStatusconnectionIDCommandParameterInfo); + + CommandParameterInfo pushAvStreamTransportsetTransportStatustransportStatusCommandParameterInfo = new CommandParameterInfo("transportStatus", Integer.class, Integer.class); + pushAvStreamTransportsetTransportStatusCommandParams.put("transportStatus",pushAvStreamTransportsetTransportStatustransportStatusCommandParameterInfo); + InteractionInfo pushAvStreamTransportsetTransportStatusInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.PushAvStreamTransportCluster) cluster) + .setTransportStatus((DefaultClusterCallback) callback + , (Integer) + commandArguments.get("connectionID") + , (Integer) + commandArguments.get("transportStatus") + ); + }, + () -> new DelegatedDefaultClusterCallback(), + pushAvStreamTransportsetTransportStatusCommandParams + ); + pushAvStreamTransportClusterInteractionInfoMap.put("setTransportStatus", pushAvStreamTransportsetTransportStatusInteractionInfo); + + Map pushAvStreamTransportmanuallyTriggerTransportCommandParams = new LinkedHashMap(); + + CommandParameterInfo pushAvStreamTransportmanuallyTriggerTransportconnectionIDCommandParameterInfo = new CommandParameterInfo("connectionID", Integer.class, Integer.class); + pushAvStreamTransportmanuallyTriggerTransportCommandParams.put("connectionID",pushAvStreamTransportmanuallyTriggerTransportconnectionIDCommandParameterInfo); + + CommandParameterInfo pushAvStreamTransportmanuallyTriggerTransportactivationReasonCommandParameterInfo = new CommandParameterInfo("activationReason", Integer.class, Integer.class); + pushAvStreamTransportmanuallyTriggerTransportCommandParams.put("activationReason",pushAvStreamTransportmanuallyTriggerTransportactivationReasonCommandParameterInfo); + + InteractionInfo pushAvStreamTransportmanuallyTriggerTransportInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.PushAvStreamTransportCluster) cluster) + .manuallyTriggerTransport((DefaultClusterCallback) callback + , (Integer) + commandArguments.get("connectionID") + , (Integer) + commandArguments.get("activationReason") + , (Optional) + commandArguments.get("timeControl") + ); + }, + () -> new DelegatedDefaultClusterCallback(), + pushAvStreamTransportmanuallyTriggerTransportCommandParams + ); + pushAvStreamTransportClusterInteractionInfoMap.put("manuallyTriggerTransport", pushAvStreamTransportmanuallyTriggerTransportInteractionInfo); + + Map pushAvStreamTransportfindTransportCommandParams = new LinkedHashMap(); + + CommandParameterInfo pushAvStreamTransportfindTransportconnectionIDCommandParameterInfo = new CommandParameterInfo("connectionID", Optional.class, Integer.class); + pushAvStreamTransportfindTransportCommandParams.put("connectionID",pushAvStreamTransportfindTransportconnectionIDCommandParameterInfo); + InteractionInfo pushAvStreamTransportfindTransportInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.PushAvStreamTransportCluster) cluster) + .findTransport((ChipClusters.PushAvStreamTransportCluster.FindTransportResponseCallback) callback + , (Optional) + commandArguments.get("connectionID") + + ); + }, + () -> new DelegatedPushAvStreamTransportClusterFindTransportResponseCallback(), + pushAvStreamTransportfindTransportCommandParams + ); + pushAvStreamTransportClusterInteractionInfoMap.put("findTransport", pushAvStreamTransportfindTransportInteractionInfo); + + commandMap.put("pushAvStreamTransport", pushAvStreamTransportClusterInteractionInfoMap); + Map chimeClusterInteractionInfoMap = new LinkedHashMap<>(); Map chimeplayChimeSoundCommandParams = new LinkedHashMap(); diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java index 85d8c246765215..5ff32bbdc9c2d4 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java @@ -18923,6 +18923,109 @@ private static Map readWebRTCTransportRequestorInteract return result; } + private static Map readPushAvStreamTransportInteractionInfo() { + Map result = new LinkedHashMap<>();Map readPushAvStreamTransportSupportedContainerFormatsCommandParams = new LinkedHashMap(); + InteractionInfo readPushAvStreamTransportSupportedContainerFormatsAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.PushAvStreamTransportCluster) cluster).readSupportedContainerFormatsAttribute( + (ChipClusters.IntegerAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readPushAvStreamTransportSupportedContainerFormatsCommandParams + ); + result.put("readSupportedContainerFormatsAttribute", readPushAvStreamTransportSupportedContainerFormatsAttributeInteractionInfo); + Map readPushAvStreamTransportSupportedIngestMethodsCommandParams = new LinkedHashMap(); + InteractionInfo readPushAvStreamTransportSupportedIngestMethodsAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.PushAvStreamTransportCluster) cluster).readSupportedIngestMethodsAttribute( + (ChipClusters.IntegerAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readPushAvStreamTransportSupportedIngestMethodsCommandParams + ); + result.put("readSupportedIngestMethodsAttribute", readPushAvStreamTransportSupportedIngestMethodsAttributeInteractionInfo); + Map readPushAvStreamTransportCurrentConnectionsCommandParams = new LinkedHashMap(); + InteractionInfo readPushAvStreamTransportCurrentConnectionsAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.PushAvStreamTransportCluster) cluster).readCurrentConnectionsAttribute( + (ChipClusters.PushAvStreamTransportCluster.CurrentConnectionsAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedPushAvStreamTransportClusterCurrentConnectionsAttributeCallback(), + readPushAvStreamTransportCurrentConnectionsCommandParams + ); + result.put("readCurrentConnectionsAttribute", readPushAvStreamTransportCurrentConnectionsAttributeInteractionInfo); + Map readPushAvStreamTransportGeneratedCommandListCommandParams = new LinkedHashMap(); + InteractionInfo readPushAvStreamTransportGeneratedCommandListAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.PushAvStreamTransportCluster) cluster).readGeneratedCommandListAttribute( + (ChipClusters.PushAvStreamTransportCluster.GeneratedCommandListAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedPushAvStreamTransportClusterGeneratedCommandListAttributeCallback(), + readPushAvStreamTransportGeneratedCommandListCommandParams + ); + result.put("readGeneratedCommandListAttribute", readPushAvStreamTransportGeneratedCommandListAttributeInteractionInfo); + Map readPushAvStreamTransportAcceptedCommandListCommandParams = new LinkedHashMap(); + InteractionInfo readPushAvStreamTransportAcceptedCommandListAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.PushAvStreamTransportCluster) cluster).readAcceptedCommandListAttribute( + (ChipClusters.PushAvStreamTransportCluster.AcceptedCommandListAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedPushAvStreamTransportClusterAcceptedCommandListAttributeCallback(), + readPushAvStreamTransportAcceptedCommandListCommandParams + ); + result.put("readAcceptedCommandListAttribute", readPushAvStreamTransportAcceptedCommandListAttributeInteractionInfo); + Map readPushAvStreamTransportEventListCommandParams = new LinkedHashMap(); + InteractionInfo readPushAvStreamTransportEventListAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.PushAvStreamTransportCluster) cluster).readEventListAttribute( + (ChipClusters.PushAvStreamTransportCluster.EventListAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedPushAvStreamTransportClusterEventListAttributeCallback(), + readPushAvStreamTransportEventListCommandParams + ); + result.put("readEventListAttribute", readPushAvStreamTransportEventListAttributeInteractionInfo); + Map readPushAvStreamTransportAttributeListCommandParams = new LinkedHashMap(); + InteractionInfo readPushAvStreamTransportAttributeListAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.PushAvStreamTransportCluster) cluster).readAttributeListAttribute( + (ChipClusters.PushAvStreamTransportCluster.AttributeListAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedPushAvStreamTransportClusterAttributeListAttributeCallback(), + readPushAvStreamTransportAttributeListCommandParams + ); + result.put("readAttributeListAttribute", readPushAvStreamTransportAttributeListAttributeInteractionInfo); + Map readPushAvStreamTransportFeatureMapCommandParams = new LinkedHashMap(); + InteractionInfo readPushAvStreamTransportFeatureMapAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.PushAvStreamTransportCluster) cluster).readFeatureMapAttribute( + (ChipClusters.LongAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readPushAvStreamTransportFeatureMapCommandParams + ); + result.put("readFeatureMapAttribute", readPushAvStreamTransportFeatureMapAttributeInteractionInfo); + Map readPushAvStreamTransportClusterRevisionCommandParams = new LinkedHashMap(); + InteractionInfo readPushAvStreamTransportClusterRevisionAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.PushAvStreamTransportCluster) cluster).readClusterRevisionAttribute( + (ChipClusters.IntegerAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readPushAvStreamTransportClusterRevisionCommandParams + ); + result.put("readClusterRevisionAttribute", readPushAvStreamTransportClusterRevisionAttributeInteractionInfo); + + return result; + } private static Map readChimeInteractionInfo() { Map result = new LinkedHashMap<>();Map readChimeInstalledChimeSoundsCommandParams = new LinkedHashMap(); InteractionInfo readChimeInstalledChimeSoundsAttributeInteractionInfo = new InteractionInfo( @@ -20480,6 +20583,7 @@ public Map> getReadAttributeMap() { put("cameraAvStreamManagement", readCameraAvStreamManagementInteractionInfo()); put("webRTCTransportProvider", readWebRTCTransportProviderInteractionInfo()); put("webRTCTransportRequestor", readWebRTCTransportRequestorInteractionInfo()); + put("pushAvStreamTransport", readPushAvStreamTransportInteractionInfo()); put("chime", readChimeInteractionInfo()); put("ecosystemInformation", readEcosystemInformationInteractionInfo()); put("commissionerControl", readCommissionerControlInteractionInfo()); diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java index 68d1f3792157cc..264a13a2cda0c8 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java @@ -3744,6 +3744,8 @@ public Map> getWriteAttributeMap() { writeAttributeMap.put("webRTCTransportProvider", writeWebRTCTransportProviderInteractionInfo); Map writeWebRTCTransportRequestorInteractionInfo = new LinkedHashMap<>(); writeAttributeMap.put("webRTCTransportRequestor", writeWebRTCTransportRequestorInteractionInfo); + Map writePushAvStreamTransportInteractionInfo = new LinkedHashMap<>(); + writeAttributeMap.put("pushAvStreamTransport", writePushAvStreamTransportInteractionInfo); Map writeChimeInteractionInfo = new LinkedHashMap<>(); Map writeChimeActiveChimeIDCommandParams = new LinkedHashMap(); CommandParameterInfo chimeactiveChimeIDCommandParameterInfo = 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/eventstructs/PushAvStreamTransportClusterPushTransportEndEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/PushAvStreamTransportClusterPushTransportEndEvent.kt new file mode 100644 index 00000000000000..641a39364a04df --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/PushAvStreamTransportClusterPushTransportEndEvent.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 PushAvStreamTransportClusterPushTransportEndEvent( + val connectionID: UInt, + val triggerType: UInt, + val activationReason: Optional, +) { + override fun toString(): String = buildString { + append("PushAvStreamTransportClusterPushTransportEndEvent {\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, + ): PushAvStreamTransportClusterPushTransportEndEvent { + 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 PushAvStreamTransportClusterPushTransportEndEvent( + connectionID, + triggerType, + activationReason, + ) + } + } +} diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/files.gni b/src/controller/java/generated/java/chip/devicecontroller/cluster/files.gni index a4fcda9f9bfcc0..b1b0a5cbd6acbe 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/files.gni +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/files.gni @@ -122,6 +122,14 @@ structs_sources = [ "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/PowerSourceClusterBatChargeFaultChangeType.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/PowerSourceClusterBatFaultChangeType.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/PowerSourceClusterWiredFaultChangeType.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/PushAvStreamTransportClusterCMAFContainerOptionsStruct.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/PushAvStreamTransportClusterContainerOptionsStruct.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/PushAvStreamTransportClusterMetadataOptionsStruct.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/PushAvStreamTransportClusterTransportConfigurationStruct.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/PushAvStreamTransportClusterTransportMotionTriggerTimeControlStruct.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/PushAvStreamTransportClusterTransportOptionsStruct.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/PushAvStreamTransportClusterTransportTriggerOptionsStruct.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/PushAvStreamTransportClusterTransportZoneOptionsStruct.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/RefrigeratorAndTemperatureControlledCabinetModeClusterModeOptionStruct.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/RefrigeratorAndTemperatureControlledCabinetModeClusterModeTagStruct.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/RvcCleanModeClusterModeOptionStruct.kt", @@ -236,6 +244,8 @@ eventstructs_sources = [ "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/PowerSourceClusterBatChargeFaultChangeEvent.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/PowerSourceClusterBatFaultChangeEvent.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/PowerSourceClusterWiredFaultChangeEvent.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/PushAvStreamTransportClusterPushTransportBeginEvent.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/PushAvStreamTransportClusterPushTransportEndEvent.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/RefrigeratorAlarmClusterNotifyEvent.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/RvcOperationalStateClusterOperationalErrorEvent.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/RvcOperationalStateClusterOperationCompletionEvent.kt", 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..0294da99b76ad4 --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/PushAvStreamTransportClusterCMAFContainerOptionsStruct.kt @@ -0,0 +1,71 @@ +/* + * + * 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.isPresent) { + val optCENCKey = CENCKey.get() + put(ContextSpecificTag(TAG_CENC_KEY), optCENCKey) + } + 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.isNextTag(ContextSpecificTag(TAG_CENC_KEY))) { + Optional.of(tlvReader.getByteArray(ContextSpecificTag(TAG_CENC_KEY))) + } else { + Optional.empty() + } + + 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..c8703c5b1360ff --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/PushAvStreamTransportClusterContainerOptionsStruct.kt @@ -0,0 +1,76 @@ +/* + * + * 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.isPresent) { + val optCMAFContainerOptions = CMAFContainerOptions.get() + optCMAFContainerOptions.toTlv(ContextSpecificTag(TAG_CMAF_CONTAINER_OPTIONS), this) + } + 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.isNextTag(ContextSpecificTag(TAG_CMAF_CONTAINER_OPTIONS))) { + Optional.of( + PushAvStreamTransportClusterCMAFContainerOptionsStruct.fromTlv( + ContextSpecificTag(TAG_CMAF_CONTAINER_OPTIONS), + tlvReader, + ) + ) + } else { + Optional.empty() + } + + 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..3ab9c9e3daad60 --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/PushAvStreamTransportClusterTransportOptionsStruct.kt @@ -0,0 +1,165 @@ +/* + * + * 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.isPresent) { + val optmetadataOptions = metadataOptions.get() + optmetadataOptions.toTlv(ContextSpecificTag(TAG_METADATA_OPTIONS), this) + } + if (expiryTime.isPresent) { + val optexpiryTime = expiryTime.get() + put(ContextSpecificTag(TAG_EXPIRY_TIME), optexpiryTime) + } + 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.isNextTag(ContextSpecificTag(TAG_METADATA_OPTIONS))) { + Optional.of( + PushAvStreamTransportClusterMetadataOptionsStruct.fromTlv( + ContextSpecificTag(TAG_METADATA_OPTIONS), + tlvReader, + ) + ) + } else { + Optional.empty() + } + val expiryTime = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_EXPIRY_TIME))) { + Optional.of(tlvReader.getULong(ContextSpecificTag(TAG_EXPIRY_TIME))) + } else { + Optional.empty() + } + + 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/clusters/PushAvStreamTransportCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/PushAvStreamTransportCluster.kt new file mode 100644 index 00000000000000..d495f814678c30 --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/PushAvStreamTransportCluster.kt @@ -0,0 +1,1166 @@ +/* + * + * 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.clusters + +import java.time.Duration +import java.util.logging.Level +import java.util.logging.Logger +import kotlinx.coroutines.flow.Flow +import kotlinx.coroutines.flow.transform +import matter.controller.InvokeRequest +import matter.controller.InvokeResponse +import matter.controller.MatterController +import matter.controller.ReadData +import matter.controller.ReadRequest +import matter.controller.SubscribeRequest +import matter.controller.SubscriptionState +import matter.controller.UByteSubscriptionState +import matter.controller.UIntSubscriptionState +import matter.controller.UShortSubscriptionState +import matter.controller.cluster.structs.* +import matter.controller.model.AttributePath +import matter.controller.model.CommandPath +import matter.tlv.AnonymousTag +import matter.tlv.ContextSpecificTag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class PushAvStreamTransportCluster( + private val controller: MatterController, + private val endpointId: UShort, +) { + class AllocatePushTransportResponse( + val connectionID: UShort, + val transportOptions: PushAvStreamTransportClusterTransportOptionsStruct, + val transportStatus: UByte, + ) + + class FindTransportResponse( + val streamConfigurations: List + ) + + class CurrentConnectionsAttribute(val value: List) + + sealed class CurrentConnectionsAttributeSubscriptionState { + data class Success(val value: List) : CurrentConnectionsAttributeSubscriptionState() + + data class Error(val exception: Exception) : CurrentConnectionsAttributeSubscriptionState() + + object SubscriptionEstablished : CurrentConnectionsAttributeSubscriptionState() + } + + class GeneratedCommandListAttribute(val value: List) + + sealed class GeneratedCommandListAttributeSubscriptionState { + data class Success(val value: List) : GeneratedCommandListAttributeSubscriptionState() + + data class Error(val exception: Exception) : GeneratedCommandListAttributeSubscriptionState() + + object SubscriptionEstablished : GeneratedCommandListAttributeSubscriptionState() + } + + class AcceptedCommandListAttribute(val value: List) + + sealed class AcceptedCommandListAttributeSubscriptionState { + data class Success(val value: List) : AcceptedCommandListAttributeSubscriptionState() + + data class Error(val exception: Exception) : AcceptedCommandListAttributeSubscriptionState() + + object SubscriptionEstablished : AcceptedCommandListAttributeSubscriptionState() + } + + class EventListAttribute(val value: List) + + sealed class EventListAttributeSubscriptionState { + data class Success(val value: List) : EventListAttributeSubscriptionState() + + data class Error(val exception: Exception) : EventListAttributeSubscriptionState() + + object SubscriptionEstablished : EventListAttributeSubscriptionState() + } + + class AttributeListAttribute(val value: List) + + sealed class AttributeListAttributeSubscriptionState { + data class Success(val value: List) : AttributeListAttributeSubscriptionState() + + data class Error(val exception: Exception) : AttributeListAttributeSubscriptionState() + + object SubscriptionEstablished : AttributeListAttributeSubscriptionState() + } + + suspend fun allocatePushTransport( + transportOptions: PushAvStreamTransportClusterTransportOptionsStruct, + timedInvokeTimeout: Duration? = null, + ): AllocatePushTransportResponse { + val commandId: UInt = 0u + + val tlvWriter = TlvWriter() + tlvWriter.startStructure(AnonymousTag) + + val TAG_TRANSPORT_OPTIONS_REQ: Int = 0 + transportOptions.toTlv(ContextSpecificTag(TAG_TRANSPORT_OPTIONS_REQ), tlvWriter) + tlvWriter.endStructure() + + val request: InvokeRequest = + InvokeRequest( + CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), + tlvPayload = tlvWriter.getEncoded(), + timedRequest = timedInvokeTimeout, + ) + + val response: InvokeResponse = controller.invoke(request) + logger.log(Level.FINE, "Invoke command succeeded: ${response}") + + val tlvReader = TlvReader(response.payload) + tlvReader.enterStructure(AnonymousTag) + val TAG_CONNECTION_ID: Int = 0 + var connectionID_decoded: UShort? = null + + val TAG_TRANSPORT_OPTIONS: Int = 1 + var transportOptions_decoded: PushAvStreamTransportClusterTransportOptionsStruct? = null + + val TAG_TRANSPORT_STATUS: Int = 2 + var transportStatus_decoded: UByte? = null + + while (!tlvReader.isEndOfContainer()) { + val tag = tlvReader.peekElement().tag + + if (tag == ContextSpecificTag(TAG_CONNECTION_ID)) { + connectionID_decoded = tlvReader.getUShort(tag) + } + + if (tag == ContextSpecificTag(TAG_TRANSPORT_OPTIONS)) { + transportOptions_decoded = + PushAvStreamTransportClusterTransportOptionsStruct.fromTlv(tag, tlvReader) + } + + if (tag == ContextSpecificTag(TAG_TRANSPORT_STATUS)) { + transportStatus_decoded = tlvReader.getUByte(tag) + } else { + tlvReader.skipElement() + } + } + + if (connectionID_decoded == null) { + throw IllegalStateException("connectionID not found in TLV") + } + + if (transportOptions_decoded == null) { + throw IllegalStateException("transportOptions not found in TLV") + } + + if (transportStatus_decoded == null) { + throw IllegalStateException("transportStatus not found in TLV") + } + + tlvReader.exitContainer() + + return AllocatePushTransportResponse( + connectionID_decoded, + transportOptions_decoded, + transportStatus_decoded, + ) + } + + suspend fun deallocatePushTransport(connectionID: UShort, timedInvokeTimeout: Duration? = null) { + val commandId: UInt = 2u + + val tlvWriter = TlvWriter() + tlvWriter.startStructure(AnonymousTag) + + val TAG_CONNECTION_ID_REQ: Int = 0 + tlvWriter.put(ContextSpecificTag(TAG_CONNECTION_ID_REQ), connectionID) + tlvWriter.endStructure() + + val request: InvokeRequest = + InvokeRequest( + CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), + tlvPayload = tlvWriter.getEncoded(), + timedRequest = timedInvokeTimeout, + ) + + val response: InvokeResponse = controller.invoke(request) + logger.log(Level.FINE, "Invoke command succeeded: ${response}") + } + + suspend fun modifyPushTransport( + connectionID: UShort, + transportOptions: PushAvStreamTransportClusterTransportOptionsStruct, + timedInvokeTimeout: Duration? = null, + ) { + val commandId: UInt = 3u + + val tlvWriter = TlvWriter() + tlvWriter.startStructure(AnonymousTag) + + val TAG_CONNECTION_ID_REQ: Int = 0 + tlvWriter.put(ContextSpecificTag(TAG_CONNECTION_ID_REQ), connectionID) + + val TAG_TRANSPORT_OPTIONS_REQ: Int = 1 + transportOptions.toTlv(ContextSpecificTag(TAG_TRANSPORT_OPTIONS_REQ), tlvWriter) + tlvWriter.endStructure() + + val request: InvokeRequest = + InvokeRequest( + CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), + tlvPayload = tlvWriter.getEncoded(), + timedRequest = timedInvokeTimeout, + ) + + val response: InvokeResponse = controller.invoke(request) + logger.log(Level.FINE, "Invoke command succeeded: ${response}") + } + + suspend fun setTransportStatus( + connectionID: UShort, + transportStatus: UByte, + timedInvokeTimeout: Duration? = null, + ) { + val commandId: UInt = 4u + + val tlvWriter = TlvWriter() + tlvWriter.startStructure(AnonymousTag) + + val TAG_CONNECTION_ID_REQ: Int = 0 + tlvWriter.put(ContextSpecificTag(TAG_CONNECTION_ID_REQ), connectionID) + + val TAG_TRANSPORT_STATUS_REQ: Int = 1 + tlvWriter.put(ContextSpecificTag(TAG_TRANSPORT_STATUS_REQ), transportStatus) + tlvWriter.endStructure() + + val request: InvokeRequest = + InvokeRequest( + CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), + tlvPayload = tlvWriter.getEncoded(), + timedRequest = timedInvokeTimeout, + ) + + val response: InvokeResponse = controller.invoke(request) + logger.log(Level.FINE, "Invoke command succeeded: ${response}") + } + + suspend fun manuallyTriggerTransport( + connectionID: UShort, + activationReason: UByte, + timeControl: PushAvStreamTransportClusterTransportMotionTriggerTimeControlStruct?, + timedInvokeTimeout: Duration? = null, + ) { + val commandId: UInt = 5u + + val tlvWriter = TlvWriter() + tlvWriter.startStructure(AnonymousTag) + + val TAG_CONNECTION_ID_REQ: Int = 0 + tlvWriter.put(ContextSpecificTag(TAG_CONNECTION_ID_REQ), connectionID) + + val TAG_ACTIVATION_REASON_REQ: Int = 1 + tlvWriter.put(ContextSpecificTag(TAG_ACTIVATION_REASON_REQ), activationReason) + + val TAG_TIME_CONTROL_REQ: Int = 2 + timeControl?.let { timeControl.toTlv(ContextSpecificTag(TAG_TIME_CONTROL_REQ), tlvWriter) } + tlvWriter.endStructure() + + val request: InvokeRequest = + InvokeRequest( + CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), + tlvPayload = tlvWriter.getEncoded(), + timedRequest = timedInvokeTimeout, + ) + + val response: InvokeResponse = controller.invoke(request) + logger.log(Level.FINE, "Invoke command succeeded: ${response}") + } + + suspend fun findTransport( + connectionID: UShort?, + timedInvokeTimeout: Duration? = null, + ): FindTransportResponse { + val commandId: UInt = 6u + + val tlvWriter = TlvWriter() + tlvWriter.startStructure(AnonymousTag) + + val TAG_CONNECTION_ID_REQ: Int = 0 + connectionID?.let { tlvWriter.put(ContextSpecificTag(TAG_CONNECTION_ID_REQ), connectionID) } + tlvWriter.endStructure() + + val request: InvokeRequest = + InvokeRequest( + CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), + tlvPayload = tlvWriter.getEncoded(), + timedRequest = timedInvokeTimeout, + ) + + val response: InvokeResponse = controller.invoke(request) + logger.log(Level.FINE, "Invoke command succeeded: ${response}") + + val tlvReader = TlvReader(response.payload) + tlvReader.enterStructure(AnonymousTag) + val TAG_STREAM_CONFIGURATIONS: Int = 0 + var streamConfigurations_decoded: + List? = + null + + while (!tlvReader.isEndOfContainer()) { + val tag = tlvReader.peekElement().tag + + if (tag == ContextSpecificTag(TAG_STREAM_CONFIGURATIONS)) { + streamConfigurations_decoded = + buildList { + tlvReader.enterArray(tag) + while (!tlvReader.isEndOfContainer()) { + add( + PushAvStreamTransportClusterTransportConfigurationStruct.fromTlv( + AnonymousTag, + tlvReader, + ) + ) + } + tlvReader.exitContainer() + } + } else { + tlvReader.skipElement() + } + } + + if (streamConfigurations_decoded == null) { + throw IllegalStateException("streamConfigurations not found in TLV") + } + + tlvReader.exitContainer() + + return FindTransportResponse(streamConfigurations_decoded) + } + + suspend fun readSupportedContainerFormatsAttribute(): UByte { + val ATTRIBUTE_ID: UInt = 0u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Supportedcontainerformats attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UByte = tlvReader.getUByte(AnonymousTag) + + return decodedValue + } + + suspend fun subscribeSupportedContainerFormatsAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 0u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + UByteSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { + "Supportedcontainerformats attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UByte = tlvReader.getUByte(AnonymousTag) + + emit(UByteSubscriptionState.Success(decodedValue)) + } + SubscriptionState.SubscriptionEstablished -> { + emit(UByteSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readSupportedIngestMethodsAttribute(): UByte { + val ATTRIBUTE_ID: UInt = 1u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Supportedingestmethods attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UByte = tlvReader.getUByte(AnonymousTag) + + return decodedValue + } + + suspend fun subscribeSupportedIngestMethodsAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 1u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + UByteSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { + "Supportedingestmethods attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UByte = tlvReader.getUByte(AnonymousTag) + + emit(UByteSubscriptionState.Success(decodedValue)) + } + SubscriptionState.SubscriptionEstablished -> { + emit(UByteSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readCurrentConnectionsAttribute(): CurrentConnectionsAttribute { + val ATTRIBUTE_ID: UInt = 2u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Currentconnections attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List = + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUShort(AnonymousTag)) + } + tlvReader.exitContainer() + } + + return CurrentConnectionsAttribute(decodedValue) + } + + suspend fun subscribeCurrentConnectionsAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 2u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + CurrentConnectionsAttributeSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { + "Currentconnections attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List = + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUShort(AnonymousTag)) + } + tlvReader.exitContainer() + } + + emit(CurrentConnectionsAttributeSubscriptionState.Success(decodedValue)) + } + SubscriptionState.SubscriptionEstablished -> { + emit(CurrentConnectionsAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readGeneratedCommandListAttribute(): GeneratedCommandListAttribute { + val ATTRIBUTE_ID: UInt = 65528u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Generatedcommandlist attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List = + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + + return GeneratedCommandListAttribute(decodedValue) + } + + suspend fun subscribeGeneratedCommandListAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 65528u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + GeneratedCommandListAttributeSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { + "Generatedcommandlist attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List = + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + + emit(GeneratedCommandListAttributeSubscriptionState.Success(decodedValue)) + } + SubscriptionState.SubscriptionEstablished -> { + emit(GeneratedCommandListAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readAcceptedCommandListAttribute(): AcceptedCommandListAttribute { + val ATTRIBUTE_ID: UInt = 65529u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Acceptedcommandlist attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List = + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + + return AcceptedCommandListAttribute(decodedValue) + } + + suspend fun subscribeAcceptedCommandListAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 65529u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + AcceptedCommandListAttributeSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { + "Acceptedcommandlist attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List = + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + + emit(AcceptedCommandListAttributeSubscriptionState.Success(decodedValue)) + } + SubscriptionState.SubscriptionEstablished -> { + emit(AcceptedCommandListAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readEventListAttribute(): EventListAttribute { + val ATTRIBUTE_ID: UInt = 65530u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Eventlist attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List = + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + + return EventListAttribute(decodedValue) + } + + suspend fun subscribeEventListAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 65530u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + EventListAttributeSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { "Eventlist attribute not found in Node State update" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List = + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + + emit(EventListAttributeSubscriptionState.Success(decodedValue)) + } + SubscriptionState.SubscriptionEstablished -> { + emit(EventListAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readAttributeListAttribute(): AttributeListAttribute { + val ATTRIBUTE_ID: UInt = 65531u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Attributelist attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List = + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + + return AttributeListAttribute(decodedValue) + } + + suspend fun subscribeAttributeListAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 65531u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + AttributeListAttributeSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { "Attributelist attribute not found in Node State update" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List = + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + + emit(AttributeListAttributeSubscriptionState.Success(decodedValue)) + } + SubscriptionState.SubscriptionEstablished -> { + emit(AttributeListAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readFeatureMapAttribute(): UInt { + val ATTRIBUTE_ID: UInt = 65532u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Featuremap attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UInt = tlvReader.getUInt(AnonymousTag) + + return decodedValue + } + + suspend fun subscribeFeatureMapAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 65532u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + UIntSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { "Featuremap attribute not found in Node State update" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UInt = tlvReader.getUInt(AnonymousTag) + + emit(UIntSubscriptionState.Success(decodedValue)) + } + SubscriptionState.SubscriptionEstablished -> { + emit(UIntSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readClusterRevisionAttribute(): UShort { + val ATTRIBUTE_ID: UInt = 65533u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Clusterrevision attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UShort = tlvReader.getUShort(AnonymousTag) + + return decodedValue + } + + suspend fun subscribeClusterRevisionAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 65533u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + UShortSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { + "Clusterrevision attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UShort = tlvReader.getUShort(AnonymousTag) + + emit(UShortSubscriptionState.Success(decodedValue)) + } + SubscriptionState.SubscriptionEstablished -> { + emit(UShortSubscriptionState.SubscriptionEstablished) + } + } + } + } + + companion object { + private val logger = Logger.getLogger(PushAvStreamTransportCluster::class.java.name) + const val CLUSTER_ID: UInt = 1365u + } +} 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/eventstructs/PushAvStreamTransportClusterPushTransportEndEvent.kt b/src/controller/java/generated/java/matter/controller/cluster/eventstructs/PushAvStreamTransportClusterPushTransportEndEvent.kt new file mode 100644 index 00000000000000..adbda81d0386e1 --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/eventstructs/PushAvStreamTransportClusterPushTransportEndEvent.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 PushAvStreamTransportClusterPushTransportEndEvent( + val connectionID: UShort, + val triggerType: UByte, + val activationReason: Optional, +) { + override fun toString(): String = buildString { + append("PushAvStreamTransportClusterPushTransportEndEvent {\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, + ): PushAvStreamTransportClusterPushTransportEndEvent { + 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 PushAvStreamTransportClusterPushTransportEndEvent( + connectionID, + triggerType, + activationReason, + ) + } + } +} diff --git a/src/controller/java/generated/java/matter/controller/cluster/files.gni b/src/controller/java/generated/java/matter/controller/cluster/files.gni index b09fc7b799e316..3425c23dccfd4c 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/files.gni +++ b/src/controller/java/generated/java/matter/controller/cluster/files.gni @@ -122,6 +122,14 @@ matter_structs_sources = [ "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/PowerSourceClusterBatChargeFaultChangeType.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/PowerSourceClusterBatFaultChangeType.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/PowerSourceClusterWiredFaultChangeType.kt", + "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/PushAvStreamTransportClusterCMAFContainerOptionsStruct.kt", + "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/PushAvStreamTransportClusterContainerOptionsStruct.kt", + "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/PushAvStreamTransportClusterMetadataOptionsStruct.kt", + "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/PushAvStreamTransportClusterTransportConfigurationStruct.kt", + "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/PushAvStreamTransportClusterTransportMotionTriggerTimeControlStruct.kt", + "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/PushAvStreamTransportClusterTransportOptionsStruct.kt", + "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/PushAvStreamTransportClusterTransportTriggerOptionsStruct.kt", + "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/PushAvStreamTransportClusterTransportZoneOptionsStruct.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/RefrigeratorAndTemperatureControlledCabinetModeClusterModeOptionStruct.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/RefrigeratorAndTemperatureControlledCabinetModeClusterModeTagStruct.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/RvcCleanModeClusterModeOptionStruct.kt", @@ -236,6 +244,8 @@ matter_eventstructs_sources = [ "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/eventstructs/PowerSourceClusterBatChargeFaultChangeEvent.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/eventstructs/PowerSourceClusterBatFaultChangeEvent.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/eventstructs/PowerSourceClusterWiredFaultChangeEvent.kt", + "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/eventstructs/PushAvStreamTransportClusterPushTransportBeginEvent.kt", + "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/eventstructs/PushAvStreamTransportClusterPushTransportEndEvent.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/eventstructs/RefrigeratorAlarmClusterNotifyEvent.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/eventstructs/RvcOperationalStateClusterOperationalErrorEvent.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/eventstructs/RvcOperationalStateClusterOperationCompletionEvent.kt", @@ -361,6 +371,7 @@ matter_clusters_sources = [ "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/ProxyValidCluster.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/PulseWidthModulationCluster.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/PumpConfigurationAndControlCluster.kt", + "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/PushAvStreamTransportCluster.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/RadonConcentrationMeasurementCluster.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/RefrigeratorAlarmCluster.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/RefrigeratorAndTemperatureControlledCabinetModeCluster.kt", 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..e2cd0333a31845 --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/structs/PushAvStreamTransportClusterCMAFContainerOptionsStruct.kt @@ -0,0 +1,71 @@ +/* + * + * 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.isPresent) { + val optCENCKey = CENCKey.get() + put(ContextSpecificTag(TAG_CENC_KEY), optCENCKey) + } + 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.isNextTag(ContextSpecificTag(TAG_CENC_KEY))) { + Optional.of(tlvReader.getByteArray(ContextSpecificTag(TAG_CENC_KEY))) + } else { + Optional.empty() + } + + 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..9de1ac752a32e8 --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/structs/PushAvStreamTransportClusterContainerOptionsStruct.kt @@ -0,0 +1,76 @@ +/* + * + * 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.isPresent) { + val optCMAFContainerOptions = CMAFContainerOptions.get() + optCMAFContainerOptions.toTlv(ContextSpecificTag(TAG_CMAF_CONTAINER_OPTIONS), this) + } + 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.isNextTag(ContextSpecificTag(TAG_CMAF_CONTAINER_OPTIONS))) { + Optional.of( + PushAvStreamTransportClusterCMAFContainerOptionsStruct.fromTlv( + ContextSpecificTag(TAG_CMAF_CONTAINER_OPTIONS), + tlvReader, + ) + ) + } else { + Optional.empty() + } + + 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..15431c83a961c0 --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/structs/PushAvStreamTransportClusterTransportOptionsStruct.kt @@ -0,0 +1,165 @@ +/* + * + * 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.isPresent) { + val optmetadataOptions = metadataOptions.get() + optmetadataOptions.toTlv(ContextSpecificTag(TAG_METADATA_OPTIONS), this) + } + if (expiryTime.isPresent) { + val optexpiryTime = expiryTime.get() + put(ContextSpecificTag(TAG_EXPIRY_TIME), optexpiryTime) + } + 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.isNextTag(ContextSpecificTag(TAG_METADATA_OPTIONS))) { + Optional.of( + PushAvStreamTransportClusterMetadataOptionsStruct.fromTlv( + ContextSpecificTag(TAG_METADATA_OPTIONS), + tlvReader, + ) + ) + } else { + Optional.empty() + } + val expiryTime = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_EXPIRY_TIME))) { + Optional.of(tlvReader.getUInt(ContextSpecificTag(TAG_EXPIRY_TIME))) + } else { + Optional.empty() + } + + 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) + } + } +} diff --git a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp index deddd974e4515e..03660018f5299c 100644 --- a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp @@ -42038,6 +42038,180 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR } break; } + case app::Clusters::PushAvStreamTransport::Id: { + using namespace app::Clusters::PushAvStreamTransport; + switch (aPath.mAttributeId) + { + case Attributes::SupportedContainerFormats::Id: { + using TypeInfo = Attributes::SupportedContainerFormats::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + jint jnivalue = static_cast(cppValue.Raw()); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, + value); + return value; + } + case Attributes::SupportedIngestMethods::Id: { + using TypeInfo = Attributes::SupportedIngestMethods::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + jint jnivalue = static_cast(cppValue.Raw()); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, + value); + return value; + } + case Attributes::CurrentConnections::Id: { + using TypeInfo = Attributes::CurrentConnections::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Integer"; + std::string newElement_0CtorSignature = "(I)V"; + jint jninewElement_0 = static_cast(entry_0); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::GeneratedCommandList::Id: { + using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + jlong jninewElement_0 = static_cast(entry_0); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::AcceptedCommandList::Id: { + using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + jlong jninewElement_0 = static_cast(entry_0); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::AttributeList::Id: { + using TypeInfo = Attributes::AttributeList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + jlong jninewElement_0 = static_cast(entry_0); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::FeatureMap::Id: { + using TypeInfo = Attributes::FeatureMap::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Long"; + std::string valueCtorSignature = "(J)V"; + jlong jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + jnivalue, value); + return value; + } + case Attributes::ClusterRevision::Id: { + using TypeInfo = Attributes::ClusterRevision::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + jint jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, + value); + return value; + } + default: + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + break; + } + break; + } case app::Clusters::Chime::Id: { using namespace app::Clusters::Chime; switch (aPath.mAttributeId) diff --git a/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp index fdb5c9fb6589f7..c67b8064f59aab 100644 --- a/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp @@ -9109,6 +9109,149 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & } break; } + case app::Clusters::PushAvStreamTransport::Id: { + using namespace app::Clusters::PushAvStreamTransport; + switch (aPath.mEventId) + { + case Events::PushTransportBegin::Id: { + Events::PushTransportBegin::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value_connectionID; + std::string value_connectionIDClassName = "java/lang/Integer"; + std::string value_connectionIDCtorSignature = "(I)V"; + jint jnivalue_connectionID = static_cast(cppValue.connectionID); + chip::JniReferences::GetInstance().CreateBoxedObject(value_connectionIDClassName.c_str(), + value_connectionIDCtorSignature.c_str(), + jnivalue_connectionID, value_connectionID); + + jobject value_triggerType; + std::string value_triggerTypeClassName = "java/lang/Integer"; + std::string value_triggerTypeCtorSignature = "(I)V"; + jint jnivalue_triggerType = static_cast(cppValue.triggerType); + chip::JniReferences::GetInstance().CreateBoxedObject(value_triggerTypeClassName.c_str(), + value_triggerTypeCtorSignature.c_str(), jnivalue_triggerType, + value_triggerType); + + jobject value_activationReason; + if (!cppValue.activationReason.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_activationReason); + } + else + { + jobject value_activationReasonInsideOptional; + std::string value_activationReasonInsideOptionalClassName = "java/lang/Integer"; + std::string value_activationReasonInsideOptionalCtorSignature = "(I)V"; + jint jnivalue_activationReasonInsideOptional = static_cast(cppValue.activationReason.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_activationReasonInsideOptionalClassName.c_str(), + value_activationReasonInsideOptionalCtorSignature.c_str(), jnivalue_activationReasonInsideOptional, + value_activationReasonInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(value_activationReasonInsideOptional, value_activationReason); + } + + jclass pushTransportBeginStructClass; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipEventStructs$PushAvStreamTransportClusterPushTransportBeginEvent", + pushTransportBeginStructClass); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipEventStructs$PushAvStreamTransportClusterPushTransportBeginEvent"); + return nullptr; + } + + jmethodID pushTransportBeginStructCtor; + err = chip::JniReferences::GetInstance().FindMethod(env, pushTransportBeginStructClass, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/util/Optional;)V", + &pushTransportBeginStructCtor); + if (err != CHIP_NO_ERROR || pushTransportBeginStructCtor == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipEventStructs$PushAvStreamTransportClusterPushTransportBeginEvent constructor"); + return nullptr; + } + + jobject value = env->NewObject(pushTransportBeginStructClass, pushTransportBeginStructCtor, value_connectionID, + value_triggerType, value_activationReason); + + return value; + } + case Events::PushTransportEnd::Id: { + Events::PushTransportEnd::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value_connectionID; + std::string value_connectionIDClassName = "java/lang/Integer"; + std::string value_connectionIDCtorSignature = "(I)V"; + jint jnivalue_connectionID = static_cast(cppValue.connectionID); + chip::JniReferences::GetInstance().CreateBoxedObject(value_connectionIDClassName.c_str(), + value_connectionIDCtorSignature.c_str(), + jnivalue_connectionID, value_connectionID); + + jobject value_triggerType; + std::string value_triggerTypeClassName = "java/lang/Integer"; + std::string value_triggerTypeCtorSignature = "(I)V"; + jint jnivalue_triggerType = static_cast(cppValue.triggerType); + chip::JniReferences::GetInstance().CreateBoxedObject(value_triggerTypeClassName.c_str(), + value_triggerTypeCtorSignature.c_str(), jnivalue_triggerType, + value_triggerType); + + jobject value_activationReason; + if (!cppValue.activationReason.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_activationReason); + } + else + { + jobject value_activationReasonInsideOptional; + std::string value_activationReasonInsideOptionalClassName = "java/lang/Integer"; + std::string value_activationReasonInsideOptionalCtorSignature = "(I)V"; + jint jnivalue_activationReasonInsideOptional = static_cast(cppValue.activationReason.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_activationReasonInsideOptionalClassName.c_str(), + value_activationReasonInsideOptionalCtorSignature.c_str(), jnivalue_activationReasonInsideOptional, + value_activationReasonInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(value_activationReasonInsideOptional, value_activationReason); + } + + jclass pushTransportEndStructClass; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipEventStructs$PushAvStreamTransportClusterPushTransportEndEvent", + pushTransportEndStructClass); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipEventStructs$PushAvStreamTransportClusterPushTransportEndEvent"); + return nullptr; + } + + jmethodID pushTransportEndStructCtor; + err = chip::JniReferences::GetInstance().FindMethod(env, pushTransportEndStructClass, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/util/Optional;)V", + &pushTransportEndStructCtor); + if (err != CHIP_NO_ERROR || pushTransportEndStructCtor == nullptr) + { + ChipLogError(Zcl, "Could not find ChipEventStructs$PushAvStreamTransportClusterPushTransportEndEvent constructor"); + return nullptr; + } + + jobject value = env->NewObject(pushTransportEndStructClass, pushTransportEndStructCtor, value_connectionID, + value_triggerType, value_activationReason); + + return value; + } + default: + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; + break; + } + break; + } case app::Clusters::Chime::Id: { using namespace app::Clusters::Chime; switch (aPath.mEventId) diff --git a/src/controller/python/chip/clusters/CHIPClusters.py b/src/controller/python/chip/clusters/CHIPClusters.py index 971bb232a097f3..9d40e000b3dabb 100644 --- a/src/controller/python/chip/clusters/CHIPClusters.py +++ b/src/controller/python/chip/clusters/CHIPClusters.py @@ -12946,6 +12946,108 @@ class ChipClusters: }, }, } + _PUSH_AV_STREAM_TRANSPORT_CLUSTER_INFO = { + "clusterName": "PushAvStreamTransport", + "clusterId": 0x00000555, + "commands": { + 0x00000000: { + "commandId": 0x00000000, + "commandName": "AllocatePushTransport", + "args": { + "transportOptions": "TransportOptionsStruct", + }, + }, + 0x00000002: { + "commandId": 0x00000002, + "commandName": "DeallocatePushTransport", + "args": { + "connectionID": "int", + }, + }, + 0x00000003: { + "commandId": 0x00000003, + "commandName": "ModifyPushTransport", + "args": { + "connectionID": "int", + "transportOptions": "TransportOptionsStruct", + }, + }, + 0x00000004: { + "commandId": 0x00000004, + "commandName": "SetTransportStatus", + "args": { + "connectionID": "int", + "transportStatus": "int", + }, + }, + 0x00000005: { + "commandId": 0x00000005, + "commandName": "ManuallyTriggerTransport", + "args": { + "connectionID": "int", + "activationReason": "int", + "timeControl": "TransportMotionTriggerTimeControlStruct", + }, + }, + 0x00000006: { + "commandId": 0x00000006, + "commandName": "FindTransport", + "args": { + "connectionID": "int", + }, + }, + }, + "attributes": { + 0x00000000: { + "attributeName": "SupportedContainerFormats", + "attributeId": 0x00000000, + "type": "int", + "reportable": True, + }, + 0x00000001: { + "attributeName": "SupportedIngestMethods", + "attributeId": 0x00000001, + "type": "int", + "reportable": True, + }, + 0x00000002: { + "attributeName": "CurrentConnections", + "attributeId": 0x00000002, + "type": "int", + "reportable": True, + }, + 0x0000FFF8: { + "attributeName": "GeneratedCommandList", + "attributeId": 0x0000FFF8, + "type": "int", + "reportable": True, + }, + 0x0000FFF9: { + "attributeName": "AcceptedCommandList", + "attributeId": 0x0000FFF9, + "type": "int", + "reportable": True, + }, + 0x0000FFFB: { + "attributeName": "AttributeList", + "attributeId": 0x0000FFFB, + "type": "int", + "reportable": True, + }, + 0x0000FFFC: { + "attributeName": "FeatureMap", + "attributeId": 0x0000FFFC, + "type": "int", + "reportable": True, + }, + 0x0000FFFD: { + "attributeName": "ClusterRevision", + "attributeId": 0x0000FFFD, + "type": "int", + "reportable": True, + }, + }, + } _CHIME_CLUSTER_INFO = { "clusterName": "Chime", "clusterId": 0x00000556, @@ -14232,6 +14334,7 @@ class ChipClusters: 0x00000551: _CAMERA_AV_STREAM_MANAGEMENT_CLUSTER_INFO, 0x00000553: _WEB_RTC_TRANSPORT_PROVIDER_CLUSTER_INFO, 0x00000554: _WEB_RTC_TRANSPORT_REQUESTOR_CLUSTER_INFO, + 0x00000555: _PUSH_AV_STREAM_TRANSPORT_CLUSTER_INFO, 0x00000556: _CHIME_CLUSTER_INFO, 0x00000750: _ECOSYSTEM_INFORMATION_CLUSTER_INFO, 0x00000751: _COMMISSIONER_CONTROL_CLUSTER_INFO, @@ -14362,6 +14465,7 @@ class ChipClusters: "CameraAvStreamManagement": _CAMERA_AV_STREAM_MANAGEMENT_CLUSTER_INFO, "WebRTCTransportProvider": _WEB_RTC_TRANSPORT_PROVIDER_CLUSTER_INFO, "WebRTCTransportRequestor": _WEB_RTC_TRANSPORT_REQUESTOR_CLUSTER_INFO, + "PushAvStreamTransport": _PUSH_AV_STREAM_TRANSPORT_CLUSTER_INFO, "Chime": _CHIME_CLUSTER_INFO, "EcosystemInformation": _ECOSYSTEM_INFORMATION_CLUSTER_INFO, "CommissionerControl": _COMMISSIONER_CONTROL_CLUSTER_INFO, diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index b27196c7512fce..02543aabb4449e 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -161,6 +161,7 @@ "CameraAvStreamManagement", "WebRTCTransportProvider", "WebRTCTransportRequestor", + "PushAvStreamTransport", "Chime", "EcosystemInformation", "CommissionerControl", @@ -46854,6 +46855,579 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: value: uint = 0 +@dataclass +class PushAvStreamTransport(Cluster): + id: typing.ClassVar[int] = 0x00000555 + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="supportedContainerFormats", Tag=0x00000000, Type=uint), + ClusterObjectFieldDescriptor(Label="supportedIngestMethods", Tag=0x00000001, Type=uint), + ClusterObjectFieldDescriptor(Label="currentConnections", Tag=0x00000002, Type=typing.List[uint]), + ClusterObjectFieldDescriptor(Label="generatedCommandList", Tag=0x0000FFF8, Type=typing.List[uint]), + ClusterObjectFieldDescriptor(Label="acceptedCommandList", Tag=0x0000FFF9, Type=typing.List[uint]), + ClusterObjectFieldDescriptor(Label="attributeList", Tag=0x0000FFFB, Type=typing.List[uint]), + ClusterObjectFieldDescriptor(Label="featureMap", Tag=0x0000FFFC, Type=uint), + ClusterObjectFieldDescriptor(Label="clusterRevision", Tag=0x0000FFFD, Type=uint), + ]) + + supportedContainerFormats: uint = 0 + supportedIngestMethods: uint = 0 + currentConnections: typing.List[uint] = field(default_factory=lambda: []) + generatedCommandList: typing.List[uint] = field(default_factory=lambda: []) + acceptedCommandList: typing.List[uint] = field(default_factory=lambda: []) + attributeList: typing.List[uint] = field(default_factory=lambda: []) + featureMap: uint = 0 + clusterRevision: uint = 0 + + class Enums: + class ContainerFormatEnum(MatterIntEnum): + kCmaf = 0x00 + # All received enum values that are not listed above will be mapped + # to kUnknownEnumValue. This is a helper enum value that should only + # be used by code to process how it handles receiving an unknown + # enum value. This specific value should never be transmitted. + kUnknownEnumValue = 1 + + class IngestMethodsEnum(MatterIntEnum): + kCMAFIngest = 0x00 + # All received enum values that are not listed above will be mapped + # to kUnknownEnumValue. This is a helper enum value that should only + # be used by code to process how it handles receiving an unknown + # enum value. This specific value should never be transmitted. + kUnknownEnumValue = 1 + + class StatusCodeEnum(MatterIntEnum): + kAllocationNotPermitted = 0x02 + kInvalidTLSEndpoint = 0x03 + kInvalidStream = 0x04 + kInvalidURL = 0x05 + kInvalidZone = 0x06 + kUnsupportedContainerFormat = 0x07 + kUnsupportedIngestMethod = 0x08 + kInvalidTriggerType = 0x09 + kInvalidTransportStatus = 0x10 + # All received enum values that are not listed above will be mapped + # to kUnknownEnumValue. This is a helper enum value that should only + # be used by code to process how it handles receiving an unknown + # enum value. This specific value should never be transmitted. + kUnknownEnumValue = 0 + + class StreamMultiplexingEnum(MatterIntEnum): + kInterleaved = 0x00 + # All received enum values that are not listed above will be mapped + # to kUnknownEnumValue. This is a helper enum value that should only + # be used by code to process how it handles receiving an unknown + # enum value. This specific value should never be transmitted. + kUnknownEnumValue = 1 + + class StreamTypeEnum(MatterIntEnum): + kInternal = 0x00 + kRecording = 0x01 + kAnalysis = 0x02 + kLiveView = 0x03 + # All received enum values that are not listed above will be mapped + # to kUnknownEnumValue. This is a helper enum value that should only + # be used by code to process how it handles receiving an unknown + # enum value. This specific value should never be transmitted. + kUnknownEnumValue = 4 + + class TransportStatusEnum(MatterIntEnum): + kActive = 0x00 + kInactive = 0x01 + # All received enum values that are not listed above will be mapped + # to kUnknownEnumValue. This is a helper enum value that should only + # be used by code to process how it handles receiving an unknown + # enum value. This specific value should never be transmitted. + kUnknownEnumValue = 2 + + class TransportTriggerTypeEnum(MatterIntEnum): + kCommand = 0x00 + kMotion = 0x01 + kContinuous = 0x02 + # All received enum values that are not listed above will be mapped + # to kUnknownEnumValue. This is a helper enum value that should only + # be used by code to process how it handles receiving an unknown + # enum value. This specific value should never be transmitted. + kUnknownEnumValue = 3 + + class TriggerActivationReasonEnum(MatterIntEnum): + kUserInitiated = 0x00 + kAutomation = 0x01 + kEmergency = 0x02 + # All received enum values that are not listed above will be mapped + # to kUnknownEnumValue. This is a helper enum value that should only + # be used by code to process how it handles receiving an unknown + # enum value. This specific value should never be transmitted. + kUnknownEnumValue = 3 + + class Bitmaps: + class Feature(IntFlag): + kPerZoneSensitivity = 0x1 + + class SupportedContainerFormatsBitmap(IntFlag): + kCmaf = 0x1 + + class SupportedIngestMethodsBitmap(IntFlag): + kCMAFIngest = 0x1 + + class Structs: + @dataclass + class TransportMotionTriggerTimeControlStruct(ClusterObject): + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="initialDuration", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="augmentationDuration", Tag=1, Type=uint), + ClusterObjectFieldDescriptor(Label="maxDuration", Tag=2, Type=uint), + ClusterObjectFieldDescriptor(Label="blindDuration", Tag=3, Type=uint), + ]) + + initialDuration: 'uint' = 0 + augmentationDuration: 'uint' = 0 + maxDuration: 'uint' = 0 + blindDuration: 'uint' = 0 + + @dataclass + class TransportZoneOptionsStruct(ClusterObject): + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="zone", Tag=1, Type=typing.Union[Nullable, uint]), + ClusterObjectFieldDescriptor(Label="sensitivity", Tag=2, Type=typing.Optional[uint]), + ]) + + zone: 'typing.Union[Nullable, uint]' = NullValue + sensitivity: 'typing.Optional[uint]' = None + + @dataclass + class MetadataOptionsStruct(ClusterObject): + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="multiplexing", Tag=0, Type=PushAvStreamTransport.Enums.StreamMultiplexingEnum), + ClusterObjectFieldDescriptor(Label="includeMotionZones", Tag=1, Type=bool), + ClusterObjectFieldDescriptor(Label="enableMetadataPrivacySensitive", Tag=2, Type=bool), + ]) + + multiplexing: 'PushAvStreamTransport.Enums.StreamMultiplexingEnum' = 0 + includeMotionZones: 'bool' = False + enableMetadataPrivacySensitive: 'bool' = False + + @dataclass + class TransportTriggerOptionsStruct(ClusterObject): + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="triggerType", Tag=0, Type=PushAvStreamTransport.Enums.TransportTriggerTypeEnum), + ClusterObjectFieldDescriptor(Label="motionZones", Tag=1, Type=typing.Union[None, Nullable, typing.List[PushAvStreamTransport.Structs.TransportZoneOptionsStruct]]), + ClusterObjectFieldDescriptor(Label="motionSensitivity", Tag=2, Type=typing.Union[None, Nullable, uint]), + ClusterObjectFieldDescriptor(Label="motionTimeControl", Tag=3, Type=typing.Optional[PushAvStreamTransport.Structs.TransportMotionTriggerTimeControlStruct]), + ClusterObjectFieldDescriptor(Label="maxPreRollLen", Tag=4, Type=typing.Optional[uint]), + ]) + + triggerType: 'PushAvStreamTransport.Enums.TransportTriggerTypeEnum' = 0 + motionZones: 'typing.Union[None, Nullable, typing.List[PushAvStreamTransport.Structs.TransportZoneOptionsStruct]]' = None + motionSensitivity: 'typing.Union[None, Nullable, uint]' = None + motionTimeControl: 'typing.Optional[PushAvStreamTransport.Structs.TransportMotionTriggerTimeControlStruct]' = None + maxPreRollLen: 'typing.Optional[uint]' = None + + @dataclass + class CMAFContainerOptionsStruct(ClusterObject): + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="chunkDuration", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="CENCKey", Tag=1, Type=typing.Optional[bytes]), + ]) + + chunkDuration: 'uint' = 0 + CENCKey: 'typing.Optional[bytes]' = None + + @dataclass + class ContainerOptionsStruct(ClusterObject): + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="containerType", Tag=0, Type=PushAvStreamTransport.Enums.ContainerFormatEnum), + ClusterObjectFieldDescriptor(Label="CMAFContainerOptions", Tag=1, Type=typing.Optional[PushAvStreamTransport.Structs.CMAFContainerOptionsStruct]), + ]) + + containerType: 'PushAvStreamTransport.Enums.ContainerFormatEnum' = 0 + CMAFContainerOptions: 'typing.Optional[PushAvStreamTransport.Structs.CMAFContainerOptionsStruct]' = None + + @dataclass + class TransportOptionsStruct(ClusterObject): + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="streamType", Tag=0, Type=PushAvStreamTransport.Enums.StreamTypeEnum), + ClusterObjectFieldDescriptor(Label="videoStreamID", Tag=1, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="audioStreamID", Tag=2, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="endpointID", Tag=3, Type=uint), + ClusterObjectFieldDescriptor(Label="url", Tag=4, Type=str), + ClusterObjectFieldDescriptor(Label="triggerOptions", Tag=5, Type=PushAvStreamTransport.Structs.TransportTriggerOptionsStruct), + ClusterObjectFieldDescriptor(Label="ingestMethod", Tag=6, Type=PushAvStreamTransport.Enums.IngestMethodsEnum), + ClusterObjectFieldDescriptor(Label="containerFormat", Tag=7, Type=PushAvStreamTransport.Enums.ContainerFormatEnum), + ClusterObjectFieldDescriptor(Label="containerOptions", Tag=8, Type=PushAvStreamTransport.Structs.ContainerOptionsStruct), + ClusterObjectFieldDescriptor(Label="metadataOptions", Tag=9, Type=typing.Optional[PushAvStreamTransport.Structs.MetadataOptionsStruct]), + ClusterObjectFieldDescriptor(Label="expiryTime", Tag=10, Type=typing.Optional[uint]), + ]) + + streamType: 'PushAvStreamTransport.Enums.StreamTypeEnum' = 0 + videoStreamID: 'typing.Optional[uint]' = None + audioStreamID: 'typing.Optional[uint]' = None + endpointID: 'uint' = 0 + url: 'str' = "" + triggerOptions: 'PushAvStreamTransport.Structs.TransportTriggerOptionsStruct' = field(default_factory=lambda: PushAvStreamTransport.Structs.TransportTriggerOptionsStruct()) + ingestMethod: 'PushAvStreamTransport.Enums.IngestMethodsEnum' = 0 + containerFormat: 'PushAvStreamTransport.Enums.ContainerFormatEnum' = 0 + containerOptions: 'PushAvStreamTransport.Structs.ContainerOptionsStruct' = field(default_factory=lambda: PushAvStreamTransport.Structs.ContainerOptionsStruct()) + metadataOptions: 'typing.Optional[PushAvStreamTransport.Structs.MetadataOptionsStruct]' = None + expiryTime: 'typing.Optional[uint]' = None + + @dataclass + class TransportConfigurationStruct(ClusterObject): + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="connectionID", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="transportStatus", Tag=1, Type=PushAvStreamTransport.Enums.TransportStatusEnum), + ClusterObjectFieldDescriptor(Label="transportOptions", Tag=2, Type=PushAvStreamTransport.Structs.TransportOptionsStruct), + ]) + + connectionID: 'uint' = 0 + transportStatus: 'PushAvStreamTransport.Enums.TransportStatusEnum' = 0 + transportOptions: 'PushAvStreamTransport.Structs.TransportOptionsStruct' = field(default_factory=lambda: PushAvStreamTransport.Structs.TransportOptionsStruct()) + + class Commands: + @dataclass + class AllocatePushTransport(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000555 + command_id: typing.ClassVar[int] = 0x00000000 + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = 'AllocatePushTransportResponse' + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="transportOptions", Tag=0, Type=PushAvStreamTransport.Structs.TransportOptionsStruct), + ]) + + transportOptions: PushAvStreamTransport.Structs.TransportOptionsStruct = field(default_factory=lambda: PushAvStreamTransport.Structs.TransportOptionsStruct()) + + @dataclass + class AllocatePushTransportResponse(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000555 + command_id: typing.ClassVar[int] = 0x00000001 + is_client: typing.ClassVar[bool] = False + response_type: typing.ClassVar[typing.Optional[str]] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="connectionID", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="transportOptions", Tag=1, Type=PushAvStreamTransport.Structs.TransportOptionsStruct), + ClusterObjectFieldDescriptor(Label="transportStatus", Tag=2, Type=PushAvStreamTransport.Enums.TransportStatusEnum), + ]) + + connectionID: uint = 0 + transportOptions: PushAvStreamTransport.Structs.TransportOptionsStruct = field(default_factory=lambda: PushAvStreamTransport.Structs.TransportOptionsStruct()) + transportStatus: PushAvStreamTransport.Enums.TransportStatusEnum = 0 + + @dataclass + class DeallocatePushTransport(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000555 + command_id: typing.ClassVar[int] = 0x00000002 + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[typing.Optional[str]] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="connectionID", Tag=0, Type=uint), + ]) + + connectionID: uint = 0 + + @dataclass + class ModifyPushTransport(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000555 + command_id: typing.ClassVar[int] = 0x00000003 + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[typing.Optional[str]] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="connectionID", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="transportOptions", Tag=1, Type=PushAvStreamTransport.Structs.TransportOptionsStruct), + ]) + + connectionID: uint = 0 + transportOptions: PushAvStreamTransport.Structs.TransportOptionsStruct = field(default_factory=lambda: PushAvStreamTransport.Structs.TransportOptionsStruct()) + + @dataclass + class SetTransportStatus(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000555 + command_id: typing.ClassVar[int] = 0x00000004 + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[typing.Optional[str]] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="connectionID", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="transportStatus", Tag=1, Type=PushAvStreamTransport.Enums.TransportStatusEnum), + ]) + + connectionID: uint = 0 + transportStatus: PushAvStreamTransport.Enums.TransportStatusEnum = 0 + + @dataclass + class ManuallyTriggerTransport(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000555 + command_id: typing.ClassVar[int] = 0x00000005 + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[typing.Optional[str]] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="connectionID", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="activationReason", Tag=1, Type=PushAvStreamTransport.Enums.TriggerActivationReasonEnum), + ClusterObjectFieldDescriptor(Label="timeControl", Tag=2, Type=typing.Optional[PushAvStreamTransport.Structs.TransportMotionTriggerTimeControlStruct]), + ]) + + connectionID: uint = 0 + activationReason: PushAvStreamTransport.Enums.TriggerActivationReasonEnum = 0 + timeControl: typing.Optional[PushAvStreamTransport.Structs.TransportMotionTriggerTimeControlStruct] = None + + @dataclass + class FindTransport(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000555 + command_id: typing.ClassVar[int] = 0x00000006 + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = 'FindTransportResponse' + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="connectionID", Tag=0, Type=typing.Union[None, Nullable, uint]), + ]) + + connectionID: typing.Union[None, Nullable, uint] = None + + @dataclass + class FindTransportResponse(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000555 + command_id: typing.ClassVar[int] = 0x00000007 + is_client: typing.ClassVar[bool] = False + response_type: typing.ClassVar[typing.Optional[str]] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="streamConfigurations", Tag=0, Type=typing.List[PushAvStreamTransport.Structs.TransportConfigurationStruct]), + ]) + + streamConfigurations: typing.List[PushAvStreamTransport.Structs.TransportConfigurationStruct] = field(default_factory=lambda: []) + + class Attributes: + @dataclass + class SupportedContainerFormats(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000555 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000000 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=uint) + + value: uint = 0 + + @dataclass + class SupportedIngestMethods(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000555 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000001 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=uint) + + value: uint = 0 + + @dataclass + class CurrentConnections(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000555 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000002 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.List[uint]) + + value: typing.List[uint] = field(default_factory=lambda: []) + + @dataclass + class GeneratedCommandList(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000555 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFF8 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.List[uint]) + + value: typing.List[uint] = field(default_factory=lambda: []) + + @dataclass + class AcceptedCommandList(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000555 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFF9 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.List[uint]) + + value: typing.List[uint] = field(default_factory=lambda: []) + + @dataclass + class AttributeList(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000555 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFFB + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.List[uint]) + + value: typing.List[uint] = field(default_factory=lambda: []) + + @dataclass + class FeatureMap(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000555 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFFC + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=uint) + + value: uint = 0 + + @dataclass + class ClusterRevision(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000555 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFFD + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=uint) + + value: uint = 0 + + class Events: + @dataclass + class PushTransportBegin(ClusterEvent): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000555 + + @ChipUtility.classproperty + def event_id(cls) -> int: + return 0x00000000 + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="connectionID", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="triggerType", Tag=1, Type=PushAvStreamTransport.Enums.TransportTriggerTypeEnum), + ClusterObjectFieldDescriptor(Label="activationReason", Tag=2, Type=typing.Optional[PushAvStreamTransport.Enums.TriggerActivationReasonEnum]), + ]) + + connectionID: uint = 0 + triggerType: PushAvStreamTransport.Enums.TransportTriggerTypeEnum = 0 + activationReason: typing.Optional[PushAvStreamTransport.Enums.TriggerActivationReasonEnum] = None + + @dataclass + class PushTransportEnd(ClusterEvent): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000555 + + @ChipUtility.classproperty + def event_id(cls) -> int: + return 0x00000001 + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="connectionID", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="triggerType", Tag=1, Type=PushAvStreamTransport.Enums.TransportTriggerTypeEnum), + ClusterObjectFieldDescriptor(Label="activationReason", Tag=2, Type=typing.Optional[PushAvStreamTransport.Enums.TriggerActivationReasonEnum]), + ]) + + connectionID: uint = 0 + triggerType: PushAvStreamTransport.Enums.TransportTriggerTypeEnum = 0 + activationReason: typing.Optional[PushAvStreamTransport.Enums.TriggerActivationReasonEnum] = None + + @dataclass class Chime(Cluster): id: typing.ClassVar[int] = 0x00000556 diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm index 947877c053205c..8dde50ff52cc03 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm @@ -5768,6 +5768,39 @@ static BOOL AttributeIsSpecifiedInWebRTCTransportRequestorCluster(AttributeId aA } } } +static BOOL AttributeIsSpecifiedInPushAVStreamTransportCluster(AttributeId aAttributeId) +{ + using namespace Clusters::PushAvStreamTransport; + switch (aAttributeId) { + case Attributes::SupportedContainerFormats::Id: { + return YES; + } + case Attributes::SupportedIngestMethods::Id: { + return YES; + } + case Attributes::CurrentConnections::Id: { + return YES; + } + case Attributes::GeneratedCommandList::Id: { + return YES; + } + case Attributes::AcceptedCommandList::Id: { + return YES; + } + case Attributes::AttributeList::Id: { + return YES; + } + case Attributes::FeatureMap::Id: { + return YES; + } + case Attributes::ClusterRevision::Id: { + return YES; + } + default: { + return NO; + } + } +} static BOOL AttributeIsSpecifiedInChimeCluster(AttributeId aAttributeId) { using namespace Clusters::Chime; @@ -6534,6 +6567,9 @@ BOOL MTRAttributeIsSpecified(ClusterId aClusterId, AttributeId aAttributeId) case Clusters::WebRTCTransportRequestor::Id: { return AttributeIsSpecifiedInWebRTCTransportRequestorCluster(aAttributeId); } + case Clusters::PushAvStreamTransport::Id: { + return AttributeIsSpecifiedInPushAVStreamTransportCluster(aAttributeId); + } case Clusters::Chime::Id: { return AttributeIsSpecifiedInChimeCluster(aAttributeId); } diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm index cd2f99abca1e03..b307ca859b7e33 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm @@ -17626,6 +17626,66 @@ static id _Nullable DecodeAttributeValueForWebRTCTransportRequestorCluster(Attri *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; return nil; } +static id _Nullable DecodeAttributeValueForPushAVStreamTransportCluster(AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::PushAvStreamTransport; + switch (aAttributeId) { + case Attributes::SupportedContainerFormats::Id: { + using TypeInfo = Attributes::SupportedContainerFormats::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue.Raw()]; + return value; + } + case Attributes::SupportedIngestMethods::Id: { + using TypeInfo = Attributes::SupportedIngestMethods::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue.Raw()]; + return value; + } + case Attributes::CurrentConnections::Id: { + using TypeInfo = Attributes::CurrentConnections::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithUnsignedShort:entry_0]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; + } + return value; + } + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} static id _Nullable DecodeAttributeValueForChimeCluster(AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) { using namespace Clusters::Chime; @@ -19814,6 +19874,9 @@ id _Nullable MTRDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::T case Clusters::WebRTCTransportRequestor::Id: { return DecodeAttributeValueForWebRTCTransportRequestorCluster(aPath.mAttributeId, aReader, aError); } + case Clusters::PushAvStreamTransport::Id: { + return DecodeAttributeValueForPushAVStreamTransportCluster(aPath.mAttributeId, aReader, aError); + } case Clusters::Chime::Id: { return DecodeAttributeValueForChimeCluster(aPath.mAttributeId, aReader, aError); } diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h index 3b73ca8805a296..69c47c0ad974fb 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h @@ -14627,6 +14627,118 @@ MTR_PROVISIONALLY_AVAILABLE @end +/** + * Cluster Push AV Stream Transport + * + * + */ +MTR_PROVISIONALLY_AVAILABLE +@interface MTRBaseClusterPushAVStreamTransport : MTRGenericBaseCluster + +/** + * Command AllocatePushTransport + * + * This command SHALL allocate a transport and return a PushTransportConnectionID. + */ +- (void)allocatePushTransportWithParams:(MTRPushAVStreamTransportClusterAllocatePushTransportParams *)params completion:(void (^)(MTRPushAVStreamTransportClusterAllocatePushTransportResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +/** + * Command DeallocatePushTransport + * + * This command SHALL be generated to request the Node deallocates the specified transport. + */ +- (void)deallocatePushTransportWithParams:(MTRPushAVStreamTransportClusterDeallocatePushTransportParams *)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +/** + * Command ModifyPushTransport + * + * This command is used to request the Node modifies the configuration of the specified push transport. + */ +- (void)modifyPushTransportWithParams:(MTRPushAVStreamTransportClusterModifyPushTransportParams *)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +/** + * Command SetTransportStatus + * + * This command SHALL be generated to request the Node modifies the Transport Status of the transport. + */ +- (void)setTransportStatusWithParams:(MTRPushAVStreamTransportClusterSetTransportStatusParams *)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +/** + * Command ManuallyTriggerTransport + * + * This command SHALL be generated to request the Node to manually start the specified push transport. + */ +- (void)manuallyTriggerTransportWithParams:(MTRPushAVStreamTransportClusterManuallyTriggerTransportParams *)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +/** + * Command FindTransport + * + * This command SHALL return the Stream Options Configuration for the specified push transport. + */ +- (void)findTransportWithParams:(MTRPushAVStreamTransportClusterFindTransportParams * _Nullable)params completion:(void (^)(MTRPushAVStreamTransportClusterFindTransportResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)findTransportWithCompletion:(void (^)(MTRPushAVStreamTransportClusterFindTransportResponseParams * _Nullable data, NSError * _Nullable error))completion + MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeSupportedContainerFormatsWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeSupportedContainerFormatsWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeSupportedContainerFormatsWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeSupportedIngestMethodsWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeSupportedIngestMethodsWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeSupportedIngestMethodsWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeCurrentConnectionsWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeCurrentConnectionsWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeCurrentConnectionsWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeGeneratedCommandListWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeAcceptedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeAcceptedCommandListWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeAttributeListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeAttributeListWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeFeatureMapWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeFeatureMapWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeClusterRevisionWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + +@interface MTRBaseClusterPushAVStreamTransport (Availability) + +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ +- (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device + endpointID:(NSNumber *)endpointID + queue:(dispatch_queue_t)queue MTR_PROVISIONALLY_AVAILABLE; + +@end + /** * Cluster Chime * @@ -20082,6 +20194,66 @@ typedef NS_OPTIONS(uint8_t, MTRWebRTCTransportRequestorWebRTCMetadataOptions) { MTRWebRTCTransportRequestorWebRTCMetadataOptionsDataTLV MTR_PROVISIONALLY_AVAILABLE = 0x1, } MTR_PROVISIONALLY_AVAILABLE; +typedef NS_ENUM(uint8_t, MTRPushAVStreamTransportContainerFormat) { + MTRPushAVStreamTransportContainerFormatCMAF MTR_PROVISIONALLY_AVAILABLE = 0x00, +} MTR_PROVISIONALLY_AVAILABLE; + +typedef NS_ENUM(uint8_t, MTRPushAVStreamTransportIngestMethods) { + MTRPushAVStreamTransportIngestMethodsCMAFIngest MTR_PROVISIONALLY_AVAILABLE = 0x00, +} MTR_PROVISIONALLY_AVAILABLE; + +typedef NS_ENUM(uint8_t, MTRPushAVStreamTransportStatusCode) { + MTRPushAVStreamTransportStatusCodeAllocationNotPermitted MTR_PROVISIONALLY_AVAILABLE = 0x02, + MTRPushAVStreamTransportStatusCodeInvalidTLSEndpoint MTR_PROVISIONALLY_AVAILABLE = 0x03, + MTRPushAVStreamTransportStatusCodeInvalidStream MTR_PROVISIONALLY_AVAILABLE = 0x04, + MTRPushAVStreamTransportStatusCodeInvalidURL MTR_PROVISIONALLY_AVAILABLE = 0x05, + MTRPushAVStreamTransportStatusCodeInvalidZone MTR_PROVISIONALLY_AVAILABLE = 0x06, + MTRPushAVStreamTransportStatusCodeUnsupportedContainerFormat MTR_PROVISIONALLY_AVAILABLE = 0x07, + MTRPushAVStreamTransportStatusCodeUnsupportedIngestMethod MTR_PROVISIONALLY_AVAILABLE = 0x08, + MTRPushAVStreamTransportStatusCodeInvalidTriggerType MTR_PROVISIONALLY_AVAILABLE = 0x09, + MTRPushAVStreamTransportStatusCodeInvalidTransportStatus MTR_PROVISIONALLY_AVAILABLE = 0x10, +} MTR_PROVISIONALLY_AVAILABLE; + +typedef NS_ENUM(uint8_t, MTRPushAVStreamTransportStreamMultiplexing) { + MTRPushAVStreamTransportStreamMultiplexingInterleaved MTR_PROVISIONALLY_AVAILABLE = 0x00, +} MTR_PROVISIONALLY_AVAILABLE; + +typedef NS_ENUM(uint8_t, MTRPushAVStreamTransportStreamType) { + MTRPushAVStreamTransportStreamTypeInternal MTR_PROVISIONALLY_AVAILABLE = 0x00, + MTRPushAVStreamTransportStreamTypeRecording MTR_PROVISIONALLY_AVAILABLE = 0x01, + MTRPushAVStreamTransportStreamTypeAnalysis MTR_PROVISIONALLY_AVAILABLE = 0x02, + MTRPushAVStreamTransportStreamTypeLiveView MTR_PROVISIONALLY_AVAILABLE = 0x03, +} MTR_PROVISIONALLY_AVAILABLE; + +typedef NS_ENUM(uint8_t, MTRPushAVStreamTransportTransportStatus) { + MTRPushAVStreamTransportTransportStatusActive MTR_PROVISIONALLY_AVAILABLE = 0x00, + MTRPushAVStreamTransportTransportStatusInactive MTR_PROVISIONALLY_AVAILABLE = 0x01, +} MTR_PROVISIONALLY_AVAILABLE; + +typedef NS_ENUM(uint8_t, MTRPushAVStreamTransportTransportTriggerType) { + MTRPushAVStreamTransportTransportTriggerTypeCommand MTR_PROVISIONALLY_AVAILABLE = 0x00, + MTRPushAVStreamTransportTransportTriggerTypeMotion MTR_PROVISIONALLY_AVAILABLE = 0x01, + MTRPushAVStreamTransportTransportTriggerTypeContinuous MTR_PROVISIONALLY_AVAILABLE = 0x02, +} MTR_PROVISIONALLY_AVAILABLE; + +typedef NS_ENUM(uint8_t, MTRPushAVStreamTransportTriggerActivationReason) { + MTRPushAVStreamTransportTriggerActivationReasonUserInitiated MTR_PROVISIONALLY_AVAILABLE = 0x00, + MTRPushAVStreamTransportTriggerActivationReasonAutomation MTR_PROVISIONALLY_AVAILABLE = 0x01, + MTRPushAVStreamTransportTriggerActivationReasonEmergency MTR_PROVISIONALLY_AVAILABLE = 0x02, +} MTR_PROVISIONALLY_AVAILABLE; + +typedef NS_OPTIONS(uint32_t, MTRPushAVStreamTransportFeature) { + MTRPushAVStreamTransportFeaturePerZoneSensitivity MTR_PROVISIONALLY_AVAILABLE = 0x1, +} MTR_PROVISIONALLY_AVAILABLE; + +typedef NS_OPTIONS(uint8_t, MTRPushAVStreamTransportSupportedContainerFormatsBitmap) { + MTRPushAVStreamTransportSupportedContainerFormatsBitmapCMAF MTR_PROVISIONALLY_AVAILABLE = 0x1, +} MTR_PROVISIONALLY_AVAILABLE; + +typedef NS_OPTIONS(uint8_t, MTRPushAVStreamTransportSupportedIngestMethodsBitmap) { + MTRPushAVStreamTransportSupportedIngestMethodsBitmapCMAFIngest MTR_PROVISIONALLY_AVAILABLE = 0x1, +} MTR_PROVISIONALLY_AVAILABLE; + typedef NS_OPTIONS(uint32_t, MTRCommissionerControlSupportedDeviceCategoryBitmap) { MTRCommissionerControlSupportedDeviceCategoryBitmapFabricSynchronization MTR_PROVISIONALLY_AVAILABLE = 0x1, } MTR_PROVISIONALLY_AVAILABLE; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm index bddf4c4de023ef..136e3c8dd39b1c 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm @@ -100563,6 +100563,447 @@ + (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheC @end +@implementation MTRBaseClusterPushAVStreamTransport + +- (void)allocatePushTransportWithParams:(MTRPushAVStreamTransportClusterAllocatePushTransportParams *)params completion:(void (^)(MTRPushAVStreamTransportClusterAllocatePushTransportResponseParams * _Nullable data, NSError * _Nullable error))completion +{ + if (params == nil) { + params = [[MTRPushAVStreamTransportClusterAllocatePushTransportParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = PushAvStreamTransport::Commands::AllocatePushTransport::Type; + [self.device _invokeKnownCommandWithEndpointID:self.endpointID + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRPushAVStreamTransportClusterAllocatePushTransportResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} +- (void)deallocatePushTransportWithParams:(MTRPushAVStreamTransportClusterDeallocatePushTransportParams *)params completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRPushAVStreamTransportClusterDeallocatePushTransportParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = PushAvStreamTransport::Commands::DeallocatePushTransport::Type; + [self.device _invokeKnownCommandWithEndpointID:self.endpointID + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} +- (void)modifyPushTransportWithParams:(MTRPushAVStreamTransportClusterModifyPushTransportParams *)params completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRPushAVStreamTransportClusterModifyPushTransportParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = PushAvStreamTransport::Commands::ModifyPushTransport::Type; + [self.device _invokeKnownCommandWithEndpointID:self.endpointID + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} +- (void)setTransportStatusWithParams:(MTRPushAVStreamTransportClusterSetTransportStatusParams *)params completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRPushAVStreamTransportClusterSetTransportStatusParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = PushAvStreamTransport::Commands::SetTransportStatus::Type; + [self.device _invokeKnownCommandWithEndpointID:self.endpointID + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} +- (void)manuallyTriggerTransportWithParams:(MTRPushAVStreamTransportClusterManuallyTriggerTransportParams *)params completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRPushAVStreamTransportClusterManuallyTriggerTransportParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = PushAvStreamTransport::Commands::ManuallyTriggerTransport::Type; + [self.device _invokeKnownCommandWithEndpointID:self.endpointID + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} +- (void)findTransportWithCompletion:(void (^)(MTRPushAVStreamTransportClusterFindTransportResponseParams * _Nullable data, NSError * _Nullable error))completion +{ + [self findTransportWithParams:nil completion:completion]; +} +- (void)findTransportWithParams:(MTRPushAVStreamTransportClusterFindTransportParams * _Nullable)params completion:(void (^)(MTRPushAVStreamTransportClusterFindTransportResponseParams * _Nullable data, NSError * _Nullable error))completion +{ + if (params == nil) { + params = [[MTRPushAVStreamTransportClusterFindTransportParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = PushAvStreamTransport::Commands::FindTransport::Type; + [self.device _invokeKnownCommandWithEndpointID:self.endpointID + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRPushAVStreamTransportClusterFindTransportResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} + +- (void)readAttributeSupportedContainerFormatsWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = PushAvStreamTransport::Attributes::SupportedContainerFormats::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeSupportedContainerFormatsWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = PushAvStreamTransport::Attributes::SupportedContainerFormats::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeSupportedContainerFormatsWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = PushAvStreamTransport::Attributes::SupportedContainerFormats::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeSupportedIngestMethodsWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = PushAvStreamTransport::Attributes::SupportedIngestMethods::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeSupportedIngestMethodsWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = PushAvStreamTransport::Attributes::SupportedIngestMethods::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeSupportedIngestMethodsWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = PushAvStreamTransport::Attributes::SupportedIngestMethods::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeCurrentConnectionsWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = PushAvStreamTransport::Attributes::CurrentConnections::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeCurrentConnectionsWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = PushAvStreamTransport::Attributes::CurrentConnections::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeCurrentConnectionsWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = PushAvStreamTransport::Attributes::CurrentConnections::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = PushAvStreamTransport::Attributes::GeneratedCommandList::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeGeneratedCommandListWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = PushAvStreamTransport::Attributes::GeneratedCommandList::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = PushAvStreamTransport::Attributes::GeneratedCommandList::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeAcceptedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = PushAvStreamTransport::Attributes::AcceptedCommandList::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeAcceptedCommandListWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = PushAvStreamTransport::Attributes::AcceptedCommandList::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = PushAvStreamTransport::Attributes::AcceptedCommandList::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeAttributeListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = PushAvStreamTransport::Attributes::AttributeList::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeAttributeListWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = PushAvStreamTransport::Attributes::AttributeList::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = PushAvStreamTransport::Attributes::AttributeList::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeFeatureMapWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = PushAvStreamTransport::Attributes::FeatureMap::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeFeatureMapWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = PushAvStreamTransport::Attributes::FeatureMap::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = PushAvStreamTransport::Attributes::FeatureMap::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = PushAvStreamTransport::Attributes::ClusterRevision::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeClusterRevisionWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = PushAvStreamTransport::Attributes::ClusterRevision::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = PushAvStreamTransport::Attributes::ClusterRevision::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +@end + @implementation MTRBaseClusterChime - (void)playChimeSoundWithCompletion:(MTRStatusCompletion)completion diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h index 95c91d9ab34423..ef575b184d928e 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h @@ -201,6 +201,7 @@ typedef NS_ENUM(uint32_t, MTRClusterIDType) { MTRClusterIDTypeCameraAVStreamManagementID MTR_PROVISIONALLY_AVAILABLE = 0x00000551, MTRClusterIDTypeWebRTCTransportProviderID MTR_PROVISIONALLY_AVAILABLE = 0x00000553, MTRClusterIDTypeWebRTCTransportRequestorID MTR_PROVISIONALLY_AVAILABLE = 0x00000554, + MTRClusterIDTypePushAVStreamTransportID MTR_PROVISIONALLY_AVAILABLE = 0x00000555, MTRClusterIDTypeChimeID MTR_PROVISIONALLY_AVAILABLE = 0x00000556, MTRClusterIDTypeEcosystemInformationID MTR_PROVISIONALLY_AVAILABLE = 0x00000750, MTRClusterIDTypeCommissionerControlID MTR_PROVISIONALLY_AVAILABLE = 0x00000751, @@ -4690,6 +4691,16 @@ typedef NS_ENUM(uint32_t, MTRAttributeIDType) { MTRAttributeIDTypeClusterWebRTCTransportRequestorAttributeFeatureMapID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeFeatureMapID, MTRAttributeIDTypeClusterWebRTCTransportRequestorAttributeClusterRevisionID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeClusterRevisionID, + // Cluster PushAVStreamTransport attributes + MTRAttributeIDTypeClusterPushAVStreamTransportAttributeSupportedContainerFormatsID MTR_PROVISIONALLY_AVAILABLE = 0x00000000, + MTRAttributeIDTypeClusterPushAVStreamTransportAttributeSupportedIngestMethodsID MTR_PROVISIONALLY_AVAILABLE = 0x00000001, + MTRAttributeIDTypeClusterPushAVStreamTransportAttributeCurrentConnectionsID MTR_PROVISIONALLY_AVAILABLE = 0x00000002, + MTRAttributeIDTypeClusterPushAVStreamTransportAttributeGeneratedCommandListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeGeneratedCommandListID, + MTRAttributeIDTypeClusterPushAVStreamTransportAttributeAcceptedCommandListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeAcceptedCommandListID, + MTRAttributeIDTypeClusterPushAVStreamTransportAttributeAttributeListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeAttributeListID, + MTRAttributeIDTypeClusterPushAVStreamTransportAttributeFeatureMapID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeFeatureMapID, + MTRAttributeIDTypeClusterPushAVStreamTransportAttributeClusterRevisionID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeClusterRevisionID, + // Cluster Chime attributes MTRAttributeIDTypeClusterChimeAttributeInstalledChimeSoundsID MTR_PROVISIONALLY_AVAILABLE = 0x00000000, MTRAttributeIDTypeClusterChimeAttributeActiveChimeIDID MTR_PROVISIONALLY_AVAILABLE = 0x00000001, @@ -6925,6 +6936,16 @@ typedef NS_ENUM(uint32_t, MTRCommandIDType) { MTRCommandIDTypeClusterWebRTCTransportRequestorCommandICECandidateID MTR_PROVISIONALLY_AVAILABLE = 0x00000003, MTRCommandIDTypeClusterWebRTCTransportRequestorCommandEndID MTR_PROVISIONALLY_AVAILABLE = 0x00000004, + // Cluster PushAVStreamTransport commands + MTRCommandIDTypeClusterPushAVStreamTransportCommandAllocatePushTransportID MTR_PROVISIONALLY_AVAILABLE = 0x00000000, + MTRCommandIDTypeClusterPushAVStreamTransportCommandAllocatePushTransportResponseID MTR_PROVISIONALLY_AVAILABLE = 0x00000001, + MTRCommandIDTypeClusterPushAVStreamTransportCommandDeallocatePushTransportID MTR_PROVISIONALLY_AVAILABLE = 0x00000002, + MTRCommandIDTypeClusterPushAVStreamTransportCommandModifyPushTransportID MTR_PROVISIONALLY_AVAILABLE = 0x00000003, + MTRCommandIDTypeClusterPushAVStreamTransportCommandSetTransportStatusID MTR_PROVISIONALLY_AVAILABLE = 0x00000004, + MTRCommandIDTypeClusterPushAVStreamTransportCommandManuallyTriggerTransportID MTR_PROVISIONALLY_AVAILABLE = 0x00000005, + MTRCommandIDTypeClusterPushAVStreamTransportCommandFindTransportID MTR_PROVISIONALLY_AVAILABLE = 0x00000006, + MTRCommandIDTypeClusterPushAVStreamTransportCommandFindTransportResponseID MTR_PROVISIONALLY_AVAILABLE = 0x00000007, + // Cluster Chime commands MTRCommandIDTypeClusterChimeCommandPlayChimeSoundID MTR_PROVISIONALLY_AVAILABLE = 0x00000000, @@ -7518,6 +7539,10 @@ typedef NS_ENUM(uint32_t, MTREventIDType) { MTREventIDTypeClusterCameraAVStreamManagementEventAudioStreamChangedID MTR_PROVISIONALLY_AVAILABLE = 0x00000001, MTREventIDTypeClusterCameraAVStreamManagementEventSnapshotStreamChangedID MTR_PROVISIONALLY_AVAILABLE = 0x00000002, + // Cluster PushAVStreamTransport events + MTREventIDTypeClusterPushAVStreamTransportEventPushTransportBeginID MTR_PROVISIONALLY_AVAILABLE = 0x00000000, + MTREventIDTypeClusterPushAVStreamTransportEventPushTransportEndID MTR_PROVISIONALLY_AVAILABLE = 0x00000001, + // Cluster CommissionerControl events MTREventIDTypeClusterCommissionerControlEventCommissioningRequestResultID MTR_PROVISIONALLY_AVAILABLE = 0x00000000, diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm b/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm index 9f8206f2e04d8f..93231198f84058 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm @@ -381,6 +381,9 @@ case MTRClusterIDTypeWebRTCTransportRequestorID: result = @"WebRTCTransportRequestor"; break; + case MTRClusterIDTypePushAVStreamTransportID: + result = @"PushAVStreamTransport"; + break; case MTRClusterIDTypeChimeID: result = @"Chime"; break; @@ -7955,6 +7958,49 @@ } break; + case MTRClusterIDTypePushAVStreamTransportID: + + switch (attributeID) { + + // Cluster PushAVStreamTransport attributes + case MTRAttributeIDTypeClusterPushAVStreamTransportAttributeSupportedContainerFormatsID: + result = @"SupportedContainerFormats"; + break; + + case MTRAttributeIDTypeClusterPushAVStreamTransportAttributeSupportedIngestMethodsID: + result = @"SupportedIngestMethods"; + break; + + case MTRAttributeIDTypeClusterPushAVStreamTransportAttributeCurrentConnectionsID: + result = @"CurrentConnections"; + break; + + case MTRAttributeIDTypeClusterPushAVStreamTransportAttributeGeneratedCommandListID: + result = @"GeneratedCommandList"; + break; + + case MTRAttributeIDTypeClusterPushAVStreamTransportAttributeAcceptedCommandListID: + result = @"AcceptedCommandList"; + break; + + case MTRAttributeIDTypeClusterPushAVStreamTransportAttributeAttributeListID: + result = @"AttributeList"; + break; + + case MTRAttributeIDTypeClusterPushAVStreamTransportAttributeFeatureMapID: + result = @"FeatureMap"; + break; + + case MTRAttributeIDTypeClusterPushAVStreamTransportAttributeClusterRevisionID: + result = @"ClusterRevision"; + break; + + default: + result = [NSString stringWithFormat:@"", attributeID]; + break; + } + break; + case MTRClusterIDTypeChimeID: switch (attributeID) { @@ -10830,6 +10876,40 @@ } break; + case MTRClusterIDTypePushAVStreamTransportID: + + switch (commandID) { + + case MTRCommandIDTypeClusterPushAVStreamTransportCommandAllocatePushTransportID: + result = @"AllocatePushTransport"; + break; + + case MTRCommandIDTypeClusterPushAVStreamTransportCommandDeallocatePushTransportID: + result = @"DeallocatePushTransport"; + break; + + case MTRCommandIDTypeClusterPushAVStreamTransportCommandModifyPushTransportID: + result = @"ModifyPushTransport"; + break; + + case MTRCommandIDTypeClusterPushAVStreamTransportCommandSetTransportStatusID: + result = @"SetTransportStatus"; + break; + + case MTRCommandIDTypeClusterPushAVStreamTransportCommandManuallyTriggerTransportID: + result = @"ManuallyTriggerTransport"; + break; + + case MTRCommandIDTypeClusterPushAVStreamTransportCommandFindTransportID: + result = @"FindTransport"; + break; + + default: + result = [NSString stringWithFormat:@"", commandID]; + break; + } + break; + case MTRClusterIDTypeChimeID: switch (commandID) { @@ -12514,6 +12594,24 @@ } break; + case MTRClusterIDTypePushAVStreamTransportID: + + switch (commandID) { + + case MTRCommandIDTypeClusterPushAVStreamTransportCommandAllocatePushTransportResponseID: + result = @"AllocatePushTransportResponse"; + break; + + case MTRCommandIDTypeClusterPushAVStreamTransportCommandFindTransportResponseID: + result = @"FindTransportResponse"; + break; + + default: + result = [NSString stringWithFormat:@"", commandID]; + break; + } + break; + case MTRClusterIDTypeChimeID: switch (commandID) { @@ -14337,6 +14435,25 @@ } break; + case MTRClusterIDTypePushAVStreamTransportID: + + switch (eventID) { + + // Cluster PushAVStreamTransport events + case MTREventIDTypeClusterPushAVStreamTransportEventPushTransportBeginID: + result = @"PushTransportBegin"; + break; + + case MTREventIDTypeClusterPushAVStreamTransportEventPushTransportEndID: + result = @"PushTransportEnd"; + break; + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + case MTRClusterIDTypeChimeID: switch (eventID) { diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h index e3304d4f790586..e91ba367812e1d 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h @@ -6834,6 +6834,55 @@ MTR_PROVISIONALLY_AVAILABLE @end +/** + * Cluster Push AV Stream Transport + * + */ +MTR_PROVISIONALLY_AVAILABLE +@interface MTRClusterPushAVStreamTransport : MTRGenericCluster + +- (void)allocatePushTransportWithParams:(MTRPushAVStreamTransportClusterAllocatePushTransportParams *)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(void (^)(MTRPushAVStreamTransportClusterAllocatePushTransportResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)deallocatePushTransportWithParams:(MTRPushAVStreamTransportClusterDeallocatePushTransportParams *)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)modifyPushTransportWithParams:(MTRPushAVStreamTransportClusterModifyPushTransportParams *)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)setTransportStatusWithParams:(MTRPushAVStreamTransportClusterSetTransportStatusParams *)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)manuallyTriggerTransportWithParams:(MTRPushAVStreamTransportClusterManuallyTriggerTransportParams *)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)findTransportWithParams:(MTRPushAVStreamTransportClusterFindTransportParams * _Nullable)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(void (^)(MTRPushAVStreamTransportClusterFindTransportResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)findTransportWithExpectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(void (^)(MTRPushAVStreamTransportClusterFindTransportResponseParams * _Nullable data, NSError * _Nullable error))completion + MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeSupportedContainerFormatsWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeSupportedIngestMethodsWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeCurrentConnectionsWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + +@interface MTRClusterPushAVStreamTransport (Availability) + +/** + * For all instance methods that take a completion (i.e. command invocations), + * the completion will be called on the provided queue. + */ +- (instancetype _Nullable)initWithDevice:(MTRDevice *)device + endpointID:(NSNumber *)endpointID + queue:(dispatch_queue_t)queue MTR_PROVISIONALLY_AVAILABLE; + +@end + /** * Cluster Chime * This cluster provides facilities to configure and play Chime sounds, such as those used in a doorbell. diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm index f19bcdd2b23836..79881ca98cefb2 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm @@ -19867,6 +19867,216 @@ - (void)endWithParams:(MTRWebRTCTransportRequestorClusterEndParams *)params expe @end +@implementation MTRClusterPushAVStreamTransport + +- (void)allocatePushTransportWithParams:(MTRPushAVStreamTransportClusterAllocatePushTransportParams *)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(void (^)(MTRPushAVStreamTransportClusterAllocatePushTransportResponseParams * _Nullable data, NSError * _Nullable error))completion +{ + if (params == nil) { + params = [[MTRPushAVStreamTransportClusterAllocatePushTransportParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = PushAvStreamTransport::Commands::AllocatePushTransport::Type; + [self.device _invokeKnownCommandWithEndpointID:self.endpointID + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRPushAVStreamTransportClusterAllocatePushTransportResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} + +- (void)deallocatePushTransportWithParams:(MTRPushAVStreamTransportClusterDeallocatePushTransportParams *)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRPushAVStreamTransportClusterDeallocatePushTransportParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = PushAvStreamTransport::Commands::DeallocatePushTransport::Type; + [self.device _invokeKnownCommandWithEndpointID:self.endpointID + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} + +- (void)modifyPushTransportWithParams:(MTRPushAVStreamTransportClusterModifyPushTransportParams *)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRPushAVStreamTransportClusterModifyPushTransportParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = PushAvStreamTransport::Commands::ModifyPushTransport::Type; + [self.device _invokeKnownCommandWithEndpointID:self.endpointID + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} + +- (void)setTransportStatusWithParams:(MTRPushAVStreamTransportClusterSetTransportStatusParams *)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRPushAVStreamTransportClusterSetTransportStatusParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = PushAvStreamTransport::Commands::SetTransportStatus::Type; + [self.device _invokeKnownCommandWithEndpointID:self.endpointID + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} + +- (void)manuallyTriggerTransportWithParams:(MTRPushAVStreamTransportClusterManuallyTriggerTransportParams *)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRPushAVStreamTransportClusterManuallyTriggerTransportParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = PushAvStreamTransport::Commands::ManuallyTriggerTransport::Type; + [self.device _invokeKnownCommandWithEndpointID:self.endpointID + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} + +- (void)findTransportWithExpectedValues:(NSArray *> *)expectedValues expectedValueInterval:(NSNumber *)expectedValueIntervalMs completion:(void (^)(MTRPushAVStreamTransportClusterFindTransportResponseParams * _Nullable data, NSError * _Nullable error))completion +{ + [self findTransportWithParams:nil expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs completion:completion]; +} +- (void)findTransportWithParams:(MTRPushAVStreamTransportClusterFindTransportParams * _Nullable)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(void (^)(MTRPushAVStreamTransportClusterFindTransportResponseParams * _Nullable data, NSError * _Nullable error))completion +{ + if (params == nil) { + params = [[MTRPushAVStreamTransportClusterFindTransportParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = PushAvStreamTransport::Commands::FindTransport::Type; + [self.device _invokeKnownCommandWithEndpointID:self.endpointID + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRPushAVStreamTransportClusterFindTransportResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} + +- (NSDictionary * _Nullable)readAttributeSupportedContainerFormatsWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypePushAVStreamTransportID) attributeID:@(MTRAttributeIDTypeClusterPushAVStreamTransportAttributeSupportedContainerFormatsID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeSupportedIngestMethodsWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypePushAVStreamTransportID) attributeID:@(MTRAttributeIDTypeClusterPushAVStreamTransportAttributeSupportedIngestMethodsID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeCurrentConnectionsWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypePushAVStreamTransportID) attributeID:@(MTRAttributeIDTypeClusterPushAVStreamTransportAttributeCurrentConnectionsID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypePushAVStreamTransportID) attributeID:@(MTRAttributeIDTypeClusterPushAVStreamTransportAttributeGeneratedCommandListID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypePushAVStreamTransportID) attributeID:@(MTRAttributeIDTypeClusterPushAVStreamTransportAttributeAcceptedCommandListID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypePushAVStreamTransportID) attributeID:@(MTRAttributeIDTypeClusterPushAVStreamTransportAttributeAttributeListID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypePushAVStreamTransportID) attributeID:@(MTRAttributeIDTypeClusterPushAVStreamTransportAttributeFeatureMapID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypePushAVStreamTransportID) attributeID:@(MTRAttributeIDTypeClusterPushAVStreamTransportAttributeClusterRevisionID) params:params]; +} + +@end + @implementation MTRClusterChime - (void)playChimeSoundWithExpectedValues:(NSArray *> *)expectedValues expectedValueInterval:(NSNumber *)expectedValueIntervalMs completion:(MTRStatusCompletion)completion diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h index 6d036be1e0b7e6..41efe5e19bd55c 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h @@ -11699,6 +11699,236 @@ MTR_PROVISIONALLY_AVAILABLE @property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; @end +MTR_PROVISIONALLY_AVAILABLE +@interface MTRPushAVStreamTransportClusterAllocatePushTransportParams : NSObject + +@property (nonatomic, copy) MTRPushAVStreamTransportClusterTransportOptionsStruct * _Nonnull transportOptions MTR_PROVISIONALLY_AVAILABLE; +/** + * Controls whether the command is a timed command (using Timed Invoke). + * + * If nil (the default value), a regular invoke is done for commands that do + * not require a timed invoke and a timed invoke with some default timed request + * timeout is done for commands that require a timed invoke. + * + * If not nil, a timed invoke is done, with the provided value used as the timed + * request timeout. The value should be chosen small enough to provide the + * desired security properties but large enough that it will allow a round-trip + * from the sever to the client (for the status response and actual invoke + * request) within the timeout window. + * + */ +@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; + +/** + * Controls how much time, in seconds, we will allow for the server to process the command. + * + * The command will then time out if that much time, plus an allowance for retransmits due to network failures, passes. + * + * If nil, the framework will try to select an appropriate timeout value itself. + */ +@property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRPushAVStreamTransportClusterAllocatePushTransportResponseParams : NSObject + +@property (nonatomic, copy) NSNumber * _Nonnull connectionID MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) MTRPushAVStreamTransportClusterTransportOptionsStruct * _Nonnull transportOptions MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) NSNumber * _Nonnull transportStatus MTR_PROVISIONALLY_AVAILABLE; + +/** + * Initialize an MTRPushAVStreamTransportClusterAllocatePushTransportResponseParams with a response-value dictionary + * of the sort that MTRDeviceResponseHandler would receive. + * + * Will return nil and hand out an error if the response-value dictionary is not + * a command data response or is not the right command response. + * + * Will return nil and hand out an error if the data response does not match the known + * schema for this command. + */ +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error MTR_PROVISIONALLY_AVAILABLE; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRPushAVStreamTransportClusterDeallocatePushTransportParams : NSObject + +@property (nonatomic, copy) NSNumber * _Nonnull connectionID MTR_PROVISIONALLY_AVAILABLE; +/** + * Controls whether the command is a timed command (using Timed Invoke). + * + * If nil (the default value), a regular invoke is done for commands that do + * not require a timed invoke and a timed invoke with some default timed request + * timeout is done for commands that require a timed invoke. + * + * If not nil, a timed invoke is done, with the provided value used as the timed + * request timeout. The value should be chosen small enough to provide the + * desired security properties but large enough that it will allow a round-trip + * from the sever to the client (for the status response and actual invoke + * request) within the timeout window. + * + */ +@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; + +/** + * Controls how much time, in seconds, we will allow for the server to process the command. + * + * The command will then time out if that much time, plus an allowance for retransmits due to network failures, passes. + * + * If nil, the framework will try to select an appropriate timeout value itself. + */ +@property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRPushAVStreamTransportClusterModifyPushTransportParams : NSObject + +@property (nonatomic, copy) NSNumber * _Nonnull connectionID MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) MTRPushAVStreamTransportClusterTransportOptionsStruct * _Nonnull transportOptions MTR_PROVISIONALLY_AVAILABLE; +/** + * Controls whether the command is a timed command (using Timed Invoke). + * + * If nil (the default value), a regular invoke is done for commands that do + * not require a timed invoke and a timed invoke with some default timed request + * timeout is done for commands that require a timed invoke. + * + * If not nil, a timed invoke is done, with the provided value used as the timed + * request timeout. The value should be chosen small enough to provide the + * desired security properties but large enough that it will allow a round-trip + * from the sever to the client (for the status response and actual invoke + * request) within the timeout window. + * + */ +@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; + +/** + * Controls how much time, in seconds, we will allow for the server to process the command. + * + * The command will then time out if that much time, plus an allowance for retransmits due to network failures, passes. + * + * If nil, the framework will try to select an appropriate timeout value itself. + */ +@property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRPushAVStreamTransportClusterSetTransportStatusParams : NSObject + +@property (nonatomic, copy) NSNumber * _Nonnull connectionID MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) NSNumber * _Nonnull transportStatus MTR_PROVISIONALLY_AVAILABLE; +/** + * Controls whether the command is a timed command (using Timed Invoke). + * + * If nil (the default value), a regular invoke is done for commands that do + * not require a timed invoke and a timed invoke with some default timed request + * timeout is done for commands that require a timed invoke. + * + * If not nil, a timed invoke is done, with the provided value used as the timed + * request timeout. The value should be chosen small enough to provide the + * desired security properties but large enough that it will allow a round-trip + * from the sever to the client (for the status response and actual invoke + * request) within the timeout window. + * + */ +@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; + +/** + * Controls how much time, in seconds, we will allow for the server to process the command. + * + * The command will then time out if that much time, plus an allowance for retransmits due to network failures, passes. + * + * If nil, the framework will try to select an appropriate timeout value itself. + */ +@property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRPushAVStreamTransportClusterManuallyTriggerTransportParams : NSObject + +@property (nonatomic, copy) NSNumber * _Nonnull connectionID MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) NSNumber * _Nonnull activationReason MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) MTRPushAVStreamTransportClusterTransportMotionTriggerTimeControlStruct * _Nullable timeControl MTR_PROVISIONALLY_AVAILABLE; +/** + * Controls whether the command is a timed command (using Timed Invoke). + * + * If nil (the default value), a regular invoke is done for commands that do + * not require a timed invoke and a timed invoke with some default timed request + * timeout is done for commands that require a timed invoke. + * + * If not nil, a timed invoke is done, with the provided value used as the timed + * request timeout. The value should be chosen small enough to provide the + * desired security properties but large enough that it will allow a round-trip + * from the sever to the client (for the status response and actual invoke + * request) within the timeout window. + * + */ +@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; + +/** + * Controls how much time, in seconds, we will allow for the server to process the command. + * + * The command will then time out if that much time, plus an allowance for retransmits due to network failures, passes. + * + * If nil, the framework will try to select an appropriate timeout value itself. + */ +@property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRPushAVStreamTransportClusterFindTransportParams : NSObject + +@property (nonatomic, copy) NSNumber * _Nullable connectionID MTR_PROVISIONALLY_AVAILABLE; +/** + * Controls whether the command is a timed command (using Timed Invoke). + * + * If nil (the default value), a regular invoke is done for commands that do + * not require a timed invoke and a timed invoke with some default timed request + * timeout is done for commands that require a timed invoke. + * + * If not nil, a timed invoke is done, with the provided value used as the timed + * request timeout. The value should be chosen small enough to provide the + * desired security properties but large enough that it will allow a round-trip + * from the sever to the client (for the status response and actual invoke + * request) within the timeout window. + * + */ +@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; + +/** + * Controls how much time, in seconds, we will allow for the server to process the command. + * + * The command will then time out if that much time, plus an allowance for retransmits due to network failures, passes. + * + * If nil, the framework will try to select an appropriate timeout value itself. + */ +@property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRPushAVStreamTransportClusterFindTransportResponseParams : NSObject + +@property (nonatomic, copy) NSArray * _Nonnull streamConfigurations MTR_PROVISIONALLY_AVAILABLE; + +/** + * Initialize an MTRPushAVStreamTransportClusterFindTransportResponseParams with a response-value dictionary + * of the sort that MTRDeviceResponseHandler would receive. + * + * Will return nil and hand out an error if the response-value dictionary is not + * a command data response or is not the right command response. + * + * Will return nil and hand out an error if the data response does not match the known + * schema for this command. + */ +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error MTR_PROVISIONALLY_AVAILABLE; +@end + MTR_PROVISIONALLY_AVAILABLE @interface MTRChimeClusterPlayChimeSoundParams : NSObject /** diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm index 3c060416f06723..606f5c02e4eac6 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm @@ -34315,6 +34315,1095 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader } @end +@implementation MTRPushAVStreamTransportClusterAllocatePushTransportParams +- (instancetype)init +{ + if (self = [super init]) { + + _transportOptions = [MTRPushAVStreamTransportClusterTransportOptionsStruct new]; + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRPushAVStreamTransportClusterAllocatePushTransportParams alloc] init]; + + other.transportOptions = self.transportOptions; + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: transportOptions:%@; >", NSStringFromClass([self class]), _transportOptions]; + return descriptionString; +} + +@end + +@implementation MTRPushAVStreamTransportClusterAllocatePushTransportParams (InternalMethods) + +- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader +{ + chip::app::Clusters::PushAvStreamTransport::Commands::AllocatePushTransport::Type encodableStruct; + ListFreer listFreer; + { + encodableStruct.transportOptions.streamType = static_cast>(self.transportOptions.streamType.unsignedCharValue); + if (self.transportOptions.videoStreamID != nil) { + auto & definedValue_1 = encodableStruct.transportOptions.videoStreamID.Emplace(); + definedValue_1 = self.transportOptions.videoStreamID.unsignedShortValue; + } + if (self.transportOptions.audioStreamID != nil) { + auto & definedValue_1 = encodableStruct.transportOptions.audioStreamID.Emplace(); + definedValue_1 = self.transportOptions.audioStreamID.unsignedShortValue; + } + encodableStruct.transportOptions.endpointID = self.transportOptions.endpointID.unsignedShortValue; + encodableStruct.transportOptions.url = AsCharSpan(self.transportOptions.url); + encodableStruct.transportOptions.triggerOptions.triggerType = static_cast>(self.transportOptions.triggerOptions.triggerType.unsignedCharValue); + if (self.transportOptions.triggerOptions.motionZones != nil) { + auto & definedValue_2 = encodableStruct.transportOptions.triggerOptions.motionZones.Emplace(); + if (self.transportOptions.triggerOptions.motionZones == nil) { + definedValue_2.SetNull(); + } else { + auto & nonNullValue_3 = definedValue_2.SetNonNull(); + { + using ListType_4 = std::remove_reference_t; + using ListMemberType_4 = ListMemberTypeGetter::Type; + if (self.transportOptions.triggerOptions.motionZones.count != 0) { + auto * listHolder_4 = new ListHolder(self.transportOptions.triggerOptions.motionZones.count); + if (listHolder_4 == nullptr || listHolder_4->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_4); + for (size_t i_4 = 0; i_4 < self.transportOptions.triggerOptions.motionZones.count; ++i_4) { + auto element_4 = MTR_SAFE_CAST(self.transportOptions.triggerOptions.motionZones[i_4], MTRPushAVStreamTransportClusterTransportZoneOptionsStruct); + if (!element_4) { + // Wrong kind of value. + MTR_LOG_ERROR("%@ incorrectly present in list of %@", self.transportOptions.triggerOptions.motionZones[i_4], NSStringFromClass(MTRPushAVStreamTransportClusterTransportZoneOptionsStruct.class)); + return CHIP_ERROR_INVALID_ARGUMENT; + } + if (element_4.zone == nil) { + listHolder_4->mList[i_4].zone.SetNull(); + } else { + auto & nonNullValue_6 = listHolder_4->mList[i_4].zone.SetNonNull(); + nonNullValue_6 = element_4.zone.unsignedShortValue; + } + if (element_4.sensitivity != nil) { + auto & definedValue_6 = listHolder_4->mList[i_4].sensitivity.Emplace(); + definedValue_6 = element_4.sensitivity.unsignedCharValue; + } + } + nonNullValue_3 = ListType_4(listHolder_4->mList, self.transportOptions.triggerOptions.motionZones.count); + } else { + nonNullValue_3 = ListType_4(); + } + } + } + } + if (self.transportOptions.triggerOptions.motionSensitivity != nil) { + auto & definedValue_2 = encodableStruct.transportOptions.triggerOptions.motionSensitivity.Emplace(); + if (self.transportOptions.triggerOptions.motionSensitivity == nil) { + definedValue_2.SetNull(); + } else { + auto & nonNullValue_3 = definedValue_2.SetNonNull(); + nonNullValue_3 = self.transportOptions.triggerOptions.motionSensitivity.unsignedCharValue; + } + } + if (self.transportOptions.triggerOptions.motionTimeControl != nil) { + auto & definedValue_2 = encodableStruct.transportOptions.triggerOptions.motionTimeControl.Emplace(); + definedValue_2.initialDuration = self.transportOptions.triggerOptions.motionTimeControl.initialDuration.unsignedShortValue; + definedValue_2.augmentationDuration = self.transportOptions.triggerOptions.motionTimeControl.augmentationDuration.unsignedShortValue; + definedValue_2.maxDuration = self.transportOptions.triggerOptions.motionTimeControl.maxDuration.unsignedIntValue; + definedValue_2.blindDuration = self.transportOptions.triggerOptions.motionTimeControl.blindDuration.unsignedShortValue; + } + if (self.transportOptions.triggerOptions.maxPreRollLen != nil) { + auto & definedValue_2 = encodableStruct.transportOptions.triggerOptions.maxPreRollLen.Emplace(); + definedValue_2 = self.transportOptions.triggerOptions.maxPreRollLen.unsignedShortValue; + } + encodableStruct.transportOptions.ingestMethod = static_cast>(self.transportOptions.ingestMethod.unsignedCharValue); + encodableStruct.transportOptions.containerFormat = static_cast>(self.transportOptions.containerFormat.unsignedCharValue); + encodableStruct.transportOptions.containerOptions.containerType = static_cast>(self.transportOptions.containerOptions.containerType.unsignedCharValue); + if (self.transportOptions.containerOptions.cmafContainerOptions != nil) { + auto & definedValue_2 = encodableStruct.transportOptions.containerOptions.CMAFContainerOptions.Emplace(); + definedValue_2.chunkDuration = self.transportOptions.containerOptions.cmafContainerOptions.chunkDuration.unsignedShortValue; + if (self.transportOptions.containerOptions.cmafContainerOptions.cencKey != nil) { + auto & definedValue_4 = definedValue_2.CENCKey.Emplace(); + definedValue_4 = AsByteSpan(self.transportOptions.containerOptions.cmafContainerOptions.cencKey); + } + } + if (self.transportOptions.metadataOptions != nil) { + auto & definedValue_1 = encodableStruct.transportOptions.metadataOptions.Emplace(); + definedValue_1.multiplexing = static_cast>(self.transportOptions.metadataOptions.multiplexing.unsignedCharValue); + definedValue_1.includeMotionZones = self.transportOptions.metadataOptions.includeMotionZones.boolValue; + definedValue_1.enableMetadataPrivacySensitive = self.transportOptions.metadataOptions.enableMetadataPrivacySensitive.boolValue; + } + if (self.transportOptions.expiryTime != nil) { + auto & definedValue_1 = encodableStruct.transportOptions.expiryTime.Emplace(); + definedValue_1 = self.transportOptions.expiryTime.unsignedIntValue; + } + } + + auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); + if (buffer.IsNull()) { + return CHIP_ERROR_NO_MEMORY; + } + + chip::System::PacketBufferTLVWriter writer; + // Commands never need chained buffers, since they cannot be chunked. + writer.Init(std::move(buffer), /* useChainedBuffers = */ false); + + ReturnErrorOnFailure(chip::app::DataModel::Encode(writer, chip::TLV::AnonymousTag(), encodableStruct)); + + ReturnErrorOnFailure(writer.Finalize(&buffer)); + + reader.Init(std::move(buffer)); + return reader.Next(chip::TLV::kTLVType_Structure, chip::TLV::AnonymousTag()); +} + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error +{ + chip::System::PacketBufferTLVReader reader; + CHIP_ERROR err = [self _encodeToTLVReader:reader]; + if (err != CHIP_NO_ERROR) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:err]; + } + return nil; + } + + auto decodedObj = MTRDecodeDataValueDictionaryFromCHIPTLV(&reader); + if (decodedObj == nil) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE]; + } + } + return decodedObj; +} +@end + +@implementation MTRPushAVStreamTransportClusterAllocatePushTransportResponseParams +- (instancetype)init +{ + if (self = [super init]) { + + _connectionID = @(0); + + _transportOptions = [MTRPushAVStreamTransportClusterTransportOptionsStruct new]; + + _transportStatus = @(0); + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRPushAVStreamTransportClusterAllocatePushTransportResponseParams alloc] init]; + + other.connectionID = self.connectionID; + other.transportOptions = self.transportOptions; + other.transportStatus = self.transportStatus; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: connectionID:%@; transportOptions:%@; transportStatus:%@; >", NSStringFromClass([self class]), _connectionID, _transportOptions, _transportStatus]; + return descriptionString; +} + +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error +{ + if (!(self = [super init])) { + return nil; + } + + using DecodableType = chip::app::Clusters::PushAvStreamTransport::Commands::AllocatePushTransportResponse::DecodableType; + chip::System::PacketBufferHandle buffer = [MTRBaseDevice _responseDataForCommand:responseValue + clusterID:DecodableType::GetClusterId() + commandID:DecodableType::GetCommandId() + error:error]; + if (buffer.IsNull()) { + return nil; + } + + chip::TLV::TLVReader reader; + reader.Init(buffer->Start(), buffer->DataLength()); + + CHIP_ERROR err = reader.Next(chip::TLV::AnonymousTag()); + if (err == CHIP_NO_ERROR) { + DecodableType decodedStruct; + err = chip::app::DataModel::Decode(reader, decodedStruct); + if (err == CHIP_NO_ERROR) { + err = [self _setFieldsFromDecodableStruct:decodedStruct]; + if (err == CHIP_NO_ERROR) { + return self; + } + } + } + + NSString * errorStr = [NSString stringWithFormat:@"Command payload decoding failed: %s", err.AsString()]; + MTR_LOG_ERROR("%s", errorStr.UTF8String); + if (error != nil) { + NSDictionary * userInfo = @{ NSLocalizedFailureReasonErrorKey : NSLocalizedString(errorStr, nil) }; + *error = [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeSchemaMismatch userInfo:userInfo]; + } + return nil; +} + +@end + +@implementation MTRPushAVStreamTransportClusterAllocatePushTransportResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::PushAvStreamTransport::Commands::AllocatePushTransportResponse::DecodableType &)decodableStruct +{ + { + self.connectionID = [NSNumber numberWithUnsignedShort:decodableStruct.connectionID]; + } + { + self.transportOptions = [MTRPushAVStreamTransportClusterTransportOptionsStruct new]; + self.transportOptions.streamType = [NSNumber numberWithUnsignedChar:chip::to_underlying(decodableStruct.transportOptions.streamType)]; + if (decodableStruct.transportOptions.videoStreamID.HasValue()) { + self.transportOptions.videoStreamID = [NSNumber numberWithUnsignedShort:decodableStruct.transportOptions.videoStreamID.Value()]; + } else { + self.transportOptions.videoStreamID = nil; + } + if (decodableStruct.transportOptions.audioStreamID.HasValue()) { + self.transportOptions.audioStreamID = [NSNumber numberWithUnsignedShort:decodableStruct.transportOptions.audioStreamID.Value()]; + } else { + self.transportOptions.audioStreamID = nil; + } + self.transportOptions.endpointID = [NSNumber numberWithUnsignedShort:decodableStruct.transportOptions.endpointID]; + self.transportOptions.url = AsString(decodableStruct.transportOptions.url); + if (self.transportOptions.url == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + return err; + } + self.transportOptions.triggerOptions = [MTRPushAVStreamTransportClusterTransportTriggerOptionsStruct new]; + self.transportOptions.triggerOptions.triggerType = [NSNumber numberWithUnsignedChar:chip::to_underlying(decodableStruct.transportOptions.triggerOptions.triggerType)]; + if (decodableStruct.transportOptions.triggerOptions.motionZones.HasValue()) { + if (decodableStruct.transportOptions.triggerOptions.motionZones.Value().IsNull()) { + self.transportOptions.triggerOptions.motionZones = nil; + } else { + { // Scope for our temporary variables + auto * array_4 = [NSMutableArray new]; + auto iter_4 = decodableStruct.transportOptions.triggerOptions.motionZones.Value().Value().begin(); + while (iter_4.Next()) { + auto & entry_4 = iter_4.GetValue(); + MTRPushAVStreamTransportClusterTransportZoneOptionsStruct * newElement_4; + newElement_4 = [MTRPushAVStreamTransportClusterTransportZoneOptionsStruct new]; + if (entry_4.zone.IsNull()) { + newElement_4.zone = nil; + } else { + newElement_4.zone = [NSNumber numberWithUnsignedShort:entry_4.zone.Value()]; + } + if (entry_4.sensitivity.HasValue()) { + newElement_4.sensitivity = [NSNumber numberWithUnsignedChar:entry_4.sensitivity.Value()]; + } else { + newElement_4.sensitivity = nil; + } + [array_4 addObject:newElement_4]; + } + CHIP_ERROR err = iter_4.GetStatus(); + if (err != CHIP_NO_ERROR) { + return err; + } + self.transportOptions.triggerOptions.motionZones = array_4; + } + } + } else { + self.transportOptions.triggerOptions.motionZones = nil; + } + if (decodableStruct.transportOptions.triggerOptions.motionSensitivity.HasValue()) { + if (decodableStruct.transportOptions.triggerOptions.motionSensitivity.Value().IsNull()) { + self.transportOptions.triggerOptions.motionSensitivity = nil; + } else { + self.transportOptions.triggerOptions.motionSensitivity = [NSNumber numberWithUnsignedChar:decodableStruct.transportOptions.triggerOptions.motionSensitivity.Value().Value()]; + } + } else { + self.transportOptions.triggerOptions.motionSensitivity = nil; + } + if (decodableStruct.transportOptions.triggerOptions.motionTimeControl.HasValue()) { + self.transportOptions.triggerOptions.motionTimeControl = [MTRPushAVStreamTransportClusterTransportMotionTriggerTimeControlStruct new]; + self.transportOptions.triggerOptions.motionTimeControl.initialDuration = [NSNumber numberWithUnsignedShort:decodableStruct.transportOptions.triggerOptions.motionTimeControl.Value().initialDuration]; + self.transportOptions.triggerOptions.motionTimeControl.augmentationDuration = [NSNumber numberWithUnsignedShort:decodableStruct.transportOptions.triggerOptions.motionTimeControl.Value().augmentationDuration]; + self.transportOptions.triggerOptions.motionTimeControl.maxDuration = [NSNumber numberWithUnsignedInt:decodableStruct.transportOptions.triggerOptions.motionTimeControl.Value().maxDuration]; + self.transportOptions.triggerOptions.motionTimeControl.blindDuration = [NSNumber numberWithUnsignedShort:decodableStruct.transportOptions.triggerOptions.motionTimeControl.Value().blindDuration]; + } else { + self.transportOptions.triggerOptions.motionTimeControl = nil; + } + if (decodableStruct.transportOptions.triggerOptions.maxPreRollLen.HasValue()) { + self.transportOptions.triggerOptions.maxPreRollLen = [NSNumber numberWithUnsignedShort:decodableStruct.transportOptions.triggerOptions.maxPreRollLen.Value()]; + } else { + self.transportOptions.triggerOptions.maxPreRollLen = nil; + } + self.transportOptions.ingestMethod = [NSNumber numberWithUnsignedChar:chip::to_underlying(decodableStruct.transportOptions.ingestMethod)]; + self.transportOptions.containerFormat = [NSNumber numberWithUnsignedChar:chip::to_underlying(decodableStruct.transportOptions.containerFormat)]; + self.transportOptions.containerOptions = [MTRPushAVStreamTransportClusterContainerOptionsStruct new]; + self.transportOptions.containerOptions.containerType = [NSNumber numberWithUnsignedChar:chip::to_underlying(decodableStruct.transportOptions.containerOptions.containerType)]; + if (decodableStruct.transportOptions.containerOptions.CMAFContainerOptions.HasValue()) { + self.transportOptions.containerOptions.cmafContainerOptions = [MTRPushAVStreamTransportClusterCMAFContainerOptionsStruct new]; + self.transportOptions.containerOptions.cmafContainerOptions.chunkDuration = [NSNumber numberWithUnsignedShort:decodableStruct.transportOptions.containerOptions.CMAFContainerOptions.Value().chunkDuration]; + if (decodableStruct.transportOptions.containerOptions.CMAFContainerOptions.Value().CENCKey.HasValue()) { + self.transportOptions.containerOptions.cmafContainerOptions.cencKey = AsData(decodableStruct.transportOptions.containerOptions.CMAFContainerOptions.Value().CENCKey.Value()); + } else { + self.transportOptions.containerOptions.cmafContainerOptions.cencKey = nil; + } + } else { + self.transportOptions.containerOptions.cmafContainerOptions = nil; + } + if (decodableStruct.transportOptions.metadataOptions.HasValue()) { + self.transportOptions.metadataOptions = [MTRPushAVStreamTransportClusterMetadataOptionsStruct new]; + self.transportOptions.metadataOptions.multiplexing = [NSNumber numberWithUnsignedChar:chip::to_underlying(decodableStruct.transportOptions.metadataOptions.Value().multiplexing)]; + self.transportOptions.metadataOptions.includeMotionZones = [NSNumber numberWithBool:decodableStruct.transportOptions.metadataOptions.Value().includeMotionZones]; + self.transportOptions.metadataOptions.enableMetadataPrivacySensitive = [NSNumber numberWithBool:decodableStruct.transportOptions.metadataOptions.Value().enableMetadataPrivacySensitive]; + } else { + self.transportOptions.metadataOptions = nil; + } + if (decodableStruct.transportOptions.expiryTime.HasValue()) { + self.transportOptions.expiryTime = [NSNumber numberWithUnsignedInt:decodableStruct.transportOptions.expiryTime.Value()]; + } else { + self.transportOptions.expiryTime = nil; + } + } + { + self.transportStatus = [NSNumber numberWithUnsignedChar:chip::to_underlying(decodableStruct.transportStatus)]; + } + return CHIP_NO_ERROR; +} + +@end + +@implementation MTRPushAVStreamTransportClusterDeallocatePushTransportParams +- (instancetype)init +{ + if (self = [super init]) { + + _connectionID = @(0); + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRPushAVStreamTransportClusterDeallocatePushTransportParams alloc] init]; + + other.connectionID = self.connectionID; + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: connectionID:%@; >", NSStringFromClass([self class]), _connectionID]; + return descriptionString; +} + +@end + +@implementation MTRPushAVStreamTransportClusterDeallocatePushTransportParams (InternalMethods) + +- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader +{ + chip::app::Clusters::PushAvStreamTransport::Commands::DeallocatePushTransport::Type encodableStruct; + ListFreer listFreer; + { + encodableStruct.connectionID = self.connectionID.unsignedShortValue; + } + + auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); + if (buffer.IsNull()) { + return CHIP_ERROR_NO_MEMORY; + } + + chip::System::PacketBufferTLVWriter writer; + // Commands never need chained buffers, since they cannot be chunked. + writer.Init(std::move(buffer), /* useChainedBuffers = */ false); + + ReturnErrorOnFailure(chip::app::DataModel::Encode(writer, chip::TLV::AnonymousTag(), encodableStruct)); + + ReturnErrorOnFailure(writer.Finalize(&buffer)); + + reader.Init(std::move(buffer)); + return reader.Next(chip::TLV::kTLVType_Structure, chip::TLV::AnonymousTag()); +} + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error +{ + chip::System::PacketBufferTLVReader reader; + CHIP_ERROR err = [self _encodeToTLVReader:reader]; + if (err != CHIP_NO_ERROR) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:err]; + } + return nil; + } + + auto decodedObj = MTRDecodeDataValueDictionaryFromCHIPTLV(&reader); + if (decodedObj == nil) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE]; + } + } + return decodedObj; +} +@end + +@implementation MTRPushAVStreamTransportClusterModifyPushTransportParams +- (instancetype)init +{ + if (self = [super init]) { + + _connectionID = @(0); + + _transportOptions = [MTRPushAVStreamTransportClusterTransportOptionsStruct new]; + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRPushAVStreamTransportClusterModifyPushTransportParams alloc] init]; + + other.connectionID = self.connectionID; + other.transportOptions = self.transportOptions; + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: connectionID:%@; transportOptions:%@; >", NSStringFromClass([self class]), _connectionID, _transportOptions]; + return descriptionString; +} + +@end + +@implementation MTRPushAVStreamTransportClusterModifyPushTransportParams (InternalMethods) + +- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader +{ + chip::app::Clusters::PushAvStreamTransport::Commands::ModifyPushTransport::Type encodableStruct; + ListFreer listFreer; + { + encodableStruct.connectionID = self.connectionID.unsignedShortValue; + } + { + encodableStruct.transportOptions.streamType = static_cast>(self.transportOptions.streamType.unsignedCharValue); + if (self.transportOptions.videoStreamID != nil) { + auto & definedValue_1 = encodableStruct.transportOptions.videoStreamID.Emplace(); + definedValue_1 = self.transportOptions.videoStreamID.unsignedShortValue; + } + if (self.transportOptions.audioStreamID != nil) { + auto & definedValue_1 = encodableStruct.transportOptions.audioStreamID.Emplace(); + definedValue_1 = self.transportOptions.audioStreamID.unsignedShortValue; + } + encodableStruct.transportOptions.endpointID = self.transportOptions.endpointID.unsignedShortValue; + encodableStruct.transportOptions.url = AsCharSpan(self.transportOptions.url); + encodableStruct.transportOptions.triggerOptions.triggerType = static_cast>(self.transportOptions.triggerOptions.triggerType.unsignedCharValue); + if (self.transportOptions.triggerOptions.motionZones != nil) { + auto & definedValue_2 = encodableStruct.transportOptions.triggerOptions.motionZones.Emplace(); + if (self.transportOptions.triggerOptions.motionZones == nil) { + definedValue_2.SetNull(); + } else { + auto & nonNullValue_3 = definedValue_2.SetNonNull(); + { + using ListType_4 = std::remove_reference_t; + using ListMemberType_4 = ListMemberTypeGetter::Type; + if (self.transportOptions.triggerOptions.motionZones.count != 0) { + auto * listHolder_4 = new ListHolder(self.transportOptions.triggerOptions.motionZones.count); + if (listHolder_4 == nullptr || listHolder_4->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_4); + for (size_t i_4 = 0; i_4 < self.transportOptions.triggerOptions.motionZones.count; ++i_4) { + auto element_4 = MTR_SAFE_CAST(self.transportOptions.triggerOptions.motionZones[i_4], MTRPushAVStreamTransportClusterTransportZoneOptionsStruct); + if (!element_4) { + // Wrong kind of value. + MTR_LOG_ERROR("%@ incorrectly present in list of %@", self.transportOptions.triggerOptions.motionZones[i_4], NSStringFromClass(MTRPushAVStreamTransportClusterTransportZoneOptionsStruct.class)); + return CHIP_ERROR_INVALID_ARGUMENT; + } + if (element_4.zone == nil) { + listHolder_4->mList[i_4].zone.SetNull(); + } else { + auto & nonNullValue_6 = listHolder_4->mList[i_4].zone.SetNonNull(); + nonNullValue_6 = element_4.zone.unsignedShortValue; + } + if (element_4.sensitivity != nil) { + auto & definedValue_6 = listHolder_4->mList[i_4].sensitivity.Emplace(); + definedValue_6 = element_4.sensitivity.unsignedCharValue; + } + } + nonNullValue_3 = ListType_4(listHolder_4->mList, self.transportOptions.triggerOptions.motionZones.count); + } else { + nonNullValue_3 = ListType_4(); + } + } + } + } + if (self.transportOptions.triggerOptions.motionSensitivity != nil) { + auto & definedValue_2 = encodableStruct.transportOptions.triggerOptions.motionSensitivity.Emplace(); + if (self.transportOptions.triggerOptions.motionSensitivity == nil) { + definedValue_2.SetNull(); + } else { + auto & nonNullValue_3 = definedValue_2.SetNonNull(); + nonNullValue_3 = self.transportOptions.triggerOptions.motionSensitivity.unsignedCharValue; + } + } + if (self.transportOptions.triggerOptions.motionTimeControl != nil) { + auto & definedValue_2 = encodableStruct.transportOptions.triggerOptions.motionTimeControl.Emplace(); + definedValue_2.initialDuration = self.transportOptions.triggerOptions.motionTimeControl.initialDuration.unsignedShortValue; + definedValue_2.augmentationDuration = self.transportOptions.triggerOptions.motionTimeControl.augmentationDuration.unsignedShortValue; + definedValue_2.maxDuration = self.transportOptions.triggerOptions.motionTimeControl.maxDuration.unsignedIntValue; + definedValue_2.blindDuration = self.transportOptions.triggerOptions.motionTimeControl.blindDuration.unsignedShortValue; + } + if (self.transportOptions.triggerOptions.maxPreRollLen != nil) { + auto & definedValue_2 = encodableStruct.transportOptions.triggerOptions.maxPreRollLen.Emplace(); + definedValue_2 = self.transportOptions.triggerOptions.maxPreRollLen.unsignedShortValue; + } + encodableStruct.transportOptions.ingestMethod = static_cast>(self.transportOptions.ingestMethod.unsignedCharValue); + encodableStruct.transportOptions.containerFormat = static_cast>(self.transportOptions.containerFormat.unsignedCharValue); + encodableStruct.transportOptions.containerOptions.containerType = static_cast>(self.transportOptions.containerOptions.containerType.unsignedCharValue); + if (self.transportOptions.containerOptions.cmafContainerOptions != nil) { + auto & definedValue_2 = encodableStruct.transportOptions.containerOptions.CMAFContainerOptions.Emplace(); + definedValue_2.chunkDuration = self.transportOptions.containerOptions.cmafContainerOptions.chunkDuration.unsignedShortValue; + if (self.transportOptions.containerOptions.cmafContainerOptions.cencKey != nil) { + auto & definedValue_4 = definedValue_2.CENCKey.Emplace(); + definedValue_4 = AsByteSpan(self.transportOptions.containerOptions.cmafContainerOptions.cencKey); + } + } + if (self.transportOptions.metadataOptions != nil) { + auto & definedValue_1 = encodableStruct.transportOptions.metadataOptions.Emplace(); + definedValue_1.multiplexing = static_cast>(self.transportOptions.metadataOptions.multiplexing.unsignedCharValue); + definedValue_1.includeMotionZones = self.transportOptions.metadataOptions.includeMotionZones.boolValue; + definedValue_1.enableMetadataPrivacySensitive = self.transportOptions.metadataOptions.enableMetadataPrivacySensitive.boolValue; + } + if (self.transportOptions.expiryTime != nil) { + auto & definedValue_1 = encodableStruct.transportOptions.expiryTime.Emplace(); + definedValue_1 = self.transportOptions.expiryTime.unsignedIntValue; + } + } + + auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); + if (buffer.IsNull()) { + return CHIP_ERROR_NO_MEMORY; + } + + chip::System::PacketBufferTLVWriter writer; + // Commands never need chained buffers, since they cannot be chunked. + writer.Init(std::move(buffer), /* useChainedBuffers = */ false); + + ReturnErrorOnFailure(chip::app::DataModel::Encode(writer, chip::TLV::AnonymousTag(), encodableStruct)); + + ReturnErrorOnFailure(writer.Finalize(&buffer)); + + reader.Init(std::move(buffer)); + return reader.Next(chip::TLV::kTLVType_Structure, chip::TLV::AnonymousTag()); +} + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error +{ + chip::System::PacketBufferTLVReader reader; + CHIP_ERROR err = [self _encodeToTLVReader:reader]; + if (err != CHIP_NO_ERROR) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:err]; + } + return nil; + } + + auto decodedObj = MTRDecodeDataValueDictionaryFromCHIPTLV(&reader); + if (decodedObj == nil) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE]; + } + } + return decodedObj; +} +@end + +@implementation MTRPushAVStreamTransportClusterSetTransportStatusParams +- (instancetype)init +{ + if (self = [super init]) { + + _connectionID = @(0); + + _transportStatus = @(0); + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRPushAVStreamTransportClusterSetTransportStatusParams alloc] init]; + + other.connectionID = self.connectionID; + other.transportStatus = self.transportStatus; + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: connectionID:%@; transportStatus:%@; >", NSStringFromClass([self class]), _connectionID, _transportStatus]; + return descriptionString; +} + +@end + +@implementation MTRPushAVStreamTransportClusterSetTransportStatusParams (InternalMethods) + +- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader +{ + chip::app::Clusters::PushAvStreamTransport::Commands::SetTransportStatus::Type encodableStruct; + ListFreer listFreer; + { + encodableStruct.connectionID = self.connectionID.unsignedShortValue; + } + { + encodableStruct.transportStatus = static_cast>(self.transportStatus.unsignedCharValue); + } + + auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); + if (buffer.IsNull()) { + return CHIP_ERROR_NO_MEMORY; + } + + chip::System::PacketBufferTLVWriter writer; + // Commands never need chained buffers, since they cannot be chunked. + writer.Init(std::move(buffer), /* useChainedBuffers = */ false); + + ReturnErrorOnFailure(chip::app::DataModel::Encode(writer, chip::TLV::AnonymousTag(), encodableStruct)); + + ReturnErrorOnFailure(writer.Finalize(&buffer)); + + reader.Init(std::move(buffer)); + return reader.Next(chip::TLV::kTLVType_Structure, chip::TLV::AnonymousTag()); +} + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error +{ + chip::System::PacketBufferTLVReader reader; + CHIP_ERROR err = [self _encodeToTLVReader:reader]; + if (err != CHIP_NO_ERROR) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:err]; + } + return nil; + } + + auto decodedObj = MTRDecodeDataValueDictionaryFromCHIPTLV(&reader); + if (decodedObj == nil) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE]; + } + } + return decodedObj; +} +@end + +@implementation MTRPushAVStreamTransportClusterManuallyTriggerTransportParams +- (instancetype)init +{ + if (self = [super init]) { + + _connectionID = @(0); + + _activationReason = @(0); + + _timeControl = nil; + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRPushAVStreamTransportClusterManuallyTriggerTransportParams alloc] init]; + + other.connectionID = self.connectionID; + other.activationReason = self.activationReason; + other.timeControl = self.timeControl; + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: connectionID:%@; activationReason:%@; timeControl:%@; >", NSStringFromClass([self class]), _connectionID, _activationReason, _timeControl]; + return descriptionString; +} + +@end + +@implementation MTRPushAVStreamTransportClusterManuallyTriggerTransportParams (InternalMethods) + +- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader +{ + chip::app::Clusters::PushAvStreamTransport::Commands::ManuallyTriggerTransport::Type encodableStruct; + ListFreer listFreer; + { + encodableStruct.connectionID = self.connectionID.unsignedShortValue; + } + { + encodableStruct.activationReason = static_cast>(self.activationReason.unsignedCharValue); + } + { + if (self.timeControl != nil) { + auto & definedValue_0 = encodableStruct.timeControl.Emplace(); + definedValue_0.initialDuration = self.timeControl.initialDuration.unsignedShortValue; + definedValue_0.augmentationDuration = self.timeControl.augmentationDuration.unsignedShortValue; + definedValue_0.maxDuration = self.timeControl.maxDuration.unsignedIntValue; + definedValue_0.blindDuration = self.timeControl.blindDuration.unsignedShortValue; + } + } + + auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); + if (buffer.IsNull()) { + return CHIP_ERROR_NO_MEMORY; + } + + chip::System::PacketBufferTLVWriter writer; + // Commands never need chained buffers, since they cannot be chunked. + writer.Init(std::move(buffer), /* useChainedBuffers = */ false); + + ReturnErrorOnFailure(chip::app::DataModel::Encode(writer, chip::TLV::AnonymousTag(), encodableStruct)); + + ReturnErrorOnFailure(writer.Finalize(&buffer)); + + reader.Init(std::move(buffer)); + return reader.Next(chip::TLV::kTLVType_Structure, chip::TLV::AnonymousTag()); +} + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error +{ + chip::System::PacketBufferTLVReader reader; + CHIP_ERROR err = [self _encodeToTLVReader:reader]; + if (err != CHIP_NO_ERROR) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:err]; + } + return nil; + } + + auto decodedObj = MTRDecodeDataValueDictionaryFromCHIPTLV(&reader); + if (decodedObj == nil) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE]; + } + } + return decodedObj; +} +@end + +@implementation MTRPushAVStreamTransportClusterFindTransportParams +- (instancetype)init +{ + if (self = [super init]) { + + _connectionID = nil; + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRPushAVStreamTransportClusterFindTransportParams alloc] init]; + + other.connectionID = self.connectionID; + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: connectionID:%@; >", NSStringFromClass([self class]), _connectionID]; + return descriptionString; +} + +@end + +@implementation MTRPushAVStreamTransportClusterFindTransportParams (InternalMethods) + +- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader +{ + chip::app::Clusters::PushAvStreamTransport::Commands::FindTransport::Type encodableStruct; + ListFreer listFreer; + { + if (self.connectionID != nil) { + auto & definedValue_0 = encodableStruct.connectionID.Emplace(); + if (self.connectionID == nil) { + definedValue_0.SetNull(); + } else { + auto & nonNullValue_1 = definedValue_0.SetNonNull(); + nonNullValue_1 = self.connectionID.unsignedShortValue; + } + } + } + + auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); + if (buffer.IsNull()) { + return CHIP_ERROR_NO_MEMORY; + } + + chip::System::PacketBufferTLVWriter writer; + // Commands never need chained buffers, since they cannot be chunked. + writer.Init(std::move(buffer), /* useChainedBuffers = */ false); + + ReturnErrorOnFailure(chip::app::DataModel::Encode(writer, chip::TLV::AnonymousTag(), encodableStruct)); + + ReturnErrorOnFailure(writer.Finalize(&buffer)); + + reader.Init(std::move(buffer)); + return reader.Next(chip::TLV::kTLVType_Structure, chip::TLV::AnonymousTag()); +} + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error +{ + chip::System::PacketBufferTLVReader reader; + CHIP_ERROR err = [self _encodeToTLVReader:reader]; + if (err != CHIP_NO_ERROR) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:err]; + } + return nil; + } + + auto decodedObj = MTRDecodeDataValueDictionaryFromCHIPTLV(&reader); + if (decodedObj == nil) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE]; + } + } + return decodedObj; +} +@end + +@implementation MTRPushAVStreamTransportClusterFindTransportResponseParams +- (instancetype)init +{ + if (self = [super init]) { + + _streamConfigurations = [NSArray array]; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRPushAVStreamTransportClusterFindTransportResponseParams alloc] init]; + + other.streamConfigurations = self.streamConfigurations; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: streamConfigurations:%@; >", NSStringFromClass([self class]), _streamConfigurations]; + return descriptionString; +} + +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error +{ + if (!(self = [super init])) { + return nil; + } + + using DecodableType = chip::app::Clusters::PushAvStreamTransport::Commands::FindTransportResponse::DecodableType; + chip::System::PacketBufferHandle buffer = [MTRBaseDevice _responseDataForCommand:responseValue + clusterID:DecodableType::GetClusterId() + commandID:DecodableType::GetCommandId() + error:error]; + if (buffer.IsNull()) { + return nil; + } + + chip::TLV::TLVReader reader; + reader.Init(buffer->Start(), buffer->DataLength()); + + CHIP_ERROR err = reader.Next(chip::TLV::AnonymousTag()); + if (err == CHIP_NO_ERROR) { + DecodableType decodedStruct; + err = chip::app::DataModel::Decode(reader, decodedStruct); + if (err == CHIP_NO_ERROR) { + err = [self _setFieldsFromDecodableStruct:decodedStruct]; + if (err == CHIP_NO_ERROR) { + return self; + } + } + } + + NSString * errorStr = [NSString stringWithFormat:@"Command payload decoding failed: %s", err.AsString()]; + MTR_LOG_ERROR("%s", errorStr.UTF8String); + if (error != nil) { + NSDictionary * userInfo = @{ NSLocalizedFailureReasonErrorKey : NSLocalizedString(errorStr, nil) }; + *error = [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeSchemaMismatch userInfo:userInfo]; + } + return nil; +} + +@end + +@implementation MTRPushAVStreamTransportClusterFindTransportResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::PushAvStreamTransport::Commands::FindTransportResponse::DecodableType &)decodableStruct +{ + { + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = decodableStruct.streamConfigurations.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + MTRPushAVStreamTransportClusterTransportConfigurationStruct * newElement_0; + newElement_0 = [MTRPushAVStreamTransportClusterTransportConfigurationStruct new]; + newElement_0.connectionID = [NSNumber numberWithUnsignedShort:entry_0.connectionID]; + newElement_0.transportStatus = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.transportStatus)]; + newElement_0.transportOptions = [MTRPushAVStreamTransportClusterTransportOptionsStruct new]; + newElement_0.transportOptions.streamType = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.transportOptions.streamType)]; + if (entry_0.transportOptions.videoStreamID.HasValue()) { + newElement_0.transportOptions.videoStreamID = [NSNumber numberWithUnsignedShort:entry_0.transportOptions.videoStreamID.Value()]; + } else { + newElement_0.transportOptions.videoStreamID = nil; + } + if (entry_0.transportOptions.audioStreamID.HasValue()) { + newElement_0.transportOptions.audioStreamID = [NSNumber numberWithUnsignedShort:entry_0.transportOptions.audioStreamID.Value()]; + } else { + newElement_0.transportOptions.audioStreamID = nil; + } + newElement_0.transportOptions.endpointID = [NSNumber numberWithUnsignedShort:entry_0.transportOptions.endpointID]; + newElement_0.transportOptions.url = AsString(entry_0.transportOptions.url); + if (newElement_0.transportOptions.url == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + return err; + } + newElement_0.transportOptions.triggerOptions = [MTRPushAVStreamTransportClusterTransportTriggerOptionsStruct new]; + newElement_0.transportOptions.triggerOptions.triggerType = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.transportOptions.triggerOptions.triggerType)]; + if (entry_0.transportOptions.triggerOptions.motionZones.HasValue()) { + if (entry_0.transportOptions.triggerOptions.motionZones.Value().IsNull()) { + newElement_0.transportOptions.triggerOptions.motionZones = nil; + } else { + { // Scope for our temporary variables + auto * array_6 = [NSMutableArray new]; + auto iter_6 = entry_0.transportOptions.triggerOptions.motionZones.Value().Value().begin(); + while (iter_6.Next()) { + auto & entry_6 = iter_6.GetValue(); + MTRPushAVStreamTransportClusterTransportZoneOptionsStruct * newElement_6; + newElement_6 = [MTRPushAVStreamTransportClusterTransportZoneOptionsStruct new]; + if (entry_6.zone.IsNull()) { + newElement_6.zone = nil; + } else { + newElement_6.zone = [NSNumber numberWithUnsignedShort:entry_6.zone.Value()]; + } + if (entry_6.sensitivity.HasValue()) { + newElement_6.sensitivity = [NSNumber numberWithUnsignedChar:entry_6.sensitivity.Value()]; + } else { + newElement_6.sensitivity = nil; + } + [array_6 addObject:newElement_6]; + } + CHIP_ERROR err = iter_6.GetStatus(); + if (err != CHIP_NO_ERROR) { + return err; + } + newElement_0.transportOptions.triggerOptions.motionZones = array_6; + } + } + } else { + newElement_0.transportOptions.triggerOptions.motionZones = nil; + } + if (entry_0.transportOptions.triggerOptions.motionSensitivity.HasValue()) { + if (entry_0.transportOptions.triggerOptions.motionSensitivity.Value().IsNull()) { + newElement_0.transportOptions.triggerOptions.motionSensitivity = nil; + } else { + newElement_0.transportOptions.triggerOptions.motionSensitivity = [NSNumber numberWithUnsignedChar:entry_0.transportOptions.triggerOptions.motionSensitivity.Value().Value()]; + } + } else { + newElement_0.transportOptions.triggerOptions.motionSensitivity = nil; + } + if (entry_0.transportOptions.triggerOptions.motionTimeControl.HasValue()) { + newElement_0.transportOptions.triggerOptions.motionTimeControl = [MTRPushAVStreamTransportClusterTransportMotionTriggerTimeControlStruct new]; + newElement_0.transportOptions.triggerOptions.motionTimeControl.initialDuration = [NSNumber numberWithUnsignedShort:entry_0.transportOptions.triggerOptions.motionTimeControl.Value().initialDuration]; + newElement_0.transportOptions.triggerOptions.motionTimeControl.augmentationDuration = [NSNumber numberWithUnsignedShort:entry_0.transportOptions.triggerOptions.motionTimeControl.Value().augmentationDuration]; + newElement_0.transportOptions.triggerOptions.motionTimeControl.maxDuration = [NSNumber numberWithUnsignedInt:entry_0.transportOptions.triggerOptions.motionTimeControl.Value().maxDuration]; + newElement_0.transportOptions.triggerOptions.motionTimeControl.blindDuration = [NSNumber numberWithUnsignedShort:entry_0.transportOptions.triggerOptions.motionTimeControl.Value().blindDuration]; + } else { + newElement_0.transportOptions.triggerOptions.motionTimeControl = nil; + } + if (entry_0.transportOptions.triggerOptions.maxPreRollLen.HasValue()) { + newElement_0.transportOptions.triggerOptions.maxPreRollLen = [NSNumber numberWithUnsignedShort:entry_0.transportOptions.triggerOptions.maxPreRollLen.Value()]; + } else { + newElement_0.transportOptions.triggerOptions.maxPreRollLen = nil; + } + newElement_0.transportOptions.ingestMethod = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.transportOptions.ingestMethod)]; + newElement_0.transportOptions.containerFormat = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.transportOptions.containerFormat)]; + newElement_0.transportOptions.containerOptions = [MTRPushAVStreamTransportClusterContainerOptionsStruct new]; + newElement_0.transportOptions.containerOptions.containerType = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.transportOptions.containerOptions.containerType)]; + if (entry_0.transportOptions.containerOptions.CMAFContainerOptions.HasValue()) { + newElement_0.transportOptions.containerOptions.cmafContainerOptions = [MTRPushAVStreamTransportClusterCMAFContainerOptionsStruct new]; + newElement_0.transportOptions.containerOptions.cmafContainerOptions.chunkDuration = [NSNumber numberWithUnsignedShort:entry_0.transportOptions.containerOptions.CMAFContainerOptions.Value().chunkDuration]; + if (entry_0.transportOptions.containerOptions.CMAFContainerOptions.Value().CENCKey.HasValue()) { + newElement_0.transportOptions.containerOptions.cmafContainerOptions.cencKey = AsData(entry_0.transportOptions.containerOptions.CMAFContainerOptions.Value().CENCKey.Value()); + } else { + newElement_0.transportOptions.containerOptions.cmafContainerOptions.cencKey = nil; + } + } else { + newElement_0.transportOptions.containerOptions.cmafContainerOptions = nil; + } + if (entry_0.transportOptions.metadataOptions.HasValue()) { + newElement_0.transportOptions.metadataOptions = [MTRPushAVStreamTransportClusterMetadataOptionsStruct new]; + newElement_0.transportOptions.metadataOptions.multiplexing = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.transportOptions.metadataOptions.Value().multiplexing)]; + newElement_0.transportOptions.metadataOptions.includeMotionZones = [NSNumber numberWithBool:entry_0.transportOptions.metadataOptions.Value().includeMotionZones]; + newElement_0.transportOptions.metadataOptions.enableMetadataPrivacySensitive = [NSNumber numberWithBool:entry_0.transportOptions.metadataOptions.Value().enableMetadataPrivacySensitive]; + } else { + newElement_0.transportOptions.metadataOptions = nil; + } + if (entry_0.transportOptions.expiryTime.HasValue()) { + newElement_0.transportOptions.expiryTime = [NSNumber numberWithUnsignedInt:entry_0.transportOptions.expiryTime.Value()]; + } else { + newElement_0.transportOptions.expiryTime = nil; + } + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + return err; + } + self.streamConfigurations = array_0; + } + } + return CHIP_NO_ERROR; +} + +@end + @implementation MTRChimeClusterPlayChimeSoundParams - (instancetype)init { diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h index a1fd2d1dc80a2e..60bb6ecd43e141 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h @@ -2200,6 +2200,54 @@ NS_ASSUME_NONNULL_BEGIN @end +@interface MTRPushAVStreamTransportClusterAllocatePushTransportParams (InternalMethods) + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; + +@end + +@interface MTRPushAVStreamTransportClusterAllocatePushTransportResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::PushAvStreamTransport::Commands::AllocatePushTransportResponse::DecodableType &)decodableStruct; + +@end + +@interface MTRPushAVStreamTransportClusterDeallocatePushTransportParams (InternalMethods) + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; + +@end + +@interface MTRPushAVStreamTransportClusterModifyPushTransportParams (InternalMethods) + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; + +@end + +@interface MTRPushAVStreamTransportClusterSetTransportStatusParams (InternalMethods) + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; + +@end + +@interface MTRPushAVStreamTransportClusterManuallyTriggerTransportParams (InternalMethods) + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; + +@end + +@interface MTRPushAVStreamTransportClusterFindTransportParams (InternalMethods) + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; + +@end + +@interface MTRPushAVStreamTransportClusterFindTransportResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::PushAvStreamTransport::Commands::FindTransportResponse::DecodableType &)decodableStruct; + +@end + @interface MTRChimeClusterPlayChimeSoundParams (InternalMethods) - (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandTimedCheck.mm b/src/darwin/Framework/CHIP/zap-generated/MTRCommandTimedCheck.mm index f45fd6f3ccdccb..07dbbfdd8e64d3 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandTimedCheck.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandTimedCheck.mm @@ -1160,6 +1160,15 @@ static BOOL CommandNeedsTimedInvokeInWebRTCTransportRequestorCluster(AttributeId } } } +static BOOL CommandNeedsTimedInvokeInPushAVStreamTransportCluster(AttributeId aAttributeId) +{ + using namespace Clusters::PushAvStreamTransport; + switch (aAttributeId) { + default: { + return NO; + } + } +} static BOOL CommandNeedsTimedInvokeInChimeCluster(AttributeId aAttributeId) { using namespace Clusters::Chime; @@ -1569,6 +1578,9 @@ BOOL MTRCommandNeedsTimedInvoke(NSNumber * _Nonnull aClusterID, NSNumber * _Nonn case Clusters::WebRTCTransportRequestor::Id: { return CommandNeedsTimedInvokeInWebRTCTransportRequestorCluster(commandID); } + case Clusters::PushAvStreamTransport::Id: { + return CommandNeedsTimedInvokeInPushAVStreamTransportCluster(commandID); + } case Clusters::Chime::Id: { return CommandNeedsTimedInvokeInChimeCluster(commandID); } diff --git a/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm index 0a04add54fd1d3..1059c5ccd94774 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm @@ -4922,6 +4922,80 @@ static id _Nullable DecodeEventPayloadForWebRTCTransportRequestorCluster(EventId *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; return nil; } +static id _Nullable DecodeEventPayloadForPushAVStreamTransportCluster(EventId aEventId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::PushAvStreamTransport; + switch (aEventId) { + case Events::PushTransportBegin::Id: { + Events::PushTransportBegin::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + + __auto_type * value = [MTRPushAVStreamTransportClusterPushTransportBeginEvent new]; + + do { + NSNumber * _Nonnull memberValue; + memberValue = [NSNumber numberWithUnsignedShort:cppValue.connectionID]; + value.connectionID = memberValue; + } while (0); + do { + NSNumber * _Nonnull memberValue; + memberValue = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.triggerType)]; + value.triggerType = memberValue; + } while (0); + do { + NSNumber * _Nullable memberValue; + if (cppValue.activationReason.HasValue()) { + memberValue = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.activationReason.Value())]; + } else { + memberValue = nil; + } + value.activationReason = memberValue; + } while (0); + + return value; + } + case Events::PushTransportEnd::Id: { + Events::PushTransportEnd::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + + __auto_type * value = [MTRPushAVStreamTransportClusterPushTransportEndEvent new]; + + do { + NSNumber * _Nonnull memberValue; + memberValue = [NSNumber numberWithUnsignedShort:cppValue.connectionID]; + value.connectionID = memberValue; + } while (0); + do { + NSNumber * _Nonnull memberValue; + memberValue = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.triggerType)]; + value.triggerType = memberValue; + } while (0); + do { + NSNumber * _Nullable memberValue; + if (cppValue.activationReason.HasValue()) { + memberValue = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.activationReason.Value())]; + } else { + memberValue = nil; + } + value.activationReason = memberValue; + } while (0); + + return value; + } + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; + return nil; +} static id _Nullable DecodeEventPayloadForChimeCluster(EventId aEventId, TLV::TLVReader & aReader, CHIP_ERROR * aError) { using namespace Clusters::Chime; @@ -5536,6 +5610,9 @@ id _Nullable MTRDecodeEventPayload(const ConcreteEventPath & aPath, TLV::TLVRead case Clusters::WebRTCTransportRequestor::Id: { return DecodeEventPayloadForWebRTCTransportRequestorCluster(aPath.mEventId, aReader, aError); } + case Clusters::PushAvStreamTransport::Id: { + return DecodeEventPayloadForPushAVStreamTransportCluster(aPath.mEventId, aReader, aError); + } case Clusters::Chime::Id: { return DecodeEventPayloadForChimeCluster(aPath.mEventId, aReader, aError); } diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h index f6e17d8bb4cfae..e61f51885527e6 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h @@ -2321,6 +2321,84 @@ MTR_PROVISIONALLY_AVAILABLE @property (nonatomic, copy) NSNumber * _Nonnull metadataOptions MTR_PROVISIONALLY_AVAILABLE; @end +MTR_PROVISIONALLY_AVAILABLE +@interface MTRPushAVStreamTransportClusterTransportMotionTriggerTimeControlStruct : NSObject +@property (nonatomic, copy) NSNumber * _Nonnull initialDuration MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull augmentationDuration MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull maxDuration MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull blindDuration MTR_PROVISIONALLY_AVAILABLE; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRPushAVStreamTransportClusterTransportZoneOptionsStruct : NSObject +@property (nonatomic, copy) NSNumber * _Nullable zone MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable sensitivity MTR_PROVISIONALLY_AVAILABLE; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRPushAVStreamTransportClusterMetadataOptionsStruct : NSObject +@property (nonatomic, copy) NSNumber * _Nonnull multiplexing MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull includeMotionZones MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull enableMetadataPrivacySensitive MTR_PROVISIONALLY_AVAILABLE; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRPushAVStreamTransportClusterTransportTriggerOptionsStruct : NSObject +@property (nonatomic, copy) NSNumber * _Nonnull triggerType MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSArray * _Nullable motionZones MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable motionSensitivity MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) MTRPushAVStreamTransportClusterTransportMotionTriggerTimeControlStruct * _Nullable motionTimeControl MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable maxPreRollLen MTR_PROVISIONALLY_AVAILABLE; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRPushAVStreamTransportClusterCMAFContainerOptionsStruct : NSObject +@property (nonatomic, copy) NSNumber * _Nonnull chunkDuration MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSData * _Nullable cencKey MTR_PROVISIONALLY_AVAILABLE; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRPushAVStreamTransportClusterContainerOptionsStruct : NSObject +@property (nonatomic, copy) NSNumber * _Nonnull containerType MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) MTRPushAVStreamTransportClusterCMAFContainerOptionsStruct * _Nullable cmafContainerOptions MTR_PROVISIONALLY_AVAILABLE; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRPushAVStreamTransportClusterTransportOptionsStruct : NSObject +@property (nonatomic, copy) NSNumber * _Nonnull streamType MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable videoStreamID MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable audioStreamID MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull endpointID MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSString * _Nonnull url MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) MTRPushAVStreamTransportClusterTransportTriggerOptionsStruct * _Nonnull triggerOptions MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull ingestMethod MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull containerFormat MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) MTRPushAVStreamTransportClusterContainerOptionsStruct * _Nonnull containerOptions MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) MTRPushAVStreamTransportClusterMetadataOptionsStruct * _Nullable metadataOptions MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable expiryTime MTR_PROVISIONALLY_AVAILABLE; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRPushAVStreamTransportClusterTransportConfigurationStruct : NSObject +@property (nonatomic, copy) NSNumber * _Nonnull connectionID MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull transportStatus MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) MTRPushAVStreamTransportClusterTransportOptionsStruct * _Nonnull transportOptions MTR_PROVISIONALLY_AVAILABLE; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRPushAVStreamTransportClusterPushTransportBeginEvent : NSObject +@property (nonatomic, copy) NSNumber * _Nonnull connectionID MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull triggerType MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable activationReason MTR_PROVISIONALLY_AVAILABLE; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRPushAVStreamTransportClusterPushTransportEndEvent : NSObject +@property (nonatomic, copy) NSNumber * _Nonnull connectionID MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull triggerType MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable activationReason MTR_PROVISIONALLY_AVAILABLE; +@end + MTR_PROVISIONALLY_AVAILABLE @interface MTRChimeClusterChimeSoundStruct : NSObject @property (nonatomic, copy) NSNumber * _Nonnull chimeID MTR_PROVISIONALLY_AVAILABLE; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm index ddc22861202fc1..1aaff2b36441ef 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm @@ -9644,6 +9644,360 @@ - (NSString *)description @end +@implementation MTRPushAVStreamTransportClusterTransportMotionTriggerTimeControlStruct +- (instancetype)init +{ + if (self = [super init]) { + + _initialDuration = @(0); + + _augmentationDuration = @(0); + + _maxDuration = @(0); + + _blindDuration = @(0); + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRPushAVStreamTransportClusterTransportMotionTriggerTimeControlStruct alloc] init]; + + other.initialDuration = self.initialDuration; + other.augmentationDuration = self.augmentationDuration; + other.maxDuration = self.maxDuration; + other.blindDuration = self.blindDuration; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: initialDuration:%@; augmentationDuration:%@; maxDuration:%@; blindDuration:%@; >", NSStringFromClass([self class]), _initialDuration, _augmentationDuration, _maxDuration, _blindDuration]; + return descriptionString; +} + +@end + +@implementation MTRPushAVStreamTransportClusterTransportZoneOptionsStruct +- (instancetype)init +{ + if (self = [super init]) { + + _zone = nil; + + _sensitivity = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRPushAVStreamTransportClusterTransportZoneOptionsStruct alloc] init]; + + other.zone = self.zone; + other.sensitivity = self.sensitivity; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: zone:%@; sensitivity:%@; >", NSStringFromClass([self class]), _zone, _sensitivity]; + return descriptionString; +} + +@end + +@implementation MTRPushAVStreamTransportClusterMetadataOptionsStruct +- (instancetype)init +{ + if (self = [super init]) { + + _multiplexing = @(0); + + _includeMotionZones = @(0); + + _enableMetadataPrivacySensitive = @(0); + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRPushAVStreamTransportClusterMetadataOptionsStruct alloc] init]; + + other.multiplexing = self.multiplexing; + other.includeMotionZones = self.includeMotionZones; + other.enableMetadataPrivacySensitive = self.enableMetadataPrivacySensitive; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: multiplexing:%@; includeMotionZones:%@; enableMetadataPrivacySensitive:%@; >", NSStringFromClass([self class]), _multiplexing, _includeMotionZones, _enableMetadataPrivacySensitive]; + return descriptionString; +} + +@end + +@implementation MTRPushAVStreamTransportClusterTransportTriggerOptionsStruct +- (instancetype)init +{ + if (self = [super init]) { + + _triggerType = @(0); + + _motionZones = nil; + + _motionSensitivity = nil; + + _motionTimeControl = nil; + + _maxPreRollLen = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRPushAVStreamTransportClusterTransportTriggerOptionsStruct alloc] init]; + + other.triggerType = self.triggerType; + other.motionZones = self.motionZones; + other.motionSensitivity = self.motionSensitivity; + other.motionTimeControl = self.motionTimeControl; + other.maxPreRollLen = self.maxPreRollLen; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: triggerType:%@; motionZones:%@; motionSensitivity:%@; motionTimeControl:%@; maxPreRollLen:%@; >", NSStringFromClass([self class]), _triggerType, _motionZones, _motionSensitivity, _motionTimeControl, _maxPreRollLen]; + return descriptionString; +} + +@end + +@implementation MTRPushAVStreamTransportClusterCMAFContainerOptionsStruct +- (instancetype)init +{ + if (self = [super init]) { + + _chunkDuration = @(0); + + _cencKey = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRPushAVStreamTransportClusterCMAFContainerOptionsStruct alloc] init]; + + other.chunkDuration = self.chunkDuration; + other.cencKey = self.cencKey; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: chunkDuration:%@; cencKey:%@; >", NSStringFromClass([self class]), _chunkDuration, [_cencKey base64EncodedStringWithOptions:0]]; + return descriptionString; +} + +@end + +@implementation MTRPushAVStreamTransportClusterContainerOptionsStruct +- (instancetype)init +{ + if (self = [super init]) { + + _containerType = @(0); + + _cmafContainerOptions = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRPushAVStreamTransportClusterContainerOptionsStruct alloc] init]; + + other.containerType = self.containerType; + other.cmafContainerOptions = self.cmafContainerOptions; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: containerType:%@; cmafContainerOptions:%@; >", NSStringFromClass([self class]), _containerType, _cmafContainerOptions]; + return descriptionString; +} + +@end + +@implementation MTRPushAVStreamTransportClusterTransportOptionsStruct +- (instancetype)init +{ + if (self = [super init]) { + + _streamType = @(0); + + _videoStreamID = nil; + + _audioStreamID = nil; + + _endpointID = @(0); + + _url = @""; + + _triggerOptions = [MTRPushAVStreamTransportClusterTransportTriggerOptionsStruct new]; + + _ingestMethod = @(0); + + _containerFormat = @(0); + + _containerOptions = [MTRPushAVStreamTransportClusterContainerOptionsStruct new]; + + _metadataOptions = nil; + + _expiryTime = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRPushAVStreamTransportClusterTransportOptionsStruct alloc] init]; + + other.streamType = self.streamType; + other.videoStreamID = self.videoStreamID; + other.audioStreamID = self.audioStreamID; + other.endpointID = self.endpointID; + other.url = self.url; + other.triggerOptions = self.triggerOptions; + other.ingestMethod = self.ingestMethod; + other.containerFormat = self.containerFormat; + other.containerOptions = self.containerOptions; + other.metadataOptions = self.metadataOptions; + other.expiryTime = self.expiryTime; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: streamType:%@; videoStreamID:%@; audioStreamID:%@; endpointID:%@; url:%@; triggerOptions:%@; ingestMethod:%@; containerFormat:%@; containerOptions:%@; metadataOptions:%@; expiryTime:%@; >", NSStringFromClass([self class]), _streamType, _videoStreamID, _audioStreamID, _endpointID, _url, _triggerOptions, _ingestMethod, _containerFormat, _containerOptions, _metadataOptions, _expiryTime]; + return descriptionString; +} + +@end + +@implementation MTRPushAVStreamTransportClusterTransportConfigurationStruct +- (instancetype)init +{ + if (self = [super init]) { + + _connectionID = @(0); + + _transportStatus = @(0); + + _transportOptions = [MTRPushAVStreamTransportClusterTransportOptionsStruct new]; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRPushAVStreamTransportClusterTransportConfigurationStruct alloc] init]; + + other.connectionID = self.connectionID; + other.transportStatus = self.transportStatus; + other.transportOptions = self.transportOptions; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: connectionID:%@; transportStatus:%@; transportOptions:%@; >", NSStringFromClass([self class]), _connectionID, _transportStatus, _transportOptions]; + return descriptionString; +} + +@end + +@implementation MTRPushAVStreamTransportClusterPushTransportBeginEvent +- (instancetype)init +{ + if (self = [super init]) { + + _connectionID = @(0); + + _triggerType = @(0); + + _activationReason = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRPushAVStreamTransportClusterPushTransportBeginEvent alloc] init]; + + other.connectionID = self.connectionID; + other.triggerType = self.triggerType; + other.activationReason = self.activationReason; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: connectionID:%@; triggerType:%@; activationReason:%@; >", NSStringFromClass([self class]), _connectionID, _triggerType, _activationReason]; + return descriptionString; +} + +@end + +@implementation MTRPushAVStreamTransportClusterPushTransportEndEvent +- (instancetype)init +{ + if (self = [super init]) { + + _connectionID = @(0); + + _triggerType = @(0); + + _activationReason = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRPushAVStreamTransportClusterPushTransportEndEvent alloc] init]; + + other.connectionID = self.connectionID; + other.triggerType = self.triggerType; + other.activationReason = self.activationReason; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: connectionID:%@; triggerType:%@; activationReason:%@; >", NSStringFromClass([self class]), _connectionID, _triggerType, _activationReason]; + return descriptionString; +} + +@end + @implementation MTRChimeClusterChimeSoundStruct - (instancetype)init { diff --git a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp index 10f67cad3ffd77..6d64bd785fc725 100644 --- a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp +++ b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp @@ -38396,6 +38396,211 @@ Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) } // namespace Attributes } // namespace WebRTCTransportRequestor +namespace PushAvStreamTransport { +namespace Attributes { + +namespace SupportedContainerFormats { + +Protocols::InteractionModel::Status +Get(EndpointId endpoint, chip::BitMask * value) +{ + using Traits = + NumericAttributeTraits>; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = + emberAfReadAttribute(endpoint, Clusters::PushAvStreamTransport::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + *value = Traits::StorageToWorking(temp); + return status; +} + +Protocols::InteractionModel::Status +Set(EndpointId endpoint, chip::BitMask value, + MarkAttributeDirty markDirty) +{ + using Traits = + NumericAttributeTraits>; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::PushAvStreamTransport::Id, Id), + EmberAfWriteDataInput(writable, ZCL_BITMAP8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); +} + +Protocols::InteractionModel::Status +Set(EndpointId endpoint, chip::BitMask value) +{ + using Traits = + NumericAttributeTraits>; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::PushAvStreamTransport::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE); +} + +} // namespace SupportedContainerFormats + +namespace SupportedIngestMethods { + +Protocols::InteractionModel::Status +Get(EndpointId endpoint, chip::BitMask * value) +{ + using Traits = NumericAttributeTraits>; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = + emberAfReadAttribute(endpoint, Clusters::PushAvStreamTransport::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + *value = Traits::StorageToWorking(temp); + return status; +} + +Protocols::InteractionModel::Status +Set(EndpointId endpoint, chip::BitMask value, + MarkAttributeDirty markDirty) +{ + using Traits = NumericAttributeTraits>; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::PushAvStreamTransport::Id, Id), + EmberAfWriteDataInput(writable, ZCL_BITMAP8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); +} + +Protocols::InteractionModel::Status +Set(EndpointId endpoint, chip::BitMask value) +{ + using Traits = NumericAttributeTraits>; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::PushAvStreamTransport::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE); +} + +} // namespace SupportedIngestMethods + +namespace FeatureMap { + +Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = + emberAfReadAttribute(endpoint, Clusters::PushAvStreamTransport::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + *value = Traits::StorageToWorking(temp); + return status; +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::PushAvStreamTransport::Id, Id), + EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::PushAvStreamTransport::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); +} + +} // namespace FeatureMap + +namespace ClusterRevision { + +Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = + emberAfReadAttribute(endpoint, Clusters::PushAvStreamTransport::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + *value = Traits::StorageToWorking(temp); + return status; +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::PushAvStreamTransport::Id, Id), + EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::PushAvStreamTransport::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); +} + +} // namespace ClusterRevision + +} // namespace Attributes +} // namespace PushAvStreamTransport + namespace Chime { namespace Attributes { diff --git a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h index d77633d6d72bbc..2d3790b204910a 100644 --- a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h +++ b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h @@ -5814,6 +5814,46 @@ Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, Mar } // namespace Attributes } // namespace WebRTCTransportRequestor +namespace PushAvStreamTransport { +namespace Attributes { + +namespace SupportedContainerFormats { +Protocols::InteractionModel::Status Get(EndpointId endpoint, + chip::BitMask * + value); // SupportedContainerFormatsBitmap +Protocols::InteractionModel::Status +Set(EndpointId endpoint, chip::BitMask value); +Protocols::InteractionModel::Status +Set(EndpointId endpoint, chip::BitMask value, + MarkAttributeDirty markDirty); +} // namespace SupportedContainerFormats + +namespace SupportedIngestMethods { +Protocols::InteractionModel::Status Get(EndpointId endpoint, + chip::BitMask * + value); // SupportedIngestMethodsBitmap +Protocols::InteractionModel::Status +Set(EndpointId endpoint, chip::BitMask value); +Protocols::InteractionModel::Status +Set(EndpointId endpoint, chip::BitMask value, + MarkAttributeDirty markDirty); +} // namespace SupportedIngestMethods + +namespace FeatureMap { +Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value); // bitmap32 +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value); +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty); +} // namespace FeatureMap + +namespace ClusterRevision { +Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value); // int16u +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value); +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty); +} // namespace ClusterRevision + +} // namespace Attributes +} // namespace PushAvStreamTransport + namespace Chime { namespace Attributes { diff --git a/zzz_generated/app-common/app-common/zap-generated/callback.h b/zzz_generated/app-common/app-common/zap-generated/callback.h index b594c4cce72675..5d3875d172a36c 100644 --- a/zzz_generated/app-common/app-common/zap-generated/callback.h +++ b/zzz_generated/app-common/app-common/zap-generated/callback.h @@ -638,6 +638,11 @@ void emberAfWebRTCTransportProviderClusterInitCallback(chip::EndpointId endpoint */ void emberAfWebRTCTransportRequestorClusterInitCallback(chip::EndpointId endpoint); +/** + * @param endpoint Endpoint that is being initialized + */ +void emberAfPushAvStreamTransportClusterInitCallback(chip::EndpointId endpoint); + /** * @param endpoint Endpoint that is being initialized */ @@ -5345,6 +5350,44 @@ chip::Protocols::InteractionModel::Status MatterWebRTCTransportRequestorClusterS */ void emberAfWebRTCTransportRequestorClusterServerTickCallback(chip::EndpointId endpoint); +// +// Push AV Stream Transport Cluster +// + +/** + * @param endpoint Endpoint that is being initialized + */ +void emberAfPushAvStreamTransportClusterServerInitCallback(chip::EndpointId endpoint); + +/** + * @param endpoint Endpoint that is being shutdown + */ +void MatterPushAvStreamTransportClusterServerShutdownCallback(chip::EndpointId endpoint); + +/** + * @param endpoint Endpoint that is being initialized + */ +void emberAfPushAvStreamTransportClusterClientInitCallback(chip::EndpointId endpoint); + +/** + * @param attributePath Concrete attribute path that changed + */ +void MatterPushAvStreamTransportClusterServerAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath); + +/** + * @param attributePath Concrete attribute path to be changed + * @param attributeType Attribute type + * @param size Attribute size + * @param value Attribute value + */ +chip::Protocols::InteractionModel::Status MatterPushAvStreamTransportClusterServerPreAttributeChangedCallback( + const chip::app::ConcreteAttributePath & attributePath, EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); + +/** + * @param endpoint Endpoint that is being served + */ +void emberAfPushAvStreamTransportClusterServerTickCallback(chip::EndpointId endpoint); + // // Chime Cluster // @@ -6906,6 +6949,42 @@ bool emberAfWebRTCTransportRequestorClusterICECandidateCallback( bool emberAfWebRTCTransportRequestorClusterEndCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, const chip::app::Clusters::WebRTCTransportRequestor::Commands::End::DecodableType & commandData); +/** + * @brief Push AV Stream Transport Cluster AllocatePushTransport Command callback (from client) + */ +bool emberAfPushAvStreamTransportClusterAllocatePushTransportCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::PushAvStreamTransport::Commands::AllocatePushTransport::DecodableType & commandData); +/** + * @brief Push AV Stream Transport Cluster DeallocatePushTransport Command callback (from client) + */ +bool emberAfPushAvStreamTransportClusterDeallocatePushTransportCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::PushAvStreamTransport::Commands::DeallocatePushTransport::DecodableType & commandData); +/** + * @brief Push AV Stream Transport Cluster ModifyPushTransport Command callback (from client) + */ +bool emberAfPushAvStreamTransportClusterModifyPushTransportCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::PushAvStreamTransport::Commands::ModifyPushTransport::DecodableType & commandData); +/** + * @brief Push AV Stream Transport Cluster SetTransportStatus Command callback (from client) + */ +bool emberAfPushAvStreamTransportClusterSetTransportStatusCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::PushAvStreamTransport::Commands::SetTransportStatus::DecodableType & commandData); +/** + * @brief Push AV Stream Transport Cluster ManuallyTriggerTransport Command callback (from client) + */ +bool emberAfPushAvStreamTransportClusterManuallyTriggerTransportCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::PushAvStreamTransport::Commands::ManuallyTriggerTransport::DecodableType & commandData); +/** + * @brief Push AV Stream Transport Cluster FindTransport Command callback (from client) + */ +bool emberAfPushAvStreamTransportClusterFindTransportCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::PushAvStreamTransport::Commands::FindTransport::DecodableType & commandData); /** * @brief Unit Testing Cluster Test Command callback (from client) */ diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-enums-check.h b/zzz_generated/app-common/app-common/zap-generated/cluster-enums-check.h index f877d63b7feeb6..fa4ed90738832e 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-enums-check.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-enums-check.h @@ -3704,6 +3704,97 @@ static auto __attribute__((unused)) EnsureKnownEnumValue(CameraAvStreamManagemen } } +static auto __attribute__((unused)) EnsureKnownEnumValue(PushAvStreamTransport::ContainerFormatEnum val) +{ + using EnumType = PushAvStreamTransport::ContainerFormatEnum; + switch (val) + { + case EnumType::kCmaf: + return val; + default: + return EnumType::kUnknownEnumValue; + } +} +static auto __attribute__((unused)) EnsureKnownEnumValue(PushAvStreamTransport::IngestMethodsEnum val) +{ + using EnumType = PushAvStreamTransport::IngestMethodsEnum; + switch (val) + { + case EnumType::kCMAFIngest: + return val; + default: + return EnumType::kUnknownEnumValue; + } +} +static auto __attribute__((unused)) EnsureKnownEnumValue(PushAvStreamTransport::StatusCodeEnum val) +{ + using EnumType = PushAvStreamTransport::StatusCodeEnum; + switch (val) + { + case EnumType::kAllocationNotPermitted: + case EnumType::kInvalidTLSEndpoint: + case EnumType::kInvalidStream: + case EnumType::kInvalidURL: + case EnumType::kInvalidZone: + case EnumType::kUnsupportedContainerFormat: + case EnumType::kUnsupportedIngestMethod: + case EnumType::kInvalidTriggerType: + case EnumType::kInvalidTransportStatus: + return val; + default: + return EnumType::kUnknownEnumValue; + } +} +static auto __attribute__((unused)) EnsureKnownEnumValue(PushAvStreamTransport::StreamMultiplexingEnum val) +{ + using EnumType = PushAvStreamTransport::StreamMultiplexingEnum; + switch (val) + { + case EnumType::kInterleaved: + return val; + default: + return EnumType::kUnknownEnumValue; + } +} +static auto __attribute__((unused)) EnsureKnownEnumValue(PushAvStreamTransport::TransportStatusEnum val) +{ + using EnumType = PushAvStreamTransport::TransportStatusEnum; + switch (val) + { + case EnumType::kActive: + case EnumType::kInactive: + return val; + default: + return EnumType::kUnknownEnumValue; + } +} +static auto __attribute__((unused)) EnsureKnownEnumValue(PushAvStreamTransport::TransportTriggerTypeEnum val) +{ + using EnumType = PushAvStreamTransport::TransportTriggerTypeEnum; + switch (val) + { + case EnumType::kCommand: + case EnumType::kMotion: + case EnumType::kContinuous: + return val; + default: + return EnumType::kUnknownEnumValue; + } +} +static auto __attribute__((unused)) EnsureKnownEnumValue(PushAvStreamTransport::TriggerActivationReasonEnum val) +{ + using EnumType = PushAvStreamTransport::TriggerActivationReasonEnum; + switch (val) + { + case EnumType::kUserInitiated: + case EnumType::kAutomation: + case EnumType::kEmergency: + return val; + default: + return EnumType::kUnknownEnumValue; + } +} + static auto __attribute__((unused)) EnsureKnownEnumValue(UnitTesting::SimpleEnum val) { using EnumType = UnitTesting::SimpleEnum; diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h b/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h index aae67302e404a0..3e2eaf35f7bf33 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h @@ -5630,6 +5630,119 @@ using WebRTCEndReasonEnum = Clusters::detail::WebRTCEndReasonEnum; using WebRTCMetadataOptions = Clusters::detail::WebRTCMetadataOptions; } // namespace WebRTCTransportRequestor +namespace PushAvStreamTransport { + +// Enum for ContainerFormatEnum +enum class ContainerFormatEnum : uint8_t +{ + kCmaf = 0x00, + // All received enum values that are not listed above will be mapped + // to kUnknownEnumValue. This is a helper enum value that should only + // be used by code to process how it handles receiving and unknown + // enum value. This specific should never be transmitted. + kUnknownEnumValue = 1, +}; + +// Enum for IngestMethodsEnum +enum class IngestMethodsEnum : uint8_t +{ + kCMAFIngest = 0x00, + // All received enum values that are not listed above will be mapped + // to kUnknownEnumValue. This is a helper enum value that should only + // be used by code to process how it handles receiving and unknown + // enum value. This specific should never be transmitted. + kUnknownEnumValue = 1, +}; + +// Enum for StatusCodeEnum +enum class StatusCodeEnum : uint8_t +{ + kAllocationNotPermitted = 0x02, + kInvalidTLSEndpoint = 0x03, + kInvalidStream = 0x04, + kInvalidURL = 0x05, + kInvalidZone = 0x06, + kUnsupportedContainerFormat = 0x07, + kUnsupportedIngestMethod = 0x08, + kInvalidTriggerType = 0x09, + kInvalidTransportStatus = 0x10, + // All received enum values that are not listed above will be mapped + // to kUnknownEnumValue. This is a helper enum value that should only + // be used by code to process how it handles receiving and unknown + // enum value. This specific should never be transmitted. + kUnknownEnumValue = 0, +}; + +// Enum for StreamMultiplexingEnum +enum class StreamMultiplexingEnum : uint8_t +{ + kInterleaved = 0x00, + // All received enum values that are not listed above will be mapped + // to kUnknownEnumValue. This is a helper enum value that should only + // be used by code to process how it handles receiving and unknown + // enum value. This specific should never be transmitted. + kUnknownEnumValue = 1, +}; + +using StreamTypeEnum = Clusters::detail::StreamTypeEnum; + +// Enum for TransportStatusEnum +enum class TransportStatusEnum : uint8_t +{ + kActive = 0x00, + kInactive = 0x01, + // All received enum values that are not listed above will be mapped + // to kUnknownEnumValue. This is a helper enum value that should only + // be used by code to process how it handles receiving and unknown + // enum value. This specific should never be transmitted. + kUnknownEnumValue = 2, +}; + +// Enum for TransportTriggerTypeEnum +enum class TransportTriggerTypeEnum : uint8_t +{ + kCommand = 0x00, + kMotion = 0x01, + kContinuous = 0x02, + // All received enum values that are not listed above will be mapped + // to kUnknownEnumValue. This is a helper enum value that should only + // be used by code to process how it handles receiving and unknown + // enum value. This specific should never be transmitted. + kUnknownEnumValue = 3, +}; + +// Enum for TriggerActivationReasonEnum +enum class TriggerActivationReasonEnum : uint8_t +{ + kUserInitiated = 0x00, + kAutomation = 0x01, + kEmergency = 0x02, + // All received enum values that are not listed above will be mapped + // to kUnknownEnumValue. This is a helper enum value that should only + // be used by code to process how it handles receiving and unknown + // enum value. This specific should never be transmitted. + kUnknownEnumValue = 3, +}; + +// Bitmap for Feature +enum class Feature : uint32_t +{ + kPerZoneSensitivity = 0x1, +}; + +// Bitmap for SupportedContainerFormatsBitmap +enum class SupportedContainerFormatsBitmap : uint8_t +{ + kCmaf = 0x1, +}; + +// Bitmap for SupportedIngestMethodsBitmap +enum class SupportedIngestMethodsBitmap : uint8_t +{ + kCMAFIngest = 0x1, +}; +} // namespace PushAvStreamTransport + namespace Chime {} // namespace Chime namespace EcosystemInformation {} // namespace EcosystemInformation diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp index 4879ae5213c65d..c3e2bc89ce2138 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp @@ -30880,6 +30880,844 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre namespace Events {} // namespace Events } // namespace WebRTCTransportRequestor +namespace PushAvStreamTransport { +namespace Structs { + +namespace TransportMotionTriggerTimeControlStruct { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kInitialDuration), initialDuration); + encoder.Encode(to_underlying(Fields::kAugmentationDuration), augmentationDuration); + encoder.Encode(to_underlying(Fields::kMaxDuration), maxDuration); + encoder.Encode(to_underlying(Fields::kBlindDuration), blindDuration); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kInitialDuration)) + { + err = DataModel::Decode(reader, initialDuration); + } + else if (__context_tag == to_underlying(Fields::kAugmentationDuration)) + { + err = DataModel::Decode(reader, augmentationDuration); + } + else if (__context_tag == to_underlying(Fields::kMaxDuration)) + { + err = DataModel::Decode(reader, maxDuration); + } + else if (__context_tag == to_underlying(Fields::kBlindDuration)) + { + err = DataModel::Decode(reader, blindDuration); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} + +} // namespace TransportMotionTriggerTimeControlStruct + +namespace TransportZoneOptionsStruct { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kZone), zone); + encoder.Encode(to_underlying(Fields::kSensitivity), sensitivity); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kZone)) + { + err = DataModel::Decode(reader, zone); + } + else if (__context_tag == to_underlying(Fields::kSensitivity)) + { + err = DataModel::Decode(reader, sensitivity); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} + +} // namespace TransportZoneOptionsStruct + +namespace MetadataOptionsStruct { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kMultiplexing), multiplexing); + encoder.Encode(to_underlying(Fields::kIncludeMotionZones), includeMotionZones); + encoder.Encode(to_underlying(Fields::kEnableMetadataPrivacySensitive), enableMetadataPrivacySensitive); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kMultiplexing)) + { + err = DataModel::Decode(reader, multiplexing); + } + else if (__context_tag == to_underlying(Fields::kIncludeMotionZones)) + { + err = DataModel::Decode(reader, includeMotionZones); + } + else if (__context_tag == to_underlying(Fields::kEnableMetadataPrivacySensitive)) + { + err = DataModel::Decode(reader, enableMetadataPrivacySensitive); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} + +} // namespace MetadataOptionsStruct + +namespace TransportTriggerOptionsStruct { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kTriggerType), triggerType); + encoder.Encode(to_underlying(Fields::kMotionZones), motionZones); + encoder.Encode(to_underlying(Fields::kMotionSensitivity), motionSensitivity); + encoder.Encode(to_underlying(Fields::kMotionTimeControl), motionTimeControl); + encoder.Encode(to_underlying(Fields::kMaxPreRollLen), maxPreRollLen); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kTriggerType)) + { + err = DataModel::Decode(reader, triggerType); + } + else if (__context_tag == to_underlying(Fields::kMotionZones)) + { + err = DataModel::Decode(reader, motionZones); + } + else if (__context_tag == to_underlying(Fields::kMotionSensitivity)) + { + err = DataModel::Decode(reader, motionSensitivity); + } + else if (__context_tag == to_underlying(Fields::kMotionTimeControl)) + { + err = DataModel::Decode(reader, motionTimeControl); + } + else if (__context_tag == to_underlying(Fields::kMaxPreRollLen)) + { + err = DataModel::Decode(reader, maxPreRollLen); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} + +} // namespace TransportTriggerOptionsStruct + +namespace CMAFContainerOptionsStruct { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kChunkDuration), chunkDuration); + encoder.Encode(to_underlying(Fields::kCENCKey), CENCKey); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kChunkDuration)) + { + err = DataModel::Decode(reader, chunkDuration); + } + else if (__context_tag == to_underlying(Fields::kCENCKey)) + { + err = DataModel::Decode(reader, CENCKey); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} + +} // namespace CMAFContainerOptionsStruct + +namespace ContainerOptionsStruct { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kContainerType), containerType); + encoder.Encode(to_underlying(Fields::kCMAFContainerOptions), CMAFContainerOptions); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kContainerType)) + { + err = DataModel::Decode(reader, containerType); + } + else if (__context_tag == to_underlying(Fields::kCMAFContainerOptions)) + { + err = DataModel::Decode(reader, CMAFContainerOptions); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} + +} // namespace ContainerOptionsStruct + +namespace TransportOptionsStruct { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kStreamType), streamType); + encoder.Encode(to_underlying(Fields::kVideoStreamID), videoStreamID); + encoder.Encode(to_underlying(Fields::kAudioStreamID), audioStreamID); + encoder.Encode(to_underlying(Fields::kEndpointID), endpointID); + encoder.Encode(to_underlying(Fields::kUrl), url); + encoder.Encode(to_underlying(Fields::kTriggerOptions), triggerOptions); + encoder.Encode(to_underlying(Fields::kIngestMethod), ingestMethod); + encoder.Encode(to_underlying(Fields::kContainerFormat), containerFormat); + encoder.Encode(to_underlying(Fields::kContainerOptions), containerOptions); + encoder.Encode(to_underlying(Fields::kMetadataOptions), metadataOptions); + encoder.Encode(to_underlying(Fields::kExpiryTime), expiryTime); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kStreamType)) + { + err = DataModel::Decode(reader, streamType); + } + else if (__context_tag == to_underlying(Fields::kVideoStreamID)) + { + err = DataModel::Decode(reader, videoStreamID); + } + else if (__context_tag == to_underlying(Fields::kAudioStreamID)) + { + err = DataModel::Decode(reader, audioStreamID); + } + else if (__context_tag == to_underlying(Fields::kEndpointID)) + { + err = DataModel::Decode(reader, endpointID); + } + else if (__context_tag == to_underlying(Fields::kUrl)) + { + err = DataModel::Decode(reader, url); + } + else if (__context_tag == to_underlying(Fields::kTriggerOptions)) + { + err = DataModel::Decode(reader, triggerOptions); + } + else if (__context_tag == to_underlying(Fields::kIngestMethod)) + { + err = DataModel::Decode(reader, ingestMethod); + } + else if (__context_tag == to_underlying(Fields::kContainerFormat)) + { + err = DataModel::Decode(reader, containerFormat); + } + else if (__context_tag == to_underlying(Fields::kContainerOptions)) + { + err = DataModel::Decode(reader, containerOptions); + } + else if (__context_tag == to_underlying(Fields::kMetadataOptions)) + { + err = DataModel::Decode(reader, metadataOptions); + } + else if (__context_tag == to_underlying(Fields::kExpiryTime)) + { + err = DataModel::Decode(reader, expiryTime); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} + +} // namespace TransportOptionsStruct + +namespace TransportConfigurationStruct { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kConnectionID), connectionID); + encoder.Encode(to_underlying(Fields::kTransportStatus), transportStatus); + encoder.Encode(to_underlying(Fields::kTransportOptions), transportOptions); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kConnectionID)) + { + err = DataModel::Decode(reader, connectionID); + } + else if (__context_tag == to_underlying(Fields::kTransportStatus)) + { + err = DataModel::Decode(reader, transportStatus); + } + else if (__context_tag == to_underlying(Fields::kTransportOptions)) + { + err = DataModel::Decode(reader, transportOptions); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} + +} // namespace TransportConfigurationStruct +} // namespace Structs + +namespace Commands { +namespace AllocatePushTransport { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kTransportOptions), transportOptions); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kTransportOptions)) + { + err = DataModel::Decode(reader, transportOptions); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace AllocatePushTransport. +namespace AllocatePushTransportResponse { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kConnectionID), connectionID); + encoder.Encode(to_underlying(Fields::kTransportOptions), transportOptions); + encoder.Encode(to_underlying(Fields::kTransportStatus), transportStatus); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kConnectionID)) + { + err = DataModel::Decode(reader, connectionID); + } + else if (__context_tag == to_underlying(Fields::kTransportOptions)) + { + err = DataModel::Decode(reader, transportOptions); + } + else if (__context_tag == to_underlying(Fields::kTransportStatus)) + { + err = DataModel::Decode(reader, transportStatus); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace AllocatePushTransportResponse. +namespace DeallocatePushTransport { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kConnectionID), connectionID); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kConnectionID)) + { + err = DataModel::Decode(reader, connectionID); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace DeallocatePushTransport. +namespace ModifyPushTransport { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kConnectionID), connectionID); + encoder.Encode(to_underlying(Fields::kTransportOptions), transportOptions); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kConnectionID)) + { + err = DataModel::Decode(reader, connectionID); + } + else if (__context_tag == to_underlying(Fields::kTransportOptions)) + { + err = DataModel::Decode(reader, transportOptions); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace ModifyPushTransport. +namespace SetTransportStatus { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kConnectionID), connectionID); + encoder.Encode(to_underlying(Fields::kTransportStatus), transportStatus); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kConnectionID)) + { + err = DataModel::Decode(reader, connectionID); + } + else if (__context_tag == to_underlying(Fields::kTransportStatus)) + { + err = DataModel::Decode(reader, transportStatus); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace SetTransportStatus. +namespace ManuallyTriggerTransport { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kConnectionID), connectionID); + encoder.Encode(to_underlying(Fields::kActivationReason), activationReason); + encoder.Encode(to_underlying(Fields::kTimeControl), timeControl); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kConnectionID)) + { + err = DataModel::Decode(reader, connectionID); + } + else if (__context_tag == to_underlying(Fields::kActivationReason)) + { + err = DataModel::Decode(reader, activationReason); + } + else if (__context_tag == to_underlying(Fields::kTimeControl)) + { + err = DataModel::Decode(reader, timeControl); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace ManuallyTriggerTransport. +namespace FindTransport { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kConnectionID), connectionID); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kConnectionID)) + { + err = DataModel::Decode(reader, connectionID); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace FindTransport. +namespace FindTransportResponse { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kStreamConfigurations), streamConfigurations); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kStreamConfigurations)) + { + err = DataModel::Decode(reader, streamConfigurations); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace FindTransportResponse. +} // namespace Commands + +namespace Attributes { +CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path) +{ + switch (path.mAttributeId) + { + case Attributes::SupportedContainerFormats::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, supportedContainerFormats); + case Attributes::SupportedIngestMethods::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, supportedIngestMethods); + case Attributes::CurrentConnections::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, currentConnections); + case Attributes::GeneratedCommandList::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, generatedCommandList); + case Attributes::AcceptedCommandList::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, acceptedCommandList); + case Attributes::AttributeList::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, attributeList); + case Attributes::FeatureMap::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, featureMap); + case Attributes::ClusterRevision::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, clusterRevision); + default: + return CHIP_NO_ERROR; + } +} +} // namespace Attributes + +namespace Events { +namespace PushTransportBegin { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + TLV::TLVType outer; + ReturnErrorOnFailure(aWriter.StartContainer(aTag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kConnectionID), connectionID)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kTriggerType), triggerType)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kActivationReason), activationReason)); + return aWriter.EndContainer(outer); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kConnectionID)) + { + err = DataModel::Decode(reader, connectionID); + } + else if (__context_tag == to_underlying(Fields::kTriggerType)) + { + err = DataModel::Decode(reader, triggerType); + } + else if (__context_tag == to_underlying(Fields::kActivationReason)) + { + err = DataModel::Decode(reader, activationReason); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace PushTransportBegin. +namespace PushTransportEnd { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + TLV::TLVType outer; + ReturnErrorOnFailure(aWriter.StartContainer(aTag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kConnectionID), connectionID)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kTriggerType), triggerType)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kActivationReason), activationReason)); + return aWriter.EndContainer(outer); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kConnectionID)) + { + err = DataModel::Decode(reader, connectionID); + } + else if (__context_tag == to_underlying(Fields::kTriggerType)) + { + err = DataModel::Decode(reader, triggerType); + } + else if (__context_tag == to_underlying(Fields::kActivationReason)) + { + err = DataModel::Decode(reader, activationReason); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace PushTransportEnd. +} // namespace Events + +} // namespace PushAvStreamTransport namespace Chime { namespace Structs { @@ -34919,6 +35757,13 @@ bool CommandIsFabricScoped(ClusterId aCluster, CommandId aCommand) return false; } } + case Clusters::PushAvStreamTransport::Id: { + switch (aCommand) + { + default: + return false; + } + } case Clusters::Chime::Id: { switch (aCommand) { diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h index 2357a87dd9d9fa..8337d32f71c2f8 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h @@ -43169,6 +43169,729 @@ struct TypeInfo }; } // namespace Attributes } // namespace WebRTCTransportRequestor +namespace PushAvStreamTransport { +namespace Structs { +namespace TransportMotionTriggerTimeControlStruct { +enum class Fields : uint8_t +{ + kInitialDuration = 0, + kAugmentationDuration = 1, + kMaxDuration = 2, + kBlindDuration = 3, +}; + +struct Type +{ +public: + uint16_t initialDuration = static_cast(0); + uint16_t augmentationDuration = static_cast(0); + uint32_t maxDuration = static_cast(0); + uint16_t blindDuration = static_cast(0); + + CHIP_ERROR Decode(TLV::TLVReader & reader); + + static constexpr bool kIsFabricScoped = false; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; +}; + +using DecodableType = Type; + +} // namespace TransportMotionTriggerTimeControlStruct +namespace TransportZoneOptionsStruct { +enum class Fields : uint8_t +{ + kZone = 1, + kSensitivity = 2, +}; + +struct Type +{ +public: + DataModel::Nullable zone; + Optional sensitivity; + + CHIP_ERROR Decode(TLV::TLVReader & reader); + + static constexpr bool kIsFabricScoped = false; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; +}; + +using DecodableType = Type; + +} // namespace TransportZoneOptionsStruct +namespace MetadataOptionsStruct { +enum class Fields : uint8_t +{ + kMultiplexing = 0, + kIncludeMotionZones = 1, + kEnableMetadataPrivacySensitive = 2, +}; + +struct Type +{ +public: + StreamMultiplexingEnum multiplexing = static_cast(0); + bool includeMotionZones = static_cast(0); + bool enableMetadataPrivacySensitive = static_cast(0); + + CHIP_ERROR Decode(TLV::TLVReader & reader); + + static constexpr bool kIsFabricScoped = false; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; +}; + +using DecodableType = Type; + +} // namespace MetadataOptionsStruct +namespace TransportTriggerOptionsStruct { +enum class Fields : uint8_t +{ + kTriggerType = 0, + kMotionZones = 1, + kMotionSensitivity = 2, + kMotionTimeControl = 3, + kMaxPreRollLen = 4, +}; + +struct Type +{ +public: + TransportTriggerTypeEnum triggerType = static_cast(0); + Optional>> motionZones; + Optional> motionSensitivity; + Optional motionTimeControl; + Optional maxPreRollLen; + + static constexpr bool kIsFabricScoped = false; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; +}; + +struct DecodableType +{ +public: + TransportTriggerTypeEnum triggerType = static_cast(0); + Optional>> motionZones; + Optional> motionSensitivity; + Optional motionTimeControl; + Optional maxPreRollLen; + + CHIP_ERROR Decode(TLV::TLVReader & reader); + + static constexpr bool kIsFabricScoped = false; +}; + +} // namespace TransportTriggerOptionsStruct +namespace CMAFContainerOptionsStruct { +enum class Fields : uint8_t +{ + kChunkDuration = 0, + kCENCKey = 1, +}; + +struct Type +{ +public: + uint16_t chunkDuration = static_cast(0); + Optional CENCKey; + + CHIP_ERROR Decode(TLV::TLVReader & reader); + + static constexpr bool kIsFabricScoped = false; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; +}; + +using DecodableType = Type; + +} // namespace CMAFContainerOptionsStruct +namespace ContainerOptionsStruct { +enum class Fields : uint8_t +{ + kContainerType = 0, + kCMAFContainerOptions = 1, +}; + +struct Type +{ +public: + ContainerFormatEnum containerType = static_cast(0); + Optional CMAFContainerOptions; + + CHIP_ERROR Decode(TLV::TLVReader & reader); + + static constexpr bool kIsFabricScoped = false; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; +}; + +using DecodableType = Type; + +} // namespace ContainerOptionsStruct +namespace TransportOptionsStruct { +enum class Fields : uint8_t +{ + kStreamType = 0, + kVideoStreamID = 1, + kAudioStreamID = 2, + kEndpointID = 3, + kUrl = 4, + kTriggerOptions = 5, + kIngestMethod = 6, + kContainerFormat = 7, + kContainerOptions = 8, + kMetadataOptions = 9, + kExpiryTime = 10, +}; + +struct Type +{ +public: + StreamTypeEnum streamType = static_cast(0); + Optional videoStreamID; + Optional audioStreamID; + uint16_t endpointID = static_cast(0); + chip::CharSpan url; + Structs::TransportTriggerOptionsStruct::Type triggerOptions; + IngestMethodsEnum ingestMethod = static_cast(0); + ContainerFormatEnum containerFormat = static_cast(0); + Structs::ContainerOptionsStruct::Type containerOptions; + Optional metadataOptions; + Optional expiryTime; + + CHIP_ERROR Decode(TLV::TLVReader & reader); + + static constexpr bool kIsFabricScoped = false; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; +}; + +using DecodableType = Type; + +} // namespace TransportOptionsStruct +namespace TransportConfigurationStruct { +enum class Fields : uint8_t +{ + kConnectionID = 0, + kTransportStatus = 1, + kTransportOptions = 2, +}; + +struct Type +{ +public: + uint16_t connectionID = static_cast(0); + TransportStatusEnum transportStatus = static_cast(0); + Structs::TransportOptionsStruct::Type transportOptions; + + CHIP_ERROR Decode(TLV::TLVReader & reader); + + static constexpr bool kIsFabricScoped = false; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; +}; + +using DecodableType = Type; + +} // namespace TransportConfigurationStruct +} // namespace Structs + +namespace Commands { +// Forward-declarations so we can reference these later. + +namespace AllocatePushTransport { +struct Type; +struct DecodableType; +} // namespace AllocatePushTransport + +namespace AllocatePushTransportResponse { +struct Type; +struct DecodableType; +} // namespace AllocatePushTransportResponse + +namespace DeallocatePushTransport { +struct Type; +struct DecodableType; +} // namespace DeallocatePushTransport + +namespace ModifyPushTransport { +struct Type; +struct DecodableType; +} // namespace ModifyPushTransport + +namespace SetTransportStatus { +struct Type; +struct DecodableType; +} // namespace SetTransportStatus + +namespace ManuallyTriggerTransport { +struct Type; +struct DecodableType; +} // namespace ManuallyTriggerTransport + +namespace FindTransport { +struct Type; +struct DecodableType; +} // namespace FindTransport + +namespace FindTransportResponse { +struct Type; +struct DecodableType; +} // namespace FindTransportResponse + +} // namespace Commands + +namespace Commands { +namespace AllocatePushTransport { +enum class Fields : uint8_t +{ + kTransportOptions = 0, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::AllocatePushTransport::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PushAvStreamTransport::Id; } + + Structs::TransportOptionsStruct::Type transportOptions; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; + + using ResponseType = Clusters::PushAvStreamTransport::Commands::AllocatePushTransportResponse::DecodableType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::AllocatePushTransport::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PushAvStreamTransport::Id; } + + Structs::TransportOptionsStruct::DecodableType transportOptions; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace AllocatePushTransport +namespace AllocatePushTransportResponse { +enum class Fields : uint8_t +{ + kConnectionID = 0, + kTransportOptions = 1, + kTransportStatus = 2, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::AllocatePushTransportResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PushAvStreamTransport::Id; } + + uint16_t connectionID = static_cast(0); + Structs::TransportOptionsStruct::Type transportOptions; + TransportStatusEnum transportStatus = static_cast(0); + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; + + using ResponseType = DataModel::NullObjectType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::AllocatePushTransportResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PushAvStreamTransport::Id; } + + uint16_t connectionID = static_cast(0); + Structs::TransportOptionsStruct::DecodableType transportOptions; + TransportStatusEnum transportStatus = static_cast(0); + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace AllocatePushTransportResponse +namespace DeallocatePushTransport { +enum class Fields : uint8_t +{ + kConnectionID = 0, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::DeallocatePushTransport::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PushAvStreamTransport::Id; } + + uint16_t connectionID = static_cast(0); + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; + + using ResponseType = DataModel::NullObjectType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::DeallocatePushTransport::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PushAvStreamTransport::Id; } + + uint16_t connectionID = static_cast(0); + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace DeallocatePushTransport +namespace ModifyPushTransport { +enum class Fields : uint8_t +{ + kConnectionID = 0, + kTransportOptions = 1, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::ModifyPushTransport::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PushAvStreamTransport::Id; } + + uint16_t connectionID = static_cast(0); + Structs::TransportOptionsStruct::Type transportOptions; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; + + using ResponseType = DataModel::NullObjectType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::ModifyPushTransport::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PushAvStreamTransport::Id; } + + uint16_t connectionID = static_cast(0); + Structs::TransportOptionsStruct::DecodableType transportOptions; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace ModifyPushTransport +namespace SetTransportStatus { +enum class Fields : uint8_t +{ + kConnectionID = 0, + kTransportStatus = 1, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::SetTransportStatus::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PushAvStreamTransport::Id; } + + uint16_t connectionID = static_cast(0); + TransportStatusEnum transportStatus = static_cast(0); + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; + + using ResponseType = DataModel::NullObjectType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::SetTransportStatus::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PushAvStreamTransport::Id; } + + uint16_t connectionID = static_cast(0); + TransportStatusEnum transportStatus = static_cast(0); + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace SetTransportStatus +namespace ManuallyTriggerTransport { +enum class Fields : uint8_t +{ + kConnectionID = 0, + kActivationReason = 1, + kTimeControl = 2, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::ManuallyTriggerTransport::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PushAvStreamTransport::Id; } + + uint16_t connectionID = static_cast(0); + TriggerActivationReasonEnum activationReason = static_cast(0); + Optional timeControl; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; + + using ResponseType = DataModel::NullObjectType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::ManuallyTriggerTransport::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PushAvStreamTransport::Id; } + + uint16_t connectionID = static_cast(0); + TriggerActivationReasonEnum activationReason = static_cast(0); + Optional timeControl; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace ManuallyTriggerTransport +namespace FindTransport { +enum class Fields : uint8_t +{ + kConnectionID = 0, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::FindTransport::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PushAvStreamTransport::Id; } + + Optional> connectionID; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; + + using ResponseType = Clusters::PushAvStreamTransport::Commands::FindTransportResponse::DecodableType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::FindTransport::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PushAvStreamTransport::Id; } + + Optional> connectionID; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace FindTransport +namespace FindTransportResponse { +enum class Fields : uint8_t +{ + kStreamConfigurations = 0, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::FindTransportResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PushAvStreamTransport::Id; } + + DataModel::List streamConfigurations; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; + + using ResponseType = DataModel::NullObjectType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::FindTransportResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PushAvStreamTransport::Id; } + + DataModel::DecodableList streamConfigurations; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace FindTransportResponse +} // namespace Commands + +namespace Attributes { + +namespace SupportedContainerFormats { +struct TypeInfo +{ + using Type = chip::BitMask; + using DecodableType = chip::BitMask; + using DecodableArgType = chip::BitMask; + + static constexpr ClusterId GetClusterId() { return Clusters::PushAvStreamTransport::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::SupportedContainerFormats::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace SupportedContainerFormats +namespace SupportedIngestMethods { +struct TypeInfo +{ + using Type = chip::BitMask; + using DecodableType = chip::BitMask; + using DecodableArgType = chip::BitMask; + + static constexpr ClusterId GetClusterId() { return Clusters::PushAvStreamTransport::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::SupportedIngestMethods::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace SupportedIngestMethods +namespace CurrentConnections { +struct TypeInfo +{ + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; + + static constexpr ClusterId GetClusterId() { return Clusters::PushAvStreamTransport::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::CurrentConnections::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace CurrentConnections +namespace GeneratedCommandList { +struct TypeInfo : public Clusters::Globals::Attributes::GeneratedCommandList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::PushAvStreamTransport::Id; } +}; +} // namespace GeneratedCommandList +namespace AcceptedCommandList { +struct TypeInfo : public Clusters::Globals::Attributes::AcceptedCommandList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::PushAvStreamTransport::Id; } +}; +} // namespace AcceptedCommandList +namespace AttributeList { +struct TypeInfo : public Clusters::Globals::Attributes::AttributeList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::PushAvStreamTransport::Id; } +}; +} // namespace AttributeList +namespace FeatureMap { +struct TypeInfo : public Clusters::Globals::Attributes::FeatureMap::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::PushAvStreamTransport::Id; } +}; +} // namespace FeatureMap +namespace ClusterRevision { +struct TypeInfo : public Clusters::Globals::Attributes::ClusterRevision::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::PushAvStreamTransport::Id; } +}; +} // namespace ClusterRevision + +struct TypeInfo +{ + struct DecodableType + { + static constexpr ClusterId GetClusterId() { return Clusters::PushAvStreamTransport::Id; } + + CHIP_ERROR Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path); + + Attributes::SupportedContainerFormats::TypeInfo::DecodableType supportedContainerFormats = + static_cast>(0); + Attributes::SupportedIngestMethods::TypeInfo::DecodableType supportedIngestMethods = + static_cast>(0); + Attributes::CurrentConnections::TypeInfo::DecodableType currentConnections; + Attributes::GeneratedCommandList::TypeInfo::DecodableType generatedCommandList; + Attributes::AcceptedCommandList::TypeInfo::DecodableType acceptedCommandList; + Attributes::AttributeList::TypeInfo::DecodableType attributeList; + Attributes::FeatureMap::TypeInfo::DecodableType featureMap = static_cast(0); + Attributes::ClusterRevision::TypeInfo::DecodableType clusterRevision = static_cast(0); + }; +}; +} // namespace Attributes +namespace Events { +namespace PushTransportBegin { +static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; + +enum class Fields : uint8_t +{ + kConnectionID = 0, + kTriggerType = 1, + kActivationReason = 2, +}; + +struct Type +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return Events::PushTransportBegin::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PushAvStreamTransport::Id; } + static constexpr bool kIsFabricScoped = false; + + uint16_t connectionID = static_cast(0); + TransportTriggerTypeEnum triggerType = static_cast(0); + Optional activationReason; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; +}; + +struct DecodableType +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return Events::PushTransportBegin::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PushAvStreamTransport::Id; } + + uint16_t connectionID = static_cast(0); + TransportTriggerTypeEnum triggerType = static_cast(0); + Optional activationReason; + + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +} // namespace PushTransportBegin +namespace PushTransportEnd { +static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; + +enum class Fields : uint8_t +{ + kConnectionID = 0, + kTriggerType = 1, + kActivationReason = 2, +}; + +struct Type +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return Events::PushTransportEnd::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PushAvStreamTransport::Id; } + static constexpr bool kIsFabricScoped = false; + + uint16_t connectionID = static_cast(0); + TransportTriggerTypeEnum triggerType = static_cast(0); + Optional activationReason; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; +}; + +struct DecodableType +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return Events::PushTransportEnd::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PushAvStreamTransport::Id; } + + uint16_t connectionID = static_cast(0); + TransportTriggerTypeEnum triggerType = static_cast(0); + Optional activationReason; + + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +} // namespace PushTransportEnd +} // namespace Events +} // namespace PushAvStreamTransport namespace Chime { namespace Structs { namespace ChimeSoundStruct { diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h b/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h index 5d12daa8564976..cde985c0e51451 100644 --- a/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h +++ b/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h @@ -7113,6 +7113,44 @@ static constexpr AttributeId Id = Globals::Attributes::ClusterRevision::Id; } // namespace Attributes } // namespace WebRTCTransportRequestor +namespace PushAvStreamTransport { +namespace Attributes { + +namespace SupportedContainerFormats { +static constexpr AttributeId Id = 0x00000000; +} // namespace SupportedContainerFormats + +namespace SupportedIngestMethods { +static constexpr AttributeId Id = 0x00000001; +} // namespace SupportedIngestMethods + +namespace CurrentConnections { +static constexpr AttributeId Id = 0x00000002; +} // namespace CurrentConnections + +namespace GeneratedCommandList { +static constexpr AttributeId Id = Globals::Attributes::GeneratedCommandList::Id; +} // namespace GeneratedCommandList + +namespace AcceptedCommandList { +static constexpr AttributeId Id = Globals::Attributes::AcceptedCommandList::Id; +} // namespace AcceptedCommandList + +namespace AttributeList { +static constexpr AttributeId Id = Globals::Attributes::AttributeList::Id; +} // namespace AttributeList + +namespace FeatureMap { +static constexpr AttributeId Id = Globals::Attributes::FeatureMap::Id; +} // namespace FeatureMap + +namespace ClusterRevision { +static constexpr AttributeId Id = Globals::Attributes::ClusterRevision::Id; +} // namespace ClusterRevision + +} // namespace Attributes +} // namespace PushAvStreamTransport + namespace Chime { namespace Attributes { diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h b/zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h index e492255152c333..b932cbefd90a32 100644 --- a/zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h +++ b/zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h @@ -388,6 +388,9 @@ static constexpr ClusterId Id = 0x00000553; namespace WebRTCTransportRequestor { static constexpr ClusterId Id = 0x00000554; } // namespace WebRTCTransportRequestor +namespace PushAvStreamTransport { +static constexpr ClusterId Id = 0x00000555; +} // namespace PushAvStreamTransport namespace Chime { static constexpr ClusterId Id = 0x00000556; } // namespace Chime diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h b/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h index d46b8ae0765467..7fe8089a12b5a8 100644 --- a/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h +++ b/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h @@ -1947,6 +1947,44 @@ static constexpr CommandId Id = 0x00000004; } // namespace Commands } // namespace WebRTCTransportRequestor +namespace PushAvStreamTransport { +namespace Commands { + +namespace AllocatePushTransport { +static constexpr CommandId Id = 0x00000000; +} // namespace AllocatePushTransport + +namespace AllocatePushTransportResponse { +static constexpr CommandId Id = 0x00000001; +} // namespace AllocatePushTransportResponse + +namespace DeallocatePushTransport { +static constexpr CommandId Id = 0x00000002; +} // namespace DeallocatePushTransport + +namespace ModifyPushTransport { +static constexpr CommandId Id = 0x00000003; +} // namespace ModifyPushTransport + +namespace SetTransportStatus { +static constexpr CommandId Id = 0x00000004; +} // namespace SetTransportStatus + +namespace ManuallyTriggerTransport { +static constexpr CommandId Id = 0x00000005; +} // namespace ManuallyTriggerTransport + +namespace FindTransport { +static constexpr CommandId Id = 0x00000006; +} // namespace FindTransport + +namespace FindTransportResponse { +static constexpr CommandId Id = 0x00000007; +} // namespace FindTransportResponse + +} // namespace Commands +} // namespace PushAvStreamTransport + namespace Chime { namespace Commands { diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Events.h b/zzz_generated/app-common/app-common/zap-generated/ids/Events.h index 818b5504b29e30..a9a1adab1fda5d 100644 --- a/zzz_generated/app-common/app-common/zap-generated/ids/Events.h +++ b/zzz_generated/app-common/app-common/zap-generated/ids/Events.h @@ -715,6 +715,20 @@ static constexpr EventId Id = 0x00000002; } // namespace Events } // namespace CameraAvStreamManagement +namespace PushAvStreamTransport { +namespace Events { + +namespace PushTransportBegin { +static constexpr EventId Id = 0x00000000; +} // namespace PushTransportBegin + +namespace PushTransportEnd { +static constexpr EventId Id = 0x00000001; +} // namespace PushTransportEnd + +} // namespace Events +} // namespace PushAvStreamTransport + namespace CommissionerControl { namespace Events { diff --git a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h index b0c00980d3e42d..2c73503a251064 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h @@ -156,6 +156,7 @@ | CameraAvStreamManagement | 0x0551 | | WebRTCTransportProvider | 0x0553 | | WebRTCTransportRequestor | 0x0554 | +| PushAvStreamTransport | 0x0555 | | Chime | 0x0556 | | EcosystemInformation | 0x0750 | | CommissionerControl | 0x0751 | @@ -14569,6 +14570,271 @@ class WebRTCTransportRequestorEnd : public ClusterCommand chip::app::Clusters::WebRTCTransportRequestor::Commands::End::Type mRequest; }; +/*----------------------------------------------------------------------------*\ +| Cluster PushAvStreamTransport | 0x0555 | +|------------------------------------------------------------------------------| +| Commands: | | +| * AllocatePushTransport | 0x00 | +| * DeallocatePushTransport | 0x02 | +| * ModifyPushTransport | 0x03 | +| * SetTransportStatus | 0x04 | +| * ManuallyTriggerTransport | 0x05 | +| * FindTransport | 0x06 | +|------------------------------------------------------------------------------| +| Attributes: | | +| * SupportedContainerFormats | 0x0000 | +| * SupportedIngestMethods | 0x0001 | +| * CurrentConnections | 0x0002 | +| * GeneratedCommandList | 0xFFF8 | +| * AcceptedCommandList | 0xFFF9 | +| * AttributeList | 0xFFFB | +| * FeatureMap | 0xFFFC | +| * ClusterRevision | 0xFFFD | +|------------------------------------------------------------------------------| +| Events: | | +| * PushTransportBegin | 0x0000 | +| * PushTransportEnd | 0x0001 | +\*----------------------------------------------------------------------------*/ + +/* + * Command AllocatePushTransport + */ +class PushAvStreamTransportAllocatePushTransport : public ClusterCommand +{ +public: + PushAvStreamTransportAllocatePushTransport(CredentialIssuerCommands * credsIssuerConfig) : + ClusterCommand("allocate-push-transport", credsIssuerConfig), mComplex_TransportOptions(&mRequest.transportOptions) + { + AddArgument("TransportOptions", &mComplex_TransportOptions); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::PushAvStreamTransport::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::PushAvStreamTransport::Commands::AllocatePushTransport::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, + commandId, endpointIds.at(0)); + return ClusterCommand::SendCommand(device, endpointIds.at(0), clusterId, commandId, mRequest); + } + + CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::PushAvStreamTransport::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::PushAvStreamTransport::Commands::AllocatePushTransport::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on Group %u", clusterId, commandId, + groupId); + + return ClusterCommand::SendGroupCommand(groupId, fabricIndex, clusterId, commandId, mRequest); + } + +private: + chip::app::Clusters::PushAvStreamTransport::Commands::AllocatePushTransport::Type mRequest; + TypedComplexArgument + mComplex_TransportOptions; +}; + +/* + * Command DeallocatePushTransport + */ +class PushAvStreamTransportDeallocatePushTransport : public ClusterCommand +{ +public: + PushAvStreamTransportDeallocatePushTransport(CredentialIssuerCommands * credsIssuerConfig) : + ClusterCommand("deallocate-push-transport", credsIssuerConfig) + { + AddArgument("ConnectionID", 0, UINT16_MAX, &mRequest.connectionID); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::PushAvStreamTransport::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::PushAvStreamTransport::Commands::DeallocatePushTransport::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, + commandId, endpointIds.at(0)); + return ClusterCommand::SendCommand(device, endpointIds.at(0), clusterId, commandId, mRequest); + } + + CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::PushAvStreamTransport::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::PushAvStreamTransport::Commands::DeallocatePushTransport::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on Group %u", clusterId, commandId, + groupId); + + return ClusterCommand::SendGroupCommand(groupId, fabricIndex, clusterId, commandId, mRequest); + } + +private: + chip::app::Clusters::PushAvStreamTransport::Commands::DeallocatePushTransport::Type mRequest; +}; + +/* + * Command ModifyPushTransport + */ +class PushAvStreamTransportModifyPushTransport : public ClusterCommand +{ +public: + PushAvStreamTransportModifyPushTransport(CredentialIssuerCommands * credsIssuerConfig) : + ClusterCommand("modify-push-transport", credsIssuerConfig), mComplex_TransportOptions(&mRequest.transportOptions) + { + AddArgument("ConnectionID", 0, UINT16_MAX, &mRequest.connectionID); + AddArgument("TransportOptions", &mComplex_TransportOptions); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::PushAvStreamTransport::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::PushAvStreamTransport::Commands::ModifyPushTransport::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, + commandId, endpointIds.at(0)); + return ClusterCommand::SendCommand(device, endpointIds.at(0), clusterId, commandId, mRequest); + } + + CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::PushAvStreamTransport::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::PushAvStreamTransport::Commands::ModifyPushTransport::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on Group %u", clusterId, commandId, + groupId); + + return ClusterCommand::SendGroupCommand(groupId, fabricIndex, clusterId, commandId, mRequest); + } + +private: + chip::app::Clusters::PushAvStreamTransport::Commands::ModifyPushTransport::Type mRequest; + TypedComplexArgument + mComplex_TransportOptions; +}; + +/* + * Command SetTransportStatus + */ +class PushAvStreamTransportSetTransportStatus : public ClusterCommand +{ +public: + PushAvStreamTransportSetTransportStatus(CredentialIssuerCommands * credsIssuerConfig) : + ClusterCommand("set-transport-status", credsIssuerConfig) + { + AddArgument("ConnectionID", 0, UINT16_MAX, &mRequest.connectionID); + AddArgument("TransportStatus", 0, UINT8_MAX, &mRequest.transportStatus); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::PushAvStreamTransport::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::PushAvStreamTransport::Commands::SetTransportStatus::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, + commandId, endpointIds.at(0)); + return ClusterCommand::SendCommand(device, endpointIds.at(0), clusterId, commandId, mRequest); + } + + CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::PushAvStreamTransport::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::PushAvStreamTransport::Commands::SetTransportStatus::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on Group %u", clusterId, commandId, + groupId); + + return ClusterCommand::SendGroupCommand(groupId, fabricIndex, clusterId, commandId, mRequest); + } + +private: + chip::app::Clusters::PushAvStreamTransport::Commands::SetTransportStatus::Type mRequest; +}; + +/* + * Command ManuallyTriggerTransport + */ +class PushAvStreamTransportManuallyTriggerTransport : public ClusterCommand +{ +public: + PushAvStreamTransportManuallyTriggerTransport(CredentialIssuerCommands * credsIssuerConfig) : + ClusterCommand("manually-trigger-transport", credsIssuerConfig), mComplex_TimeControl(&mRequest.timeControl) + { + AddArgument("ConnectionID", 0, UINT16_MAX, &mRequest.connectionID); + AddArgument("ActivationReason", 0, UINT8_MAX, &mRequest.activationReason); + AddArgument("TimeControl", &mComplex_TimeControl, "", Argument::kOptional); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::PushAvStreamTransport::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::PushAvStreamTransport::Commands::ManuallyTriggerTransport::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, + commandId, endpointIds.at(0)); + return ClusterCommand::SendCommand(device, endpointIds.at(0), clusterId, commandId, mRequest); + } + + CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::PushAvStreamTransport::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::PushAvStreamTransport::Commands::ManuallyTriggerTransport::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on Group %u", clusterId, commandId, + groupId); + + return ClusterCommand::SendGroupCommand(groupId, fabricIndex, clusterId, commandId, mRequest); + } + +private: + chip::app::Clusters::PushAvStreamTransport::Commands::ManuallyTriggerTransport::Type mRequest; + TypedComplexArgument< + chip::Optional> + mComplex_TimeControl; +}; + +/* + * Command FindTransport + */ +class PushAvStreamTransportFindTransport : public ClusterCommand +{ +public: + PushAvStreamTransportFindTransport(CredentialIssuerCommands * credsIssuerConfig) : + ClusterCommand("find-transport", credsIssuerConfig) + { + AddArgument("ConnectionID", 0, UINT16_MAX, &mRequest.connectionID); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::PushAvStreamTransport::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::PushAvStreamTransport::Commands::FindTransport::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, + commandId, endpointIds.at(0)); + return ClusterCommand::SendCommand(device, endpointIds.at(0), clusterId, commandId, mRequest); + } + + CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::PushAvStreamTransport::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::PushAvStreamTransport::Commands::FindTransport::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on Group %u", clusterId, commandId, + groupId); + + return ClusterCommand::SendGroupCommand(groupId, fabricIndex, clusterId, commandId, mRequest); + } + +private: + chip::app::Clusters::PushAvStreamTransport::Commands::FindTransport::Type mRequest; +}; + /*----------------------------------------------------------------------------*\ | Cluster Chime | 0x0556 | |------------------------------------------------------------------------------| @@ -27103,6 +27369,80 @@ void registerClusterWebRTCTransportRequestor(Commands & commands, CredentialIssu commands.RegisterCluster(clusterName, clusterCommands); } +void registerClusterPushAvStreamTransport(Commands & commands, CredentialIssuerCommands * credsIssuerConfig) +{ + using namespace chip::app::Clusters::PushAvStreamTransport; + + const char * clusterName = "PushAvStreamTransport"; + + commands_list clusterCommands = { + // + // Commands + // + make_unique(Id, credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + // + // Attributes + // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, "supported-container-formats", Attributes::SupportedContainerFormats::Id, + credsIssuerConfig), // + make_unique(Id, "supported-ingest-methods", Attributes::SupportedIngestMethods::Id, credsIssuerConfig), // + make_unique(Id, "current-connections", Attributes::CurrentConnections::Id, credsIssuerConfig), // + make_unique(Id, "generated-command-list", Attributes::GeneratedCommandList::Id, credsIssuerConfig), // + make_unique(Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, credsIssuerConfig), // + make_unique(Id, "attribute-list", Attributes::AttributeList::Id, credsIssuerConfig), // + make_unique(Id, "feature-map", Attributes::FeatureMap::Id, credsIssuerConfig), // + make_unique(Id, "cluster-revision", Attributes::ClusterRevision::Id, credsIssuerConfig), // + make_unique>(Id, credsIssuerConfig), // + make_unique>>( + Id, "supported-container-formats", 0, UINT8_MAX, Attributes::SupportedContainerFormats::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>( + Id, "supported-ingest-methods", 0, UINT8_MAX, Attributes::SupportedIngestMethods::Id, WriteCommandType::kForceWrite, + credsIssuerConfig), // + make_unique>>( + Id, "current-connections", Attributes::CurrentConnections::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>( + Id, "generated-command-list", Attributes::GeneratedCommandList::Id, WriteCommandType::kForceWrite, + credsIssuerConfig), // + make_unique>>( + Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>( + Id, "attribute-list", Attributes::AttributeList::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>(Id, "feature-map", 0, UINT32_MAX, Attributes::FeatureMap::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>(Id, "cluster-revision", 0, UINT16_MAX, Attributes::ClusterRevision::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, "supported-container-formats", Attributes::SupportedContainerFormats::Id, + credsIssuerConfig), // + make_unique(Id, "supported-ingest-methods", Attributes::SupportedIngestMethods::Id, + credsIssuerConfig), // + make_unique(Id, "current-connections", Attributes::CurrentConnections::Id, credsIssuerConfig), // + make_unique(Id, "generated-command-list", Attributes::GeneratedCommandList::Id, credsIssuerConfig), // + make_unique(Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, credsIssuerConfig), // + make_unique(Id, "attribute-list", Attributes::AttributeList::Id, credsIssuerConfig), // + make_unique(Id, "feature-map", Attributes::FeatureMap::Id, credsIssuerConfig), // + make_unique(Id, "cluster-revision", Attributes::ClusterRevision::Id, credsIssuerConfig), // + // + // Events + // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, "push-transport-begin", Events::PushTransportBegin::Id, credsIssuerConfig), // + make_unique(Id, "push-transport-end", Events::PushTransportEnd::Id, credsIssuerConfig), // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, "push-transport-begin", Events::PushTransportBegin::Id, credsIssuerConfig), // + make_unique(Id, "push-transport-end", Events::PushTransportEnd::Id, credsIssuerConfig), // + }; + + commands.RegisterCluster(clusterName, clusterCommands); +} void registerClusterChime(Commands & commands, CredentialIssuerCommands * credsIssuerConfig) { using namespace chip::app::Clusters::Chime; @@ -28011,6 +28351,7 @@ void registerClusters(Commands & commands, CredentialIssuerCommands * credsIssue registerClusterCameraAvStreamManagement(commands, credsIssuerConfig); registerClusterWebRTCTransportProvider(commands, credsIssuerConfig); registerClusterWebRTCTransportRequestor(commands, credsIssuerConfig); + registerClusterPushAvStreamTransport(commands, credsIssuerConfig); registerClusterChime(commands, credsIssuerConfig); registerClusterEcosystemInformation(commands, credsIssuerConfig); registerClusterCommissionerControl(commands, credsIssuerConfig); diff --git a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp index 0c3abfbc83a89d..1d0c0650441948 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp @@ -6477,6 +6477,398 @@ void ComplexArgumentParser::Finalize( ComplexArgumentParser::Finalize(request.maxHDRFPS); } +CHIP_ERROR ComplexArgumentParser::Setup( + const char * label, + chip::app::Clusters::PushAvStreamTransport::Structs::TransportMotionTriggerTimeControlStruct::Type & request, + Json::Value & value) +{ + VerifyOrReturnError(value.isObject(), CHIP_ERROR_INVALID_ARGUMENT); + + // Copy to track which members we already processed. + Json::Value valueCopy(value); + + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("TransportMotionTriggerTimeControlStruct.initialDuration", + "initialDuration", value.isMember("initialDuration"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("TransportMotionTriggerTimeControlStruct.augmentationDuration", + "augmentationDuration", value.isMember("augmentationDuration"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("TransportMotionTriggerTimeControlStruct.maxDuration", + "maxDuration", value.isMember("maxDuration"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("TransportMotionTriggerTimeControlStruct.blindDuration", + "blindDuration", value.isMember("blindDuration"))); + + char labelWithMember[kMaxLabelLength]; + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "initialDuration"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.initialDuration, value["initialDuration"])); + valueCopy.removeMember("initialDuration"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "augmentationDuration"); + ReturnErrorOnFailure( + ComplexArgumentParser::Setup(labelWithMember, request.augmentationDuration, value["augmentationDuration"])); + valueCopy.removeMember("augmentationDuration"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "maxDuration"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.maxDuration, value["maxDuration"])); + valueCopy.removeMember("maxDuration"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "blindDuration"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.blindDuration, value["blindDuration"])); + valueCopy.removeMember("blindDuration"); + + return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); +} + +void ComplexArgumentParser::Finalize( + chip::app::Clusters::PushAvStreamTransport::Structs::TransportMotionTriggerTimeControlStruct::Type & request) +{ + ComplexArgumentParser::Finalize(request.initialDuration); + ComplexArgumentParser::Finalize(request.augmentationDuration); + ComplexArgumentParser::Finalize(request.maxDuration); + ComplexArgumentParser::Finalize(request.blindDuration); +} + +CHIP_ERROR +ComplexArgumentParser::Setup(const char * label, + chip::app::Clusters::PushAvStreamTransport::Structs::TransportZoneOptionsStruct::Type & request, + Json::Value & value) +{ + VerifyOrReturnError(value.isObject(), CHIP_ERROR_INVALID_ARGUMENT); + + // Copy to track which members we already processed. + Json::Value valueCopy(value); + + ReturnErrorOnFailure( + ComplexArgumentParser::EnsureMemberExist("TransportZoneOptionsStruct.zone", "zone", value.isMember("zone"))); + + char labelWithMember[kMaxLabelLength]; + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "zone"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.zone, value["zone"])); + valueCopy.removeMember("zone"); + + if (value.isMember("sensitivity")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "sensitivity"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.sensitivity, value["sensitivity"])); + } + valueCopy.removeMember("sensitivity"); + + return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); +} + +void ComplexArgumentParser::Finalize( + chip::app::Clusters::PushAvStreamTransport::Structs::TransportZoneOptionsStruct::Type & request) +{ + ComplexArgumentParser::Finalize(request.zone); + ComplexArgumentParser::Finalize(request.sensitivity); +} + +CHIP_ERROR ComplexArgumentParser::Setup(const char * label, + chip::app::Clusters::PushAvStreamTransport::Structs::MetadataOptionsStruct::Type & request, + Json::Value & value) +{ + VerifyOrReturnError(value.isObject(), CHIP_ERROR_INVALID_ARGUMENT); + + // Copy to track which members we already processed. + Json::Value valueCopy(value); + + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("MetadataOptionsStruct.multiplexing", "multiplexing", + value.isMember("multiplexing"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("MetadataOptionsStruct.includeMotionZones", "includeMotionZones", + value.isMember("includeMotionZones"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("MetadataOptionsStruct.enableMetadataPrivacySensitive", + "enableMetadataPrivacySensitive", + value.isMember("enableMetadataPrivacySensitive"))); + + char labelWithMember[kMaxLabelLength]; + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "multiplexing"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.multiplexing, value["multiplexing"])); + valueCopy.removeMember("multiplexing"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "includeMotionZones"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.includeMotionZones, value["includeMotionZones"])); + valueCopy.removeMember("includeMotionZones"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "enableMetadataPrivacySensitive"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.enableMetadataPrivacySensitive, + value["enableMetadataPrivacySensitive"])); + valueCopy.removeMember("enableMetadataPrivacySensitive"); + + return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); +} + +void ComplexArgumentParser::Finalize(chip::app::Clusters::PushAvStreamTransport::Structs::MetadataOptionsStruct::Type & request) +{ + ComplexArgumentParser::Finalize(request.multiplexing); + ComplexArgumentParser::Finalize(request.includeMotionZones); + ComplexArgumentParser::Finalize(request.enableMetadataPrivacySensitive); +} + +CHIP_ERROR +ComplexArgumentParser::Setup(const char * label, + chip::app::Clusters::PushAvStreamTransport::Structs::TransportTriggerOptionsStruct::Type & request, + Json::Value & value) +{ + VerifyOrReturnError(value.isObject(), CHIP_ERROR_INVALID_ARGUMENT); + + // Copy to track which members we already processed. + Json::Value valueCopy(value); + + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("TransportTriggerOptionsStruct.triggerType", "triggerType", + value.isMember("triggerType"))); + + char labelWithMember[kMaxLabelLength]; + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "triggerType"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.triggerType, value["triggerType"])); + valueCopy.removeMember("triggerType"); + + if (value.isMember("motionZones")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "motionZones"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.motionZones, value["motionZones"])); + } + valueCopy.removeMember("motionZones"); + + if (value.isMember("motionSensitivity")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "motionSensitivity"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.motionSensitivity, value["motionSensitivity"])); + } + valueCopy.removeMember("motionSensitivity"); + + if (value.isMember("motionTimeControl")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "motionTimeControl"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.motionTimeControl, value["motionTimeControl"])); + } + valueCopy.removeMember("motionTimeControl"); + + if (value.isMember("maxPreRollLen")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "maxPreRollLen"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.maxPreRollLen, value["maxPreRollLen"])); + } + valueCopy.removeMember("maxPreRollLen"); + + return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); +} + +void ComplexArgumentParser::Finalize( + chip::app::Clusters::PushAvStreamTransport::Structs::TransportTriggerOptionsStruct::Type & request) +{ + ComplexArgumentParser::Finalize(request.triggerType); + ComplexArgumentParser::Finalize(request.motionZones); + ComplexArgumentParser::Finalize(request.motionSensitivity); + ComplexArgumentParser::Finalize(request.motionTimeControl); + ComplexArgumentParser::Finalize(request.maxPreRollLen); +} + +CHIP_ERROR +ComplexArgumentParser::Setup(const char * label, + chip::app::Clusters::PushAvStreamTransport::Structs::CMAFContainerOptionsStruct::Type & request, + Json::Value & value) +{ + VerifyOrReturnError(value.isObject(), CHIP_ERROR_INVALID_ARGUMENT); + + // Copy to track which members we already processed. + Json::Value valueCopy(value); + + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("CMAFContainerOptionsStruct.chunkDuration", "chunkDuration", + value.isMember("chunkDuration"))); + + char labelWithMember[kMaxLabelLength]; + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "chunkDuration"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.chunkDuration, value["chunkDuration"])); + valueCopy.removeMember("chunkDuration"); + + if (value.isMember("CENCKey")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "CENCKey"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.CENCKey, value["CENCKey"])); + } + valueCopy.removeMember("CENCKey"); + + return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); +} + +void ComplexArgumentParser::Finalize( + chip::app::Clusters::PushAvStreamTransport::Structs::CMAFContainerOptionsStruct::Type & request) +{ + ComplexArgumentParser::Finalize(request.chunkDuration); + ComplexArgumentParser::Finalize(request.CENCKey); +} + +CHIP_ERROR ComplexArgumentParser::Setup(const char * label, + chip::app::Clusters::PushAvStreamTransport::Structs::ContainerOptionsStruct::Type & request, + Json::Value & value) +{ + VerifyOrReturnError(value.isObject(), CHIP_ERROR_INVALID_ARGUMENT); + + // Copy to track which members we already processed. + Json::Value valueCopy(value); + + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("ContainerOptionsStruct.containerType", "containerType", + value.isMember("containerType"))); + + char labelWithMember[kMaxLabelLength]; + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "containerType"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.containerType, value["containerType"])); + valueCopy.removeMember("containerType"); + + if (value.isMember("CMAFContainerOptions")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "CMAFContainerOptions"); + ReturnErrorOnFailure( + ComplexArgumentParser::Setup(labelWithMember, request.CMAFContainerOptions, value["CMAFContainerOptions"])); + } + valueCopy.removeMember("CMAFContainerOptions"); + + return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); +} + +void ComplexArgumentParser::Finalize(chip::app::Clusters::PushAvStreamTransport::Structs::ContainerOptionsStruct::Type & request) +{ + ComplexArgumentParser::Finalize(request.containerType); + ComplexArgumentParser::Finalize(request.CMAFContainerOptions); +} + +CHIP_ERROR ComplexArgumentParser::Setup(const char * label, + chip::app::Clusters::PushAvStreamTransport::Structs::TransportOptionsStruct::Type & request, + Json::Value & value) +{ + VerifyOrReturnError(value.isObject(), CHIP_ERROR_INVALID_ARGUMENT); + + // Copy to track which members we already processed. + Json::Value valueCopy(value); + + ReturnErrorOnFailure( + ComplexArgumentParser::EnsureMemberExist("TransportOptionsStruct.streamType", "streamType", value.isMember("streamType"))); + ReturnErrorOnFailure( + ComplexArgumentParser::EnsureMemberExist("TransportOptionsStruct.endpointID", "endpointID", value.isMember("endpointID"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("TransportOptionsStruct.url", "url", value.isMember("url"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("TransportOptionsStruct.triggerOptions", "triggerOptions", + value.isMember("triggerOptions"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("TransportOptionsStruct.ingestMethod", "ingestMethod", + value.isMember("ingestMethod"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("TransportOptionsStruct.containerFormat", "containerFormat", + value.isMember("containerFormat"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("TransportOptionsStruct.containerOptions", "containerOptions", + value.isMember("containerOptions"))); + + char labelWithMember[kMaxLabelLength]; + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "streamType"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.streamType, value["streamType"])); + valueCopy.removeMember("streamType"); + + if (value.isMember("videoStreamID")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "videoStreamID"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.videoStreamID, value["videoStreamID"])); + } + valueCopy.removeMember("videoStreamID"); + + if (value.isMember("audioStreamID")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "audioStreamID"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.audioStreamID, value["audioStreamID"])); + } + valueCopy.removeMember("audioStreamID"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "endpointID"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.endpointID, value["endpointID"])); + valueCopy.removeMember("endpointID"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "url"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.url, value["url"])); + valueCopy.removeMember("url"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "triggerOptions"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.triggerOptions, value["triggerOptions"])); + valueCopy.removeMember("triggerOptions"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "ingestMethod"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.ingestMethod, value["ingestMethod"])); + valueCopy.removeMember("ingestMethod"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "containerFormat"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.containerFormat, value["containerFormat"])); + valueCopy.removeMember("containerFormat"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "containerOptions"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.containerOptions, value["containerOptions"])); + valueCopy.removeMember("containerOptions"); + + if (value.isMember("metadataOptions")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "metadataOptions"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.metadataOptions, value["metadataOptions"])); + } + valueCopy.removeMember("metadataOptions"); + + if (value.isMember("expiryTime")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "expiryTime"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.expiryTime, value["expiryTime"])); + } + valueCopy.removeMember("expiryTime"); + + return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); +} + +void ComplexArgumentParser::Finalize(chip::app::Clusters::PushAvStreamTransport::Structs::TransportOptionsStruct::Type & request) +{ + ComplexArgumentParser::Finalize(request.streamType); + ComplexArgumentParser::Finalize(request.videoStreamID); + ComplexArgumentParser::Finalize(request.audioStreamID); + ComplexArgumentParser::Finalize(request.endpointID); + ComplexArgumentParser::Finalize(request.url); + ComplexArgumentParser::Finalize(request.triggerOptions); + ComplexArgumentParser::Finalize(request.ingestMethod); + ComplexArgumentParser::Finalize(request.containerFormat); + ComplexArgumentParser::Finalize(request.containerOptions); + ComplexArgumentParser::Finalize(request.metadataOptions); + ComplexArgumentParser::Finalize(request.expiryTime); +} + +CHIP_ERROR +ComplexArgumentParser::Setup(const char * label, + chip::app::Clusters::PushAvStreamTransport::Structs::TransportConfigurationStruct::Type & request, + Json::Value & value) +{ + VerifyOrReturnError(value.isObject(), CHIP_ERROR_INVALID_ARGUMENT); + + // Copy to track which members we already processed. + Json::Value valueCopy(value); + + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("TransportConfigurationStruct.connectionID", "connectionID", + value.isMember("connectionID"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("TransportConfigurationStruct.transportStatus", "transportStatus", + value.isMember("transportStatus"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("TransportConfigurationStruct.transportOptions", + "transportOptions", value.isMember("transportOptions"))); + + char labelWithMember[kMaxLabelLength]; + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "connectionID"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.connectionID, value["connectionID"])); + valueCopy.removeMember("connectionID"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "transportStatus"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.transportStatus, value["transportStatus"])); + valueCopy.removeMember("transportStatus"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "transportOptions"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.transportOptions, value["transportOptions"])); + valueCopy.removeMember("transportOptions"); + + return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); +} + +void ComplexArgumentParser::Finalize( + chip::app::Clusters::PushAvStreamTransport::Structs::TransportConfigurationStruct::Type & request) +{ + ComplexArgumentParser::Finalize(request.connectionID); + ComplexArgumentParser::Finalize(request.transportStatus); + ComplexArgumentParser::Finalize(request.transportOptions); +} + CHIP_ERROR ComplexArgumentParser::Setup(const char * label, chip::app::Clusters::Chime::Structs::ChimeSoundStruct::Type & request, Json::Value & value) { diff --git a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h index 869fcb855a142a..c2d71da03e6227 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h @@ -741,6 +741,55 @@ static CHIP_ERROR Setup(const char * label, static void Finalize(chip::app::Clusters::CameraAvStreamManagement::Structs::VideoSensorParamsStruct::Type & request); +static CHIP_ERROR +Setup(const char * label, + chip::app::Clusters::PushAvStreamTransport::Structs::TransportMotionTriggerTimeControlStruct::Type & request, + Json::Value & value); + +static void Finalize(chip::app::Clusters::PushAvStreamTransport::Structs::TransportMotionTriggerTimeControlStruct::Type & request); + +static CHIP_ERROR Setup(const char * label, + chip::app::Clusters::PushAvStreamTransport::Structs::TransportZoneOptionsStruct::Type & request, + Json::Value & value); + +static void Finalize(chip::app::Clusters::PushAvStreamTransport::Structs::TransportZoneOptionsStruct::Type & request); + +static CHIP_ERROR Setup(const char * label, + chip::app::Clusters::PushAvStreamTransport::Structs::MetadataOptionsStruct::Type & request, + Json::Value & value); + +static void Finalize(chip::app::Clusters::PushAvStreamTransport::Structs::MetadataOptionsStruct::Type & request); + +static CHIP_ERROR Setup(const char * label, + chip::app::Clusters::PushAvStreamTransport::Structs::TransportTriggerOptionsStruct::Type & request, + Json::Value & value); + +static void Finalize(chip::app::Clusters::PushAvStreamTransport::Structs::TransportTriggerOptionsStruct::Type & request); + +static CHIP_ERROR Setup(const char * label, + chip::app::Clusters::PushAvStreamTransport::Structs::CMAFContainerOptionsStruct::Type & request, + Json::Value & value); + +static void Finalize(chip::app::Clusters::PushAvStreamTransport::Structs::CMAFContainerOptionsStruct::Type & request); + +static CHIP_ERROR Setup(const char * label, + chip::app::Clusters::PushAvStreamTransport::Structs::ContainerOptionsStruct::Type & request, + Json::Value & value); + +static void Finalize(chip::app::Clusters::PushAvStreamTransport::Structs::ContainerOptionsStruct::Type & request); + +static CHIP_ERROR Setup(const char * label, + chip::app::Clusters::PushAvStreamTransport::Structs::TransportOptionsStruct::Type & request, + Json::Value & value); + +static void Finalize(chip::app::Clusters::PushAvStreamTransport::Structs::TransportOptionsStruct::Type & request); + +static CHIP_ERROR Setup(const char * label, + chip::app::Clusters::PushAvStreamTransport::Structs::TransportConfigurationStruct::Type & request, + Json::Value & value); + +static void Finalize(chip::app::Clusters::PushAvStreamTransport::Structs::TransportConfigurationStruct::Type & request); + static CHIP_ERROR Setup(const char * label, chip::app::Clusters::Chime::Structs::ChimeSoundStruct::Type & request, Json::Value & value); diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp index 9e44b001a17247..1a4966649f6ed6 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp @@ -5752,6 +5752,342 @@ CHIP_ERROR DataModelLogger::LogValue( return CHIP_NO_ERROR; } +CHIP_ERROR DataModelLogger::LogValue( + const char * label, size_t indent, + const chip::app::Clusters::PushAvStreamTransport::Structs::TransportMotionTriggerTimeControlStruct::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = LogValue("InitialDuration", indent + 1, value.initialDuration); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'InitialDuration'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("AugmentationDuration", indent + 1, value.augmentationDuration); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'AugmentationDuration'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("MaxDuration", indent + 1, value.maxDuration); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'MaxDuration'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("BlindDuration", indent + 1, value.blindDuration); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'BlindDuration'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} + +CHIP_ERROR DataModelLogger::LogValue( + const char * label, size_t indent, + const chip::app::Clusters::PushAvStreamTransport::Structs::TransportZoneOptionsStruct::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = LogValue("Zone", indent + 1, value.zone); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Zone'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("Sensitivity", indent + 1, value.sensitivity); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Sensitivity'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} + +CHIP_ERROR +DataModelLogger::LogValue(const char * label, size_t indent, + const chip::app::Clusters::PushAvStreamTransport::Structs::MetadataOptionsStruct::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = LogValue("Multiplexing", indent + 1, value.multiplexing); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Multiplexing'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("IncludeMotionZones", indent + 1, value.includeMotionZones); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'IncludeMotionZones'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("EnableMetadataPrivacySensitive", indent + 1, value.enableMetadataPrivacySensitive); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'EnableMetadataPrivacySensitive'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} + +CHIP_ERROR DataModelLogger::LogValue( + const char * label, size_t indent, + const chip::app::Clusters::PushAvStreamTransport::Structs::TransportTriggerOptionsStruct::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = LogValue("TriggerType", indent + 1, value.triggerType); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'TriggerType'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("MotionZones", indent + 1, value.motionZones); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'MotionZones'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("MotionSensitivity", indent + 1, value.motionSensitivity); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'MotionSensitivity'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("MotionTimeControl", indent + 1, value.motionTimeControl); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'MotionTimeControl'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("MaxPreRollLen", indent + 1, value.maxPreRollLen); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'MaxPreRollLen'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} + +CHIP_ERROR DataModelLogger::LogValue( + const char * label, size_t indent, + const chip::app::Clusters::PushAvStreamTransport::Structs::CMAFContainerOptionsStruct::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = LogValue("ChunkDuration", indent + 1, value.chunkDuration); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'ChunkDuration'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("CENCKey", indent + 1, value.CENCKey); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'CENCKey'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} + +CHIP_ERROR +DataModelLogger::LogValue(const char * label, size_t indent, + const chip::app::Clusters::PushAvStreamTransport::Structs::ContainerOptionsStruct::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = LogValue("ContainerType", indent + 1, value.containerType); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'ContainerType'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("CMAFContainerOptions", indent + 1, value.CMAFContainerOptions); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'CMAFContainerOptions'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} + +CHIP_ERROR +DataModelLogger::LogValue(const char * label, size_t indent, + const chip::app::Clusters::PushAvStreamTransport::Structs::TransportOptionsStruct::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = LogValue("StreamType", indent + 1, value.streamType); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'StreamType'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("VideoStreamID", indent + 1, value.videoStreamID); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'VideoStreamID'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("AudioStreamID", indent + 1, value.audioStreamID); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'AudioStreamID'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("EndpointID", indent + 1, value.endpointID); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'EndpointID'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("Url", indent + 1, value.url); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Url'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("TriggerOptions", indent + 1, value.triggerOptions); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'TriggerOptions'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("IngestMethod", indent + 1, value.ingestMethod); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'IngestMethod'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("ContainerFormat", indent + 1, value.containerFormat); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'ContainerFormat'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("ContainerOptions", indent + 1, value.containerOptions); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'ContainerOptions'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("MetadataOptions", indent + 1, value.metadataOptions); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'MetadataOptions'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("ExpiryTime", indent + 1, value.expiryTime); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'ExpiryTime'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} + +CHIP_ERROR DataModelLogger::LogValue( + const char * label, size_t indent, + const chip::app::Clusters::PushAvStreamTransport::Structs::TransportConfigurationStruct::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = LogValue("ConnectionID", indent + 1, value.connectionID); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'ConnectionID'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("TransportStatus", indent + 1, value.transportStatus); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'TransportStatus'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("TransportOptions", indent + 1, value.transportOptions); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'TransportOptions'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} + CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const chip::app::Clusters::Chime::Structs::ChimeSoundStruct::DecodableType & value) { @@ -8948,6 +9284,70 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const PushAvStreamTransport::Events::PushTransportBegin::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = DataModelLogger::LogValue("ConnectionID", indent + 1, value.connectionID); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'ConnectionID'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("TriggerType", indent + 1, value.triggerType); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'TriggerType'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("ActivationReason", indent + 1, value.activationReason); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'ActivationReason'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const PushAvStreamTransport::Events::PushTransportEnd::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = DataModelLogger::LogValue("ConnectionID", indent + 1, value.connectionID); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'ConnectionID'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("TriggerType", indent + 1, value.triggerType); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'TriggerType'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("ActivationReason", indent + 1, value.activationReason); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'ActivationReason'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const CommissionerControl::Events::CommissioningRequestResult::DecodableType & value) { @@ -9840,6 +10240,24 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, DataModelLogger::LogString(indent, "}"); return CHIP_NO_ERROR; } +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const PushAvStreamTransport::Commands::AllocatePushTransportResponse::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + ReturnErrorOnFailure(DataModelLogger::LogValue("connectionID", indent + 1, value.connectionID)); + ReturnErrorOnFailure(DataModelLogger::LogValue("transportOptions", indent + 1, value.transportOptions)); + ReturnErrorOnFailure(DataModelLogger::LogValue("transportStatus", indent + 1, value.transportStatus)); + DataModelLogger::LogString(indent, "}"); + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const PushAvStreamTransport::Commands::FindTransportResponse::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + ReturnErrorOnFailure(DataModelLogger::LogValue("streamConfigurations", indent + 1, value.streamConfigurations)); + DataModelLogger::LogString(indent, "}"); + return CHIP_NO_ERROR; +} CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const CommissionerControl::Commands::ReverseOpenCommissioningWindow::DecodableType & value) { @@ -18808,6 +19226,52 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP } break; } + case PushAvStreamTransport::Id: { + switch (path.mAttributeId) + { + case PushAvStreamTransport::Attributes::SupportedContainerFormats::Id: { + chip::BitMask value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("SupportedContainerFormats", 1, value); + } + case PushAvStreamTransport::Attributes::SupportedIngestMethods::Id: { + chip::BitMask value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("SupportedIngestMethods", 1, value); + } + case PushAvStreamTransport::Attributes::CurrentConnections::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("CurrentConnections", 1, value); + } + case PushAvStreamTransport::Attributes::GeneratedCommandList::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, PushAvStreamTransport::Id); + } + case PushAvStreamTransport::Attributes::AcceptedCommandList::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, PushAvStreamTransport::Id); + } + case PushAvStreamTransport::Attributes::AttributeList::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, PushAvStreamTransport::Id); + } + case PushAvStreamTransport::Attributes::FeatureMap::Id: { + uint32_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("FeatureMap", 1, value); + } + case PushAvStreamTransport::Attributes::ClusterRevision::Id: { + uint16_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("ClusterRevision", 1, value); + } + } + break; + } case Chime::Id: { switch (path.mAttributeId) { @@ -20143,6 +20607,22 @@ CHIP_ERROR DataModelLogger::LogCommand(const chip::app::ConcreteCommandPath & pa } break; } + case PushAvStreamTransport::Id: { + switch (path.mCommandId) + { + case PushAvStreamTransport::Commands::AllocatePushTransportResponse::Id: { + PushAvStreamTransport::Commands::AllocatePushTransportResponse::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("AllocatePushTransportResponse", 1, value); + } + case PushAvStreamTransport::Commands::FindTransportResponse::Id: { + PushAvStreamTransport::Commands::FindTransportResponse::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("FindTransportResponse", 1, value); + } + } + break; + } case CommissionerControl::Id: { switch (path.mCommandId) { @@ -21093,6 +21573,22 @@ CHIP_ERROR DataModelLogger::LogEvent(const chip::app::EventHeader & header, chip } break; } + case PushAvStreamTransport::Id: { + switch (header.mPath.mEventId) + { + case PushAvStreamTransport::Events::PushTransportBegin::Id: { + chip::app::Clusters::PushAvStreamTransport::Events::PushTransportBegin::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("PushTransportBegin", 1, value); + } + case PushAvStreamTransport::Events::PushTransportEnd::Id: { + chip::app::Clusters::PushAvStreamTransport::Events::PushTransportEnd::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("PushTransportEnd", 1, value); + } + } + break; + } case CommissionerControl::Id: { switch (header.mPath.mEventId) { diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h index dd53dfabc6a6eb..d24042c64123ca 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h @@ -455,6 +455,37 @@ static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::CameraAvStreamManagement::Structs::VideoSensorParamsStruct::DecodableType & value); +static CHIP_ERROR +LogValue(const char * label, size_t indent, + const chip::app::Clusters::PushAvStreamTransport::Structs::TransportMotionTriggerTimeControlStruct::DecodableType & value); + +static CHIP_ERROR +LogValue(const char * label, size_t indent, + const chip::app::Clusters::PushAvStreamTransport::Structs::TransportZoneOptionsStruct::DecodableType & value); + +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::PushAvStreamTransport::Structs::MetadataOptionsStruct::DecodableType & value); + +static CHIP_ERROR +LogValue(const char * label, size_t indent, + const chip::app::Clusters::PushAvStreamTransport::Structs::TransportTriggerOptionsStruct::DecodableType & value); + +static CHIP_ERROR +LogValue(const char * label, size_t indent, + const chip::app::Clusters::PushAvStreamTransport::Structs::CMAFContainerOptionsStruct::DecodableType & value); + +static CHIP_ERROR +LogValue(const char * label, size_t indent, + const chip::app::Clusters::PushAvStreamTransport::Structs::ContainerOptionsStruct::DecodableType & value); + +static CHIP_ERROR +LogValue(const char * label, size_t indent, + const chip::app::Clusters::PushAvStreamTransport::Structs::TransportOptionsStruct::DecodableType & value); + +static CHIP_ERROR +LogValue(const char * label, size_t indent, + const chip::app::Clusters::PushAvStreamTransport::Structs::TransportConfigurationStruct::DecodableType & value); + static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::Chime::Structs::ChimeSoundStruct::DecodableType & value); @@ -737,6 +768,10 @@ static CHIP_ERROR LogValue(const char * label, size_t indent, static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::CameraAvStreamManagement::Events::SnapshotStreamChanged::DecodableType & value); +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::PushAvStreamTransport::Events::PushTransportBegin::DecodableType & value); +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::PushAvStreamTransport::Events::PushTransportEnd::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::CommissionerControl::Events::CommissioningRequestResult::DecodableType & value); @@ -934,6 +969,12 @@ static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::WebRTCTransportProvider::Commands::ProvideOfferResponse::DecodableType & value); static CHIP_ERROR +LogValue(const char * label, size_t indent, + const chip::app::Clusters::PushAvStreamTransport::Commands::AllocatePushTransportResponse::DecodableType & value); +static CHIP_ERROR +LogValue(const char * label, size_t indent, + const chip::app::Clusters::PushAvStreamTransport::Commands::FindTransportResponse::DecodableType & value); +static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::CommissionerControl::Commands::ReverseOpenCommissioningWindow::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.cpp b/zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.cpp index 3977ee180be1e2..66ad8228711630 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.cpp @@ -267,6 +267,8 @@ char const * ClusterIdToText(chip::ClusterId id) return "WebRTCTransportProvider"; case chip::app::Clusters::WebRTCTransportRequestor::Id: return "WebRTCTransportRequestor"; + case chip::app::Clusters::PushAvStreamTransport::Id: + return "PushAvStreamTransport"; case chip::app::Clusters::Chime::Id: return "Chime"; case chip::app::Clusters::EcosystemInformation::Id: @@ -4303,6 +4305,29 @@ char const * AttributeIdToText(chip::ClusterId cluster, chip::AttributeId id) return "Unknown"; } } + case chip::app::Clusters::PushAvStreamTransport::Id: { + switch (id) + { + case chip::app::Clusters::PushAvStreamTransport::Attributes::SupportedContainerFormats::Id: + return "SupportedContainerFormats"; + case chip::app::Clusters::PushAvStreamTransport::Attributes::SupportedIngestMethods::Id: + return "SupportedIngestMethods"; + case chip::app::Clusters::PushAvStreamTransport::Attributes::CurrentConnections::Id: + return "CurrentConnections"; + case chip::app::Clusters::PushAvStreamTransport::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::PushAvStreamTransport::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::PushAvStreamTransport::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::PushAvStreamTransport::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::PushAvStreamTransport::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } case chip::app::Clusters::Chime::Id: { switch (id) { @@ -5714,6 +5739,25 @@ char const * AcceptedCommandIdToText(chip::ClusterId cluster, chip::CommandId id return "Unknown"; } } + case chip::app::Clusters::PushAvStreamTransport::Id: { + switch (id) + { + case chip::app::Clusters::PushAvStreamTransport::Commands::AllocatePushTransport::Id: + return "AllocatePushTransport"; + case chip::app::Clusters::PushAvStreamTransport::Commands::DeallocatePushTransport::Id: + return "DeallocatePushTransport"; + case chip::app::Clusters::PushAvStreamTransport::Commands::ModifyPushTransport::Id: + return "ModifyPushTransport"; + case chip::app::Clusters::PushAvStreamTransport::Commands::SetTransportStatus::Id: + return "SetTransportStatus"; + case chip::app::Clusters::PushAvStreamTransport::Commands::ManuallyTriggerTransport::Id: + return "ManuallyTriggerTransport"; + case chip::app::Clusters::PushAvStreamTransport::Commands::FindTransport::Id: + return "FindTransport"; + default: + return "Unknown"; + } + } case chip::app::Clusters::Chime::Id: { switch (id) { @@ -6283,6 +6327,17 @@ char const * GeneratedCommandIdToText(chip::ClusterId cluster, chip::CommandId i return "Unknown"; } } + case chip::app::Clusters::PushAvStreamTransport::Id: { + switch (id) + { + case chip::app::Clusters::PushAvStreamTransport::Commands::AllocatePushTransportResponse::Id: + return "AllocatePushTransportResponse"; + case chip::app::Clusters::PushAvStreamTransport::Commands::FindTransportResponse::Id: + return "FindTransportResponse"; + default: + return "Unknown"; + } + } case chip::app::Clusters::CommissionerControl::Id: { switch (id) { diff --git a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h index 5f6e87c76b7b03..070960017b0e81 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h @@ -158,6 +158,7 @@ | CameraAvStreamManagement | 0x0551 | | WebRTCTransportProvider | 0x0553 | | WebRTCTransportRequestor | 0x0554 | +| PushAvStreamTransport | 0x0555 | | Chime | 0x0556 | | EcosystemInformation | 0x0750 | | CommissionerControl | 0x0751 | @@ -156285,6 +156286,1277 @@ class SubscribeAttributeWebRTCTransportRequestorClusterRevision : public Subscri } }; +#endif // MTR_ENABLE_PROVISIONAL +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL +/*----------------------------------------------------------------------------*\ +| Cluster PushAvStreamTransport | 0x0555 | +|------------------------------------------------------------------------------| +| Commands: | | +| * AllocatePushTransport | 0x00 | +| * DeallocatePushTransport | 0x02 | +| * ModifyPushTransport | 0x03 | +| * SetTransportStatus | 0x04 | +| * ManuallyTriggerTransport | 0x05 | +| * FindTransport | 0x06 | +|------------------------------------------------------------------------------| +| Attributes: | | +| * SupportedContainerFormats | 0x0000 | +| * SupportedIngestMethods | 0x0001 | +| * CurrentConnections | 0x0002 | +| * GeneratedCommandList | 0xFFF8 | +| * AcceptedCommandList | 0xFFF9 | +| * AttributeList | 0xFFFB | +| * FeatureMap | 0xFFFC | +| * ClusterRevision | 0xFFFD | +|------------------------------------------------------------------------------| +| Events: | | +| * PushTransportBegin | 0x0000 | +| * PushTransportEnd | 0x0001 | +\*----------------------------------------------------------------------------*/ + +#if MTR_ENABLE_PROVISIONAL +/* + * Command AllocatePushTransport + */ +class PushAvStreamTransportAllocatePushTransport : public ClusterCommand { +public: + PushAvStreamTransportAllocatePushTransport() + : ClusterCommand("allocate-push-transport") + , mComplex_TransportOptions(&mRequest.transportOptions) + { +#if MTR_ENABLE_PROVISIONAL + AddArgument("TransportOptions", &mComplex_TransportOptions); +#endif // MTR_ENABLE_PROVISIONAL + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::PushAvStreamTransport::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::PushAvStreamTransport::Commands::AllocatePushTransport::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, commandId, endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterPushAVStreamTransport alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRPushAVStreamTransportClusterAllocatePushTransportParams alloc] init]; + params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; +#if MTR_ENABLE_PROVISIONAL + params.transportOptions = [MTRPushAVStreamTransportClusterTransportOptionsStruct new]; + params.transportOptions.streamType = [NSNumber numberWithUnsignedChar:chip::to_underlying(mRequest.transportOptions.streamType)]; + if (mRequest.transportOptions.videoStreamID.HasValue()) { + params.transportOptions.videoStreamID = [NSNumber numberWithUnsignedShort:mRequest.transportOptions.videoStreamID.Value()]; + } else { + params.transportOptions.videoStreamID = nil; + } + if (mRequest.transportOptions.audioStreamID.HasValue()) { + params.transportOptions.audioStreamID = [NSNumber numberWithUnsignedShort:mRequest.transportOptions.audioStreamID.Value()]; + } else { + params.transportOptions.audioStreamID = nil; + } + params.transportOptions.endpointID = [NSNumber numberWithUnsignedShort:mRequest.transportOptions.endpointID]; + params.transportOptions.url = [[NSString alloc] initWithBytes:mRequest.transportOptions.url.data() length:mRequest.transportOptions.url.size() encoding:NSUTF8StringEncoding]; + params.transportOptions.triggerOptions = [MTRPushAVStreamTransportClusterTransportTriggerOptionsStruct new]; + params.transportOptions.triggerOptions.triggerType = [NSNumber numberWithUnsignedChar:chip::to_underlying(mRequest.transportOptions.triggerOptions.triggerType)]; + if (mRequest.transportOptions.triggerOptions.motionZones.HasValue()) { + if (mRequest.transportOptions.triggerOptions.motionZones.Value().IsNull()) { + params.transportOptions.triggerOptions.motionZones = nil; + } else { + { // Scope for our temporary variables + auto * array_4 = [NSMutableArray new]; + for (auto & entry_4 : mRequest.transportOptions.triggerOptions.motionZones.Value().Value()) { + MTRPushAVStreamTransportClusterTransportZoneOptionsStruct * newElement_4; + newElement_4 = [MTRPushAVStreamTransportClusterTransportZoneOptionsStruct new]; + if (entry_4.zone.IsNull()) { + newElement_4.zone = nil; + } else { + newElement_4.zone = [NSNumber numberWithUnsignedShort:entry_4.zone.Value()]; + } + if (entry_4.sensitivity.HasValue()) { + newElement_4.sensitivity = [NSNumber numberWithUnsignedChar:entry_4.sensitivity.Value()]; + } else { + newElement_4.sensitivity = nil; + } + [array_4 addObject:newElement_4]; + } + params.transportOptions.triggerOptions.motionZones = array_4; + } + } + } else { + params.transportOptions.triggerOptions.motionZones = nil; + } + if (mRequest.transportOptions.triggerOptions.motionSensitivity.HasValue()) { + if (mRequest.transportOptions.triggerOptions.motionSensitivity.Value().IsNull()) { + params.transportOptions.triggerOptions.motionSensitivity = nil; + } else { + params.transportOptions.triggerOptions.motionSensitivity = [NSNumber numberWithUnsignedChar:mRequest.transportOptions.triggerOptions.motionSensitivity.Value().Value()]; + } + } else { + params.transportOptions.triggerOptions.motionSensitivity = nil; + } + if (mRequest.transportOptions.triggerOptions.motionTimeControl.HasValue()) { + params.transportOptions.triggerOptions.motionTimeControl = [MTRPushAVStreamTransportClusterTransportMotionTriggerTimeControlStruct new]; + params.transportOptions.triggerOptions.motionTimeControl.initialDuration = [NSNumber numberWithUnsignedShort:mRequest.transportOptions.triggerOptions.motionTimeControl.Value().initialDuration]; + params.transportOptions.triggerOptions.motionTimeControl.augmentationDuration = [NSNumber numberWithUnsignedShort:mRequest.transportOptions.triggerOptions.motionTimeControl.Value().augmentationDuration]; + params.transportOptions.triggerOptions.motionTimeControl.maxDuration = [NSNumber numberWithUnsignedInt:mRequest.transportOptions.triggerOptions.motionTimeControl.Value().maxDuration]; + params.transportOptions.triggerOptions.motionTimeControl.blindDuration = [NSNumber numberWithUnsignedShort:mRequest.transportOptions.triggerOptions.motionTimeControl.Value().blindDuration]; + } else { + params.transportOptions.triggerOptions.motionTimeControl = nil; + } + if (mRequest.transportOptions.triggerOptions.maxPreRollLen.HasValue()) { + params.transportOptions.triggerOptions.maxPreRollLen = [NSNumber numberWithUnsignedShort:mRequest.transportOptions.triggerOptions.maxPreRollLen.Value()]; + } else { + params.transportOptions.triggerOptions.maxPreRollLen = nil; + } + params.transportOptions.ingestMethod = [NSNumber numberWithUnsignedChar:chip::to_underlying(mRequest.transportOptions.ingestMethod)]; + params.transportOptions.containerFormat = [NSNumber numberWithUnsignedChar:chip::to_underlying(mRequest.transportOptions.containerFormat)]; + params.transportOptions.containerOptions = [MTRPushAVStreamTransportClusterContainerOptionsStruct new]; + params.transportOptions.containerOptions.containerType = [NSNumber numberWithUnsignedChar:chip::to_underlying(mRequest.transportOptions.containerOptions.containerType)]; + if (mRequest.transportOptions.containerOptions.CMAFContainerOptions.HasValue()) { + params.transportOptions.containerOptions.cmafContainerOptions = [MTRPushAVStreamTransportClusterCMAFContainerOptionsStruct new]; + params.transportOptions.containerOptions.cmafContainerOptions.chunkDuration = [NSNumber numberWithUnsignedShort:mRequest.transportOptions.containerOptions.CMAFContainerOptions.Value().chunkDuration]; + if (mRequest.transportOptions.containerOptions.CMAFContainerOptions.Value().CENCKey.HasValue()) { + params.transportOptions.containerOptions.cmafContainerOptions.cencKey = [NSData dataWithBytes:mRequest.transportOptions.containerOptions.CMAFContainerOptions.Value().CENCKey.Value().data() length:mRequest.transportOptions.containerOptions.CMAFContainerOptions.Value().CENCKey.Value().size()]; + } else { + params.transportOptions.containerOptions.cmafContainerOptions.cencKey = nil; + } + } else { + params.transportOptions.containerOptions.cmafContainerOptions = nil; + } + if (mRequest.transportOptions.metadataOptions.HasValue()) { + params.transportOptions.metadataOptions = [MTRPushAVStreamTransportClusterMetadataOptionsStruct new]; + params.transportOptions.metadataOptions.multiplexing = [NSNumber numberWithUnsignedChar:chip::to_underlying(mRequest.transportOptions.metadataOptions.Value().multiplexing)]; + params.transportOptions.metadataOptions.includeMotionZones = [NSNumber numberWithBool:mRequest.transportOptions.metadataOptions.Value().includeMotionZones]; + params.transportOptions.metadataOptions.enableMetadataPrivacySensitive = [NSNumber numberWithBool:mRequest.transportOptions.metadataOptions.Value().enableMetadataPrivacySensitive]; + } else { + params.transportOptions.metadataOptions = nil; + } + if (mRequest.transportOptions.expiryTime.HasValue()) { + params.transportOptions.expiryTime = [NSNumber numberWithUnsignedInt:mRequest.transportOptions.expiryTime.Value()]; + } else { + params.transportOptions.expiryTime = nil; + } +#endif // MTR_ENABLE_PROVISIONAL + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster allocatePushTransportWithParams:params completion: + ^(MTRPushAVStreamTransportClusterAllocatePushTransportResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId = chip::app::Clusters::PushAvStreamTransport::Commands::AllocatePushTransportResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + constexpr chip::CommandId responseId = chip::app::Clusters::PushAvStreamTransport::Commands::AllocatePushTransportResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return CHIP_NO_ERROR; + } + +private: + chip::app::Clusters::PushAvStreamTransport::Commands::AllocatePushTransport::Type mRequest; + TypedComplexArgument mComplex_TransportOptions; +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL +/* + * Command DeallocatePushTransport + */ +class PushAvStreamTransportDeallocatePushTransport : public ClusterCommand { +public: + PushAvStreamTransportDeallocatePushTransport() + : ClusterCommand("deallocate-push-transport") + { +#if MTR_ENABLE_PROVISIONAL + AddArgument("ConnectionID", 0, UINT16_MAX, &mRequest.connectionID); +#endif // MTR_ENABLE_PROVISIONAL + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::PushAvStreamTransport::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::PushAvStreamTransport::Commands::DeallocatePushTransport::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, commandId, endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterPushAVStreamTransport alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRPushAVStreamTransportClusterDeallocatePushTransportParams alloc] init]; + params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; +#if MTR_ENABLE_PROVISIONAL + params.connectionID = [NSNumber numberWithUnsignedShort:mRequest.connectionID]; +#endif // MTR_ENABLE_PROVISIONAL + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster deallocatePushTransportWithParams:params completion: + ^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return CHIP_NO_ERROR; + } + +private: + chip::app::Clusters::PushAvStreamTransport::Commands::DeallocatePushTransport::Type mRequest; +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL +/* + * Command ModifyPushTransport + */ +class PushAvStreamTransportModifyPushTransport : public ClusterCommand { +public: + PushAvStreamTransportModifyPushTransport() + : ClusterCommand("modify-push-transport") + , mComplex_TransportOptions(&mRequest.transportOptions) + { +#if MTR_ENABLE_PROVISIONAL + AddArgument("ConnectionID", 0, UINT16_MAX, &mRequest.connectionID); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("TransportOptions", &mComplex_TransportOptions); +#endif // MTR_ENABLE_PROVISIONAL + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::PushAvStreamTransport::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::PushAvStreamTransport::Commands::ModifyPushTransport::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, commandId, endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterPushAVStreamTransport alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRPushAVStreamTransportClusterModifyPushTransportParams alloc] init]; + params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; +#if MTR_ENABLE_PROVISIONAL + params.connectionID = [NSNumber numberWithUnsignedShort:mRequest.connectionID]; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + params.transportOptions = [MTRPushAVStreamTransportClusterTransportOptionsStruct new]; + params.transportOptions.streamType = [NSNumber numberWithUnsignedChar:chip::to_underlying(mRequest.transportOptions.streamType)]; + if (mRequest.transportOptions.videoStreamID.HasValue()) { + params.transportOptions.videoStreamID = [NSNumber numberWithUnsignedShort:mRequest.transportOptions.videoStreamID.Value()]; + } else { + params.transportOptions.videoStreamID = nil; + } + if (mRequest.transportOptions.audioStreamID.HasValue()) { + params.transportOptions.audioStreamID = [NSNumber numberWithUnsignedShort:mRequest.transportOptions.audioStreamID.Value()]; + } else { + params.transportOptions.audioStreamID = nil; + } + params.transportOptions.endpointID = [NSNumber numberWithUnsignedShort:mRequest.transportOptions.endpointID]; + params.transportOptions.url = [[NSString alloc] initWithBytes:mRequest.transportOptions.url.data() length:mRequest.transportOptions.url.size() encoding:NSUTF8StringEncoding]; + params.transportOptions.triggerOptions = [MTRPushAVStreamTransportClusterTransportTriggerOptionsStruct new]; + params.transportOptions.triggerOptions.triggerType = [NSNumber numberWithUnsignedChar:chip::to_underlying(mRequest.transportOptions.triggerOptions.triggerType)]; + if (mRequest.transportOptions.triggerOptions.motionZones.HasValue()) { + if (mRequest.transportOptions.triggerOptions.motionZones.Value().IsNull()) { + params.transportOptions.triggerOptions.motionZones = nil; + } else { + { // Scope for our temporary variables + auto * array_4 = [NSMutableArray new]; + for (auto & entry_4 : mRequest.transportOptions.triggerOptions.motionZones.Value().Value()) { + MTRPushAVStreamTransportClusterTransportZoneOptionsStruct * newElement_4; + newElement_4 = [MTRPushAVStreamTransportClusterTransportZoneOptionsStruct new]; + if (entry_4.zone.IsNull()) { + newElement_4.zone = nil; + } else { + newElement_4.zone = [NSNumber numberWithUnsignedShort:entry_4.zone.Value()]; + } + if (entry_4.sensitivity.HasValue()) { + newElement_4.sensitivity = [NSNumber numberWithUnsignedChar:entry_4.sensitivity.Value()]; + } else { + newElement_4.sensitivity = nil; + } + [array_4 addObject:newElement_4]; + } + params.transportOptions.triggerOptions.motionZones = array_4; + } + } + } else { + params.transportOptions.triggerOptions.motionZones = nil; + } + if (mRequest.transportOptions.triggerOptions.motionSensitivity.HasValue()) { + if (mRequest.transportOptions.triggerOptions.motionSensitivity.Value().IsNull()) { + params.transportOptions.triggerOptions.motionSensitivity = nil; + } else { + params.transportOptions.triggerOptions.motionSensitivity = [NSNumber numberWithUnsignedChar:mRequest.transportOptions.triggerOptions.motionSensitivity.Value().Value()]; + } + } else { + params.transportOptions.triggerOptions.motionSensitivity = nil; + } + if (mRequest.transportOptions.triggerOptions.motionTimeControl.HasValue()) { + params.transportOptions.triggerOptions.motionTimeControl = [MTRPushAVStreamTransportClusterTransportMotionTriggerTimeControlStruct new]; + params.transportOptions.triggerOptions.motionTimeControl.initialDuration = [NSNumber numberWithUnsignedShort:mRequest.transportOptions.triggerOptions.motionTimeControl.Value().initialDuration]; + params.transportOptions.triggerOptions.motionTimeControl.augmentationDuration = [NSNumber numberWithUnsignedShort:mRequest.transportOptions.triggerOptions.motionTimeControl.Value().augmentationDuration]; + params.transportOptions.triggerOptions.motionTimeControl.maxDuration = [NSNumber numberWithUnsignedInt:mRequest.transportOptions.triggerOptions.motionTimeControl.Value().maxDuration]; + params.transportOptions.triggerOptions.motionTimeControl.blindDuration = [NSNumber numberWithUnsignedShort:mRequest.transportOptions.triggerOptions.motionTimeControl.Value().blindDuration]; + } else { + params.transportOptions.triggerOptions.motionTimeControl = nil; + } + if (mRequest.transportOptions.triggerOptions.maxPreRollLen.HasValue()) { + params.transportOptions.triggerOptions.maxPreRollLen = [NSNumber numberWithUnsignedShort:mRequest.transportOptions.triggerOptions.maxPreRollLen.Value()]; + } else { + params.transportOptions.triggerOptions.maxPreRollLen = nil; + } + params.transportOptions.ingestMethod = [NSNumber numberWithUnsignedChar:chip::to_underlying(mRequest.transportOptions.ingestMethod)]; + params.transportOptions.containerFormat = [NSNumber numberWithUnsignedChar:chip::to_underlying(mRequest.transportOptions.containerFormat)]; + params.transportOptions.containerOptions = [MTRPushAVStreamTransportClusterContainerOptionsStruct new]; + params.transportOptions.containerOptions.containerType = [NSNumber numberWithUnsignedChar:chip::to_underlying(mRequest.transportOptions.containerOptions.containerType)]; + if (mRequest.transportOptions.containerOptions.CMAFContainerOptions.HasValue()) { + params.transportOptions.containerOptions.cmafContainerOptions = [MTRPushAVStreamTransportClusterCMAFContainerOptionsStruct new]; + params.transportOptions.containerOptions.cmafContainerOptions.chunkDuration = [NSNumber numberWithUnsignedShort:mRequest.transportOptions.containerOptions.CMAFContainerOptions.Value().chunkDuration]; + if (mRequest.transportOptions.containerOptions.CMAFContainerOptions.Value().CENCKey.HasValue()) { + params.transportOptions.containerOptions.cmafContainerOptions.cencKey = [NSData dataWithBytes:mRequest.transportOptions.containerOptions.CMAFContainerOptions.Value().CENCKey.Value().data() length:mRequest.transportOptions.containerOptions.CMAFContainerOptions.Value().CENCKey.Value().size()]; + } else { + params.transportOptions.containerOptions.cmafContainerOptions.cencKey = nil; + } + } else { + params.transportOptions.containerOptions.cmafContainerOptions = nil; + } + if (mRequest.transportOptions.metadataOptions.HasValue()) { + params.transportOptions.metadataOptions = [MTRPushAVStreamTransportClusterMetadataOptionsStruct new]; + params.transportOptions.metadataOptions.multiplexing = [NSNumber numberWithUnsignedChar:chip::to_underlying(mRequest.transportOptions.metadataOptions.Value().multiplexing)]; + params.transportOptions.metadataOptions.includeMotionZones = [NSNumber numberWithBool:mRequest.transportOptions.metadataOptions.Value().includeMotionZones]; + params.transportOptions.metadataOptions.enableMetadataPrivacySensitive = [NSNumber numberWithBool:mRequest.transportOptions.metadataOptions.Value().enableMetadataPrivacySensitive]; + } else { + params.transportOptions.metadataOptions = nil; + } + if (mRequest.transportOptions.expiryTime.HasValue()) { + params.transportOptions.expiryTime = [NSNumber numberWithUnsignedInt:mRequest.transportOptions.expiryTime.Value()]; + } else { + params.transportOptions.expiryTime = nil; + } +#endif // MTR_ENABLE_PROVISIONAL + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster modifyPushTransportWithParams:params completion: + ^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return CHIP_NO_ERROR; + } + +private: + chip::app::Clusters::PushAvStreamTransport::Commands::ModifyPushTransport::Type mRequest; + TypedComplexArgument mComplex_TransportOptions; +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL +/* + * Command SetTransportStatus + */ +class PushAvStreamTransportSetTransportStatus : public ClusterCommand { +public: + PushAvStreamTransportSetTransportStatus() + : ClusterCommand("set-transport-status") + { +#if MTR_ENABLE_PROVISIONAL + AddArgument("ConnectionID", 0, UINT16_MAX, &mRequest.connectionID); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("TransportStatus", 0, UINT8_MAX, &mRequest.transportStatus); +#endif // MTR_ENABLE_PROVISIONAL + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::PushAvStreamTransport::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::PushAvStreamTransport::Commands::SetTransportStatus::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, commandId, endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterPushAVStreamTransport alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRPushAVStreamTransportClusterSetTransportStatusParams alloc] init]; + params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; +#if MTR_ENABLE_PROVISIONAL + params.connectionID = [NSNumber numberWithUnsignedShort:mRequest.connectionID]; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + params.transportStatus = [NSNumber numberWithUnsignedChar:chip::to_underlying(mRequest.transportStatus)]; +#endif // MTR_ENABLE_PROVISIONAL + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster setTransportStatusWithParams:params completion: + ^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return CHIP_NO_ERROR; + } + +private: + chip::app::Clusters::PushAvStreamTransport::Commands::SetTransportStatus::Type mRequest; +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL +/* + * Command ManuallyTriggerTransport + */ +class PushAvStreamTransportManuallyTriggerTransport : public ClusterCommand { +public: + PushAvStreamTransportManuallyTriggerTransport() + : ClusterCommand("manually-trigger-transport") + , mComplex_TimeControl(&mRequest.timeControl) + { +#if MTR_ENABLE_PROVISIONAL + AddArgument("ConnectionID", 0, UINT16_MAX, &mRequest.connectionID); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("ActivationReason", 0, UINT8_MAX, &mRequest.activationReason); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("TimeControl", &mComplex_TimeControl); +#endif // MTR_ENABLE_PROVISIONAL + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::PushAvStreamTransport::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::PushAvStreamTransport::Commands::ManuallyTriggerTransport::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, commandId, endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterPushAVStreamTransport alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRPushAVStreamTransportClusterManuallyTriggerTransportParams alloc] init]; + params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; +#if MTR_ENABLE_PROVISIONAL + params.connectionID = [NSNumber numberWithUnsignedShort:mRequest.connectionID]; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + params.activationReason = [NSNumber numberWithUnsignedChar:chip::to_underlying(mRequest.activationReason)]; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + if (mRequest.timeControl.HasValue()) { + params.timeControl = [MTRPushAVStreamTransportClusterTransportMotionTriggerTimeControlStruct new]; + params.timeControl.initialDuration = [NSNumber numberWithUnsignedShort:mRequest.timeControl.Value().initialDuration]; + params.timeControl.augmentationDuration = [NSNumber numberWithUnsignedShort:mRequest.timeControl.Value().augmentationDuration]; + params.timeControl.maxDuration = [NSNumber numberWithUnsignedInt:mRequest.timeControl.Value().maxDuration]; + params.timeControl.blindDuration = [NSNumber numberWithUnsignedShort:mRequest.timeControl.Value().blindDuration]; + } else { + params.timeControl = nil; + } +#endif // MTR_ENABLE_PROVISIONAL + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster manuallyTriggerTransportWithParams:params completion: + ^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return CHIP_NO_ERROR; + } + +private: + chip::app::Clusters::PushAvStreamTransport::Commands::ManuallyTriggerTransport::Type mRequest; + TypedComplexArgument> mComplex_TimeControl; +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL +/* + * Command FindTransport + */ +class PushAvStreamTransportFindTransport : public ClusterCommand { +public: + PushAvStreamTransportFindTransport() + : ClusterCommand("find-transport") + { +#if MTR_ENABLE_PROVISIONAL + AddArgument("ConnectionID", 0, UINT16_MAX, &mRequest.connectionID); +#endif // MTR_ENABLE_PROVISIONAL + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::PushAvStreamTransport::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::PushAvStreamTransport::Commands::FindTransport::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, commandId, endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterPushAVStreamTransport alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRPushAVStreamTransportClusterFindTransportParams alloc] init]; + params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; +#if MTR_ENABLE_PROVISIONAL + if (mRequest.connectionID.HasValue()) { + if (mRequest.connectionID.Value().IsNull()) { + params.connectionID = nil; + } else { + params.connectionID = [NSNumber numberWithUnsignedShort:mRequest.connectionID.Value().Value()]; + } + } else { + params.connectionID = nil; + } +#endif // MTR_ENABLE_PROVISIONAL + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster findTransportWithParams:params completion: + ^(MTRPushAVStreamTransportClusterFindTransportResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId = chip::app::Clusters::PushAvStreamTransport::Commands::FindTransportResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + constexpr chip::CommandId responseId = chip::app::Clusters::PushAvStreamTransport::Commands::FindTransportResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return CHIP_NO_ERROR; + } + +private: + chip::app::Clusters::PushAvStreamTransport::Commands::FindTransport::Type mRequest; +}; + +#endif // MTR_ENABLE_PROVISIONAL + +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute SupportedContainerFormats + */ +class ReadPushAvStreamTransportSupportedContainerFormats : public ReadAttribute { +public: + ReadPushAvStreamTransportSupportedContainerFormats() + : ReadAttribute("supported-container-formats") + { + } + + ~ReadPushAvStreamTransportSupportedContainerFormats() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::PushAvStreamTransport::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::PushAvStreamTransport::Attributes::SupportedContainerFormats::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterPushAVStreamTransport alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeSupportedContainerFormatsWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PushAVStreamTransport.SupportedContainerFormats response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("PushAVStreamTransport SupportedContainerFormats read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributePushAvStreamTransportSupportedContainerFormats : public SubscribeAttribute { +public: + SubscribeAttributePushAvStreamTransportSupportedContainerFormats() + : SubscribeAttribute("supported-container-formats") + { + } + + ~SubscribeAttributePushAvStreamTransportSupportedContainerFormats() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::PushAvStreamTransport::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::PushAvStreamTransport::Attributes::SupportedContainerFormats::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterPushAVStreamTransport alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeSupportedContainerFormatsWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PushAVStreamTransport.SupportedContainerFormats response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute SupportedIngestMethods + */ +class ReadPushAvStreamTransportSupportedIngestMethods : public ReadAttribute { +public: + ReadPushAvStreamTransportSupportedIngestMethods() + : ReadAttribute("supported-ingest-methods") + { + } + + ~ReadPushAvStreamTransportSupportedIngestMethods() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::PushAvStreamTransport::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::PushAvStreamTransport::Attributes::SupportedIngestMethods::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterPushAVStreamTransport alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeSupportedIngestMethodsWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PushAVStreamTransport.SupportedIngestMethods response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("PushAVStreamTransport SupportedIngestMethods read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributePushAvStreamTransportSupportedIngestMethods : public SubscribeAttribute { +public: + SubscribeAttributePushAvStreamTransportSupportedIngestMethods() + : SubscribeAttribute("supported-ingest-methods") + { + } + + ~SubscribeAttributePushAvStreamTransportSupportedIngestMethods() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::PushAvStreamTransport::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::PushAvStreamTransport::Attributes::SupportedIngestMethods::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterPushAVStreamTransport alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeSupportedIngestMethodsWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PushAVStreamTransport.SupportedIngestMethods response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute CurrentConnections + */ +class ReadPushAvStreamTransportCurrentConnections : public ReadAttribute { +public: + ReadPushAvStreamTransportCurrentConnections() + : ReadAttribute("current-connections") + { + } + + ~ReadPushAvStreamTransportCurrentConnections() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::PushAvStreamTransport::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::PushAvStreamTransport::Attributes::CurrentConnections::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterPushAVStreamTransport alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeCurrentConnectionsWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"PushAVStreamTransport.CurrentConnections response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("PushAVStreamTransport CurrentConnections read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributePushAvStreamTransportCurrentConnections : public SubscribeAttribute { +public: + SubscribeAttributePushAvStreamTransportCurrentConnections() + : SubscribeAttribute("current-connections") + { + } + + ~SubscribeAttributePushAvStreamTransportCurrentConnections() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::PushAvStreamTransport::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::PushAvStreamTransport::Attributes::CurrentConnections::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterPushAVStreamTransport alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeCurrentConnectionsWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"PushAVStreamTransport.CurrentConnections response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute GeneratedCommandList + */ +class ReadPushAvStreamTransportGeneratedCommandList : public ReadAttribute { +public: + ReadPushAvStreamTransportGeneratedCommandList() + : ReadAttribute("generated-command-list") + { + } + + ~ReadPushAvStreamTransportGeneratedCommandList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::PushAvStreamTransport::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::PushAvStreamTransport::Attributes::GeneratedCommandList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterPushAVStreamTransport alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"PushAVStreamTransport.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("PushAVStreamTransport GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributePushAvStreamTransportGeneratedCommandList : public SubscribeAttribute { +public: + SubscribeAttributePushAvStreamTransportGeneratedCommandList() + : SubscribeAttribute("generated-command-list") + { + } + + ~SubscribeAttributePushAvStreamTransportGeneratedCommandList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::PushAvStreamTransport::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::PushAvStreamTransport::Attributes::GeneratedCommandList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterPushAVStreamTransport alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeGeneratedCommandListWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"PushAVStreamTransport.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute AcceptedCommandList + */ +class ReadPushAvStreamTransportAcceptedCommandList : public ReadAttribute { +public: + ReadPushAvStreamTransportAcceptedCommandList() + : ReadAttribute("accepted-command-list") + { + } + + ~ReadPushAvStreamTransportAcceptedCommandList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::PushAvStreamTransport::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::PushAvStreamTransport::Attributes::AcceptedCommandList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterPushAVStreamTransport alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"PushAVStreamTransport.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("PushAVStreamTransport AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributePushAvStreamTransportAcceptedCommandList : public SubscribeAttribute { +public: + SubscribeAttributePushAvStreamTransportAcceptedCommandList() + : SubscribeAttribute("accepted-command-list") + { + } + + ~SubscribeAttributePushAvStreamTransportAcceptedCommandList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::PushAvStreamTransport::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::PushAvStreamTransport::Attributes::AcceptedCommandList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterPushAVStreamTransport alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeAcceptedCommandListWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"PushAVStreamTransport.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute AttributeList + */ +class ReadPushAvStreamTransportAttributeList : public ReadAttribute { +public: + ReadPushAvStreamTransportAttributeList() + : ReadAttribute("attribute-list") + { + } + + ~ReadPushAvStreamTransportAttributeList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::PushAvStreamTransport::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::PushAvStreamTransport::Attributes::AttributeList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterPushAVStreamTransport alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"PushAVStreamTransport.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("PushAVStreamTransport AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributePushAvStreamTransportAttributeList : public SubscribeAttribute { +public: + SubscribeAttributePushAvStreamTransportAttributeList() + : SubscribeAttribute("attribute-list") + { + } + + ~SubscribeAttributePushAvStreamTransportAttributeList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::PushAvStreamTransport::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::PushAvStreamTransport::Attributes::AttributeList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterPushAVStreamTransport alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeAttributeListWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"PushAVStreamTransport.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute FeatureMap + */ +class ReadPushAvStreamTransportFeatureMap : public ReadAttribute { +public: + ReadPushAvStreamTransportFeatureMap() + : ReadAttribute("feature-map") + { + } + + ~ReadPushAvStreamTransportFeatureMap() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::PushAvStreamTransport::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::PushAvStreamTransport::Attributes::FeatureMap::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterPushAVStreamTransport alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PushAVStreamTransport.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("PushAVStreamTransport FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributePushAvStreamTransportFeatureMap : public SubscribeAttribute { +public: + SubscribeAttributePushAvStreamTransportFeatureMap() + : SubscribeAttribute("feature-map") + { + } + + ~SubscribeAttributePushAvStreamTransportFeatureMap() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::PushAvStreamTransport::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::PushAvStreamTransport::Attributes::FeatureMap::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterPushAVStreamTransport alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeFeatureMapWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PushAVStreamTransport.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute ClusterRevision + */ +class ReadPushAvStreamTransportClusterRevision : public ReadAttribute { +public: + ReadPushAvStreamTransportClusterRevision() + : ReadAttribute("cluster-revision") + { + } + + ~ReadPushAvStreamTransportClusterRevision() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::PushAvStreamTransport::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::PushAvStreamTransport::Attributes::ClusterRevision::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterPushAVStreamTransport alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PushAVStreamTransport.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("PushAVStreamTransport ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributePushAvStreamTransportClusterRevision : public SubscribeAttribute { +public: + SubscribeAttributePushAvStreamTransportClusterRevision() + : SubscribeAttribute("cluster-revision") + { + } + + ~SubscribeAttributePushAvStreamTransportClusterRevision() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::PushAvStreamTransport::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::PushAvStreamTransport::Attributes::ClusterRevision::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterPushAVStreamTransport alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeClusterRevisionWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PushAVStreamTransport.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + #endif // MTR_ENABLE_PROVISIONAL #endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL @@ -179382,6 +180654,75 @@ void registerClusterWebRTCTransportRequestor(Commands & commands) commands.RegisterCluster(clusterName, clusterCommands); #endif // MTR_ENABLE_PROVISIONAL } +void registerClusterPushAvStreamTransport(Commands & commands) +{ +#if MTR_ENABLE_PROVISIONAL + using namespace chip::app::Clusters::PushAvStreamTransport; + + const char * clusterName = "PushAvStreamTransport"; + + commands_list clusterCommands = { + make_unique(Id), // +#if MTR_ENABLE_PROVISIONAL + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL + make_unique(Id), // + make_unique(Id), // + make_unique(Id), // +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL + make_unique(Id), // + make_unique(Id), // + }; + + commands.RegisterCluster(clusterName, clusterCommands); +#endif // MTR_ENABLE_PROVISIONAL +} void registerClusterChime(Commands & commands) { #if MTR_ENABLE_PROVISIONAL @@ -180064,6 +181405,7 @@ void registerClusters(Commands & commands) registerClusterCameraAvStreamManagement(commands); registerClusterWebRTCTransportProvider(commands); registerClusterWebRTCTransportRequestor(commands); + registerClusterPushAvStreamTransport(commands); registerClusterChime(commands); registerClusterEcosystemInformation(commands); registerClusterCommissionerControl(commands);