From 3445e8428deb59a1d5a63e543ae49b74b55ebb55 Mon Sep 17 00:00:00 2001 From: marcos <15697303+gmarcosb@users.noreply.github.com> Date: Tue, 17 Dec 2024 13:55:25 -0700 Subject: [PATCH] Generated with ./scripts/tools/zap_regen_all.py --- docs/ids_and_codes/zap_clusters.md | 1 + .../all-clusters-app.matter | 4 +- .../rootnode_heatpump_87ivjRAECh.matter | 2 +- .../placeholder/linux/apps/app1/config.matter | 6 +- .../placeholder/linux/apps/app2/config.matter | 6 +- .../data_model/controller-clusters.matter | 181 +++ .../chip/devicecontroller/ChipClusters.java | 456 ++++++ .../devicecontroller/ChipEventStructs.java | 89 ++ .../chip/devicecontroller/ChipStructs.java | 667 ++++++++ .../devicecontroller/ClusterIDMapping.java | 216 +++ .../devicecontroller/ClusterInfoMapping.java | 281 ++++ .../devicecontroller/ClusterReadMapping.java | 104 ++ .../devicecontroller/ClusterWriteMapping.java | 2 + ...amTransportClusterPushTransportEndEvent.kt | 66 + .../chip/devicecontroller/cluster/files.gni | 8 + ...tClusterPushAVStreamConfigurationStruct.kt | 75 + ...reamTransportCMAFContainerOptionsStruct.kt | 83 + ...AVStreamTransportContainerOptionsStruct.kt | 89 ++ ...hAVStreamTransportMetadataOptionsStruct.kt | 72 + ...TransportMotionTriggerTimeControlStruct.kt | 77 + ...usterPushAVStreamTransportOptionsStruct.kt | 202 +++ ...shAVStreamTransportTriggerOptionsStruct.kt | 169 ++ .../clusters/PushAvStreamTransportCluster.kt | 1170 ++++++++++++++ ...amTransportClusterPushTransportEndEvent.kt | 66 + .../java/matter/controller/cluster/files.gni | 9 + ...tClusterPushAVStreamConfigurationStruct.kt | 76 + ...reamTransportCMAFContainerOptionsStruct.kt | 83 + ...AVStreamTransportContainerOptionsStruct.kt | 89 ++ ...hAVStreamTransportMetadataOptionsStruct.kt | 72 + ...TransportMotionTriggerTimeControlStruct.kt | 77 + ...usterPushAVStreamTransportOptionsStruct.kt | 202 +++ ...shAVStreamTransportTriggerOptionsStruct.kt | 169 ++ .../CHIPAttributeTLVValueDecoder.cpp | 174 ++ .../CHIPEventTLVValueDecoder.cpp | 310 ++++ .../python/chip/clusters/CHIPClusters.py | 104 ++ .../python/chip/clusters/Objects.py | 549 +++++++ .../MTRAttributeSpecifiedCheck.mm | 36 + .../MTRAttributeTLVValueDecoder.mm | 63 + .../CHIP/zap-generated/MTRBaseClusters.h | 168 ++ .../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 | 1210 ++++++++++++++ .../MTRCommandPayloads_Internal.h | 48 + .../zap-generated/MTRCommandTimedCheck.mm | 12 + .../zap-generated/MTREventTLVValueDecoder.mm | 104 ++ .../CHIP/zap-generated/MTRStructsObjc.h | 68 + .../CHIP/zap-generated/MTRStructsObjc.mm | 311 ++++ .../zap-generated/attributes/Accessors.cpp | 1113 +++++++++---- .../zap-generated/attributes/Accessors.h | 152 +- .../app-common/zap-generated/callback.h | 79 + .../zap-generated/cluster-enums-check.h | 92 ++ .../app-common/zap-generated/cluster-enums.h | 107 ++ .../zap-generated/cluster-objects.cpp | 775 +++++++++ .../zap-generated/cluster-objects.h | 690 ++++++++ .../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 | 345 ++++ .../cluster/ComplexArgumentParser.cpp | 368 +++++ .../cluster/ComplexArgumentParser.h | 52 + .../cluster/logging/DataModelLogger.cpp | 440 ++++++ .../cluster/logging/DataModelLogger.h | 40 + .../cluster/logging/EntryToText.cpp | 55 + .../zap-generated/cluster/Commands.h | 1398 +++++++++++++++++ 69 files changed, 14573 insertions(+), 324 deletions(-) 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/PushAvStreamTransportClusterPushAVStreamConfigurationStruct.kt create mode 100644 src/controller/java/generated/java/chip/devicecontroller/cluster/structs/PushAvStreamTransportClusterPushAVStreamTransportCMAFContainerOptionsStruct.kt create mode 100644 src/controller/java/generated/java/chip/devicecontroller/cluster/structs/PushAvStreamTransportClusterPushAVStreamTransportContainerOptionsStruct.kt create mode 100644 src/controller/java/generated/java/chip/devicecontroller/cluster/structs/PushAvStreamTransportClusterPushAVStreamTransportMetadataOptionsStruct.kt create mode 100644 src/controller/java/generated/java/chip/devicecontroller/cluster/structs/PushAvStreamTransportClusterPushAVStreamTransportMotionTriggerTimeControlStruct.kt create mode 100644 src/controller/java/generated/java/chip/devicecontroller/cluster/structs/PushAvStreamTransportClusterPushAVStreamTransportOptionsStruct.kt create mode 100644 src/controller/java/generated/java/chip/devicecontroller/cluster/structs/PushAvStreamTransportClusterPushAVStreamTransportTriggerOptionsStruct.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/PushAvStreamTransportClusterPushTransportEndEvent.kt create mode 100644 src/controller/java/generated/java/matter/controller/cluster/structs/PushAvStreamTransportClusterPushAVStreamConfigurationStruct.kt create mode 100644 src/controller/java/generated/java/matter/controller/cluster/structs/PushAvStreamTransportClusterPushAVStreamTransportCMAFContainerOptionsStruct.kt create mode 100644 src/controller/java/generated/java/matter/controller/cluster/structs/PushAvStreamTransportClusterPushAVStreamTransportContainerOptionsStruct.kt create mode 100644 src/controller/java/generated/java/matter/controller/cluster/structs/PushAvStreamTransportClusterPushAVStreamTransportMetadataOptionsStruct.kt create mode 100644 src/controller/java/generated/java/matter/controller/cluster/structs/PushAvStreamTransportClusterPushAVStreamTransportMotionTriggerTimeControlStruct.kt create mode 100644 src/controller/java/generated/java/matter/controller/cluster/structs/PushAvStreamTransportClusterPushAVStreamTransportOptionsStruct.kt create mode 100644 src/controller/java/generated/java/matter/controller/cluster/structs/PushAvStreamTransportClusterPushAVStreamTransportTriggerOptionsStruct.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/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter index be6f4c0622c94a..0c5b55d33a9ef5 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter @@ -9047,7 +9047,7 @@ endpoint 1 { ram attribute occupancySensorTypeBitmap default = 1; callback attribute holdTime; callback attribute holdTimeLimits; - callback attribute PIROccupiedToUnoccupiedDelay; + ram attribute PIROccupiedToUnoccupiedDelay default = 10; callback attribute featureMap; ram attribute clusterRevision default = 5; } @@ -9505,7 +9505,7 @@ endpoint 2 { ram attribute occupancySensorTypeBitmap default = 1; callback attribute holdTime; callback attribute holdTimeLimits; - callback attribute PIROccupiedToUnoccupiedDelay; + ram attribute PIROccupiedToUnoccupiedDelay default = 10; callback attribute featureMap; ram attribute clusterRevision default = 5; } diff --git a/examples/chef/devices/rootnode_heatpump_87ivjRAECh.matter b/examples/chef/devices/rootnode_heatpump_87ivjRAECh.matter index 87ff9a38821291..ecd48d74867218 100644 --- a/examples/chef/devices/rootnode_heatpump_87ivjRAECh.matter +++ b/examples/chef/devices/rootnode_heatpump_87ivjRAECh.matter @@ -1269,7 +1269,7 @@ cluster GeneralDiagnostics = 51 { /** Take a snapshot of system time and epoch time. */ command TimeSnapshot(): TimeSnapshotResponse = 1; /** Request a variable length payload response. */ - command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3; + command access(invoke: manage) PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3; } /** Commands to trigger a Node to allow a new Administrator to commission it. */ diff --git a/examples/placeholder/linux/apps/app1/config.matter b/examples/placeholder/linux/apps/app1/config.matter index 6bc47afef7015b..f8544c04c07c2c 100644 --- a/examples/placeholder/linux/apps/app1/config.matter +++ b/examples/placeholder/linux/apps/app1/config.matter @@ -9645,13 +9645,13 @@ endpoint 1 { ram attribute occupancy; ram attribute occupancySensorType; ram attribute occupancySensorTypeBitmap; - callback attribute PIROccupiedToUnoccupiedDelay; + ram attribute PIROccupiedToUnoccupiedDelay default = 0x00; ram attribute PIRUnoccupiedToOccupiedDelay default = 0x00; ram attribute PIRUnoccupiedToOccupiedThreshold default = 1; - callback attribute ultrasonicOccupiedToUnoccupiedDelay; + ram attribute ultrasonicOccupiedToUnoccupiedDelay default = 0x00; ram attribute ultrasonicUnoccupiedToOccupiedDelay default = 0x00; ram attribute ultrasonicUnoccupiedToOccupiedThreshold default = 1; - callback attribute physicalContactOccupiedToUnoccupiedDelay; + ram attribute physicalContactOccupiedToUnoccupiedDelay default = 0x00; ram attribute physicalContactUnoccupiedToOccupiedDelay default = 0x00; ram attribute physicalContactUnoccupiedToOccupiedThreshold default = 1; callback attribute featureMap; diff --git a/examples/placeholder/linux/apps/app2/config.matter b/examples/placeholder/linux/apps/app2/config.matter index 9b116eb8ba7780..8daeb82a6f1e71 100644 --- a/examples/placeholder/linux/apps/app2/config.matter +++ b/examples/placeholder/linux/apps/app2/config.matter @@ -9540,13 +9540,13 @@ endpoint 1 { ram attribute occupancy; ram attribute occupancySensorType; ram attribute occupancySensorTypeBitmap; - callback attribute PIROccupiedToUnoccupiedDelay; + ram attribute PIROccupiedToUnoccupiedDelay default = 0x00; ram attribute PIRUnoccupiedToOccupiedDelay default = 0x00; ram attribute PIRUnoccupiedToOccupiedThreshold default = 1; - callback attribute ultrasonicOccupiedToUnoccupiedDelay; + ram attribute ultrasonicOccupiedToUnoccupiedDelay default = 0x00; ram attribute ultrasonicUnoccupiedToOccupiedDelay default = 0x00; ram attribute ultrasonicUnoccupiedToOccupiedThreshold default = 1; - callback attribute physicalContactOccupiedToUnoccupiedDelay; + ram attribute physicalContactOccupiedToUnoccupiedDelay default = 0x00; ram attribute physicalContactUnoccupiedToOccupiedDelay default = 0x00; ram attribute physicalContactUnoccupiedToOccupiedThreshold default = 1; callback attribute featureMap; diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index aa2707931f36d6..2df2b9abfcf3ef 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -10040,6 +10040,187 @@ cluster WebRTCTransportRequestor = 1364 { command End(EndRequest): DefaultSuccess = 4; } +/** This cluster implements the upload of Audio and Video streams from the Camera AV Stream Management Cluster using suitable push-based transports. */ +cluster PushAvStreamTransport = 1365 { + revision 1; + + enum PushAVStreamTransportContainerFormatEnum : enum8 { + kCMAF = 0; + } + + enum PushAVStreamTransportIngestMethodEnum : enum8 { + kCMAFIngest = 0; + } + + enum PushAVStreamTransportStatusEnum : enum8 { + kActive = 0; + kInactive = 1; + } + + enum PushAVStreamTransportStreamMultiplexingEnum : enum8 { + kInterleaved = 0; + } + + enum PushAVStreamTransportTriggerActivationReasonEnum : enum8 { + kUserInitiated = 0; + kAutomation = 1; + kEmergency = 2; + } + + enum PushAVStreamTransportTriggerTypeEnum : enum8 { + kCommand = 0; + kMotion = 1; + kContinuous = 2; + } + + enum StatusCodeEnum : enum8 { + kALLOCATIONNOTPERMITTED = 2; + kINVALIDPARAMETERS = 3; + kINVALIDURL = 4; + kINVALIDTRIGGEROPTIONS = 5; + kUNSUPPORTEDCONTAINERFORMAT = 6; + kUNSUPPORTEDINGESTMETHOD = 7; + kPAVSTNOTINUSE = 8; + kINVALIDTRIGGERFORMAT = 9; + kINVALIDTRANSPORTSTATUS = 16; + } + + enum StreamTypeEnum : enum8 { + kInternal = 0; + kRecording = 1; + kAnalysis = 2; + kLiveView = 3; + } + + bitmap PushAVStreamTransportSupportedContainerFormatsBitmap : bitmap8 { + kCMAF = 0x1; + } + + bitmap PushAVStreamTransportSupportedIngestMethodsBitmap : bitmap8 { + kCMAFIngest = 0x1; + } + + struct PushAVStreamTransportMotionTriggerTimeControlStruct { + int16u initialDuration = 0; + int16u augmentationDuration = 1; + int32u maxDuration = 2; + int16u blindDuration = 3; + } + + struct PushAVStreamTransportMetadataOptionsStruct { + PushAVStreamTransportStreamMultiplexingEnum multiplexing = 0; + boolean includeMotionZones = 1; + boolean enableMetadataPrivacySensitive = 2; + } + + struct PushAVStreamTransportTriggerOptionsStruct { + PushAVStreamTransportTriggerTypeEnum triggerType = 0; + optional nullable int16u motionZones[] = 1; + optional nullable int8u motionSensitivity = 2; + optional nullable PushAVStreamTransportMotionTriggerTimeControlStruct motionTimeControl = 3; + optional nullable PushAVStreamTransportTriggerActivationReasonEnum activationReason = 4; + } + + struct PushAVStreamTransportCMAFContainerOptionsStruct { + int16u chunkDuration = 0; + optional nullable octet_string CENCKey = 1; + } + + struct PushAVStreamTransportContainerOptionsStruct { + PushAVStreamTransportContainerFormatEnum containerType = 0; + optional nullable PushAVStreamTransportCMAFContainerOptionsStruct CMAFContainerOptions = 1; + } + + struct PushAVStreamTransportOptionsStruct { + StreamTypeEnum streamType = 0; + optional nullable int16u videoStreamID = 1; + optional nullable int16u audioStreamID = 2; + int16u TLSEndpointID = 3; + long_char_string<256> url = 4; + PushAVStreamTransportTriggerOptionsStruct triggerOptions = 5; + PushAVStreamTransportContainerFormatEnum containerFormat = 6; + PushAVStreamTransportIngestMethodEnum ingestMethod = 7; + PushAVStreamTransportContainerOptionsStruct containerOptions = 8; + optional nullable PushAVStreamTransportMetadataOptionsStruct metadataOptions = 9; + optional nullable int32u expiryTime = 10; + } + + struct PushAVStreamConfigurationStruct { + int16u connectionID = 0; + PushAVStreamTransportStatusEnum streamTransportStatus = 1; + PushAVStreamTransportOptionsStruct streamTransportOptions = 2; + } + + info event PushTransportBegin = 0 { + } + + info event PushTransportEnd = 1 { + int16u connectionID = 0; + PushAVStreamTransportTriggerOptionsStruct triggerDetails = 1; + } + + readonly attribute PushAVStreamTransportSupportedContainerFormatsBitmap supportedContainerFormats = 0; + readonly attribute PushAVStreamTransportSupportedIngestMethodsBitmap 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 { + PushAVStreamTransportOptionsStruct streamTransportOptions = 0; + } + + response struct AllocatePushTransportResponse = 1 { + int16u connectionID = 0; + PushAVStreamTransportOptionsStruct streamTransportOptions = 1; + PushAVStreamTransportStatusEnum transportStatus = 2; + } + + request struct DeallocatePushTransportRequest { + int16u connectionID = 0; + } + + request struct ModifyPushTransportRequest { + int16u connectionID = 0; + PushAVStreamTransportOptionsStruct streamTransportOptions = 1; + } + + request struct SetTransportStatusRequest { + nullable int16u connectionID = 0; + PushAVStreamTransportStatusEnum streamTransportStatus = 1; + } + + request struct ManuallyTriggerTransportRequest { + int16u connectionID = 0; + nullable PushAVStreamTransportTriggerActivationReasonEnum activationReason = 1; + optional nullable PushAVStreamTransportMotionTriggerTimeControlStruct timeControl = 2; + } + + request struct FindStreamConfigurationRequest { + optional nullable int16u connectionID = 0; + } + + response struct FindStreamConfigurationResponse = 7 { + PushAVStreamConfigurationStruct streamConfigurations[] = 0; + } + + /** This command SHALL allocate a transport and return a PushTransportConnectionID. */ + command access(invoke: administer) AllocatePushTransport(AllocatePushTransportRequest): AllocatePushTransportResponse = 0; + /** This command SHALL be generated to request the Node deallocates the specified transport. */ + command access(invoke: administer) DeallocatePushTransport(DeallocatePushTransportRequest): DefaultSuccess = 2; + /** This command is used to request the Node modifies the configuration of the specified push transport. */ + command access(invoke: administer) ModifyPushTransport(ModifyPushTransportRequest): DefaultSuccess = 3; + /** This command SHALL be generated to request the Node modifies the Transport Status of the transport. */ + command access(invoke: administer) SetTransportStatus(SetTransportStatusRequest): DefaultSuccess = 4; + /** This command SHALL be generated to request the Node to manually start the specified push transport. */ + command access(invoke: administer) ManuallyTriggerTransport(ManuallyTriggerTransportRequest): DefaultSuccess = 5; + /** This command SHALL return the Stream Options Configuration for the specified push transport. */ + command access(invoke: administer) FindStreamConfiguration(FindStreamConfigurationRequest): FindStreamConfigurationResponse = 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..bb17d9b3176f31 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.PushAvStreamTransportClusterPushAVStreamTransportOptionsStruct streamTransportOptions) { + allocatePushTransport(callback, streamTransportOptions, 0); + } + + public void allocatePushTransport(AllocatePushTransportResponseCallback callback, ChipStructs.PushAvStreamTransportClusterPushAVStreamTransportOptionsStruct streamTransportOptions, int timedInvokeTimeoutMs) { + final long commandId = 0L; + + ArrayList elements = new ArrayList<>(); + final long streamTransportOptionsFieldID = 0L; + BaseTLVType streamTransportOptionstlvValue = streamTransportOptions.encodeTlv(); + elements.add(new StructElement(streamTransportOptionsFieldID, streamTransportOptionstlvValue)); + + StructType commandArgs = new StructType(elements); + invoke(new InvokeCallbackImpl(callback) { + @Override + public void onResponse(StructType invokeStructValue) { + final long connectionIDFieldID = 0L; + Integer connectionID = null; + final long streamTransportOptionsFieldID = 1L; + ChipStructs.PushAvStreamTransportClusterPushAVStreamTransportOptionsStruct streamTransportOptions = 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() == streamTransportOptionsFieldID) { + if (element.value(BaseTLVType.class).type() == TLVType.Struct) { + StructType castingValue = element.value(StructType.class); + streamTransportOptions = ChipStructs.PushAvStreamTransportClusterPushAVStreamTransportOptionsStruct.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, streamTransportOptions, 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.PushAvStreamTransportClusterPushAVStreamTransportOptionsStruct streamTransportOptions) { + modifyPushTransport(callback, connectionID, streamTransportOptions, 0); + } + + public void modifyPushTransport(DefaultClusterCallback callback, Integer connectionID, ChipStructs.PushAvStreamTransportClusterPushAVStreamTransportOptionsStruct streamTransportOptions, 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 streamTransportOptionsFieldID = 1L; + BaseTLVType streamTransportOptionstlvValue = streamTransportOptions.encodeTlv(); + elements.add(new StructElement(streamTransportOptionsFieldID, streamTransportOptionstlvValue)); + + 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, @Nullable Integer connectionID, Integer streamTransportStatus) { + setTransportStatus(callback, connectionID, streamTransportStatus, 0); + } + + public void setTransportStatus(DefaultClusterCallback callback, @Nullable Integer connectionID, Integer streamTransportStatus, int timedInvokeTimeoutMs) { + final long commandId = 4L; + + ArrayList elements = new ArrayList<>(); + final long connectionIDFieldID = 0L; + BaseTLVType connectionIDtlvValue = connectionID != null ? new UIntType(connectionID) : new NullType(); + elements.add(new StructElement(connectionIDFieldID, connectionIDtlvValue)); + + final long streamTransportStatusFieldID = 1L; + BaseTLVType streamTransportStatustlvValue = new UIntType(streamTransportStatus); + elements.add(new StructElement(streamTransportStatusFieldID, streamTransportStatustlvValue)); + + 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, @Nullable Integer activationReason, @Nullable Optional timeControl) { + manuallyTriggerTransport(callback, connectionID, activationReason, timeControl, 0); + } + + public void manuallyTriggerTransport(DefaultClusterCallback callback, Integer connectionID, @Nullable Integer activationReason, @Nullable 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 = activationReason != null ? new UIntType(activationReason) : new NullType(); + elements.add(new StructElement(activationReasonFieldID, activationReasontlvValue)); + + final long timeControlFieldID = 2L; + BaseTLVType timeControltlvValue = timeControl != null ? timeControl.map((nonOptionaltimeControl) -> nonOptionaltimeControl.encodeTlv()).orElse(new EmptyType()) : new NullType(); + 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 findStreamConfiguration(FindStreamConfigurationResponseCallback callback, @Nullable Optional connectionID) { + findStreamConfiguration(callback, connectionID, 0); + } + + public void findStreamConfiguration(FindStreamConfigurationResponseCallback 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.PushAvStreamTransportClusterPushAVStreamConfigurationStruct.decodeTlv(elementcastingValue)); + } + } + } + callback.onSuccess(streamConfigurations); + }}, commandId, commandArgs, timedInvokeTimeoutMs); + } + + public interface AllocatePushTransportResponseCallback extends BaseClusterCallback { + void onSuccess(Integer connectionID, ChipStructs.PushAvStreamTransportClusterPushAVStreamTransportOptionsStruct streamTransportOptions, Integer transportStatus); + } + + public interface FindStreamConfigurationResponseCallback 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..942206e175929d 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ChipEventStructs.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ChipEventStructs.java @@ -6777,6 +6777,95 @@ public String toString() { return output.toString(); } } +public static class PushAvStreamTransportClusterPushTransportBeginEvent { + + public PushAvStreamTransportClusterPushTransportBeginEvent( + ) { + } + + public StructType encodeTlv() { + ArrayList values = new ArrayList<>(); + + return new StructType(values); + } + + public static PushAvStreamTransportClusterPushTransportBeginEvent decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + return new PushAvStreamTransportClusterPushTransportBeginEvent( + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("PushAvStreamTransportClusterPushTransportBeginEvent {\n"); + output.append("}\n"); + return output.toString(); + } +} +public static class PushAvStreamTransportClusterPushTransportEndEvent { + public Integer connectionID; + public ChipStructs.PushAvStreamTransportClusterPushAVStreamTransportTriggerOptionsStruct triggerDetails; + private static final long CONNECTION_ID_ID = 0L; + private static final long TRIGGER_DETAILS_ID = 1L; + + public PushAvStreamTransportClusterPushTransportEndEvent( + Integer connectionID, + ChipStructs.PushAvStreamTransportClusterPushAVStreamTransportTriggerOptionsStruct triggerDetails + ) { + this.connectionID = connectionID; + this.triggerDetails = triggerDetails; + } + + public StructType encodeTlv() { + ArrayList values = new ArrayList<>(); + values.add(new StructElement(CONNECTION_ID_ID, new UIntType(connectionID))); + values.add(new StructElement(TRIGGER_DETAILS_ID, triggerDetails.encodeTlv())); + + return new StructType(values); + } + + public static PushAvStreamTransportClusterPushTransportEndEvent decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + Integer connectionID = null; + ChipStructs.PushAvStreamTransportClusterPushAVStreamTransportTriggerOptionsStruct triggerDetails = 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() == TRIGGER_DETAILS_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Struct) { + StructType castingValue = element.value(StructType.class); + triggerDetails = ChipStructs.PushAvStreamTransportClusterPushAVStreamTransportTriggerOptionsStruct.decodeTlv(castingValue); + } + } + } + return new PushAvStreamTransportClusterPushTransportEndEvent( + connectionID, + triggerDetails + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("PushAvStreamTransportClusterPushTransportEndEvent {\n"); + output.append("\tconnectionID: "); + output.append(connectionID); + output.append("\n"); + output.append("\ttriggerDetails: "); + output.append(triggerDetails); + 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..b5491189e8f125 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java @@ -14556,6 +14556,673 @@ public String toString() { return output.toString(); } } +public static class PushAvStreamTransportClusterPushAVStreamTransportMotionTriggerTimeControlStruct { + 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 PushAvStreamTransportClusterPushAVStreamTransportMotionTriggerTimeControlStruct( + 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 PushAvStreamTransportClusterPushAVStreamTransportMotionTriggerTimeControlStruct 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 PushAvStreamTransportClusterPushAVStreamTransportMotionTriggerTimeControlStruct( + initialDuration, + augmentationDuration, + maxDuration, + blindDuration + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("PushAvStreamTransportClusterPushAVStreamTransportMotionTriggerTimeControlStruct {\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 PushAvStreamTransportClusterPushAVStreamTransportMetadataOptionsStruct { + 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 PushAvStreamTransportClusterPushAVStreamTransportMetadataOptionsStruct( + 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 PushAvStreamTransportClusterPushAVStreamTransportMetadataOptionsStruct 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 PushAvStreamTransportClusterPushAVStreamTransportMetadataOptionsStruct( + multiplexing, + includeMotionZones, + enableMetadataPrivacySensitive + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("PushAvStreamTransportClusterPushAVStreamTransportMetadataOptionsStruct {\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 PushAvStreamTransportClusterPushAVStreamTransportTriggerOptionsStruct { + public Integer triggerType; + public @Nullable Optional> motionZones; + public @Nullable Optional motionSensitivity; + public @Nullable Optional motionTimeControl; + public @Nullable Optional activationReason; + 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 ACTIVATION_REASON_ID = 4L; + + public PushAvStreamTransportClusterPushAVStreamTransportTriggerOptionsStruct( + Integer triggerType, + @Nullable Optional> motionZones, + @Nullable Optional motionSensitivity, + @Nullable Optional motionTimeControl, + @Nullable Optional activationReason + ) { + this.triggerType = triggerType; + this.motionZones = motionZones; + this.motionSensitivity = motionSensitivity; + this.motionTimeControl = motionTimeControl; + this.activationReason = activationReason; + } + + 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) -> new UIntType(elementnonOptionalmotionZones))).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 != null ? motionTimeControl.map((nonOptionalmotionTimeControl) -> nonOptionalmotionTimeControl.encodeTlv()).orElse(new EmptyType()) : new NullType())); + values.add(new StructElement(ACTIVATION_REASON_ID, activationReason != null ? activationReason.map((nonOptionalactivationReason) -> new UIntType(nonOptionalactivationReason)).orElse(new EmptyType()) : new NullType())); + + return new StructType(values); + } + + public static PushAvStreamTransportClusterPushAVStreamTransportTriggerOptionsStruct decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + Integer triggerType = null; + @Nullable Optional> motionZones = null; + @Nullable Optional motionSensitivity = null; + @Nullable Optional motionTimeControl = null; + @Nullable Optional activationReason = null; + 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) -> elementcastingValue.value(Integer.class))); + } + } 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.PushAvStreamTransportClusterPushAVStreamTransportMotionTriggerTimeControlStruct.decodeTlv(castingValue)); + } + } 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 PushAvStreamTransportClusterPushAVStreamTransportTriggerOptionsStruct( + triggerType, + motionZones, + motionSensitivity, + motionTimeControl, + activationReason + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("PushAvStreamTransportClusterPushAVStreamTransportTriggerOptionsStruct {\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("\tactivationReason: "); + output.append(activationReason); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} +public static class PushAvStreamTransportClusterPushAVStreamTransportCMAFContainerOptionsStruct { + public Integer chunkDuration; + public @Nullable Optional CENCKey; + private static final long CHUNK_DURATION_ID = 0L; + private static final long CENC_KEY_ID = 1L; + + public PushAvStreamTransportClusterPushAVStreamTransportCMAFContainerOptionsStruct( + Integer chunkDuration, + @Nullable 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 != null ? CENCKey.map((nonOptionalCENCKey) -> new ByteArrayType(nonOptionalCENCKey)).orElse(new EmptyType()) : new NullType())); + + return new StructType(values); + } + + public static PushAvStreamTransportClusterPushAVStreamTransportCMAFContainerOptionsStruct decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + Integer chunkDuration = null; + @Nullable Optional CENCKey = null; + 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 PushAvStreamTransportClusterPushAVStreamTransportCMAFContainerOptionsStruct( + chunkDuration, + CENCKey + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("PushAvStreamTransportClusterPushAVStreamTransportCMAFContainerOptionsStruct {\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 PushAvStreamTransportClusterPushAVStreamTransportContainerOptionsStruct { + public Integer containerType; + public @Nullable Optional CMAFContainerOptions; + private static final long CONTAINER_TYPE_ID = 0L; + private static final long CMAF_CONTAINER_OPTIONS_ID = 1L; + + public PushAvStreamTransportClusterPushAVStreamTransportContainerOptionsStruct( + Integer containerType, + @Nullable 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 != null ? CMAFContainerOptions.map((nonOptionalCMAFContainerOptions) -> nonOptionalCMAFContainerOptions.encodeTlv()).orElse(new EmptyType()) : new NullType())); + + return new StructType(values); + } + + public static PushAvStreamTransportClusterPushAVStreamTransportContainerOptionsStruct decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + Integer containerType = null; + @Nullable Optional CMAFContainerOptions = null; + 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.PushAvStreamTransportClusterPushAVStreamTransportCMAFContainerOptionsStruct.decodeTlv(castingValue)); + } + } + } + return new PushAvStreamTransportClusterPushAVStreamTransportContainerOptionsStruct( + containerType, + CMAFContainerOptions + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("PushAvStreamTransportClusterPushAVStreamTransportContainerOptionsStruct {\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 PushAvStreamTransportClusterPushAVStreamTransportOptionsStruct { + public Integer streamType; + public @Nullable Optional videoStreamID; + public @Nullable Optional audioStreamID; + public Integer TLSEndpointID; + public String url; + public ChipStructs.PushAvStreamTransportClusterPushAVStreamTransportTriggerOptionsStruct triggerOptions; + public Integer containerFormat; + public Integer ingestMethod; + public ChipStructs.PushAvStreamTransportClusterPushAVStreamTransportContainerOptionsStruct containerOptions; + public @Nullable Optional metadataOptions; + public @Nullable 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 TLS_ENDPOINT_ID_ID = 3L; + private static final long URL_ID = 4L; + private static final long TRIGGER_OPTIONS_ID = 5L; + private static final long CONTAINER_FORMAT_ID = 6L; + private static final long INGEST_METHOD_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 PushAvStreamTransportClusterPushAVStreamTransportOptionsStruct( + Integer streamType, + @Nullable Optional videoStreamID, + @Nullable Optional audioStreamID, + Integer TLSEndpointID, + String url, + ChipStructs.PushAvStreamTransportClusterPushAVStreamTransportTriggerOptionsStruct triggerOptions, + Integer containerFormat, + Integer ingestMethod, + ChipStructs.PushAvStreamTransportClusterPushAVStreamTransportContainerOptionsStruct containerOptions, + @Nullable Optional metadataOptions, + @Nullable Optional expiryTime + ) { + this.streamType = streamType; + this.videoStreamID = videoStreamID; + this.audioStreamID = audioStreamID; + this.TLSEndpointID = TLSEndpointID; + this.url = url; + this.triggerOptions = triggerOptions; + this.containerFormat = containerFormat; + this.ingestMethod = ingestMethod; + 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 != null ? videoStreamID.map((nonOptionalvideoStreamID) -> new UIntType(nonOptionalvideoStreamID)).orElse(new EmptyType()) : new NullType())); + values.add(new StructElement(AUDIO_STREAM_ID_ID, audioStreamID != null ? audioStreamID.map((nonOptionalaudioStreamID) -> new UIntType(nonOptionalaudioStreamID)).orElse(new EmptyType()) : new NullType())); + values.add(new StructElement(TLS_ENDPOINT_ID_ID, new UIntType(TLSEndpointID))); + values.add(new StructElement(URL_ID, new StringType(url))); + values.add(new StructElement(TRIGGER_OPTIONS_ID, triggerOptions.encodeTlv())); + values.add(new StructElement(CONTAINER_FORMAT_ID, new UIntType(containerFormat))); + values.add(new StructElement(INGEST_METHOD_ID, new UIntType(ingestMethod))); + values.add(new StructElement(CONTAINER_OPTIONS_ID, containerOptions.encodeTlv())); + values.add(new StructElement(METADATA_OPTIONS_ID, metadataOptions != null ? metadataOptions.map((nonOptionalmetadataOptions) -> nonOptionalmetadataOptions.encodeTlv()).orElse(new EmptyType()) : new NullType())); + values.add(new StructElement(EXPIRY_TIME_ID, expiryTime != null ? expiryTime.map((nonOptionalexpiryTime) -> new UIntType(nonOptionalexpiryTime)).orElse(new EmptyType()) : new NullType())); + + return new StructType(values); + } + + public static PushAvStreamTransportClusterPushAVStreamTransportOptionsStruct decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + Integer streamType = null; + @Nullable Optional videoStreamID = null; + @Nullable Optional audioStreamID = null; + Integer TLSEndpointID = null; + String url = null; + ChipStructs.PushAvStreamTransportClusterPushAVStreamTransportTriggerOptionsStruct triggerOptions = null; + Integer containerFormat = null; + Integer ingestMethod = null; + ChipStructs.PushAvStreamTransportClusterPushAVStreamTransportContainerOptionsStruct containerOptions = null; + @Nullable Optional metadataOptions = null; + @Nullable Optional expiryTime = null; + 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() == TLS_ENDPOINT_ID_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + TLSEndpointID = 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.PushAvStreamTransportClusterPushAVStreamTransportTriggerOptionsStruct.decodeTlv(castingValue); + } + } 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() == 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_OPTIONS_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Struct) { + StructType castingValue = element.value(StructType.class); + containerOptions = ChipStructs.PushAvStreamTransportClusterPushAVStreamTransportContainerOptionsStruct.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.PushAvStreamTransportClusterPushAVStreamTransportMetadataOptionsStruct.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 PushAvStreamTransportClusterPushAVStreamTransportOptionsStruct( + streamType, + videoStreamID, + audioStreamID, + TLSEndpointID, + url, + triggerOptions, + containerFormat, + ingestMethod, + containerOptions, + metadataOptions, + expiryTime + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("PushAvStreamTransportClusterPushAVStreamTransportOptionsStruct {\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("\tTLSEndpointID: "); + output.append(TLSEndpointID); + output.append("\n"); + output.append("\turl: "); + output.append(url); + output.append("\n"); + output.append("\ttriggerOptions: "); + output.append(triggerOptions); + output.append("\n"); + output.append("\tcontainerFormat: "); + output.append(containerFormat); + output.append("\n"); + output.append("\tingestMethod: "); + output.append(ingestMethod); + 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 PushAvStreamTransportClusterPushAVStreamConfigurationStruct { + public Integer connectionID; + public Integer streamTransportStatus; + public ChipStructs.PushAvStreamTransportClusterPushAVStreamTransportOptionsStruct streamTransportOptions; + private static final long CONNECTION_ID_ID = 0L; + private static final long STREAM_TRANSPORT_STATUS_ID = 1L; + private static final long STREAM_TRANSPORT_OPTIONS_ID = 2L; + + public PushAvStreamTransportClusterPushAVStreamConfigurationStruct( + Integer connectionID, + Integer streamTransportStatus, + ChipStructs.PushAvStreamTransportClusterPushAVStreamTransportOptionsStruct streamTransportOptions + ) { + this.connectionID = connectionID; + this.streamTransportStatus = streamTransportStatus; + this.streamTransportOptions = streamTransportOptions; + } + + public StructType encodeTlv() { + ArrayList values = new ArrayList<>(); + values.add(new StructElement(CONNECTION_ID_ID, new UIntType(connectionID))); + values.add(new StructElement(STREAM_TRANSPORT_STATUS_ID, new UIntType(streamTransportStatus))); + values.add(new StructElement(STREAM_TRANSPORT_OPTIONS_ID, streamTransportOptions.encodeTlv())); + + return new StructType(values); + } + + public static PushAvStreamTransportClusterPushAVStreamConfigurationStruct decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + Integer connectionID = null; + Integer streamTransportStatus = null; + ChipStructs.PushAvStreamTransportClusterPushAVStreamTransportOptionsStruct streamTransportOptions = 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() == STREAM_TRANSPORT_STATUS_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + streamTransportStatus = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == STREAM_TRANSPORT_OPTIONS_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Struct) { + StructType castingValue = element.value(StructType.class); + streamTransportOptions = ChipStructs.PushAvStreamTransportClusterPushAVStreamTransportOptionsStruct.decodeTlv(castingValue); + } + } + } + return new PushAvStreamTransportClusterPushAVStreamConfigurationStruct( + connectionID, + streamTransportStatus, + streamTransportOptions + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("PushAvStreamTransportClusterPushAVStreamConfigurationStruct {\n"); + output.append("\tconnectionID: "); + output.append(connectionID); + output.append("\n"); + output.append("\tstreamTransportStatus: "); + output.append(streamTransportStatus); + output.append("\n"); + output.append("\tstreamTransportOptions: "); + output.append(streamTransportOptions); + 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..854f4497ef4554 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), + FindStreamConfiguration(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 {StreamTransportOptions(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),StreamTransportOptions(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),StreamTransportStatus(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 FindStreamConfigurationCommandField {ConnectionID(0),; + private final int id; + FindStreamConfigurationCommandField(int id) { + this.id = id; + } + + public int getID() { + return id; + } + public static FindStreamConfigurationCommandField value(int id) throws NoSuchFieldError { + for (FindStreamConfigurationCommandField field : FindStreamConfigurationCommandField.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..b03b2a67dacd6b 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.PushAvStreamTransportClusterPushAVStreamTransportOptionsStruct streamTransportOptions, Integer transportStatus) { + Map responseValues = new LinkedHashMap<>(); + + CommandResponseInfo connectionIDResponseValue = new CommandResponseInfo("connectionID", "Integer"); + responseValues.put(connectionIDResponseValue, connectionID); + // streamTransportOptions: Struct PushAVStreamTransportOptionsStruct + // 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 DelegatedPushAvStreamTransportClusterFindStreamConfigurationResponseCallback implements ChipClusters.PushAvStreamTransportCluster.FindStreamConfigurationResponseCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(ArrayList streamConfigurations) { + Map responseValues = new LinkedHashMap<>(); + + // streamConfigurations: PushAVStreamConfigurationStruct + // 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.PushAvStreamTransportClusterPushAVStreamTransportOptionsStruct) + commandArguments.get("streamTransportOptions") + + ); + }, + () -> 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.PushAvStreamTransportClusterPushAVStreamTransportOptionsStruct) + commandArguments.get("streamTransportOptions") + ); + }, + () -> 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 pushAvStreamTransportsetTransportStatusstreamTransportStatusCommandParameterInfo = new CommandParameterInfo("streamTransportStatus", Integer.class, Integer.class); + pushAvStreamTransportsetTransportStatusCommandParams.put("streamTransportStatus",pushAvStreamTransportsetTransportStatusstreamTransportStatusCommandParameterInfo); + InteractionInfo pushAvStreamTransportsetTransportStatusInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.PushAvStreamTransportCluster) cluster) + .setTransportStatus((DefaultClusterCallback) callback + , (Integer) + commandArguments.get("connectionID") + , (Integer) + commandArguments.get("streamTransportStatus") + ); + }, + () -> 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 pushAvStreamTransportfindStreamConfigurationCommandParams = new LinkedHashMap(); + + CommandParameterInfo pushAvStreamTransportfindStreamConfigurationconnectionIDCommandParameterInfo = new CommandParameterInfo("connectionID", Optional.class, Integer.class); + pushAvStreamTransportfindStreamConfigurationCommandParams.put("connectionID",pushAvStreamTransportfindStreamConfigurationconnectionIDCommandParameterInfo); + InteractionInfo pushAvStreamTransportfindStreamConfigurationInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.PushAvStreamTransportCluster) cluster) + .findStreamConfiguration((ChipClusters.PushAvStreamTransportCluster.FindStreamConfigurationResponseCallback) callback + , (Optional) + commandArguments.get("connectionID") + + ); + }, + () -> new DelegatedPushAvStreamTransportClusterFindStreamConfigurationResponseCallback(), + pushAvStreamTransportfindStreamConfigurationCommandParams + ); + pushAvStreamTransportClusterInteractionInfoMap.put("findStreamConfiguration", pushAvStreamTransportfindStreamConfigurationInteractionInfo); + + 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/PushAvStreamTransportClusterPushTransportEndEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/PushAvStreamTransportClusterPushTransportEndEvent.kt new file mode 100644 index 00000000000000..d45dac5bfb61f6 --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/PushAvStreamTransportClusterPushTransportEndEvent.kt @@ -0,0 +1,66 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package chip.devicecontroller.cluster.eventstructs + +import chip.devicecontroller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class PushAvStreamTransportClusterPushTransportEndEvent( + val connectionID: UInt, + val triggerDetails: + chip.devicecontroller.cluster.structs.PushAvStreamTransportClusterPushAVStreamTransportTriggerOptionsStruct, +) { + override fun toString(): String = buildString { + append("PushAvStreamTransportClusterPushTransportEndEvent {\n") + append("\tconnectionID : $connectionID\n") + append("\ttriggerDetails : $triggerDetails\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_CONNECTION_ID), connectionID) + triggerDetails.toTlv(ContextSpecificTag(TAG_TRIGGER_DETAILS), this) + endStructure() + } + } + + companion object { + private const val TAG_CONNECTION_ID = 0 + private const val TAG_TRIGGER_DETAILS = 1 + + fun fromTlv( + tlvTag: Tag, + tlvReader: TlvReader, + ): PushAvStreamTransportClusterPushTransportEndEvent { + tlvReader.enterStructure(tlvTag) + val connectionID = tlvReader.getUInt(ContextSpecificTag(TAG_CONNECTION_ID)) + val triggerDetails = + chip.devicecontroller.cluster.structs + .PushAvStreamTransportClusterPushAVStreamTransportTriggerOptionsStruct + .fromTlv(ContextSpecificTag(TAG_TRIGGER_DETAILS), tlvReader) + + tlvReader.exitContainer() + + return PushAvStreamTransportClusterPushTransportEndEvent(connectionID, triggerDetails) + } + } +} 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..f7d2e33fa19eb0 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,13 @@ 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/PushAvStreamTransportClusterPushAVStreamConfigurationStruct.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/PushAvStreamTransportClusterPushAVStreamTransportCMAFContainerOptionsStruct.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/PushAvStreamTransportClusterPushAVStreamTransportContainerOptionsStruct.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/PushAvStreamTransportClusterPushAVStreamTransportMetadataOptionsStruct.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/PushAvStreamTransportClusterPushAVStreamTransportMotionTriggerTimeControlStruct.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/PushAvStreamTransportClusterPushAVStreamTransportOptionsStruct.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/PushAvStreamTransportClusterPushAVStreamTransportTriggerOptionsStruct.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 +243,7 @@ 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/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/PushAvStreamTransportClusterPushAVStreamConfigurationStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/PushAvStreamTransportClusterPushAVStreamConfigurationStruct.kt new file mode 100644 index 00000000000000..70c5d13d6225c5 --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/PushAvStreamTransportClusterPushAVStreamConfigurationStruct.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 PushAvStreamTransportClusterPushAVStreamConfigurationStruct( + val connectionID: UInt, + val streamTransportStatus: UInt, + val streamTransportOptions: PushAvStreamTransportClusterPushAVStreamTransportOptionsStruct, +) { + override fun toString(): String = buildString { + append("PushAvStreamTransportClusterPushAVStreamConfigurationStruct {\n") + append("\tconnectionID : $connectionID\n") + append("\tstreamTransportStatus : $streamTransportStatus\n") + append("\tstreamTransportOptions : $streamTransportOptions\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_CONNECTION_ID), connectionID) + put(ContextSpecificTag(TAG_STREAM_TRANSPORT_STATUS), streamTransportStatus) + streamTransportOptions.toTlv(ContextSpecificTag(TAG_STREAM_TRANSPORT_OPTIONS), this) + endStructure() + } + } + + companion object { + private const val TAG_CONNECTION_ID = 0 + private const val TAG_STREAM_TRANSPORT_STATUS = 1 + private const val TAG_STREAM_TRANSPORT_OPTIONS = 2 + + fun fromTlv( + tlvTag: Tag, + tlvReader: TlvReader, + ): PushAvStreamTransportClusterPushAVStreamConfigurationStruct { + tlvReader.enterStructure(tlvTag) + val connectionID = tlvReader.getUInt(ContextSpecificTag(TAG_CONNECTION_ID)) + val streamTransportStatus = tlvReader.getUInt(ContextSpecificTag(TAG_STREAM_TRANSPORT_STATUS)) + val streamTransportOptions = + PushAvStreamTransportClusterPushAVStreamTransportOptionsStruct.fromTlv( + ContextSpecificTag(TAG_STREAM_TRANSPORT_OPTIONS), + tlvReader, + ) + + tlvReader.exitContainer() + + return PushAvStreamTransportClusterPushAVStreamConfigurationStruct( + connectionID, + streamTransportStatus, + streamTransportOptions, + ) + } + } +} diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/PushAvStreamTransportClusterPushAVStreamTransportCMAFContainerOptionsStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/PushAvStreamTransportClusterPushAVStreamTransportCMAFContainerOptionsStruct.kt new file mode 100644 index 00000000000000..35618c8fe31db3 --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/PushAvStreamTransportClusterPushAVStreamTransportCMAFContainerOptionsStruct.kt @@ -0,0 +1,83 @@ +/* + * + * 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 PushAvStreamTransportClusterPushAVStreamTransportCMAFContainerOptionsStruct( + val chunkDuration: UInt, + val CENCKey: Optional?, +) { + override fun toString(): String = buildString { + append("PushAvStreamTransportClusterPushAVStreamTransportCMAFContainerOptionsStruct {\n") + append("\tchunkDuration : $chunkDuration\n") + append("\tCENCKey : $CENCKey\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_CHUNK_DURATION), chunkDuration) + if (CENCKey != null) { + if (CENCKey.isPresent) { + val optCENCKey = CENCKey.get() + put(ContextSpecificTag(TAG_CENC_KEY), optCENCKey) + } + } else { + putNull(ContextSpecificTag(TAG_CENC_KEY)) + } + endStructure() + } + } + + companion object { + private const val TAG_CHUNK_DURATION = 0 + private const val TAG_CENC_KEY = 1 + + fun fromTlv( + tlvTag: Tag, + tlvReader: TlvReader, + ): PushAvStreamTransportClusterPushAVStreamTransportCMAFContainerOptionsStruct { + tlvReader.enterStructure(tlvTag) + val chunkDuration = tlvReader.getUInt(ContextSpecificTag(TAG_CHUNK_DURATION)) + val CENCKey = + if (!tlvReader.isNull()) { + if (tlvReader.isNextTag(ContextSpecificTag(TAG_CENC_KEY))) { + Optional.of(tlvReader.getByteArray(ContextSpecificTag(TAG_CENC_KEY))) + } else { + Optional.empty() + } + } else { + tlvReader.getNull(ContextSpecificTag(TAG_CENC_KEY)) + null + } + + tlvReader.exitContainer() + + return PushAvStreamTransportClusterPushAVStreamTransportCMAFContainerOptionsStruct( + chunkDuration, + CENCKey, + ) + } + } +} diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/PushAvStreamTransportClusterPushAVStreamTransportContainerOptionsStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/PushAvStreamTransportClusterPushAVStreamTransportContainerOptionsStruct.kt new file mode 100644 index 00000000000000..f0b335b9e7cf86 --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/PushAvStreamTransportClusterPushAVStreamTransportContainerOptionsStruct.kt @@ -0,0 +1,89 @@ +/* + * + * 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 PushAvStreamTransportClusterPushAVStreamTransportContainerOptionsStruct( + val containerType: UInt, + val CMAFContainerOptions: + Optional?, +) { + override fun toString(): String = buildString { + append("PushAvStreamTransportClusterPushAVStreamTransportContainerOptionsStruct {\n") + append("\tcontainerType : $containerType\n") + append("\tCMAFContainerOptions : $CMAFContainerOptions\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_CONTAINER_TYPE), containerType) + if (CMAFContainerOptions != null) { + if (CMAFContainerOptions.isPresent) { + val optCMAFContainerOptions = CMAFContainerOptions.get() + optCMAFContainerOptions.toTlv(ContextSpecificTag(TAG_CMAF_CONTAINER_OPTIONS), this) + } + } else { + putNull(ContextSpecificTag(TAG_CMAF_CONTAINER_OPTIONS)) + } + endStructure() + } + } + + companion object { + private const val TAG_CONTAINER_TYPE = 0 + private const val TAG_CMAF_CONTAINER_OPTIONS = 1 + + fun fromTlv( + tlvTag: Tag, + tlvReader: TlvReader, + ): PushAvStreamTransportClusterPushAVStreamTransportContainerOptionsStruct { + tlvReader.enterStructure(tlvTag) + val containerType = tlvReader.getUInt(ContextSpecificTag(TAG_CONTAINER_TYPE)) + val CMAFContainerOptions = + if (!tlvReader.isNull()) { + if (tlvReader.isNextTag(ContextSpecificTag(TAG_CMAF_CONTAINER_OPTIONS))) { + Optional.of( + PushAvStreamTransportClusterPushAVStreamTransportCMAFContainerOptionsStruct.fromTlv( + ContextSpecificTag(TAG_CMAF_CONTAINER_OPTIONS), + tlvReader, + ) + ) + } else { + Optional.empty() + } + } else { + tlvReader.getNull(ContextSpecificTag(TAG_CMAF_CONTAINER_OPTIONS)) + null + } + + tlvReader.exitContainer() + + return PushAvStreamTransportClusterPushAVStreamTransportContainerOptionsStruct( + containerType, + CMAFContainerOptions, + ) + } + } +} diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/PushAvStreamTransportClusterPushAVStreamTransportMetadataOptionsStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/PushAvStreamTransportClusterPushAVStreamTransportMetadataOptionsStruct.kt new file mode 100644 index 00000000000000..26a8c8307715c1 --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/PushAvStreamTransportClusterPushAVStreamTransportMetadataOptionsStruct.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 PushAvStreamTransportClusterPushAVStreamTransportMetadataOptionsStruct( + val multiplexing: UInt, + val includeMotionZones: Boolean, + val enableMetadataPrivacySensitive: Boolean, +) { + override fun toString(): String = buildString { + append("PushAvStreamTransportClusterPushAVStreamTransportMetadataOptionsStruct {\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, + ): PushAvStreamTransportClusterPushAVStreamTransportMetadataOptionsStruct { + 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 PushAvStreamTransportClusterPushAVStreamTransportMetadataOptionsStruct( + multiplexing, + includeMotionZones, + enableMetadataPrivacySensitive, + ) + } + } +} diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/PushAvStreamTransportClusterPushAVStreamTransportMotionTriggerTimeControlStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/PushAvStreamTransportClusterPushAVStreamTransportMotionTriggerTimeControlStruct.kt new file mode 100644 index 00000000000000..ab55a596563cc9 --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/PushAvStreamTransportClusterPushAVStreamTransportMotionTriggerTimeControlStruct.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 PushAvStreamTransportClusterPushAVStreamTransportMotionTriggerTimeControlStruct( + val initialDuration: UInt, + val augmentationDuration: UInt, + val maxDuration: ULong, + val blindDuration: UInt, +) { + override fun toString(): String = buildString { + append("PushAvStreamTransportClusterPushAVStreamTransportMotionTriggerTimeControlStruct {\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, + ): PushAvStreamTransportClusterPushAVStreamTransportMotionTriggerTimeControlStruct { + 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 PushAvStreamTransportClusterPushAVStreamTransportMotionTriggerTimeControlStruct( + initialDuration, + augmentationDuration, + maxDuration, + blindDuration, + ) + } + } +} diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/PushAvStreamTransportClusterPushAVStreamTransportOptionsStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/PushAvStreamTransportClusterPushAVStreamTransportOptionsStruct.kt new file mode 100644 index 00000000000000..eece75a24acf2b --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/PushAvStreamTransportClusterPushAVStreamTransportOptionsStruct.kt @@ -0,0 +1,202 @@ +/* + * + * 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 PushAvStreamTransportClusterPushAVStreamTransportOptionsStruct( + val streamType: UInt, + val videoStreamID: Optional?, + val audioStreamID: Optional?, + val TLSEndpointID: UInt, + val url: String, + val triggerOptions: PushAvStreamTransportClusterPushAVStreamTransportTriggerOptionsStruct, + val containerFormat: UInt, + val ingestMethod: UInt, + val containerOptions: PushAvStreamTransportClusterPushAVStreamTransportContainerOptionsStruct, + val metadataOptions: + Optional?, + val expiryTime: Optional?, +) { + override fun toString(): String = buildString { + append("PushAvStreamTransportClusterPushAVStreamTransportOptionsStruct {\n") + append("\tstreamType : $streamType\n") + append("\tvideoStreamID : $videoStreamID\n") + append("\taudioStreamID : $audioStreamID\n") + append("\tTLSEndpointID : $TLSEndpointID\n") + append("\turl : $url\n") + append("\ttriggerOptions : $triggerOptions\n") + append("\tcontainerFormat : $containerFormat\n") + append("\tingestMethod : $ingestMethod\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 != null) { + if (videoStreamID.isPresent) { + val optvideoStreamID = videoStreamID.get() + put(ContextSpecificTag(TAG_VIDEO_STREAM_ID), optvideoStreamID) + } + } else { + putNull(ContextSpecificTag(TAG_VIDEO_STREAM_ID)) + } + if (audioStreamID != null) { + if (audioStreamID.isPresent) { + val optaudioStreamID = audioStreamID.get() + put(ContextSpecificTag(TAG_AUDIO_STREAM_ID), optaudioStreamID) + } + } else { + putNull(ContextSpecificTag(TAG_AUDIO_STREAM_ID)) + } + put(ContextSpecificTag(TAG_TLS_ENDPOINT_ID), TLSEndpointID) + put(ContextSpecificTag(TAG_URL), url) + triggerOptions.toTlv(ContextSpecificTag(TAG_TRIGGER_OPTIONS), this) + put(ContextSpecificTag(TAG_CONTAINER_FORMAT), containerFormat) + put(ContextSpecificTag(TAG_INGEST_METHOD), ingestMethod) + containerOptions.toTlv(ContextSpecificTag(TAG_CONTAINER_OPTIONS), this) + if (metadataOptions != null) { + if (metadataOptions.isPresent) { + val optmetadataOptions = metadataOptions.get() + optmetadataOptions.toTlv(ContextSpecificTag(TAG_METADATA_OPTIONS), this) + } + } else { + putNull(ContextSpecificTag(TAG_METADATA_OPTIONS)) + } + if (expiryTime != null) { + if (expiryTime.isPresent) { + val optexpiryTime = expiryTime.get() + put(ContextSpecificTag(TAG_EXPIRY_TIME), optexpiryTime) + } + } else { + putNull(ContextSpecificTag(TAG_EXPIRY_TIME)) + } + endStructure() + } + } + + companion object { + private const val TAG_STREAM_TYPE = 0 + private const val TAG_VIDEO_STREAM_ID = 1 + private const val TAG_AUDIO_STREAM_ID = 2 + private const val TAG_TLS_ENDPOINT_ID = 3 + private const val TAG_URL = 4 + private const val TAG_TRIGGER_OPTIONS = 5 + private const val TAG_CONTAINER_FORMAT = 6 + private const val TAG_INGEST_METHOD = 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, + ): PushAvStreamTransportClusterPushAVStreamTransportOptionsStruct { + tlvReader.enterStructure(tlvTag) + val streamType = tlvReader.getUInt(ContextSpecificTag(TAG_STREAM_TYPE)) + val videoStreamID = + if (!tlvReader.isNull()) { + if (tlvReader.isNextTag(ContextSpecificTag(TAG_VIDEO_STREAM_ID))) { + Optional.of(tlvReader.getUInt(ContextSpecificTag(TAG_VIDEO_STREAM_ID))) + } else { + Optional.empty() + } + } else { + tlvReader.getNull(ContextSpecificTag(TAG_VIDEO_STREAM_ID)) + null + } + val audioStreamID = + if (!tlvReader.isNull()) { + if (tlvReader.isNextTag(ContextSpecificTag(TAG_AUDIO_STREAM_ID))) { + Optional.of(tlvReader.getUInt(ContextSpecificTag(TAG_AUDIO_STREAM_ID))) + } else { + Optional.empty() + } + } else { + tlvReader.getNull(ContextSpecificTag(TAG_AUDIO_STREAM_ID)) + null + } + val TLSEndpointID = tlvReader.getUInt(ContextSpecificTag(TAG_TLS_ENDPOINT_ID)) + val url = tlvReader.getString(ContextSpecificTag(TAG_URL)) + val triggerOptions = + PushAvStreamTransportClusterPushAVStreamTransportTriggerOptionsStruct.fromTlv( + ContextSpecificTag(TAG_TRIGGER_OPTIONS), + tlvReader, + ) + val containerFormat = tlvReader.getUInt(ContextSpecificTag(TAG_CONTAINER_FORMAT)) + val ingestMethod = tlvReader.getUInt(ContextSpecificTag(TAG_INGEST_METHOD)) + val containerOptions = + PushAvStreamTransportClusterPushAVStreamTransportContainerOptionsStruct.fromTlv( + ContextSpecificTag(TAG_CONTAINER_OPTIONS), + tlvReader, + ) + val metadataOptions = + if (!tlvReader.isNull()) { + if (tlvReader.isNextTag(ContextSpecificTag(TAG_METADATA_OPTIONS))) { + Optional.of( + PushAvStreamTransportClusterPushAVStreamTransportMetadataOptionsStruct.fromTlv( + ContextSpecificTag(TAG_METADATA_OPTIONS), + tlvReader, + ) + ) + } else { + Optional.empty() + } + } else { + tlvReader.getNull(ContextSpecificTag(TAG_METADATA_OPTIONS)) + null + } + val expiryTime = + if (!tlvReader.isNull()) { + if (tlvReader.isNextTag(ContextSpecificTag(TAG_EXPIRY_TIME))) { + Optional.of(tlvReader.getULong(ContextSpecificTag(TAG_EXPIRY_TIME))) + } else { + Optional.empty() + } + } else { + tlvReader.getNull(ContextSpecificTag(TAG_EXPIRY_TIME)) + null + } + + tlvReader.exitContainer() + + return PushAvStreamTransportClusterPushAVStreamTransportOptionsStruct( + streamType, + videoStreamID, + audioStreamID, + TLSEndpointID, + url, + triggerOptions, + containerFormat, + ingestMethod, + containerOptions, + metadataOptions, + expiryTime, + ) + } + } +} diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/PushAvStreamTransportClusterPushAVStreamTransportTriggerOptionsStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/PushAvStreamTransportClusterPushAVStreamTransportTriggerOptionsStruct.kt new file mode 100644 index 00000000000000..73e7ff2954a1c4 --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/PushAvStreamTransportClusterPushAVStreamTransportTriggerOptionsStruct.kt @@ -0,0 +1,169 @@ +/* + * + * 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 PushAvStreamTransportClusterPushAVStreamTransportTriggerOptionsStruct( + val triggerType: UInt, + val motionZones: Optional>?, + val motionSensitivity: Optional?, + val motionTimeControl: + Optional?, + val activationReason: Optional?, +) { + override fun toString(): String = buildString { + append("PushAvStreamTransportClusterPushAVStreamTransportTriggerOptionsStruct {\n") + append("\ttriggerType : $triggerType\n") + append("\tmotionZones : $motionZones\n") + append("\tmotionSensitivity : $motionSensitivity\n") + append("\tmotionTimeControl : $motionTimeControl\n") + append("\tactivationReason : $activationReason\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()) { + put(AnonymousTag, item) + } + 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 != null) { + if (motionTimeControl.isPresent) { + val optmotionTimeControl = motionTimeControl.get() + optmotionTimeControl.toTlv(ContextSpecificTag(TAG_MOTION_TIME_CONTROL), this) + } + } else { + putNull(ContextSpecificTag(TAG_MOTION_TIME_CONTROL)) + } + if (activationReason != null) { + if (activationReason.isPresent) { + val optactivationReason = activationReason.get() + put(ContextSpecificTag(TAG_ACTIVATION_REASON), optactivationReason) + } + } else { + putNull(ContextSpecificTag(TAG_ACTIVATION_REASON)) + } + 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_ACTIVATION_REASON = 4 + + fun fromTlv( + tlvTag: Tag, + tlvReader: TlvReader, + ): PushAvStreamTransportClusterPushAVStreamTransportTriggerOptionsStruct { + 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(tlvReader.getUInt(AnonymousTag)) + } + 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.isNull()) { + if (tlvReader.isNextTag(ContextSpecificTag(TAG_MOTION_TIME_CONTROL))) { + Optional.of( + PushAvStreamTransportClusterPushAVStreamTransportMotionTriggerTimeControlStruct + .fromTlv(ContextSpecificTag(TAG_MOTION_TIME_CONTROL), tlvReader) + ) + } else { + Optional.empty() + } + } else { + tlvReader.getNull(ContextSpecificTag(TAG_MOTION_TIME_CONTROL)) + null + } + val activationReason = + if (!tlvReader.isNull()) { + if (tlvReader.isNextTag(ContextSpecificTag(TAG_ACTIVATION_REASON))) { + Optional.of(tlvReader.getUInt(ContextSpecificTag(TAG_ACTIVATION_REASON))) + } else { + Optional.empty() + } + } else { + tlvReader.getNull(ContextSpecificTag(TAG_ACTIVATION_REASON)) + null + } + + tlvReader.exitContainer() + + return PushAvStreamTransportClusterPushAVStreamTransportTriggerOptionsStruct( + triggerType, + motionZones, + motionSensitivity, + motionTimeControl, + activationReason, + ) + } + } +} 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..ca521085de7b3a --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/PushAvStreamTransportCluster.kt @@ -0,0 +1,1170 @@ +/* + * + * 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 streamTransportOptions: PushAvStreamTransportClusterPushAVStreamTransportOptionsStruct, + val transportStatus: UByte, + ) + + class FindStreamConfigurationResponse( + 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( + streamTransportOptions: PushAvStreamTransportClusterPushAVStreamTransportOptionsStruct, + timedInvokeTimeout: Duration? = null, + ): AllocatePushTransportResponse { + val commandId: UInt = 0u + + val tlvWriter = TlvWriter() + tlvWriter.startStructure(AnonymousTag) + + val TAG_STREAM_TRANSPORT_OPTIONS_REQ: Int = 0 + streamTransportOptions.toTlv(ContextSpecificTag(TAG_STREAM_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_STREAM_TRANSPORT_OPTIONS: Int = 1 + var streamTransportOptions_decoded: + PushAvStreamTransportClusterPushAVStreamTransportOptionsStruct? = + 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_STREAM_TRANSPORT_OPTIONS)) { + streamTransportOptions_decoded = + PushAvStreamTransportClusterPushAVStreamTransportOptionsStruct.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 (streamTransportOptions_decoded == null) { + throw IllegalStateException("streamTransportOptions not found in TLV") + } + + if (transportStatus_decoded == null) { + throw IllegalStateException("transportStatus not found in TLV") + } + + tlvReader.exitContainer() + + return AllocatePushTransportResponse( + connectionID_decoded, + streamTransportOptions_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, + streamTransportOptions: PushAvStreamTransportClusterPushAVStreamTransportOptionsStruct, + 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_STREAM_TRANSPORT_OPTIONS_REQ: Int = 1 + streamTransportOptions.toTlv(ContextSpecificTag(TAG_STREAM_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?, + streamTransportStatus: UByte, + timedInvokeTimeout: Duration? = null, + ) { + val commandId: UInt = 4u + + val tlvWriter = TlvWriter() + tlvWriter.startStructure(AnonymousTag) + + val TAG_CONNECTION_ID_REQ: Int = 0 + connectionID?.let { tlvWriter.put(ContextSpecificTag(TAG_CONNECTION_ID_REQ), connectionID) } + + val TAG_STREAM_TRANSPORT_STATUS_REQ: Int = 1 + tlvWriter.put(ContextSpecificTag(TAG_STREAM_TRANSPORT_STATUS_REQ), streamTransportStatus) + 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: PushAvStreamTransportClusterPushAVStreamTransportMotionTriggerTimeControlStruct?, + 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 + activationReason?.let { + 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 findStreamConfiguration( + connectionID: UShort?, + timedInvokeTimeout: Duration? = null, + ): FindStreamConfigurationResponse { + 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( + PushAvStreamTransportClusterPushAVStreamConfigurationStruct.fromTlv( + AnonymousTag, + tlvReader, + ) + ) + } + tlvReader.exitContainer() + } + } else { + tlvReader.skipElement() + } + } + + if (streamConfigurations_decoded == null) { + throw IllegalStateException("streamConfigurations not found in TLV") + } + + tlvReader.exitContainer() + + return FindStreamConfigurationResponse(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/PushAvStreamTransportClusterPushTransportEndEvent.kt b/src/controller/java/generated/java/matter/controller/cluster/eventstructs/PushAvStreamTransportClusterPushTransportEndEvent.kt new file mode 100644 index 00000000000000..ac52180b567e7f --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/eventstructs/PushAvStreamTransportClusterPushTransportEndEvent.kt @@ -0,0 +1,66 @@ +/* + * + * 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 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 triggerDetails: + matter.controller.cluster.structs.PushAvStreamTransportClusterPushAVStreamTransportTriggerOptionsStruct, +) { + override fun toString(): String = buildString { + append("PushAvStreamTransportClusterPushTransportEndEvent {\n") + append("\tconnectionID : $connectionID\n") + append("\ttriggerDetails : $triggerDetails\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_CONNECTION_ID), connectionID) + triggerDetails.toTlv(ContextSpecificTag(TAG_TRIGGER_DETAILS), this) + endStructure() + } + } + + companion object { + private const val TAG_CONNECTION_ID = 0 + private const val TAG_TRIGGER_DETAILS = 1 + + fun fromTlv( + tlvTag: Tag, + tlvReader: TlvReader, + ): PushAvStreamTransportClusterPushTransportEndEvent { + tlvReader.enterStructure(tlvTag) + val connectionID = tlvReader.getUShort(ContextSpecificTag(TAG_CONNECTION_ID)) + val triggerDetails = + matter.controller.cluster.structs + .PushAvStreamTransportClusterPushAVStreamTransportTriggerOptionsStruct + .fromTlv(ContextSpecificTag(TAG_TRIGGER_DETAILS), tlvReader) + + tlvReader.exitContainer() + + return PushAvStreamTransportClusterPushTransportEndEvent(connectionID, triggerDetails) + } + } +} 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..cdbe2182f94534 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,13 @@ 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/PushAvStreamTransportClusterPushAVStreamConfigurationStruct.kt", + "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/PushAvStreamTransportClusterPushAVStreamTransportCMAFContainerOptionsStruct.kt", + "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/PushAvStreamTransportClusterPushAVStreamTransportContainerOptionsStruct.kt", + "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/PushAvStreamTransportClusterPushAVStreamTransportMetadataOptionsStruct.kt", + "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/PushAvStreamTransportClusterPushAVStreamTransportMotionTriggerTimeControlStruct.kt", + "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/PushAvStreamTransportClusterPushAVStreamTransportOptionsStruct.kt", + "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/PushAvStreamTransportClusterPushAVStreamTransportTriggerOptionsStruct.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 +243,7 @@ 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/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 +369,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/PushAvStreamTransportClusterPushAVStreamConfigurationStruct.kt b/src/controller/java/generated/java/matter/controller/cluster/structs/PushAvStreamTransportClusterPushAVStreamConfigurationStruct.kt new file mode 100644 index 00000000000000..22c3c3b3f61064 --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/structs/PushAvStreamTransportClusterPushAVStreamConfigurationStruct.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 matter.controller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class PushAvStreamTransportClusterPushAVStreamConfigurationStruct( + val connectionID: UShort, + val streamTransportStatus: UByte, + val streamTransportOptions: PushAvStreamTransportClusterPushAVStreamTransportOptionsStruct, +) { + override fun toString(): String = buildString { + append("PushAvStreamTransportClusterPushAVStreamConfigurationStruct {\n") + append("\tconnectionID : $connectionID\n") + append("\tstreamTransportStatus : $streamTransportStatus\n") + append("\tstreamTransportOptions : $streamTransportOptions\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_CONNECTION_ID), connectionID) + put(ContextSpecificTag(TAG_STREAM_TRANSPORT_STATUS), streamTransportStatus) + streamTransportOptions.toTlv(ContextSpecificTag(TAG_STREAM_TRANSPORT_OPTIONS), this) + endStructure() + } + } + + companion object { + private const val TAG_CONNECTION_ID = 0 + private const val TAG_STREAM_TRANSPORT_STATUS = 1 + private const val TAG_STREAM_TRANSPORT_OPTIONS = 2 + + fun fromTlv( + tlvTag: Tag, + tlvReader: TlvReader, + ): PushAvStreamTransportClusterPushAVStreamConfigurationStruct { + tlvReader.enterStructure(tlvTag) + val connectionID = tlvReader.getUShort(ContextSpecificTag(TAG_CONNECTION_ID)) + val streamTransportStatus = + tlvReader.getUByte(ContextSpecificTag(TAG_STREAM_TRANSPORT_STATUS)) + val streamTransportOptions = + PushAvStreamTransportClusterPushAVStreamTransportOptionsStruct.fromTlv( + ContextSpecificTag(TAG_STREAM_TRANSPORT_OPTIONS), + tlvReader, + ) + + tlvReader.exitContainer() + + return PushAvStreamTransportClusterPushAVStreamConfigurationStruct( + connectionID, + streamTransportStatus, + streamTransportOptions, + ) + } + } +} diff --git a/src/controller/java/generated/java/matter/controller/cluster/structs/PushAvStreamTransportClusterPushAVStreamTransportCMAFContainerOptionsStruct.kt b/src/controller/java/generated/java/matter/controller/cluster/structs/PushAvStreamTransportClusterPushAVStreamTransportCMAFContainerOptionsStruct.kt new file mode 100644 index 00000000000000..5b17f1e2b4c1a9 --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/structs/PushAvStreamTransportClusterPushAVStreamTransportCMAFContainerOptionsStruct.kt @@ -0,0 +1,83 @@ +/* + * + * 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 PushAvStreamTransportClusterPushAVStreamTransportCMAFContainerOptionsStruct( + val chunkDuration: UShort, + val CENCKey: Optional?, +) { + override fun toString(): String = buildString { + append("PushAvStreamTransportClusterPushAVStreamTransportCMAFContainerOptionsStruct {\n") + append("\tchunkDuration : $chunkDuration\n") + append("\tCENCKey : $CENCKey\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_CHUNK_DURATION), chunkDuration) + if (CENCKey != null) { + if (CENCKey.isPresent) { + val optCENCKey = CENCKey.get() + put(ContextSpecificTag(TAG_CENC_KEY), optCENCKey) + } + } else { + putNull(ContextSpecificTag(TAG_CENC_KEY)) + } + endStructure() + } + } + + companion object { + private const val TAG_CHUNK_DURATION = 0 + private const val TAG_CENC_KEY = 1 + + fun fromTlv( + tlvTag: Tag, + tlvReader: TlvReader, + ): PushAvStreamTransportClusterPushAVStreamTransportCMAFContainerOptionsStruct { + tlvReader.enterStructure(tlvTag) + val chunkDuration = tlvReader.getUShort(ContextSpecificTag(TAG_CHUNK_DURATION)) + val CENCKey = + if (!tlvReader.isNull()) { + if (tlvReader.isNextTag(ContextSpecificTag(TAG_CENC_KEY))) { + Optional.of(tlvReader.getByteArray(ContextSpecificTag(TAG_CENC_KEY))) + } else { + Optional.empty() + } + } else { + tlvReader.getNull(ContextSpecificTag(TAG_CENC_KEY)) + null + } + + tlvReader.exitContainer() + + return PushAvStreamTransportClusterPushAVStreamTransportCMAFContainerOptionsStruct( + chunkDuration, + CENCKey, + ) + } + } +} diff --git a/src/controller/java/generated/java/matter/controller/cluster/structs/PushAvStreamTransportClusterPushAVStreamTransportContainerOptionsStruct.kt b/src/controller/java/generated/java/matter/controller/cluster/structs/PushAvStreamTransportClusterPushAVStreamTransportContainerOptionsStruct.kt new file mode 100644 index 00000000000000..2ff39bedd407ae --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/structs/PushAvStreamTransportClusterPushAVStreamTransportContainerOptionsStruct.kt @@ -0,0 +1,89 @@ +/* + * + * 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 PushAvStreamTransportClusterPushAVStreamTransportContainerOptionsStruct( + val containerType: UByte, + val CMAFContainerOptions: + Optional?, +) { + override fun toString(): String = buildString { + append("PushAvStreamTransportClusterPushAVStreamTransportContainerOptionsStruct {\n") + append("\tcontainerType : $containerType\n") + append("\tCMAFContainerOptions : $CMAFContainerOptions\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_CONTAINER_TYPE), containerType) + if (CMAFContainerOptions != null) { + if (CMAFContainerOptions.isPresent) { + val optCMAFContainerOptions = CMAFContainerOptions.get() + optCMAFContainerOptions.toTlv(ContextSpecificTag(TAG_CMAF_CONTAINER_OPTIONS), this) + } + } else { + putNull(ContextSpecificTag(TAG_CMAF_CONTAINER_OPTIONS)) + } + endStructure() + } + } + + companion object { + private const val TAG_CONTAINER_TYPE = 0 + private const val TAG_CMAF_CONTAINER_OPTIONS = 1 + + fun fromTlv( + tlvTag: Tag, + tlvReader: TlvReader, + ): PushAvStreamTransportClusterPushAVStreamTransportContainerOptionsStruct { + tlvReader.enterStructure(tlvTag) + val containerType = tlvReader.getUByte(ContextSpecificTag(TAG_CONTAINER_TYPE)) + val CMAFContainerOptions = + if (!tlvReader.isNull()) { + if (tlvReader.isNextTag(ContextSpecificTag(TAG_CMAF_CONTAINER_OPTIONS))) { + Optional.of( + PushAvStreamTransportClusterPushAVStreamTransportCMAFContainerOptionsStruct.fromTlv( + ContextSpecificTag(TAG_CMAF_CONTAINER_OPTIONS), + tlvReader, + ) + ) + } else { + Optional.empty() + } + } else { + tlvReader.getNull(ContextSpecificTag(TAG_CMAF_CONTAINER_OPTIONS)) + null + } + + tlvReader.exitContainer() + + return PushAvStreamTransportClusterPushAVStreamTransportContainerOptionsStruct( + containerType, + CMAFContainerOptions, + ) + } + } +} diff --git a/src/controller/java/generated/java/matter/controller/cluster/structs/PushAvStreamTransportClusterPushAVStreamTransportMetadataOptionsStruct.kt b/src/controller/java/generated/java/matter/controller/cluster/structs/PushAvStreamTransportClusterPushAVStreamTransportMetadataOptionsStruct.kt new file mode 100644 index 00000000000000..a9f26e1accd581 --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/structs/PushAvStreamTransportClusterPushAVStreamTransportMetadataOptionsStruct.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 PushAvStreamTransportClusterPushAVStreamTransportMetadataOptionsStruct( + val multiplexing: UByte, + val includeMotionZones: Boolean, + val enableMetadataPrivacySensitive: Boolean, +) { + override fun toString(): String = buildString { + append("PushAvStreamTransportClusterPushAVStreamTransportMetadataOptionsStruct {\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, + ): PushAvStreamTransportClusterPushAVStreamTransportMetadataOptionsStruct { + 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 PushAvStreamTransportClusterPushAVStreamTransportMetadataOptionsStruct( + multiplexing, + includeMotionZones, + enableMetadataPrivacySensitive, + ) + } + } +} diff --git a/src/controller/java/generated/java/matter/controller/cluster/structs/PushAvStreamTransportClusterPushAVStreamTransportMotionTriggerTimeControlStruct.kt b/src/controller/java/generated/java/matter/controller/cluster/structs/PushAvStreamTransportClusterPushAVStreamTransportMotionTriggerTimeControlStruct.kt new file mode 100644 index 00000000000000..988becdb66a59f --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/structs/PushAvStreamTransportClusterPushAVStreamTransportMotionTriggerTimeControlStruct.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 PushAvStreamTransportClusterPushAVStreamTransportMotionTriggerTimeControlStruct( + val initialDuration: UShort, + val augmentationDuration: UShort, + val maxDuration: UInt, + val blindDuration: UShort, +) { + override fun toString(): String = buildString { + append("PushAvStreamTransportClusterPushAVStreamTransportMotionTriggerTimeControlStruct {\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, + ): PushAvStreamTransportClusterPushAVStreamTransportMotionTriggerTimeControlStruct { + 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 PushAvStreamTransportClusterPushAVStreamTransportMotionTriggerTimeControlStruct( + initialDuration, + augmentationDuration, + maxDuration, + blindDuration, + ) + } + } +} diff --git a/src/controller/java/generated/java/matter/controller/cluster/structs/PushAvStreamTransportClusterPushAVStreamTransportOptionsStruct.kt b/src/controller/java/generated/java/matter/controller/cluster/structs/PushAvStreamTransportClusterPushAVStreamTransportOptionsStruct.kt new file mode 100644 index 00000000000000..49b3df53e29a7e --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/structs/PushAvStreamTransportClusterPushAVStreamTransportOptionsStruct.kt @@ -0,0 +1,202 @@ +/* + * + * 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 PushAvStreamTransportClusterPushAVStreamTransportOptionsStruct( + val streamType: UByte, + val videoStreamID: Optional?, + val audioStreamID: Optional?, + val TLSEndpointID: UShort, + val url: String, + val triggerOptions: PushAvStreamTransportClusterPushAVStreamTransportTriggerOptionsStruct, + val containerFormat: UByte, + val ingestMethod: UByte, + val containerOptions: PushAvStreamTransportClusterPushAVStreamTransportContainerOptionsStruct, + val metadataOptions: + Optional?, + val expiryTime: Optional?, +) { + override fun toString(): String = buildString { + append("PushAvStreamTransportClusterPushAVStreamTransportOptionsStruct {\n") + append("\tstreamType : $streamType\n") + append("\tvideoStreamID : $videoStreamID\n") + append("\taudioStreamID : $audioStreamID\n") + append("\tTLSEndpointID : $TLSEndpointID\n") + append("\turl : $url\n") + append("\ttriggerOptions : $triggerOptions\n") + append("\tcontainerFormat : $containerFormat\n") + append("\tingestMethod : $ingestMethod\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 != null) { + if (videoStreamID.isPresent) { + val optvideoStreamID = videoStreamID.get() + put(ContextSpecificTag(TAG_VIDEO_STREAM_ID), optvideoStreamID) + } + } else { + putNull(ContextSpecificTag(TAG_VIDEO_STREAM_ID)) + } + if (audioStreamID != null) { + if (audioStreamID.isPresent) { + val optaudioStreamID = audioStreamID.get() + put(ContextSpecificTag(TAG_AUDIO_STREAM_ID), optaudioStreamID) + } + } else { + putNull(ContextSpecificTag(TAG_AUDIO_STREAM_ID)) + } + put(ContextSpecificTag(TAG_TLS_ENDPOINT_ID), TLSEndpointID) + put(ContextSpecificTag(TAG_URL), url) + triggerOptions.toTlv(ContextSpecificTag(TAG_TRIGGER_OPTIONS), this) + put(ContextSpecificTag(TAG_CONTAINER_FORMAT), containerFormat) + put(ContextSpecificTag(TAG_INGEST_METHOD), ingestMethod) + containerOptions.toTlv(ContextSpecificTag(TAG_CONTAINER_OPTIONS), this) + if (metadataOptions != null) { + if (metadataOptions.isPresent) { + val optmetadataOptions = metadataOptions.get() + optmetadataOptions.toTlv(ContextSpecificTag(TAG_METADATA_OPTIONS), this) + } + } else { + putNull(ContextSpecificTag(TAG_METADATA_OPTIONS)) + } + if (expiryTime != null) { + if (expiryTime.isPresent) { + val optexpiryTime = expiryTime.get() + put(ContextSpecificTag(TAG_EXPIRY_TIME), optexpiryTime) + } + } else { + putNull(ContextSpecificTag(TAG_EXPIRY_TIME)) + } + endStructure() + } + } + + companion object { + private const val TAG_STREAM_TYPE = 0 + private const val TAG_VIDEO_STREAM_ID = 1 + private const val TAG_AUDIO_STREAM_ID = 2 + private const val TAG_TLS_ENDPOINT_ID = 3 + private const val TAG_URL = 4 + private const val TAG_TRIGGER_OPTIONS = 5 + private const val TAG_CONTAINER_FORMAT = 6 + private const val TAG_INGEST_METHOD = 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, + ): PushAvStreamTransportClusterPushAVStreamTransportOptionsStruct { + tlvReader.enterStructure(tlvTag) + val streamType = tlvReader.getUByte(ContextSpecificTag(TAG_STREAM_TYPE)) + val videoStreamID = + if (!tlvReader.isNull()) { + if (tlvReader.isNextTag(ContextSpecificTag(TAG_VIDEO_STREAM_ID))) { + Optional.of(tlvReader.getUShort(ContextSpecificTag(TAG_VIDEO_STREAM_ID))) + } else { + Optional.empty() + } + } else { + tlvReader.getNull(ContextSpecificTag(TAG_VIDEO_STREAM_ID)) + null + } + val audioStreamID = + if (!tlvReader.isNull()) { + if (tlvReader.isNextTag(ContextSpecificTag(TAG_AUDIO_STREAM_ID))) { + Optional.of(tlvReader.getUShort(ContextSpecificTag(TAG_AUDIO_STREAM_ID))) + } else { + Optional.empty() + } + } else { + tlvReader.getNull(ContextSpecificTag(TAG_AUDIO_STREAM_ID)) + null + } + val TLSEndpointID = tlvReader.getUShort(ContextSpecificTag(TAG_TLS_ENDPOINT_ID)) + val url = tlvReader.getString(ContextSpecificTag(TAG_URL)) + val triggerOptions = + PushAvStreamTransportClusterPushAVStreamTransportTriggerOptionsStruct.fromTlv( + ContextSpecificTag(TAG_TRIGGER_OPTIONS), + tlvReader, + ) + val containerFormat = tlvReader.getUByte(ContextSpecificTag(TAG_CONTAINER_FORMAT)) + val ingestMethod = tlvReader.getUByte(ContextSpecificTag(TAG_INGEST_METHOD)) + val containerOptions = + PushAvStreamTransportClusterPushAVStreamTransportContainerOptionsStruct.fromTlv( + ContextSpecificTag(TAG_CONTAINER_OPTIONS), + tlvReader, + ) + val metadataOptions = + if (!tlvReader.isNull()) { + if (tlvReader.isNextTag(ContextSpecificTag(TAG_METADATA_OPTIONS))) { + Optional.of( + PushAvStreamTransportClusterPushAVStreamTransportMetadataOptionsStruct.fromTlv( + ContextSpecificTag(TAG_METADATA_OPTIONS), + tlvReader, + ) + ) + } else { + Optional.empty() + } + } else { + tlvReader.getNull(ContextSpecificTag(TAG_METADATA_OPTIONS)) + null + } + val expiryTime = + if (!tlvReader.isNull()) { + if (tlvReader.isNextTag(ContextSpecificTag(TAG_EXPIRY_TIME))) { + Optional.of(tlvReader.getUInt(ContextSpecificTag(TAG_EXPIRY_TIME))) + } else { + Optional.empty() + } + } else { + tlvReader.getNull(ContextSpecificTag(TAG_EXPIRY_TIME)) + null + } + + tlvReader.exitContainer() + + return PushAvStreamTransportClusterPushAVStreamTransportOptionsStruct( + streamType, + videoStreamID, + audioStreamID, + TLSEndpointID, + url, + triggerOptions, + containerFormat, + ingestMethod, + containerOptions, + metadataOptions, + expiryTime, + ) + } + } +} diff --git a/src/controller/java/generated/java/matter/controller/cluster/structs/PushAvStreamTransportClusterPushAVStreamTransportTriggerOptionsStruct.kt b/src/controller/java/generated/java/matter/controller/cluster/structs/PushAvStreamTransportClusterPushAVStreamTransportTriggerOptionsStruct.kt new file mode 100644 index 00000000000000..1af935a9906e5d --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/structs/PushAvStreamTransportClusterPushAVStreamTransportTriggerOptionsStruct.kt @@ -0,0 +1,169 @@ +/* + * + * 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 PushAvStreamTransportClusterPushAVStreamTransportTriggerOptionsStruct( + val triggerType: UByte, + val motionZones: Optional>?, + val motionSensitivity: Optional?, + val motionTimeControl: + Optional?, + val activationReason: Optional?, +) { + override fun toString(): String = buildString { + append("PushAvStreamTransportClusterPushAVStreamTransportTriggerOptionsStruct {\n") + append("\ttriggerType : $triggerType\n") + append("\tmotionZones : $motionZones\n") + append("\tmotionSensitivity : $motionSensitivity\n") + append("\tmotionTimeControl : $motionTimeControl\n") + append("\tactivationReason : $activationReason\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()) { + put(AnonymousTag, item) + } + 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 != null) { + if (motionTimeControl.isPresent) { + val optmotionTimeControl = motionTimeControl.get() + optmotionTimeControl.toTlv(ContextSpecificTag(TAG_MOTION_TIME_CONTROL), this) + } + } else { + putNull(ContextSpecificTag(TAG_MOTION_TIME_CONTROL)) + } + if (activationReason != null) { + if (activationReason.isPresent) { + val optactivationReason = activationReason.get() + put(ContextSpecificTag(TAG_ACTIVATION_REASON), optactivationReason) + } + } else { + putNull(ContextSpecificTag(TAG_ACTIVATION_REASON)) + } + 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_ACTIVATION_REASON = 4 + + fun fromTlv( + tlvTag: Tag, + tlvReader: TlvReader, + ): PushAvStreamTransportClusterPushAVStreamTransportTriggerOptionsStruct { + 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(tlvReader.getUShort(AnonymousTag)) + } + 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.isNull()) { + if (tlvReader.isNextTag(ContextSpecificTag(TAG_MOTION_TIME_CONTROL))) { + Optional.of( + PushAvStreamTransportClusterPushAVStreamTransportMotionTriggerTimeControlStruct + .fromTlv(ContextSpecificTag(TAG_MOTION_TIME_CONTROL), tlvReader) + ) + } else { + Optional.empty() + } + } else { + tlvReader.getNull(ContextSpecificTag(TAG_MOTION_TIME_CONTROL)) + null + } + val activationReason = + if (!tlvReader.isNull()) { + if (tlvReader.isNextTag(ContextSpecificTag(TAG_ACTIVATION_REASON))) { + Optional.of(tlvReader.getUByte(ContextSpecificTag(TAG_ACTIVATION_REASON))) + } else { + Optional.empty() + } + } else { + tlvReader.getNull(ContextSpecificTag(TAG_ACTIVATION_REASON)) + null + } + + tlvReader.exitContainer() + + return PushAvStreamTransportClusterPushAVStreamTransportTriggerOptionsStruct( + triggerType, + motionZones, + motionSensitivity, + motionTimeControl, + activationReason, + ) + } + } +} 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..7dc45927415def 100644 --- a/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp @@ -9109,6 +9109,316 @@ 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; + } + 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, "", "()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); + + 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_triggerDetails; + jobject value_triggerDetails_triggerType; + std::string value_triggerDetails_triggerTypeClassName = "java/lang/Integer"; + std::string value_triggerDetails_triggerTypeCtorSignature = "(I)V"; + jint jnivalue_triggerDetails_triggerType = static_cast(cppValue.triggerDetails.triggerType); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_triggerDetails_triggerTypeClassName.c_str(), value_triggerDetails_triggerTypeCtorSignature.c_str(), + jnivalue_triggerDetails_triggerType, value_triggerDetails_triggerType); + jobject value_triggerDetails_motionZones; + if (!cppValue.triggerDetails.motionZones.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_triggerDetails_motionZones); + } + else + { + jobject value_triggerDetails_motionZonesInsideOptional; + if (cppValue.triggerDetails.motionZones.Value().IsNull()) + { + value_triggerDetails_motionZonesInsideOptional = nullptr; + } + else + { + chip::JniReferences::GetInstance().CreateArrayList(value_triggerDetails_motionZonesInsideOptional); + + auto iter_value_triggerDetails_motionZonesInsideOptional_3 = + cppValue.triggerDetails.motionZones.Value().Value().begin(); + while (iter_value_triggerDetails_motionZonesInsideOptional_3.Next()) + { + auto & entry_3 = iter_value_triggerDetails_motionZonesInsideOptional_3.GetValue(); + jobject newElement_3; + std::string newElement_3ClassName = "java/lang/Integer"; + std::string newElement_3CtorSignature = "(I)V"; + jint jninewElement_3 = static_cast(entry_3); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_3ClassName.c_str(), newElement_3CtorSignature.c_str(), jninewElement_3, newElement_3); + chip::JniReferences::GetInstance().AddToList(value_triggerDetails_motionZonesInsideOptional, newElement_3); + } + } + chip::JniReferences::GetInstance().CreateOptional(value_triggerDetails_motionZonesInsideOptional, + value_triggerDetails_motionZones); + } + jobject value_triggerDetails_motionSensitivity; + if (!cppValue.triggerDetails.motionSensitivity.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_triggerDetails_motionSensitivity); + } + else + { + jobject value_triggerDetails_motionSensitivityInsideOptional; + if (cppValue.triggerDetails.motionSensitivity.Value().IsNull()) + { + value_triggerDetails_motionSensitivityInsideOptional = nullptr; + } + else + { + std::string value_triggerDetails_motionSensitivityInsideOptionalClassName = "java/lang/Integer"; + std::string value_triggerDetails_motionSensitivityInsideOptionalCtorSignature = "(I)V"; + jint jnivalue_triggerDetails_motionSensitivityInsideOptional = + static_cast(cppValue.triggerDetails.motionSensitivity.Value().Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_triggerDetails_motionSensitivityInsideOptionalClassName.c_str(), + value_triggerDetails_motionSensitivityInsideOptionalCtorSignature.c_str(), + jnivalue_triggerDetails_motionSensitivityInsideOptional, + value_triggerDetails_motionSensitivityInsideOptional); + } + chip::JniReferences::GetInstance().CreateOptional(value_triggerDetails_motionSensitivityInsideOptional, + value_triggerDetails_motionSensitivity); + } + jobject value_triggerDetails_motionTimeControl; + if (!cppValue.triggerDetails.motionTimeControl.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_triggerDetails_motionTimeControl); + } + else + { + jobject value_triggerDetails_motionTimeControlInsideOptional; + if (cppValue.triggerDetails.motionTimeControl.Value().IsNull()) + { + value_triggerDetails_motionTimeControlInsideOptional = nullptr; + } + else + { + jobject value_triggerDetails_motionTimeControlInsideOptional_initialDuration; + std::string value_triggerDetails_motionTimeControlInsideOptional_initialDurationClassName = "java/lang/Integer"; + std::string value_triggerDetails_motionTimeControlInsideOptional_initialDurationCtorSignature = "(I)V"; + jint jnivalue_triggerDetails_motionTimeControlInsideOptional_initialDuration = + static_cast(cppValue.triggerDetails.motionTimeControl.Value().Value().initialDuration); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_triggerDetails_motionTimeControlInsideOptional_initialDurationClassName.c_str(), + value_triggerDetails_motionTimeControlInsideOptional_initialDurationCtorSignature.c_str(), + jnivalue_triggerDetails_motionTimeControlInsideOptional_initialDuration, + value_triggerDetails_motionTimeControlInsideOptional_initialDuration); + jobject value_triggerDetails_motionTimeControlInsideOptional_augmentationDuration; + std::string value_triggerDetails_motionTimeControlInsideOptional_augmentationDurationClassName = + "java/lang/Integer"; + std::string value_triggerDetails_motionTimeControlInsideOptional_augmentationDurationCtorSignature = "(I)V"; + jint jnivalue_triggerDetails_motionTimeControlInsideOptional_augmentationDuration = + static_cast(cppValue.triggerDetails.motionTimeControl.Value().Value().augmentationDuration); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_triggerDetails_motionTimeControlInsideOptional_augmentationDurationClassName.c_str(), + value_triggerDetails_motionTimeControlInsideOptional_augmentationDurationCtorSignature.c_str(), + jnivalue_triggerDetails_motionTimeControlInsideOptional_augmentationDuration, + value_triggerDetails_motionTimeControlInsideOptional_augmentationDuration); + jobject value_triggerDetails_motionTimeControlInsideOptional_maxDuration; + std::string value_triggerDetails_motionTimeControlInsideOptional_maxDurationClassName = "java/lang/Long"; + std::string value_triggerDetails_motionTimeControlInsideOptional_maxDurationCtorSignature = "(J)V"; + jlong jnivalue_triggerDetails_motionTimeControlInsideOptional_maxDuration = + static_cast(cppValue.triggerDetails.motionTimeControl.Value().Value().maxDuration); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_triggerDetails_motionTimeControlInsideOptional_maxDurationClassName.c_str(), + value_triggerDetails_motionTimeControlInsideOptional_maxDurationCtorSignature.c_str(), + jnivalue_triggerDetails_motionTimeControlInsideOptional_maxDuration, + value_triggerDetails_motionTimeControlInsideOptional_maxDuration); + jobject value_triggerDetails_motionTimeControlInsideOptional_blindDuration; + std::string value_triggerDetails_motionTimeControlInsideOptional_blindDurationClassName = "java/lang/Integer"; + std::string value_triggerDetails_motionTimeControlInsideOptional_blindDurationCtorSignature = "(I)V"; + jint jnivalue_triggerDetails_motionTimeControlInsideOptional_blindDuration = + static_cast(cppValue.triggerDetails.motionTimeControl.Value().Value().blindDuration); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_triggerDetails_motionTimeControlInsideOptional_blindDurationClassName.c_str(), + value_triggerDetails_motionTimeControlInsideOptional_blindDurationCtorSignature.c_str(), + jnivalue_triggerDetails_motionTimeControlInsideOptional_blindDuration, + value_triggerDetails_motionTimeControlInsideOptional_blindDuration); + + { + jclass pushAVStreamTransportMotionTriggerTimeControlStructStructClass_3; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, + "chip/devicecontroller/" + "ChipStructs$PushAvStreamTransportClusterPushAVStreamTransportMotionTriggerTimeControlStruct", + pushAVStreamTransportMotionTriggerTimeControlStructStructClass_3); + if (err != CHIP_NO_ERROR) + { + ChipLogError( + Zcl, + "Could not find class " + "ChipStructs$PushAvStreamTransportClusterPushAVStreamTransportMotionTriggerTimeControlStruct"); + return nullptr; + } + + jmethodID pushAVStreamTransportMotionTriggerTimeControlStructStructCtor_3; + err = chip::JniReferences::GetInstance().FindMethod( + env, pushAVStreamTransportMotionTriggerTimeControlStructStructClass_3, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Long;Ljava/lang/Integer;)V", + &pushAVStreamTransportMotionTriggerTimeControlStructStructCtor_3); + if (err != CHIP_NO_ERROR || pushAVStreamTransportMotionTriggerTimeControlStructStructCtor_3 == nullptr) + { + ChipLogError( + Zcl, + "Could not find " + "ChipStructs$PushAvStreamTransportClusterPushAVStreamTransportMotionTriggerTimeControlStruct " + "constructor"); + return nullptr; + } + + value_triggerDetails_motionTimeControlInsideOptional = + env->NewObject(pushAVStreamTransportMotionTriggerTimeControlStructStructClass_3, + pushAVStreamTransportMotionTriggerTimeControlStructStructCtor_3, + value_triggerDetails_motionTimeControlInsideOptional_initialDuration, + value_triggerDetails_motionTimeControlInsideOptional_augmentationDuration, + value_triggerDetails_motionTimeControlInsideOptional_maxDuration, + value_triggerDetails_motionTimeControlInsideOptional_blindDuration); + } + } + chip::JniReferences::GetInstance().CreateOptional(value_triggerDetails_motionTimeControlInsideOptional, + value_triggerDetails_motionTimeControl); + } + jobject value_triggerDetails_activationReason; + if (!cppValue.triggerDetails.activationReason.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_triggerDetails_activationReason); + } + else + { + jobject value_triggerDetails_activationReasonInsideOptional; + if (cppValue.triggerDetails.activationReason.Value().IsNull()) + { + value_triggerDetails_activationReasonInsideOptional = nullptr; + } + else + { + std::string value_triggerDetails_activationReasonInsideOptionalClassName = "java/lang/Integer"; + std::string value_triggerDetails_activationReasonInsideOptionalCtorSignature = "(I)V"; + jint jnivalue_triggerDetails_activationReasonInsideOptional = + static_cast(cppValue.triggerDetails.activationReason.Value().Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_triggerDetails_activationReasonInsideOptionalClassName.c_str(), + value_triggerDetails_activationReasonInsideOptionalCtorSignature.c_str(), + jnivalue_triggerDetails_activationReasonInsideOptional, + value_triggerDetails_activationReasonInsideOptional); + } + chip::JniReferences::GetInstance().CreateOptional(value_triggerDetails_activationReasonInsideOptional, + value_triggerDetails_activationReason); + } + + { + jclass pushAVStreamTransportTriggerOptionsStructStructClass_0; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$PushAvStreamTransportClusterPushAVStreamTransportTriggerOptionsStruct", + pushAVStreamTransportTriggerOptionsStructStructClass_0); + if (err != CHIP_NO_ERROR) + { + ChipLogError( + Zcl, + "Could not find class ChipStructs$PushAvStreamTransportClusterPushAVStreamTransportTriggerOptionsStruct"); + return nullptr; + } + + jmethodID pushAVStreamTransportTriggerOptionsStructStructCtor_0; + err = chip::JniReferences::GetInstance().FindMethod( + env, pushAVStreamTransportTriggerOptionsStructStructClass_0, "", + "(Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;)V", + &pushAVStreamTransportTriggerOptionsStructStructCtor_0); + if (err != CHIP_NO_ERROR || pushAVStreamTransportTriggerOptionsStructStructCtor_0 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$PushAvStreamTransportClusterPushAVStreamTransportTriggerOptionsStruct " + "constructor"); + return nullptr; + } + + value_triggerDetails = env->NewObject( + pushAVStreamTransportTriggerOptionsStructStructClass_0, pushAVStreamTransportTriggerOptionsStructStructCtor_0, + value_triggerDetails_triggerType, value_triggerDetails_motionZones, value_triggerDetails_motionSensitivity, + value_triggerDetails_motionTimeControl, value_triggerDetails_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;Lchip/devicecontroller/" + "ChipStructs$PushAvStreamTransportClusterPushAVStreamTransportTriggerOptionsStruct;)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_triggerDetails); + + 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..2b93b908ed3c25 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": { + "streamTransportOptions": "PushAVStreamTransportOptionsStruct", + }, + }, + 0x00000002: { + "commandId": 0x00000002, + "commandName": "DeallocatePushTransport", + "args": { + "connectionID": "int", + }, + }, + 0x00000003: { + "commandId": 0x00000003, + "commandName": "ModifyPushTransport", + "args": { + "connectionID": "int", + "streamTransportOptions": "PushAVStreamTransportOptionsStruct", + }, + }, + 0x00000004: { + "commandId": 0x00000004, + "commandName": "SetTransportStatus", + "args": { + "connectionID": "int", + "streamTransportStatus": "int", + }, + }, + 0x00000005: { + "commandId": 0x00000005, + "commandName": "ManuallyTriggerTransport", + "args": { + "connectionID": "int", + "activationReason": "int", + "timeControl": "PushAVStreamTransportMotionTriggerTimeControlStruct", + }, + }, + 0x00000006: { + "commandId": 0x00000006, + "commandName": "FindStreamConfiguration", + "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..5aaf6739c2224d 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,554 @@ 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 PushAVStreamTransportContainerFormatEnum(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 PushAVStreamTransportIngestMethodEnum(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 PushAVStreamTransportStatusEnum(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 PushAVStreamTransportStreamMultiplexingEnum(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 PushAVStreamTransportTriggerActivationReasonEnum(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 PushAVStreamTransportTriggerTypeEnum(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 StatusCodeEnum(MatterIntEnum): + kAllocationNotPermitted = 0x02 + kInvalidParameters = 0x03 + kInvalidUrl = 0x04 + kInvalidTriggerOptions = 0x05 + kUnsupportedContainerFormat = 0x06 + kUnsupportedIngestMethod = 0x07 + kPavstNotInUse = 0x08 + kInvalidTriggerFormat = 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 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 Bitmaps: + class PushAVStreamTransportSupportedContainerFormatsBitmap(IntFlag): + kCmaf = 0x1 + + class PushAVStreamTransportSupportedIngestMethodsBitmap(IntFlag): + kCMAFIngest = 0x1 + + class Structs: + @dataclass + class PushAVStreamTransportMotionTriggerTimeControlStruct(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 PushAVStreamTransportMetadataOptionsStruct(ClusterObject): + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="multiplexing", Tag=0, Type=PushAvStreamTransport.Enums.PushAVStreamTransportStreamMultiplexingEnum), + ClusterObjectFieldDescriptor(Label="includeMotionZones", Tag=1, Type=bool), + ClusterObjectFieldDescriptor(Label="enableMetadataPrivacySensitive", Tag=2, Type=bool), + ]) + + multiplexing: 'PushAvStreamTransport.Enums.PushAVStreamTransportStreamMultiplexingEnum' = 0 + includeMotionZones: 'bool' = False + enableMetadataPrivacySensitive: 'bool' = False + + @dataclass + class PushAVStreamTransportTriggerOptionsStruct(ClusterObject): + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="triggerType", Tag=0, Type=PushAvStreamTransport.Enums.PushAVStreamTransportTriggerTypeEnum), + ClusterObjectFieldDescriptor(Label="motionZones", Tag=1, Type=typing.Union[None, Nullable, typing.List[uint]]), + ClusterObjectFieldDescriptor(Label="motionSensitivity", Tag=2, Type=typing.Union[None, Nullable, uint]), + ClusterObjectFieldDescriptor(Label="motionTimeControl", Tag=3, Type=typing.Union[None, Nullable, PushAvStreamTransport.Structs.PushAVStreamTransportMotionTriggerTimeControlStruct]), + ClusterObjectFieldDescriptor(Label="activationReason", Tag=4, Type=typing.Union[None, Nullable, PushAvStreamTransport.Enums.PushAVStreamTransportTriggerActivationReasonEnum]), + ]) + + triggerType: 'PushAvStreamTransport.Enums.PushAVStreamTransportTriggerTypeEnum' = 0 + motionZones: 'typing.Union[None, Nullable, typing.List[uint]]' = None + motionSensitivity: 'typing.Union[None, Nullable, uint]' = None + motionTimeControl: 'typing.Union[None, Nullable, PushAvStreamTransport.Structs.PushAVStreamTransportMotionTriggerTimeControlStruct]' = None + activationReason: 'typing.Union[None, Nullable, PushAvStreamTransport.Enums.PushAVStreamTransportTriggerActivationReasonEnum]' = None + + @dataclass + class PushAVStreamTransportCMAFContainerOptionsStruct(ClusterObject): + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="chunkDuration", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="CENCKey", Tag=1, Type=typing.Union[None, Nullable, bytes]), + ]) + + chunkDuration: 'uint' = 0 + CENCKey: 'typing.Union[None, Nullable, bytes]' = None + + @dataclass + class PushAVStreamTransportContainerOptionsStruct(ClusterObject): + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="containerType", Tag=0, Type=PushAvStreamTransport.Enums.PushAVStreamTransportContainerFormatEnum), + ClusterObjectFieldDescriptor(Label="CMAFContainerOptions", Tag=1, Type=typing.Union[None, Nullable, PushAvStreamTransport.Structs.PushAVStreamTransportCMAFContainerOptionsStruct]), + ]) + + containerType: 'PushAvStreamTransport.Enums.PushAVStreamTransportContainerFormatEnum' = 0 + CMAFContainerOptions: 'typing.Union[None, Nullable, PushAvStreamTransport.Structs.PushAVStreamTransportCMAFContainerOptionsStruct]' = None + + @dataclass + class PushAVStreamTransportOptionsStruct(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.Union[None, Nullable, uint]), + ClusterObjectFieldDescriptor(Label="audioStreamID", Tag=2, Type=typing.Union[None, Nullable, uint]), + ClusterObjectFieldDescriptor(Label="TLSEndpointID", Tag=3, Type=uint), + ClusterObjectFieldDescriptor(Label="url", Tag=4, Type=str), + ClusterObjectFieldDescriptor(Label="triggerOptions", Tag=5, Type=PushAvStreamTransport.Structs.PushAVStreamTransportTriggerOptionsStruct), + ClusterObjectFieldDescriptor(Label="containerFormat", Tag=6, Type=PushAvStreamTransport.Enums.PushAVStreamTransportContainerFormatEnum), + ClusterObjectFieldDescriptor(Label="ingestMethod", Tag=7, Type=PushAvStreamTransport.Enums.PushAVStreamTransportIngestMethodEnum), + ClusterObjectFieldDescriptor(Label="containerOptions", Tag=8, Type=PushAvStreamTransport.Structs.PushAVStreamTransportContainerOptionsStruct), + ClusterObjectFieldDescriptor(Label="metadataOptions", Tag=9, Type=typing.Union[None, Nullable, PushAvStreamTransport.Structs.PushAVStreamTransportMetadataOptionsStruct]), + ClusterObjectFieldDescriptor(Label="expiryTime", Tag=10, Type=typing.Union[None, Nullable, uint]), + ]) + + streamType: 'PushAvStreamTransport.Enums.StreamTypeEnum' = 0 + videoStreamID: 'typing.Union[None, Nullable, uint]' = None + audioStreamID: 'typing.Union[None, Nullable, uint]' = None + TLSEndpointID: 'uint' = 0 + url: 'str' = "" + triggerOptions: 'PushAvStreamTransport.Structs.PushAVStreamTransportTriggerOptionsStruct' = field(default_factory=lambda: PushAvStreamTransport.Structs.PushAVStreamTransportTriggerOptionsStruct()) + containerFormat: 'PushAvStreamTransport.Enums.PushAVStreamTransportContainerFormatEnum' = 0 + ingestMethod: 'PushAvStreamTransport.Enums.PushAVStreamTransportIngestMethodEnum' = 0 + containerOptions: 'PushAvStreamTransport.Structs.PushAVStreamTransportContainerOptionsStruct' = field(default_factory=lambda: PushAvStreamTransport.Structs.PushAVStreamTransportContainerOptionsStruct()) + metadataOptions: 'typing.Union[None, Nullable, PushAvStreamTransport.Structs.PushAVStreamTransportMetadataOptionsStruct]' = None + expiryTime: 'typing.Union[None, Nullable, uint]' = None + + @dataclass + class PushAVStreamConfigurationStruct(ClusterObject): + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="connectionID", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="streamTransportStatus", Tag=1, Type=PushAvStreamTransport.Enums.PushAVStreamTransportStatusEnum), + ClusterObjectFieldDescriptor(Label="streamTransportOptions", Tag=2, Type=PushAvStreamTransport.Structs.PushAVStreamTransportOptionsStruct), + ]) + + connectionID: 'uint' = 0 + streamTransportStatus: 'PushAvStreamTransport.Enums.PushAVStreamTransportStatusEnum' = 0 + streamTransportOptions: 'PushAvStreamTransport.Structs.PushAVStreamTransportOptionsStruct' = field(default_factory=lambda: PushAvStreamTransport.Structs.PushAVStreamTransportOptionsStruct()) + + 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="streamTransportOptions", Tag=0, Type=PushAvStreamTransport.Structs.PushAVStreamTransportOptionsStruct), + ]) + + streamTransportOptions: PushAvStreamTransport.Structs.PushAVStreamTransportOptionsStruct = field(default_factory=lambda: PushAvStreamTransport.Structs.PushAVStreamTransportOptionsStruct()) + + @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="streamTransportOptions", Tag=1, Type=PushAvStreamTransport.Structs.PushAVStreamTransportOptionsStruct), + ClusterObjectFieldDescriptor(Label="transportStatus", Tag=2, Type=PushAvStreamTransport.Enums.PushAVStreamTransportStatusEnum), + ]) + + connectionID: uint = 0 + streamTransportOptions: PushAvStreamTransport.Structs.PushAVStreamTransportOptionsStruct = field(default_factory=lambda: PushAvStreamTransport.Structs.PushAVStreamTransportOptionsStruct()) + transportStatus: PushAvStreamTransport.Enums.PushAVStreamTransportStatusEnum = 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="streamTransportOptions", Tag=1, Type=PushAvStreamTransport.Structs.PushAVStreamTransportOptionsStruct), + ]) + + connectionID: uint = 0 + streamTransportOptions: PushAvStreamTransport.Structs.PushAVStreamTransportOptionsStruct = field(default_factory=lambda: PushAvStreamTransport.Structs.PushAVStreamTransportOptionsStruct()) + + @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=typing.Union[Nullable, uint]), + ClusterObjectFieldDescriptor(Label="streamTransportStatus", Tag=1, Type=PushAvStreamTransport.Enums.PushAVStreamTransportStatusEnum), + ]) + + connectionID: typing.Union[Nullable, uint] = NullValue + streamTransportStatus: PushAvStreamTransport.Enums.PushAVStreamTransportStatusEnum = 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=typing.Union[Nullable, PushAvStreamTransport.Enums.PushAVStreamTransportTriggerActivationReasonEnum]), + ClusterObjectFieldDescriptor(Label="timeControl", Tag=2, Type=typing.Union[None, Nullable, PushAvStreamTransport.Structs.PushAVStreamTransportMotionTriggerTimeControlStruct]), + ]) + + connectionID: uint = 0 + activationReason: typing.Union[Nullable, PushAvStreamTransport.Enums.PushAVStreamTransportTriggerActivationReasonEnum] = NullValue + timeControl: typing.Union[None, Nullable, PushAvStreamTransport.Structs.PushAVStreamTransportMotionTriggerTimeControlStruct] = None + + @dataclass + class FindStreamConfiguration(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000555 + command_id: typing.ClassVar[int] = 0x00000006 + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = 'FindStreamConfigurationResponse' + + @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 FindStreamConfigurationResponse(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.PushAVStreamConfigurationStruct]), + ]) + + streamConfigurations: typing.List[PushAvStreamTransport.Structs.PushAVStreamConfigurationStruct] = 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=[ + ]) + + @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="triggerDetails", Tag=1, Type=PushAvStreamTransport.Structs.PushAVStreamTransportTriggerOptionsStruct), + ]) + + connectionID: uint = 0 + triggerDetails: PushAvStreamTransport.Structs.PushAVStreamTransportTriggerOptionsStruct = field(default_factory=lambda: PushAvStreamTransport.Structs.PushAVStreamTransportTriggerOptionsStruct()) + + @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..1047e3c9a91474 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 + * + * This cluster implements the upload of Audio and Video streams from the Camera AV Stream Management Cluster using suitable push-based transports. + */ +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 FindStreamConfiguration + * + * This command SHALL return the Stream Options Configuration for the specified push transport. + */ +- (void)findStreamConfigurationWithParams:(MTRPushAVStreamTransportClusterFindStreamConfigurationParams * _Nullable)params completion:(void (^)(MTRPushAVStreamTransportClusterFindStreamConfigurationResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)findStreamConfigurationWithCompletion:(void (^)(MTRPushAVStreamTransportClusterFindStreamConfigurationResponseParams * _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,62 @@ 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, MTRPushAVStreamTransportIngestMethod) { + MTRPushAVStreamTransportIngestMethodCMAFIngest MTR_PROVISIONALLY_AVAILABLE = 0x00, +} MTR_PROVISIONALLY_AVAILABLE; + +typedef NS_ENUM(uint8_t, MTRPushAVStreamTransportStatus) { + MTRPushAVStreamTransportStatusActive MTR_PROVISIONALLY_AVAILABLE = 0x00, + MTRPushAVStreamTransportStatusInactive MTR_PROVISIONALLY_AVAILABLE = 0x01, +} MTR_PROVISIONALLY_AVAILABLE; + +typedef NS_ENUM(uint8_t, MTRPushAVStreamTransportStreamMultiplexing) { + MTRPushAVStreamTransportStreamMultiplexingInterleaved MTR_PROVISIONALLY_AVAILABLE = 0x00, +} 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_ENUM(uint8_t, MTRPushAVStreamTransportTriggerType) { + MTRPushAVStreamTransportTriggerTypeCommand MTR_PROVISIONALLY_AVAILABLE = 0x00, + MTRPushAVStreamTransportTriggerTypeMotion MTR_PROVISIONALLY_AVAILABLE = 0x01, + MTRPushAVStreamTransportTriggerTypeContinuous MTR_PROVISIONALLY_AVAILABLE = 0x02, +} MTR_PROVISIONALLY_AVAILABLE; + +typedef NS_ENUM(uint8_t, MTRPushAVStreamTransportStatusCode) { + MTRPushAVStreamTransportStatusCodeALLOCATIONNOTPERMITTED MTR_PROVISIONALLY_AVAILABLE = 0x02, + MTRPushAVStreamTransportStatusCodeINVALIDPARAMETERS MTR_PROVISIONALLY_AVAILABLE = 0x03, + MTRPushAVStreamTransportStatusCodeINVALIDURL MTR_PROVISIONALLY_AVAILABLE = 0x04, + MTRPushAVStreamTransportStatusCodeINVALIDTRIGGEROPTIONS MTR_PROVISIONALLY_AVAILABLE = 0x05, + MTRPushAVStreamTransportStatusCodeUNSUPPORTEDCONTAINERFORMAT MTR_PROVISIONALLY_AVAILABLE = 0x06, + MTRPushAVStreamTransportStatusCodeUNSUPPORTEDINGESTMETHOD MTR_PROVISIONALLY_AVAILABLE = 0x07, + MTRPushAVStreamTransportStatusCodePAVSTNOTINUSE MTR_PROVISIONALLY_AVAILABLE = 0x08, + MTRPushAVStreamTransportStatusCodeINVALIDTRIGGERFORMAT MTR_PROVISIONALLY_AVAILABLE = 0x09, + MTRPushAVStreamTransportStatusCodeINVALIDTRANSPORTSTATUS MTR_PROVISIONALLY_AVAILABLE = 0x10, +} 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_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..f5aa617cc5940c 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)findStreamConfigurationWithCompletion:(void (^)(MTRPushAVStreamTransportClusterFindStreamConfigurationResponseParams * _Nullable data, NSError * _Nullable error))completion +{ + [self findStreamConfigurationWithParams:nil completion:completion]; +} +- (void)findStreamConfigurationWithParams:(MTRPushAVStreamTransportClusterFindStreamConfigurationParams * _Nullable)params completion:(void (^)(MTRPushAVStreamTransportClusterFindStreamConfigurationResponseParams * _Nullable data, NSError * _Nullable error))completion +{ + if (params == nil) { + params = [[MTRPushAVStreamTransportClusterFindStreamConfigurationParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = PushAvStreamTransport::Commands::FindStreamConfiguration::Type; + [self.device _invokeKnownCommandWithEndpointID:self.endpointID + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRPushAVStreamTransportClusterFindStreamConfigurationResponseParams.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..dfff553544126d 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, + MTRCommandIDTypeClusterPushAVStreamTransportCommandFindStreamConfigurationID MTR_PROVISIONALLY_AVAILABLE = 0x00000006, + MTRCommandIDTypeClusterPushAVStreamTransportCommandFindStreamConfigurationResponseID 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..0699df7e5623b3 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 MTRCommandIDTypeClusterPushAVStreamTransportCommandFindStreamConfigurationID: + result = @"FindStreamConfiguration"; + 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 MTRCommandIDTypeClusterPushAVStreamTransportCommandFindStreamConfigurationResponseID: + result = @"FindStreamConfigurationResponse"; + 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..bc0fdc9d03fe00 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 + * This cluster implements the upload of Audio and Video streams from the Camera AV Stream Management Cluster using suitable push-based transports. + */ +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)findStreamConfigurationWithParams:(MTRPushAVStreamTransportClusterFindStreamConfigurationParams * _Nullable)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(void (^)(MTRPushAVStreamTransportClusterFindStreamConfigurationResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)findStreamConfigurationWithExpectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(void (^)(MTRPushAVStreamTransportClusterFindStreamConfigurationResponseParams * _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..7da4c9a4e40ab3 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)findStreamConfigurationWithExpectedValues:(NSArray *> *)expectedValues expectedValueInterval:(NSNumber *)expectedValueIntervalMs completion:(void (^)(MTRPushAVStreamTransportClusterFindStreamConfigurationResponseParams * _Nullable data, NSError * _Nullable error))completion +{ + [self findStreamConfigurationWithParams:nil expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs completion:completion]; +} +- (void)findStreamConfigurationWithParams:(MTRPushAVStreamTransportClusterFindStreamConfigurationParams * _Nullable)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(void (^)(MTRPushAVStreamTransportClusterFindStreamConfigurationResponseParams * _Nullable data, NSError * _Nullable error))completion +{ + if (params == nil) { + params = [[MTRPushAVStreamTransportClusterFindStreamConfigurationParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = PushAvStreamTransport::Commands::FindStreamConfiguration::Type; + [self.device _invokeKnownCommandWithEndpointID:self.endpointID + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRPushAVStreamTransportClusterFindStreamConfigurationResponseParams.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..94be2f90393d25 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) MTRPushAVStreamTransportClusterPushAVStreamTransportOptionsStruct * _Nonnull streamTransportOptions 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) MTRPushAVStreamTransportClusterPushAVStreamTransportOptionsStruct * _Nonnull streamTransportOptions 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) MTRPushAVStreamTransportClusterPushAVStreamTransportOptionsStruct * _Nonnull streamTransportOptions 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 * _Nullable connectionID MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) NSNumber * _Nonnull streamTransportStatus 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 * _Nullable activationReason MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) MTRPushAVStreamTransportClusterPushAVStreamTransportMotionTriggerTimeControlStruct * _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 MTRPushAVStreamTransportClusterFindStreamConfigurationParams : 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 MTRPushAVStreamTransportClusterFindStreamConfigurationResponseParams : NSObject + +@property (nonatomic, copy) NSArray * _Nonnull streamConfigurations MTR_PROVISIONALLY_AVAILABLE; + +/** + * Initialize an MTRPushAVStreamTransportClusterFindStreamConfigurationResponseParams 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..0f33074816a1cd 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm @@ -34315,6 +34315,1216 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader } @end +@implementation MTRPushAVStreamTransportClusterAllocatePushTransportParams +- (instancetype)init +{ + if (self = [super init]) { + + _streamTransportOptions = [MTRPushAVStreamTransportClusterPushAVStreamTransportOptionsStruct new]; + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRPushAVStreamTransportClusterAllocatePushTransportParams alloc] init]; + + other.streamTransportOptions = self.streamTransportOptions; + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: streamTransportOptions:%@; >", NSStringFromClass([self class]), _streamTransportOptions]; + return descriptionString; +} + +@end + +@implementation MTRPushAVStreamTransportClusterAllocatePushTransportParams (InternalMethods) + +- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader +{ + chip::app::Clusters::PushAvStreamTransport::Commands::AllocatePushTransport::Type encodableStruct; + ListFreer listFreer; + { + encodableStruct.streamTransportOptions.streamType = static_cast>(self.streamTransportOptions.streamType.unsignedCharValue); + if (self.streamTransportOptions.videoStreamID != nil) { + auto & definedValue_1 = encodableStruct.streamTransportOptions.videoStreamID.Emplace(); + if (self.streamTransportOptions.videoStreamID == nil) { + definedValue_1.SetNull(); + } else { + auto & nonNullValue_2 = definedValue_1.SetNonNull(); + nonNullValue_2 = self.streamTransportOptions.videoStreamID.unsignedShortValue; + } + } + if (self.streamTransportOptions.audioStreamID != nil) { + auto & definedValue_1 = encodableStruct.streamTransportOptions.audioStreamID.Emplace(); + if (self.streamTransportOptions.audioStreamID == nil) { + definedValue_1.SetNull(); + } else { + auto & nonNullValue_2 = definedValue_1.SetNonNull(); + nonNullValue_2 = self.streamTransportOptions.audioStreamID.unsignedShortValue; + } + } + encodableStruct.streamTransportOptions.TLSEndpointID = self.streamTransportOptions.tlsEndpointID.unsignedShortValue; + encodableStruct.streamTransportOptions.url = AsCharSpan(self.streamTransportOptions.url); + encodableStruct.streamTransportOptions.triggerOptions.triggerType = static_cast>(self.streamTransportOptions.triggerOptions.triggerType.unsignedCharValue); + if (self.streamTransportOptions.triggerOptions.motionZones != nil) { + auto & definedValue_2 = encodableStruct.streamTransportOptions.triggerOptions.motionZones.Emplace(); + if (self.streamTransportOptions.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.streamTransportOptions.triggerOptions.motionZones.count != 0) { + auto * listHolder_4 = new ListHolder(self.streamTransportOptions.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.streamTransportOptions.triggerOptions.motionZones.count; ++i_4) { + auto element_4 = MTR_SAFE_CAST(self.streamTransportOptions.triggerOptions.motionZones[i_4], NSNumber); + if (!element_4) { + // Wrong kind of value. + MTR_LOG_ERROR("%@ incorrectly present in list of %@", self.streamTransportOptions.triggerOptions.motionZones[i_4], NSStringFromClass(NSNumber.class)); + return CHIP_ERROR_INVALID_ARGUMENT; + } + listHolder_4->mList[i_4] = element_4.unsignedShortValue; + } + nonNullValue_3 = ListType_4(listHolder_4->mList, self.streamTransportOptions.triggerOptions.motionZones.count); + } else { + nonNullValue_3 = ListType_4(); + } + } + } + } + if (self.streamTransportOptions.triggerOptions.motionSensitivity != nil) { + auto & definedValue_2 = encodableStruct.streamTransportOptions.triggerOptions.motionSensitivity.Emplace(); + if (self.streamTransportOptions.triggerOptions.motionSensitivity == nil) { + definedValue_2.SetNull(); + } else { + auto & nonNullValue_3 = definedValue_2.SetNonNull(); + nonNullValue_3 = self.streamTransportOptions.triggerOptions.motionSensitivity.unsignedCharValue; + } + } + if (self.streamTransportOptions.triggerOptions.motionTimeControl != nil) { + auto & definedValue_2 = encodableStruct.streamTransportOptions.triggerOptions.motionTimeControl.Emplace(); + if (self.streamTransportOptions.triggerOptions.motionTimeControl == nil) { + definedValue_2.SetNull(); + } else { + auto & nonNullValue_3 = definedValue_2.SetNonNull(); + nonNullValue_3.initialDuration = self.streamTransportOptions.triggerOptions.motionTimeControl.initialDuration.unsignedShortValue; + nonNullValue_3.augmentationDuration = self.streamTransportOptions.triggerOptions.motionTimeControl.augmentationDuration.unsignedShortValue; + nonNullValue_3.maxDuration = self.streamTransportOptions.triggerOptions.motionTimeControl.maxDuration.unsignedIntValue; + nonNullValue_3.blindDuration = self.streamTransportOptions.triggerOptions.motionTimeControl.blindDuration.unsignedShortValue; + } + } + if (self.streamTransportOptions.triggerOptions.activationReason != nil) { + auto & definedValue_2 = encodableStruct.streamTransportOptions.triggerOptions.activationReason.Emplace(); + if (self.streamTransportOptions.triggerOptions.activationReason == nil) { + definedValue_2.SetNull(); + } else { + auto & nonNullValue_3 = definedValue_2.SetNonNull(); + nonNullValue_3 = static_cast>(self.streamTransportOptions.triggerOptions.activationReason.unsignedCharValue); + } + } + encodableStruct.streamTransportOptions.containerFormat = static_cast>(self.streamTransportOptions.containerFormat.unsignedCharValue); + encodableStruct.streamTransportOptions.ingestMethod = static_cast>(self.streamTransportOptions.ingestMethod.unsignedCharValue); + encodableStruct.streamTransportOptions.containerOptions.containerType = static_cast>(self.streamTransportOptions.containerOptions.containerType.unsignedCharValue); + if (self.streamTransportOptions.containerOptions.cmafContainerOptions != nil) { + auto & definedValue_2 = encodableStruct.streamTransportOptions.containerOptions.CMAFContainerOptions.Emplace(); + if (self.streamTransportOptions.containerOptions.cmafContainerOptions == nil) { + definedValue_2.SetNull(); + } else { + auto & nonNullValue_3 = definedValue_2.SetNonNull(); + nonNullValue_3.chunkDuration = self.streamTransportOptions.containerOptions.cmafContainerOptions.chunkDuration.unsignedShortValue; + if (self.streamTransportOptions.containerOptions.cmafContainerOptions.cencKey != nil) { + auto & definedValue_5 = nonNullValue_3.CENCKey.Emplace(); + if (self.streamTransportOptions.containerOptions.cmafContainerOptions.cencKey == nil) { + definedValue_5.SetNull(); + } else { + auto & nonNullValue_6 = definedValue_5.SetNonNull(); + nonNullValue_6 = AsByteSpan(self.streamTransportOptions.containerOptions.cmafContainerOptions.cencKey); + } + } + } + } + if (self.streamTransportOptions.metadataOptions != nil) { + auto & definedValue_1 = encodableStruct.streamTransportOptions.metadataOptions.Emplace(); + if (self.streamTransportOptions.metadataOptions == nil) { + definedValue_1.SetNull(); + } else { + auto & nonNullValue_2 = definedValue_1.SetNonNull(); + nonNullValue_2.multiplexing = static_cast>(self.streamTransportOptions.metadataOptions.multiplexing.unsignedCharValue); + nonNullValue_2.includeMotionZones = self.streamTransportOptions.metadataOptions.includeMotionZones.boolValue; + nonNullValue_2.enableMetadataPrivacySensitive = self.streamTransportOptions.metadataOptions.enableMetadataPrivacySensitive.boolValue; + } + } + if (self.streamTransportOptions.expiryTime != nil) { + auto & definedValue_1 = encodableStruct.streamTransportOptions.expiryTime.Emplace(); + if (self.streamTransportOptions.expiryTime == nil) { + definedValue_1.SetNull(); + } else { + auto & nonNullValue_2 = definedValue_1.SetNonNull(); + nonNullValue_2 = self.streamTransportOptions.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); + + _streamTransportOptions = [MTRPushAVStreamTransportClusterPushAVStreamTransportOptionsStruct new]; + + _transportStatus = @(0); + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRPushAVStreamTransportClusterAllocatePushTransportResponseParams alloc] init]; + + other.connectionID = self.connectionID; + other.streamTransportOptions = self.streamTransportOptions; + other.transportStatus = self.transportStatus; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: connectionID:%@; streamTransportOptions:%@; transportStatus:%@; >", NSStringFromClass([self class]), _connectionID, _streamTransportOptions, _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.streamTransportOptions = [MTRPushAVStreamTransportClusterPushAVStreamTransportOptionsStruct new]; + self.streamTransportOptions.streamType = [NSNumber numberWithUnsignedChar:chip::to_underlying(decodableStruct.streamTransportOptions.streamType)]; + if (decodableStruct.streamTransportOptions.videoStreamID.HasValue()) { + if (decodableStruct.streamTransportOptions.videoStreamID.Value().IsNull()) { + self.streamTransportOptions.videoStreamID = nil; + } else { + self.streamTransportOptions.videoStreamID = [NSNumber numberWithUnsignedShort:decodableStruct.streamTransportOptions.videoStreamID.Value().Value()]; + } + } else { + self.streamTransportOptions.videoStreamID = nil; + } + if (decodableStruct.streamTransportOptions.audioStreamID.HasValue()) { + if (decodableStruct.streamTransportOptions.audioStreamID.Value().IsNull()) { + self.streamTransportOptions.audioStreamID = nil; + } else { + self.streamTransportOptions.audioStreamID = [NSNumber numberWithUnsignedShort:decodableStruct.streamTransportOptions.audioStreamID.Value().Value()]; + } + } else { + self.streamTransportOptions.audioStreamID = nil; + } + self.streamTransportOptions.tlsEndpointID = [NSNumber numberWithUnsignedShort:decodableStruct.streamTransportOptions.TLSEndpointID]; + self.streamTransportOptions.url = AsString(decodableStruct.streamTransportOptions.url); + if (self.streamTransportOptions.url == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + return err; + } + self.streamTransportOptions.triggerOptions = [MTRPushAVStreamTransportClusterPushAVStreamTransportTriggerOptionsStruct new]; + self.streamTransportOptions.triggerOptions.triggerType = [NSNumber numberWithUnsignedChar:chip::to_underlying(decodableStruct.streamTransportOptions.triggerOptions.triggerType)]; + if (decodableStruct.streamTransportOptions.triggerOptions.motionZones.HasValue()) { + if (decodableStruct.streamTransportOptions.triggerOptions.motionZones.Value().IsNull()) { + self.streamTransportOptions.triggerOptions.motionZones = nil; + } else { + { // Scope for our temporary variables + auto * array_4 = [NSMutableArray new]; + auto iter_4 = decodableStruct.streamTransportOptions.triggerOptions.motionZones.Value().Value().begin(); + while (iter_4.Next()) { + auto & entry_4 = iter_4.GetValue(); + NSNumber * newElement_4; + newElement_4 = [NSNumber numberWithUnsignedShort:entry_4]; + [array_4 addObject:newElement_4]; + } + CHIP_ERROR err = iter_4.GetStatus(); + if (err != CHIP_NO_ERROR) { + return err; + } + self.streamTransportOptions.triggerOptions.motionZones = array_4; + } + } + } else { + self.streamTransportOptions.triggerOptions.motionZones = nil; + } + if (decodableStruct.streamTransportOptions.triggerOptions.motionSensitivity.HasValue()) { + if (decodableStruct.streamTransportOptions.triggerOptions.motionSensitivity.Value().IsNull()) { + self.streamTransportOptions.triggerOptions.motionSensitivity = nil; + } else { + self.streamTransportOptions.triggerOptions.motionSensitivity = [NSNumber numberWithUnsignedChar:decodableStruct.streamTransportOptions.triggerOptions.motionSensitivity.Value().Value()]; + } + } else { + self.streamTransportOptions.triggerOptions.motionSensitivity = nil; + } + if (decodableStruct.streamTransportOptions.triggerOptions.motionTimeControl.HasValue()) { + if (decodableStruct.streamTransportOptions.triggerOptions.motionTimeControl.Value().IsNull()) { + self.streamTransportOptions.triggerOptions.motionTimeControl = nil; + } else { + self.streamTransportOptions.triggerOptions.motionTimeControl = [MTRPushAVStreamTransportClusterPushAVStreamTransportMotionTriggerTimeControlStruct new]; + self.streamTransportOptions.triggerOptions.motionTimeControl.initialDuration = [NSNumber numberWithUnsignedShort:decodableStruct.streamTransportOptions.triggerOptions.motionTimeControl.Value().Value().initialDuration]; + self.streamTransportOptions.triggerOptions.motionTimeControl.augmentationDuration = [NSNumber numberWithUnsignedShort:decodableStruct.streamTransportOptions.triggerOptions.motionTimeControl.Value().Value().augmentationDuration]; + self.streamTransportOptions.triggerOptions.motionTimeControl.maxDuration = [NSNumber numberWithUnsignedInt:decodableStruct.streamTransportOptions.triggerOptions.motionTimeControl.Value().Value().maxDuration]; + self.streamTransportOptions.triggerOptions.motionTimeControl.blindDuration = [NSNumber numberWithUnsignedShort:decodableStruct.streamTransportOptions.triggerOptions.motionTimeControl.Value().Value().blindDuration]; + } + } else { + self.streamTransportOptions.triggerOptions.motionTimeControl = nil; + } + if (decodableStruct.streamTransportOptions.triggerOptions.activationReason.HasValue()) { + if (decodableStruct.streamTransportOptions.triggerOptions.activationReason.Value().IsNull()) { + self.streamTransportOptions.triggerOptions.activationReason = nil; + } else { + self.streamTransportOptions.triggerOptions.activationReason = [NSNumber numberWithUnsignedChar:chip::to_underlying(decodableStruct.streamTransportOptions.triggerOptions.activationReason.Value().Value())]; + } + } else { + self.streamTransportOptions.triggerOptions.activationReason = nil; + } + self.streamTransportOptions.containerFormat = [NSNumber numberWithUnsignedChar:chip::to_underlying(decodableStruct.streamTransportOptions.containerFormat)]; + self.streamTransportOptions.ingestMethod = [NSNumber numberWithUnsignedChar:chip::to_underlying(decodableStruct.streamTransportOptions.ingestMethod)]; + self.streamTransportOptions.containerOptions = [MTRPushAVStreamTransportClusterPushAVStreamTransportContainerOptionsStruct new]; + self.streamTransportOptions.containerOptions.containerType = [NSNumber numberWithUnsignedChar:chip::to_underlying(decodableStruct.streamTransportOptions.containerOptions.containerType)]; + if (decodableStruct.streamTransportOptions.containerOptions.CMAFContainerOptions.HasValue()) { + if (decodableStruct.streamTransportOptions.containerOptions.CMAFContainerOptions.Value().IsNull()) { + self.streamTransportOptions.containerOptions.cmafContainerOptions = nil; + } else { + self.streamTransportOptions.containerOptions.cmafContainerOptions = [MTRPushAVStreamTransportClusterPushAVStreamTransportCMAFContainerOptionsStruct new]; + self.streamTransportOptions.containerOptions.cmafContainerOptions.chunkDuration = [NSNumber numberWithUnsignedShort:decodableStruct.streamTransportOptions.containerOptions.CMAFContainerOptions.Value().Value().chunkDuration]; + if (decodableStruct.streamTransportOptions.containerOptions.CMAFContainerOptions.Value().Value().CENCKey.HasValue()) { + if (decodableStruct.streamTransportOptions.containerOptions.CMAFContainerOptions.Value().Value().CENCKey.Value().IsNull()) { + self.streamTransportOptions.containerOptions.cmafContainerOptions.cencKey = nil; + } else { + self.streamTransportOptions.containerOptions.cmafContainerOptions.cencKey = AsData(decodableStruct.streamTransportOptions.containerOptions.CMAFContainerOptions.Value().Value().CENCKey.Value().Value()); + } + } else { + self.streamTransportOptions.containerOptions.cmafContainerOptions.cencKey = nil; + } + } + } else { + self.streamTransportOptions.containerOptions.cmafContainerOptions = nil; + } + if (decodableStruct.streamTransportOptions.metadataOptions.HasValue()) { + if (decodableStruct.streamTransportOptions.metadataOptions.Value().IsNull()) { + self.streamTransportOptions.metadataOptions = nil; + } else { + self.streamTransportOptions.metadataOptions = [MTRPushAVStreamTransportClusterPushAVStreamTransportMetadataOptionsStruct new]; + self.streamTransportOptions.metadataOptions.multiplexing = [NSNumber numberWithUnsignedChar:chip::to_underlying(decodableStruct.streamTransportOptions.metadataOptions.Value().Value().multiplexing)]; + self.streamTransportOptions.metadataOptions.includeMotionZones = [NSNumber numberWithBool:decodableStruct.streamTransportOptions.metadataOptions.Value().Value().includeMotionZones]; + self.streamTransportOptions.metadataOptions.enableMetadataPrivacySensitive = [NSNumber numberWithBool:decodableStruct.streamTransportOptions.metadataOptions.Value().Value().enableMetadataPrivacySensitive]; + } + } else { + self.streamTransportOptions.metadataOptions = nil; + } + if (decodableStruct.streamTransportOptions.expiryTime.HasValue()) { + if (decodableStruct.streamTransportOptions.expiryTime.Value().IsNull()) { + self.streamTransportOptions.expiryTime = nil; + } else { + self.streamTransportOptions.expiryTime = [NSNumber numberWithUnsignedInt:decodableStruct.streamTransportOptions.expiryTime.Value().Value()]; + } + } else { + self.streamTransportOptions.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); + + _streamTransportOptions = [MTRPushAVStreamTransportClusterPushAVStreamTransportOptionsStruct new]; + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRPushAVStreamTransportClusterModifyPushTransportParams alloc] init]; + + other.connectionID = self.connectionID; + other.streamTransportOptions = self.streamTransportOptions; + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: connectionID:%@; streamTransportOptions:%@; >", NSStringFromClass([self class]), _connectionID, _streamTransportOptions]; + 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.streamTransportOptions.streamType = static_cast>(self.streamTransportOptions.streamType.unsignedCharValue); + if (self.streamTransportOptions.videoStreamID != nil) { + auto & definedValue_1 = encodableStruct.streamTransportOptions.videoStreamID.Emplace(); + if (self.streamTransportOptions.videoStreamID == nil) { + definedValue_1.SetNull(); + } else { + auto & nonNullValue_2 = definedValue_1.SetNonNull(); + nonNullValue_2 = self.streamTransportOptions.videoStreamID.unsignedShortValue; + } + } + if (self.streamTransportOptions.audioStreamID != nil) { + auto & definedValue_1 = encodableStruct.streamTransportOptions.audioStreamID.Emplace(); + if (self.streamTransportOptions.audioStreamID == nil) { + definedValue_1.SetNull(); + } else { + auto & nonNullValue_2 = definedValue_1.SetNonNull(); + nonNullValue_2 = self.streamTransportOptions.audioStreamID.unsignedShortValue; + } + } + encodableStruct.streamTransportOptions.TLSEndpointID = self.streamTransportOptions.tlsEndpointID.unsignedShortValue; + encodableStruct.streamTransportOptions.url = AsCharSpan(self.streamTransportOptions.url); + encodableStruct.streamTransportOptions.triggerOptions.triggerType = static_cast>(self.streamTransportOptions.triggerOptions.triggerType.unsignedCharValue); + if (self.streamTransportOptions.triggerOptions.motionZones != nil) { + auto & definedValue_2 = encodableStruct.streamTransportOptions.triggerOptions.motionZones.Emplace(); + if (self.streamTransportOptions.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.streamTransportOptions.triggerOptions.motionZones.count != 0) { + auto * listHolder_4 = new ListHolder(self.streamTransportOptions.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.streamTransportOptions.triggerOptions.motionZones.count; ++i_4) { + auto element_4 = MTR_SAFE_CAST(self.streamTransportOptions.triggerOptions.motionZones[i_4], NSNumber); + if (!element_4) { + // Wrong kind of value. + MTR_LOG_ERROR("%@ incorrectly present in list of %@", self.streamTransportOptions.triggerOptions.motionZones[i_4], NSStringFromClass(NSNumber.class)); + return CHIP_ERROR_INVALID_ARGUMENT; + } + listHolder_4->mList[i_4] = element_4.unsignedShortValue; + } + nonNullValue_3 = ListType_4(listHolder_4->mList, self.streamTransportOptions.triggerOptions.motionZones.count); + } else { + nonNullValue_3 = ListType_4(); + } + } + } + } + if (self.streamTransportOptions.triggerOptions.motionSensitivity != nil) { + auto & definedValue_2 = encodableStruct.streamTransportOptions.triggerOptions.motionSensitivity.Emplace(); + if (self.streamTransportOptions.triggerOptions.motionSensitivity == nil) { + definedValue_2.SetNull(); + } else { + auto & nonNullValue_3 = definedValue_2.SetNonNull(); + nonNullValue_3 = self.streamTransportOptions.triggerOptions.motionSensitivity.unsignedCharValue; + } + } + if (self.streamTransportOptions.triggerOptions.motionTimeControl != nil) { + auto & definedValue_2 = encodableStruct.streamTransportOptions.triggerOptions.motionTimeControl.Emplace(); + if (self.streamTransportOptions.triggerOptions.motionTimeControl == nil) { + definedValue_2.SetNull(); + } else { + auto & nonNullValue_3 = definedValue_2.SetNonNull(); + nonNullValue_3.initialDuration = self.streamTransportOptions.triggerOptions.motionTimeControl.initialDuration.unsignedShortValue; + nonNullValue_3.augmentationDuration = self.streamTransportOptions.triggerOptions.motionTimeControl.augmentationDuration.unsignedShortValue; + nonNullValue_3.maxDuration = self.streamTransportOptions.triggerOptions.motionTimeControl.maxDuration.unsignedIntValue; + nonNullValue_3.blindDuration = self.streamTransportOptions.triggerOptions.motionTimeControl.blindDuration.unsignedShortValue; + } + } + if (self.streamTransportOptions.triggerOptions.activationReason != nil) { + auto & definedValue_2 = encodableStruct.streamTransportOptions.triggerOptions.activationReason.Emplace(); + if (self.streamTransportOptions.triggerOptions.activationReason == nil) { + definedValue_2.SetNull(); + } else { + auto & nonNullValue_3 = definedValue_2.SetNonNull(); + nonNullValue_3 = static_cast>(self.streamTransportOptions.triggerOptions.activationReason.unsignedCharValue); + } + } + encodableStruct.streamTransportOptions.containerFormat = static_cast>(self.streamTransportOptions.containerFormat.unsignedCharValue); + encodableStruct.streamTransportOptions.ingestMethod = static_cast>(self.streamTransportOptions.ingestMethod.unsignedCharValue); + encodableStruct.streamTransportOptions.containerOptions.containerType = static_cast>(self.streamTransportOptions.containerOptions.containerType.unsignedCharValue); + if (self.streamTransportOptions.containerOptions.cmafContainerOptions != nil) { + auto & definedValue_2 = encodableStruct.streamTransportOptions.containerOptions.CMAFContainerOptions.Emplace(); + if (self.streamTransportOptions.containerOptions.cmafContainerOptions == nil) { + definedValue_2.SetNull(); + } else { + auto & nonNullValue_3 = definedValue_2.SetNonNull(); + nonNullValue_3.chunkDuration = self.streamTransportOptions.containerOptions.cmafContainerOptions.chunkDuration.unsignedShortValue; + if (self.streamTransportOptions.containerOptions.cmafContainerOptions.cencKey != nil) { + auto & definedValue_5 = nonNullValue_3.CENCKey.Emplace(); + if (self.streamTransportOptions.containerOptions.cmafContainerOptions.cencKey == nil) { + definedValue_5.SetNull(); + } else { + auto & nonNullValue_6 = definedValue_5.SetNonNull(); + nonNullValue_6 = AsByteSpan(self.streamTransportOptions.containerOptions.cmafContainerOptions.cencKey); + } + } + } + } + if (self.streamTransportOptions.metadataOptions != nil) { + auto & definedValue_1 = encodableStruct.streamTransportOptions.metadataOptions.Emplace(); + if (self.streamTransportOptions.metadataOptions == nil) { + definedValue_1.SetNull(); + } else { + auto & nonNullValue_2 = definedValue_1.SetNonNull(); + nonNullValue_2.multiplexing = static_cast>(self.streamTransportOptions.metadataOptions.multiplexing.unsignedCharValue); + nonNullValue_2.includeMotionZones = self.streamTransportOptions.metadataOptions.includeMotionZones.boolValue; + nonNullValue_2.enableMetadataPrivacySensitive = self.streamTransportOptions.metadataOptions.enableMetadataPrivacySensitive.boolValue; + } + } + if (self.streamTransportOptions.expiryTime != nil) { + auto & definedValue_1 = encodableStruct.streamTransportOptions.expiryTime.Emplace(); + if (self.streamTransportOptions.expiryTime == nil) { + definedValue_1.SetNull(); + } else { + auto & nonNullValue_2 = definedValue_1.SetNonNull(); + nonNullValue_2 = self.streamTransportOptions.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 = nil; + + _streamTransportStatus = @(0); + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRPushAVStreamTransportClusterSetTransportStatusParams alloc] init]; + + other.connectionID = self.connectionID; + other.streamTransportStatus = self.streamTransportStatus; + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: connectionID:%@; streamTransportStatus:%@; >", NSStringFromClass([self class]), _connectionID, _streamTransportStatus]; + return descriptionString; +} + +@end + +@implementation MTRPushAVStreamTransportClusterSetTransportStatusParams (InternalMethods) + +- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader +{ + chip::app::Clusters::PushAvStreamTransport::Commands::SetTransportStatus::Type encodableStruct; + ListFreer listFreer; + { + if (self.connectionID == nil) { + encodableStruct.connectionID.SetNull(); + } else { + auto & nonNullValue_0 = encodableStruct.connectionID.SetNonNull(); + nonNullValue_0 = self.connectionID.unsignedShortValue; + } + } + { + encodableStruct.streamTransportStatus = static_cast>(self.streamTransportStatus.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 = nil; + + _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; + } + { + if (self.activationReason == nil) { + encodableStruct.activationReason.SetNull(); + } else { + auto & nonNullValue_0 = encodableStruct.activationReason.SetNonNull(); + nonNullValue_0 = static_cast>(self.activationReason.unsignedCharValue); + } + } + { + if (self.timeControl != nil) { + auto & definedValue_0 = encodableStruct.timeControl.Emplace(); + if (self.timeControl == nil) { + definedValue_0.SetNull(); + } else { + auto & nonNullValue_1 = definedValue_0.SetNonNull(); + nonNullValue_1.initialDuration = self.timeControl.initialDuration.unsignedShortValue; + nonNullValue_1.augmentationDuration = self.timeControl.augmentationDuration.unsignedShortValue; + nonNullValue_1.maxDuration = self.timeControl.maxDuration.unsignedIntValue; + nonNullValue_1.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 MTRPushAVStreamTransportClusterFindStreamConfigurationParams +- (instancetype)init +{ + if (self = [super init]) { + + _connectionID = nil; + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRPushAVStreamTransportClusterFindStreamConfigurationParams 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 MTRPushAVStreamTransportClusterFindStreamConfigurationParams (InternalMethods) + +- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader +{ + chip::app::Clusters::PushAvStreamTransport::Commands::FindStreamConfiguration::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 MTRPushAVStreamTransportClusterFindStreamConfigurationResponseParams +- (instancetype)init +{ + if (self = [super init]) { + + _streamConfigurations = [NSArray array]; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRPushAVStreamTransportClusterFindStreamConfigurationResponseParams 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::FindStreamConfigurationResponse::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 MTRPushAVStreamTransportClusterFindStreamConfigurationResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::PushAvStreamTransport::Commands::FindStreamConfigurationResponse::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(); + MTRPushAVStreamTransportClusterPushAVStreamConfigurationStruct * newElement_0; + newElement_0 = [MTRPushAVStreamTransportClusterPushAVStreamConfigurationStruct new]; + newElement_0.connectionID = [NSNumber numberWithUnsignedShort:entry_0.connectionID]; + newElement_0.streamTransportStatus = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.streamTransportStatus)]; + newElement_0.streamTransportOptions = [MTRPushAVStreamTransportClusterPushAVStreamTransportOptionsStruct new]; + newElement_0.streamTransportOptions.streamType = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.streamTransportOptions.streamType)]; + if (entry_0.streamTransportOptions.videoStreamID.HasValue()) { + if (entry_0.streamTransportOptions.videoStreamID.Value().IsNull()) { + newElement_0.streamTransportOptions.videoStreamID = nil; + } else { + newElement_0.streamTransportOptions.videoStreamID = [NSNumber numberWithUnsignedShort:entry_0.streamTransportOptions.videoStreamID.Value().Value()]; + } + } else { + newElement_0.streamTransportOptions.videoStreamID = nil; + } + if (entry_0.streamTransportOptions.audioStreamID.HasValue()) { + if (entry_0.streamTransportOptions.audioStreamID.Value().IsNull()) { + newElement_0.streamTransportOptions.audioStreamID = nil; + } else { + newElement_0.streamTransportOptions.audioStreamID = [NSNumber numberWithUnsignedShort:entry_0.streamTransportOptions.audioStreamID.Value().Value()]; + } + } else { + newElement_0.streamTransportOptions.audioStreamID = nil; + } + newElement_0.streamTransportOptions.tlsEndpointID = [NSNumber numberWithUnsignedShort:entry_0.streamTransportOptions.TLSEndpointID]; + newElement_0.streamTransportOptions.url = AsString(entry_0.streamTransportOptions.url); + if (newElement_0.streamTransportOptions.url == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + return err; + } + newElement_0.streamTransportOptions.triggerOptions = [MTRPushAVStreamTransportClusterPushAVStreamTransportTriggerOptionsStruct new]; + newElement_0.streamTransportOptions.triggerOptions.triggerType = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.streamTransportOptions.triggerOptions.triggerType)]; + if (entry_0.streamTransportOptions.triggerOptions.motionZones.HasValue()) { + if (entry_0.streamTransportOptions.triggerOptions.motionZones.Value().IsNull()) { + newElement_0.streamTransportOptions.triggerOptions.motionZones = nil; + } else { + { // Scope for our temporary variables + auto * array_6 = [NSMutableArray new]; + auto iter_6 = entry_0.streamTransportOptions.triggerOptions.motionZones.Value().Value().begin(); + while (iter_6.Next()) { + auto & entry_6 = iter_6.GetValue(); + NSNumber * newElement_6; + newElement_6 = [NSNumber numberWithUnsignedShort:entry_6]; + [array_6 addObject:newElement_6]; + } + CHIP_ERROR err = iter_6.GetStatus(); + if (err != CHIP_NO_ERROR) { + return err; + } + newElement_0.streamTransportOptions.triggerOptions.motionZones = array_6; + } + } + } else { + newElement_0.streamTransportOptions.triggerOptions.motionZones = nil; + } + if (entry_0.streamTransportOptions.triggerOptions.motionSensitivity.HasValue()) { + if (entry_0.streamTransportOptions.triggerOptions.motionSensitivity.Value().IsNull()) { + newElement_0.streamTransportOptions.triggerOptions.motionSensitivity = nil; + } else { + newElement_0.streamTransportOptions.triggerOptions.motionSensitivity = [NSNumber numberWithUnsignedChar:entry_0.streamTransportOptions.triggerOptions.motionSensitivity.Value().Value()]; + } + } else { + newElement_0.streamTransportOptions.triggerOptions.motionSensitivity = nil; + } + if (entry_0.streamTransportOptions.triggerOptions.motionTimeControl.HasValue()) { + if (entry_0.streamTransportOptions.triggerOptions.motionTimeControl.Value().IsNull()) { + newElement_0.streamTransportOptions.triggerOptions.motionTimeControl = nil; + } else { + newElement_0.streamTransportOptions.triggerOptions.motionTimeControl = [MTRPushAVStreamTransportClusterPushAVStreamTransportMotionTriggerTimeControlStruct new]; + newElement_0.streamTransportOptions.triggerOptions.motionTimeControl.initialDuration = [NSNumber numberWithUnsignedShort:entry_0.streamTransportOptions.triggerOptions.motionTimeControl.Value().Value().initialDuration]; + newElement_0.streamTransportOptions.triggerOptions.motionTimeControl.augmentationDuration = [NSNumber numberWithUnsignedShort:entry_0.streamTransportOptions.triggerOptions.motionTimeControl.Value().Value().augmentationDuration]; + newElement_0.streamTransportOptions.triggerOptions.motionTimeControl.maxDuration = [NSNumber numberWithUnsignedInt:entry_0.streamTransportOptions.triggerOptions.motionTimeControl.Value().Value().maxDuration]; + newElement_0.streamTransportOptions.triggerOptions.motionTimeControl.blindDuration = [NSNumber numberWithUnsignedShort:entry_0.streamTransportOptions.triggerOptions.motionTimeControl.Value().Value().blindDuration]; + } + } else { + newElement_0.streamTransportOptions.triggerOptions.motionTimeControl = nil; + } + if (entry_0.streamTransportOptions.triggerOptions.activationReason.HasValue()) { + if (entry_0.streamTransportOptions.triggerOptions.activationReason.Value().IsNull()) { + newElement_0.streamTransportOptions.triggerOptions.activationReason = nil; + } else { + newElement_0.streamTransportOptions.triggerOptions.activationReason = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.streamTransportOptions.triggerOptions.activationReason.Value().Value())]; + } + } else { + newElement_0.streamTransportOptions.triggerOptions.activationReason = nil; + } + newElement_0.streamTransportOptions.containerFormat = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.streamTransportOptions.containerFormat)]; + newElement_0.streamTransportOptions.ingestMethod = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.streamTransportOptions.ingestMethod)]; + newElement_0.streamTransportOptions.containerOptions = [MTRPushAVStreamTransportClusterPushAVStreamTransportContainerOptionsStruct new]; + newElement_0.streamTransportOptions.containerOptions.containerType = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.streamTransportOptions.containerOptions.containerType)]; + if (entry_0.streamTransportOptions.containerOptions.CMAFContainerOptions.HasValue()) { + if (entry_0.streamTransportOptions.containerOptions.CMAFContainerOptions.Value().IsNull()) { + newElement_0.streamTransportOptions.containerOptions.cmafContainerOptions = nil; + } else { + newElement_0.streamTransportOptions.containerOptions.cmafContainerOptions = [MTRPushAVStreamTransportClusterPushAVStreamTransportCMAFContainerOptionsStruct new]; + newElement_0.streamTransportOptions.containerOptions.cmafContainerOptions.chunkDuration = [NSNumber numberWithUnsignedShort:entry_0.streamTransportOptions.containerOptions.CMAFContainerOptions.Value().Value().chunkDuration]; + if (entry_0.streamTransportOptions.containerOptions.CMAFContainerOptions.Value().Value().CENCKey.HasValue()) { + if (entry_0.streamTransportOptions.containerOptions.CMAFContainerOptions.Value().Value().CENCKey.Value().IsNull()) { + newElement_0.streamTransportOptions.containerOptions.cmafContainerOptions.cencKey = nil; + } else { + newElement_0.streamTransportOptions.containerOptions.cmafContainerOptions.cencKey = AsData(entry_0.streamTransportOptions.containerOptions.CMAFContainerOptions.Value().Value().CENCKey.Value().Value()); + } + } else { + newElement_0.streamTransportOptions.containerOptions.cmafContainerOptions.cencKey = nil; + } + } + } else { + newElement_0.streamTransportOptions.containerOptions.cmafContainerOptions = nil; + } + if (entry_0.streamTransportOptions.metadataOptions.HasValue()) { + if (entry_0.streamTransportOptions.metadataOptions.Value().IsNull()) { + newElement_0.streamTransportOptions.metadataOptions = nil; + } else { + newElement_0.streamTransportOptions.metadataOptions = [MTRPushAVStreamTransportClusterPushAVStreamTransportMetadataOptionsStruct new]; + newElement_0.streamTransportOptions.metadataOptions.multiplexing = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.streamTransportOptions.metadataOptions.Value().Value().multiplexing)]; + newElement_0.streamTransportOptions.metadataOptions.includeMotionZones = [NSNumber numberWithBool:entry_0.streamTransportOptions.metadataOptions.Value().Value().includeMotionZones]; + newElement_0.streamTransportOptions.metadataOptions.enableMetadataPrivacySensitive = [NSNumber numberWithBool:entry_0.streamTransportOptions.metadataOptions.Value().Value().enableMetadataPrivacySensitive]; + } + } else { + newElement_0.streamTransportOptions.metadataOptions = nil; + } + if (entry_0.streamTransportOptions.expiryTime.HasValue()) { + if (entry_0.streamTransportOptions.expiryTime.Value().IsNull()) { + newElement_0.streamTransportOptions.expiryTime = nil; + } else { + newElement_0.streamTransportOptions.expiryTime = [NSNumber numberWithUnsignedInt:entry_0.streamTransportOptions.expiryTime.Value().Value()]; + } + } else { + newElement_0.streamTransportOptions.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..1b23f1064aa66f 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 MTRPushAVStreamTransportClusterFindStreamConfigurationParams (InternalMethods) + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; + +@end + +@interface MTRPushAVStreamTransportClusterFindStreamConfigurationResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::PushAvStreamTransport::Commands::FindStreamConfigurationResponse::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..991e87d33a4bc9 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm @@ -4922,6 +4922,107 @@ 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]; + + 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 { + MTRPushAVStreamTransportClusterPushAVStreamTransportTriggerOptionsStruct * _Nonnull memberValue; + memberValue = [MTRPushAVStreamTransportClusterPushAVStreamTransportTriggerOptionsStruct new]; + memberValue.triggerType = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.triggerDetails.triggerType)]; + if (cppValue.triggerDetails.motionZones.HasValue()) { + if (cppValue.triggerDetails.motionZones.Value().IsNull()) { + memberValue.motionZones = nil; + } else { + { // Scope for our temporary variables + auto * array_3 = [NSMutableArray new]; + auto iter_3 = cppValue.triggerDetails.motionZones.Value().Value().begin(); + while (iter_3.Next()) { + auto & entry_3 = iter_3.GetValue(); + NSNumber * newElement_3; + newElement_3 = [NSNumber numberWithUnsignedShort:entry_3]; + [array_3 addObject:newElement_3]; + } + CHIP_ERROR err = iter_3.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + memberValue.motionZones = array_3; + } + } + } else { + memberValue.motionZones = nil; + } + if (cppValue.triggerDetails.motionSensitivity.HasValue()) { + if (cppValue.triggerDetails.motionSensitivity.Value().IsNull()) { + memberValue.motionSensitivity = nil; + } else { + memberValue.motionSensitivity = [NSNumber numberWithUnsignedChar:cppValue.triggerDetails.motionSensitivity.Value().Value()]; + } + } else { + memberValue.motionSensitivity = nil; + } + if (cppValue.triggerDetails.motionTimeControl.HasValue()) { + if (cppValue.triggerDetails.motionTimeControl.Value().IsNull()) { + memberValue.motionTimeControl = nil; + } else { + memberValue.motionTimeControl = [MTRPushAVStreamTransportClusterPushAVStreamTransportMotionTriggerTimeControlStruct new]; + memberValue.motionTimeControl.initialDuration = [NSNumber numberWithUnsignedShort:cppValue.triggerDetails.motionTimeControl.Value().Value().initialDuration]; + memberValue.motionTimeControl.augmentationDuration = [NSNumber numberWithUnsignedShort:cppValue.triggerDetails.motionTimeControl.Value().Value().augmentationDuration]; + memberValue.motionTimeControl.maxDuration = [NSNumber numberWithUnsignedInt:cppValue.triggerDetails.motionTimeControl.Value().Value().maxDuration]; + memberValue.motionTimeControl.blindDuration = [NSNumber numberWithUnsignedShort:cppValue.triggerDetails.motionTimeControl.Value().Value().blindDuration]; + } + } else { + memberValue.motionTimeControl = nil; + } + if (cppValue.triggerDetails.activationReason.HasValue()) { + if (cppValue.triggerDetails.activationReason.Value().IsNull()) { + memberValue.activationReason = nil; + } else { + memberValue.activationReason = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.triggerDetails.activationReason.Value().Value())]; + } + } else { + memberValue.activationReason = nil; + } + value.triggerDetails = 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 +5637,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..32106bc0bbccc0 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h @@ -2321,6 +2321,74 @@ MTR_PROVISIONALLY_AVAILABLE @property (nonatomic, copy) NSNumber * _Nonnull metadataOptions MTR_PROVISIONALLY_AVAILABLE; @end +MTR_PROVISIONALLY_AVAILABLE +@interface MTRPushAVStreamTransportClusterPushAVStreamTransportMotionTriggerTimeControlStruct : 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 MTRPushAVStreamTransportClusterPushAVStreamTransportMetadataOptionsStruct : 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 MTRPushAVStreamTransportClusterPushAVStreamTransportTriggerOptionsStruct : 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) MTRPushAVStreamTransportClusterPushAVStreamTransportMotionTriggerTimeControlStruct * _Nullable motionTimeControl MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable activationReason MTR_PROVISIONALLY_AVAILABLE; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRPushAVStreamTransportClusterPushAVStreamTransportCMAFContainerOptionsStruct : NSObject +@property (nonatomic, copy) NSNumber * _Nonnull chunkDuration MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSData * _Nullable cencKey MTR_PROVISIONALLY_AVAILABLE; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRPushAVStreamTransportClusterPushAVStreamTransportContainerOptionsStruct : NSObject +@property (nonatomic, copy) NSNumber * _Nonnull containerType MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) MTRPushAVStreamTransportClusterPushAVStreamTransportCMAFContainerOptionsStruct * _Nullable cmafContainerOptions MTR_PROVISIONALLY_AVAILABLE; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRPushAVStreamTransportClusterPushAVStreamTransportOptionsStruct : 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 tlsEndpointID MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSString * _Nonnull url MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) MTRPushAVStreamTransportClusterPushAVStreamTransportTriggerOptionsStruct * _Nonnull triggerOptions MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull containerFormat MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull ingestMethod MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) MTRPushAVStreamTransportClusterPushAVStreamTransportContainerOptionsStruct * _Nonnull containerOptions MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) MTRPushAVStreamTransportClusterPushAVStreamTransportMetadataOptionsStruct * _Nullable metadataOptions MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable expiryTime MTR_PROVISIONALLY_AVAILABLE; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRPushAVStreamTransportClusterPushAVStreamConfigurationStruct : NSObject +@property (nonatomic, copy) NSNumber * _Nonnull connectionID MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull streamTransportStatus MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) MTRPushAVStreamTransportClusterPushAVStreamTransportOptionsStruct * _Nonnull streamTransportOptions MTR_PROVISIONALLY_AVAILABLE; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRPushAVStreamTransportClusterPushTransportBeginEvent : NSObject +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRPushAVStreamTransportClusterPushTransportEndEvent : NSObject +@property (nonatomic, copy) NSNumber * _Nonnull connectionID MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) MTRPushAVStreamTransportClusterPushAVStreamTransportTriggerOptionsStruct * _Nonnull triggerDetails 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..8ba884ff423a27 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm @@ -9644,6 +9644,317 @@ - (NSString *)description @end +@implementation MTRPushAVStreamTransportClusterPushAVStreamTransportMotionTriggerTimeControlStruct +- (instancetype)init +{ + if (self = [super init]) { + + _initialDuration = @(0); + + _augmentationDuration = @(0); + + _maxDuration = @(0); + + _blindDuration = @(0); + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRPushAVStreamTransportClusterPushAVStreamTransportMotionTriggerTimeControlStruct 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 MTRPushAVStreamTransportClusterPushAVStreamTransportMetadataOptionsStruct +- (instancetype)init +{ + if (self = [super init]) { + + _multiplexing = @(0); + + _includeMotionZones = @(0); + + _enableMetadataPrivacySensitive = @(0); + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRPushAVStreamTransportClusterPushAVStreamTransportMetadataOptionsStruct 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 MTRPushAVStreamTransportClusterPushAVStreamTransportTriggerOptionsStruct +- (instancetype)init +{ + if (self = [super init]) { + + _triggerType = @(0); + + _motionZones = nil; + + _motionSensitivity = nil; + + _motionTimeControl = nil; + + _activationReason = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRPushAVStreamTransportClusterPushAVStreamTransportTriggerOptionsStruct alloc] init]; + + other.triggerType = self.triggerType; + other.motionZones = self.motionZones; + other.motionSensitivity = self.motionSensitivity; + other.motionTimeControl = self.motionTimeControl; + other.activationReason = self.activationReason; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: triggerType:%@; motionZones:%@; motionSensitivity:%@; motionTimeControl:%@; activationReason:%@; >", NSStringFromClass([self class]), _triggerType, _motionZones, _motionSensitivity, _motionTimeControl, _activationReason]; + return descriptionString; +} + +@end + +@implementation MTRPushAVStreamTransportClusterPushAVStreamTransportCMAFContainerOptionsStruct +- (instancetype)init +{ + if (self = [super init]) { + + _chunkDuration = @(0); + + _cencKey = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRPushAVStreamTransportClusterPushAVStreamTransportCMAFContainerOptionsStruct 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 MTRPushAVStreamTransportClusterPushAVStreamTransportContainerOptionsStruct +- (instancetype)init +{ + if (self = [super init]) { + + _containerType = @(0); + + _cmafContainerOptions = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRPushAVStreamTransportClusterPushAVStreamTransportContainerOptionsStruct 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 MTRPushAVStreamTransportClusterPushAVStreamTransportOptionsStruct +- (instancetype)init +{ + if (self = [super init]) { + + _streamType = @(0); + + _videoStreamID = nil; + + _audioStreamID = nil; + + _tlsEndpointID = @(0); + + _url = @""; + + _triggerOptions = [MTRPushAVStreamTransportClusterPushAVStreamTransportTriggerOptionsStruct new]; + + _containerFormat = @(0); + + _ingestMethod = @(0); + + _containerOptions = [MTRPushAVStreamTransportClusterPushAVStreamTransportContainerOptionsStruct new]; + + _metadataOptions = nil; + + _expiryTime = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRPushAVStreamTransportClusterPushAVStreamTransportOptionsStruct alloc] init]; + + other.streamType = self.streamType; + other.videoStreamID = self.videoStreamID; + other.audioStreamID = self.audioStreamID; + other.tlsEndpointID = self.tlsEndpointID; + other.url = self.url; + other.triggerOptions = self.triggerOptions; + other.containerFormat = self.containerFormat; + other.ingestMethod = self.ingestMethod; + other.containerOptions = self.containerOptions; + other.metadataOptions = self.metadataOptions; + other.expiryTime = self.expiryTime; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: streamType:%@; videoStreamID:%@; audioStreamID:%@; tlsEndpointID:%@; url:%@; triggerOptions:%@; containerFormat:%@; ingestMethod:%@; containerOptions:%@; metadataOptions:%@; expiryTime:%@; >", NSStringFromClass([self class]), _streamType, _videoStreamID, _audioStreamID, _tlsEndpointID, _url, _triggerOptions, _containerFormat, _ingestMethod, _containerOptions, _metadataOptions, _expiryTime]; + return descriptionString; +} + +@end + +@implementation MTRPushAVStreamTransportClusterPushAVStreamConfigurationStruct +- (instancetype)init +{ + if (self = [super init]) { + + _connectionID = @(0); + + _streamTransportStatus = @(0); + + _streamTransportOptions = [MTRPushAVStreamTransportClusterPushAVStreamTransportOptionsStruct new]; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRPushAVStreamTransportClusterPushAVStreamConfigurationStruct alloc] init]; + + other.connectionID = self.connectionID; + other.streamTransportStatus = self.streamTransportStatus; + other.streamTransportOptions = self.streamTransportOptions; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: connectionID:%@; streamTransportStatus:%@; streamTransportOptions:%@; >", NSStringFromClass([self class]), _connectionID, _streamTransportStatus, _streamTransportOptions]; + return descriptionString; +} + +@end + +@implementation MTRPushAVStreamTransportClusterPushTransportBeginEvent +- (instancetype)init +{ + if (self = [super init]) { + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRPushAVStreamTransportClusterPushTransportBeginEvent alloc] init]; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: >", NSStringFromClass([self class])]; + return descriptionString; +} + +@end + +@implementation MTRPushAVStreamTransportClusterPushTransportEndEvent +- (instancetype)init +{ + if (self = [super init]) { + + _connectionID = @(0); + + _triggerDetails = [MTRPushAVStreamTransportClusterPushAVStreamTransportTriggerOptionsStruct new]; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRPushAVStreamTransportClusterPushTransportEndEvent alloc] init]; + + other.connectionID = self.connectionID; + other.triggerDetails = self.triggerDetails; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: connectionID:%@; triggerDetails:%@; >", NSStringFromClass([self class]), _connectionID, _triggerDetails]; + 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..cc2f3ea0878227 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 @@ -11908,186 +11908,6 @@ Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) namespace DishwasherMode { namespace Attributes { -namespace StartUpMode { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable & value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::DishwasherMode::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (Traits::IsNullValue(temp)) - { - value.SetNull(); - } - else - { - value.SetNonNull() = Traits::StorageToWorking(temp); - } - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::DishwasherMode::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::DishwasherMode::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); -} - -Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType value; - Traits::SetNull(value); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::DishwasherMode::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status SetNull(EndpointId endpoint) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType value; - Traits::SetNull(value); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); - return emberAfWriteAttribute(endpoint, Clusters::DishwasherMode::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable & value, - MarkAttributeDirty markDirty) -{ - if (value.IsNull()) - { - return SetNull(endpoint, markDirty); - } - - return Set(endpoint, value.Value(), markDirty); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable & value) -{ - if (value.IsNull()) - { - return SetNull(endpoint); - } - - return Set(endpoint, value.Value()); -} - -} // namespace StartUpMode - -namespace OnMode { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable & value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::DishwasherMode::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (Traits::IsNullValue(temp)) - { - value.SetNull(); - } - else - { - value.SetNonNull() = Traits::StorageToWorking(temp); - } - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::DishwasherMode::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::DishwasherMode::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); -} - -Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType value; - Traits::SetNull(value); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::DishwasherMode::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status SetNull(EndpointId endpoint) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType value; - Traits::SetNull(value); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); - return emberAfWriteAttribute(endpoint, Clusters::DishwasherMode::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable & value, - MarkAttributeDirty markDirty) -{ - if (value.IsNull()) - { - return SetNull(endpoint, markDirty); - } - - return Set(endpoint, value.Value(), markDirty); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable & value) -{ - if (value.IsNull()) - { - return SetNull(endpoint); - } - - return Set(endpoint, value.Value()); -} - -} // namespace OnMode - namespace ClusterRevision { Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) @@ -32754,7 +32574,7 @@ Protocols::InteractionModel::Status Set(EndpointId endpoint, } // namespace OccupancySensorTypeBitmap -namespace PIRUnoccupiedToOccupiedDelay { +namespace PIROccupiedToUnoccupiedDelay { Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) { @@ -32799,13 +32619,13 @@ Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) return emberAfWriteAttribute(endpoint, Clusters::OccupancySensing::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } -} // namespace PIRUnoccupiedToOccupiedDelay +} // namespace PIROccupiedToUnoccupiedDelay -namespace PIRUnoccupiedToOccupiedThreshold { +namespace PIRUnoccupiedToOccupiedDelay { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value) +Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = @@ -32819,9 +32639,9 @@ Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value) return status; } -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -32830,12 +32650,12 @@ Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, Mark Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::OccupancySensing::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); + EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); } -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value) +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -32843,16 +32663,16 @@ Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value) Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::OccupancySensing::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::OccupancySensing::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } -} // namespace PIRUnoccupiedToOccupiedThreshold +} // namespace PIRUnoccupiedToOccupiedDelay -namespace UltrasonicUnoccupiedToOccupiedDelay { +namespace PIRUnoccupiedToOccupiedThreshold { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) +Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = @@ -32866,9 +32686,9 @@ Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) return status; } -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -32877,12 +32697,12 @@ Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, Mar Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::OccupancySensing::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); + EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); } -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -32890,16 +32710,16 @@ Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::OccupancySensing::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::OccupancySensing::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } -} // namespace UltrasonicUnoccupiedToOccupiedDelay +} // namespace PIRUnoccupiedToOccupiedThreshold -namespace UltrasonicUnoccupiedToOccupiedThreshold { +namespace UltrasonicOccupiedToUnoccupiedDelay { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value) +Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = @@ -32913,9 +32733,9 @@ Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value) return status; } -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -32924,12 +32744,12 @@ Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, Mark Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::OccupancySensing::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); + EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); } -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value) +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -32937,12 +32757,12 @@ Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value) Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::OccupancySensing::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::OccupancySensing::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } -} // namespace UltrasonicUnoccupiedToOccupiedThreshold +} // namespace UltrasonicOccupiedToUnoccupiedDelay -namespace PhysicalContactUnoccupiedToOccupiedDelay { +namespace UltrasonicUnoccupiedToOccupiedDelay { Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) { @@ -32987,9 +32807,9 @@ Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) return emberAfWriteAttribute(endpoint, Clusters::OccupancySensing::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } -} // namespace PhysicalContactUnoccupiedToOccupiedDelay +} // namespace UltrasonicUnoccupiedToOccupiedDelay -namespace PhysicalContactUnoccupiedToOccupiedThreshold { +namespace UltrasonicUnoccupiedToOccupiedThreshold { Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value) { @@ -33034,9 +32854,9 @@ Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value) return emberAfWriteAttribute(endpoint, Clusters::OccupancySensing::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } -} // namespace PhysicalContactUnoccupiedToOccupiedThreshold +} // namespace UltrasonicUnoccupiedToOccupiedThreshold -namespace ClusterRevision { +namespace PhysicalContactOccupiedToUnoccupiedDelay { Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) { @@ -33081,15 +32901,9 @@ Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) return emberAfWriteAttribute(endpoint, Clusters::OccupancySensing::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } -} // namespace ClusterRevision - -} // namespace Attributes -} // namespace OccupancySensing - -namespace CarbonMonoxideConcentrationMeasurement { -namespace Attributes { +} // namespace PhysicalContactOccupiedToUnoccupiedDelay -namespace ClusterRevision { +namespace PhysicalContactUnoccupiedToOccupiedDelay { Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) { @@ -33097,7 +32911,154 @@ Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::CarbonMonoxideConcentrationMeasurement::Id, Id, readable, sizeof(temp)); + emberAfReadAttribute(endpoint, Clusters::OccupancySensing::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::OccupancySensing::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::OccupancySensing::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); +} + +} // namespace PhysicalContactUnoccupiedToOccupiedDelay + +namespace PhysicalContactUnoccupiedToOccupiedThreshold { + +Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = + emberAfReadAttribute(endpoint, Clusters::OccupancySensing::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, uint8_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::OccupancySensing::Id, Id), + EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_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::OccupancySensing::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); +} + +} // namespace PhysicalContactUnoccupiedToOccupiedThreshold + +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::OccupancySensing::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::OccupancySensing::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::OccupancySensing::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); +} + +} // namespace ClusterRevision + +} // namespace Attributes +} // namespace OccupancySensing + +namespace CarbonMonoxideConcentrationMeasurement { +namespace Attributes { + +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::CarbonMonoxideConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { @@ -36821,11 +36782,13 @@ Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value) } // namespace MaxEncodedPixelRate -namespace NightVisionCapable { +#error Attribute "VideoSensorParams" in cluster "Camera AV Stream Management" is struct-typed and must be added to the attributeAccessInterfaceAttributes object in src/app/zap-templates/zcl/zcl.json and src/app/zap-templates/zcl/zcl-with-test-extensions.json +namespace VideoSensorParams { -Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value) +Protocols::InteractionModel::Status +Get(EndpointId endpoint, chip::app::Clusters::CameraAvStreamManagement::Structs::VideoSensorParamsStruct::Type * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = @@ -36839,9 +36802,11 @@ Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value) return status; } -Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(EndpointId endpoint, + chip::app::Clusters::CameraAvStreamManagement::Structs::VideoSensorParamsStruct::Type value, + MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -36850,12 +36815,13 @@ Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAtt Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::CameraAvStreamManagement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); + EmberAfWriteDataInput(writable, ZCL__ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); } -Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value) +Protocols::InteractionModel::Status Set(EndpointId endpoint, + chip::app::Clusters::CameraAvStreamManagement::Structs::VideoSensorParamsStruct::Type value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -36863,16 +36829,16 @@ Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value) Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, writable, ZCL__ATTRIBUTE_TYPE); } -} // namespace NightVisionCapable +} // namespace VideoSensorParams -namespace MaxContentBufferSize { +namespace NightVisionCapable { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value) +Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = @@ -36886,9 +36852,9 @@ Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value) return status; } -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -36897,12 +36863,12 @@ Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, Mar Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::CameraAvStreamManagement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT32U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); + EmberAfWriteDataInput(writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); } -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value) +Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -36910,17 +36876,18 @@ Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value) Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } -} // namespace MaxContentBufferSize +} // namespace NightVisionCapable -namespace TwoWayTalkSupport { +#error Attribute "MinViewport" in cluster "Camera AV Stream Management" is struct-typed and must be added to the attributeAccessInterfaceAttributes object in src/app/zap-templates/zcl/zcl.json and src/app/zap-templates/zcl/zcl-with-test-extensions.json +namespace MinViewport { Protocols::InteractionModel::Status Get(EndpointId endpoint, - chip::app::Clusters::CameraAvStreamManagement::TwoWayTalkSupportTypeEnum * value) + chip::app::Clusters::CameraAvStreamManagement::Structs::VideoResolutionStruct::Type * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = @@ -36935,10 +36902,10 @@ Protocols::InteractionModel::Status Get(EndpointId endpoint, } Protocols::InteractionModel::Status Set(EndpointId endpoint, - chip::app::Clusters::CameraAvStreamManagement::TwoWayTalkSupportTypeEnum value, + chip::app::Clusters::CameraAvStreamManagement::Structs::VideoResolutionStruct::Type value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -36947,13 +36914,13 @@ Protocols::InteractionModel::Status Set(EndpointId endpoint, Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::CameraAvStreamManagement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_ENUM8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); + EmberAfWriteDataInput(writable, ZCL__ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); } Protocols::InteractionModel::Status Set(EndpointId endpoint, - chip::app::Clusters::CameraAvStreamManagement::TwoWayTalkSupportTypeEnum value) + chip::app::Clusters::CameraAvStreamManagement::Structs::VideoResolutionStruct::Type value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -36961,12 +36928,12 @@ Protocols::InteractionModel::Status Set(EndpointId endpoint, Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, writable, ZCL__ATTRIBUTE_TYPE); } -} // namespace TwoWayTalkSupport +} // namespace MinViewport -namespace MaxNetworkBandwidth { +namespace MaxContentBufferSize { Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value) { @@ -37011,13 +36978,15 @@ Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value) return emberAfWriteAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } -} // namespace MaxNetworkBandwidth +} // namespace MaxContentBufferSize -namespace CurrentFrameRate { +#error Attribute "MicrophoneCapabilities" in cluster "Camera AV Stream Management" is struct-typed and must be added to the attributeAccessInterfaceAttributes object in src/app/zap-templates/zcl/zcl.json and src/app/zap-templates/zcl/zcl-with-test-extensions.json +namespace MicrophoneCapabilities { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) +Protocols::InteractionModel::Status +Get(EndpointId endpoint, chip::app::Clusters::CameraAvStreamManagement::Structs::AudioCapabilitiesStruct::Type * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = @@ -37031,9 +37000,11 @@ Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) return status; } -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(EndpointId endpoint, + chip::app::Clusters::CameraAvStreamManagement::Structs::AudioCapabilitiesStruct::Type value, + MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -37042,12 +37013,13 @@ Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, Mar Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::CameraAvStreamManagement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); + EmberAfWriteDataInput(writable, ZCL__ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); } -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) +Protocols::InteractionModel::Status Set(EndpointId endpoint, + chip::app::Clusters::CameraAvStreamManagement::Structs::AudioCapabilitiesStruct::Type value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -37055,16 +37027,18 @@ Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, writable, ZCL__ATTRIBUTE_TYPE); } -} // namespace CurrentFrameRate +} // namespace MicrophoneCapabilities -namespace HDRModeEnabled { +#error Attribute "SpeakerCapabilities" in cluster "Camera AV Stream Management" is struct-typed and must be added to the attributeAccessInterfaceAttributes object in src/app/zap-templates/zcl/zcl.json and src/app/zap-templates/zcl/zcl-with-test-extensions.json +namespace SpeakerCapabilities { -Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value) +Protocols::InteractionModel::Status +Get(EndpointId endpoint, chip::app::Clusters::CameraAvStreamManagement::Structs::AudioCapabilitiesStruct::Type * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = @@ -37078,9 +37052,11 @@ Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value) return status; } -Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(EndpointId endpoint, + chip::app::Clusters::CameraAvStreamManagement::Structs::AudioCapabilitiesStruct::Type value, + MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -37089,12 +37065,13 @@ Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAtt Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::CameraAvStreamManagement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); + EmberAfWriteDataInput(writable, ZCL__ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); } -Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value) +Protocols::InteractionModel::Status Set(EndpointId endpoint, + chip::app::Clusters::CameraAvStreamManagement::Structs::AudioCapabilitiesStruct::Type value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -37102,16 +37079,17 @@ Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value) Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, writable, ZCL__ATTRIBUTE_TYPE); } -} // namespace HDRModeEnabled +} // namespace SpeakerCapabilities -namespace SoftRecordingPrivacyModeEnabled { +namespace TwoWayTalkSupport { -Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value) +Protocols::InteractionModel::Status Get(EndpointId endpoint, + chip::app::Clusters::CameraAvStreamManagement::TwoWayTalkSupportTypeEnum * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = @@ -37125,9 +37103,11 @@ Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value) return status; } -Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(EndpointId endpoint, + chip::app::Clusters::CameraAvStreamManagement::TwoWayTalkSupportTypeEnum value, + MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -37136,12 +37116,13 @@ Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAtt Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::CameraAvStreamManagement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); + EmberAfWriteDataInput(writable, ZCL_ENUM8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); } -Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value) +Protocols::InteractionModel::Status Set(EndpointId endpoint, + chip::app::Clusters::CameraAvStreamManagement::TwoWayTalkSupportTypeEnum value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -37149,16 +37130,16 @@ Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value) Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } -} // namespace SoftRecordingPrivacyModeEnabled +} // namespace TwoWayTalkSupport -namespace SoftLivestreamPrivacyModeEnabled { +namespace MaxNetworkBandwidth { -Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value) +Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = @@ -37172,9 +37153,197 @@ Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value) return status; } -Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + 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::CameraAvStreamManagement::Id, Id), + EmberAfWriteDataInput(writable, ZCL_INT32U_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::CameraAvStreamManagement::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); +} + +} // namespace MaxNetworkBandwidth + +namespace CurrentFrameRate { + +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::CameraAvStreamManagement::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::CameraAvStreamManagement::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::CameraAvStreamManagement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); +} + +} // namespace CurrentFrameRate + +namespace HDRModeEnabled { + +Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = + emberAfReadAttribute(endpoint, Clusters::CameraAvStreamManagement::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, bool 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::CameraAvStreamManagement::Id, Id), + EmberAfWriteDataInput(writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, bool 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::CameraAvStreamManagement::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); +} + +} // namespace HDRModeEnabled + +namespace SoftRecordingPrivacyModeEnabled { + +Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = + emberAfReadAttribute(endpoint, Clusters::CameraAvStreamManagement::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, bool 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::CameraAvStreamManagement::Id, Id), + EmberAfWriteDataInput(writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, bool 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::CameraAvStreamManagement::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); +} + +} // namespace SoftRecordingPrivacyModeEnabled + +namespace SoftLivestreamPrivacyModeEnabled { + +Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = + emberAfReadAttribute(endpoint, Clusters::CameraAvStreamManagement::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, bool value, MarkAttributeDirty markDirty) +{ + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -37346,6 +37515,58 @@ Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters } // namespace NightVisionIllum +#error Attribute "Viewport" in cluster "Camera AV Stream Management" is struct-typed and must be added to the attributeAccessInterfaceAttributes object in src/app/zap-templates/zcl/zcl.json and src/app/zap-templates/zcl/zcl-with-test-extensions.json +namespace Viewport { + +Protocols::InteractionModel::Status Get(EndpointId endpoint, + chip::app::Clusters::CameraAvStreamManagement::Structs::ViewportStruct::Type * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = + emberAfReadAttribute(endpoint, Clusters::CameraAvStreamManagement::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::app::Clusters::CameraAvStreamManagement::Structs::ViewportStruct::Type 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::CameraAvStreamManagement::Id, Id), + EmberAfWriteDataInput(writable, ZCL__ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, + chip::app::Clusters::CameraAvStreamManagement::Structs::ViewportStruct::Type 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::CameraAvStreamManagement::Id, Id, writable, ZCL__ATTRIBUTE_TYPE); +} + +} // namespace Viewport + namespace SpeakerMuted { Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value) @@ -38396,9 +38617,315 @@ 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< + chip::BitMask>; + 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< + chip::BitMask>; + 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< + chip::BitMask>; + 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< + chip::BitMask>; + 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< + chip::BitMask>; + 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< + chip::BitMask>; + 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 { +namespace ActiveChimeID { + +Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Chime::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, uint8_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::Chime::Id, Id), + EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_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::Chime::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); +} + +} // namespace ActiveChimeID + +namespace Enabled { + +Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Chime::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, bool 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::Chime::Id, Id), + EmberAfWriteDataInput(writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, bool 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::Chime::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); +} + +} // namespace Enabled + namespace FeatureMap { Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value) 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..1e4c8fdf7b399d 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 @@ -1870,28 +1870,6 @@ Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, Mar namespace DishwasherMode { namespace Attributes { -namespace StartUpMode { -Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable & value); // int8u -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty); -Protocols::InteractionModel::Status SetNull(EndpointId endpoint); -Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty); -Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable & value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable & value, - MarkAttributeDirty markDirty); -} // namespace StartUpMode - -namespace OnMode { -Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable & value); // int8u -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty); -Protocols::InteractionModel::Status SetNull(EndpointId endpoint); -Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty); -Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable & value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable & value, - MarkAttributeDirty markDirty); -} // namespace OnMode - namespace ClusterRevision { Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value); // int16u Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value); @@ -4913,6 +4891,12 @@ Protocols::InteractionModel::Status Set(EndpointId endpoint, MarkAttributeDirty markDirty); } // namespace OccupancySensorTypeBitmap +namespace PIROccupiedToUnoccupiedDelay { +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 PIROccupiedToUnoccupiedDelay + namespace PIRUnoccupiedToOccupiedDelay { Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value); // int16u Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value); @@ -4925,6 +4909,12 @@ Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value); Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty); } // namespace PIRUnoccupiedToOccupiedThreshold +namespace UltrasonicOccupiedToUnoccupiedDelay { +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 UltrasonicOccupiedToUnoccupiedDelay + namespace UltrasonicUnoccupiedToOccupiedDelay { Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value); // int16u Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value); @@ -4937,6 +4927,12 @@ Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value); Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty); } // namespace UltrasonicUnoccupiedToOccupiedThreshold +namespace PhysicalContactOccupiedToUnoccupiedDelay { +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 PhysicalContactOccupiedToUnoccupiedDelay + namespace PhysicalContactUnoccupiedToOccupiedDelay { Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value); // int16u Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value); @@ -5590,18 +5586,62 @@ Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value); Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty); } // namespace MaxEncodedPixelRate +namespace VideoSensorParams { +Protocols::InteractionModel::Status +Get(EndpointId endpoint, + chip::app::Clusters::CameraAvStreamManagement::Structs::VideoSensorParamsStruct::Type * value); // VideoSensorParamsStruct +Protocols::InteractionModel::Status +Set(EndpointId endpoint, chip::app::Clusters::CameraAvStreamManagement::Structs::VideoSensorParamsStruct::Type value); +Protocols::InteractionModel::Status Set(EndpointId endpoint, + chip::app::Clusters::CameraAvStreamManagement::Structs::VideoSensorParamsStruct::Type value, + MarkAttributeDirty markDirty); +} // namespace VideoSensorParams + namespace NightVisionCapable { Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value); // boolean Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value); Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty); } // namespace NightVisionCapable +namespace MinViewport { +Protocols::InteractionModel::Status +Get(EndpointId endpoint, + chip::app::Clusters::CameraAvStreamManagement::Structs::VideoResolutionStruct::Type * value); // VideoResolutionStruct +Protocols::InteractionModel::Status Set(EndpointId endpoint, + chip::app::Clusters::CameraAvStreamManagement::Structs::VideoResolutionStruct::Type value); +Protocols::InteractionModel::Status Set(EndpointId endpoint, + chip::app::Clusters::CameraAvStreamManagement::Structs::VideoResolutionStruct::Type value, + MarkAttributeDirty markDirty); +} // namespace MinViewport + namespace MaxContentBufferSize { Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value); // int32u Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value); Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty); } // namespace MaxContentBufferSize +namespace MicrophoneCapabilities { +Protocols::InteractionModel::Status +Get(EndpointId endpoint, + chip::app::Clusters::CameraAvStreamManagement::Structs::AudioCapabilitiesStruct::Type * value); // AudioCapabilitiesStruct +Protocols::InteractionModel::Status +Set(EndpointId endpoint, chip::app::Clusters::CameraAvStreamManagement::Structs::AudioCapabilitiesStruct::Type value); +Protocols::InteractionModel::Status Set(EndpointId endpoint, + chip::app::Clusters::CameraAvStreamManagement::Structs::AudioCapabilitiesStruct::Type value, + MarkAttributeDirty markDirty); +} // namespace MicrophoneCapabilities + +namespace SpeakerCapabilities { +Protocols::InteractionModel::Status +Get(EndpointId endpoint, + chip::app::Clusters::CameraAvStreamManagement::Structs::AudioCapabilitiesStruct::Type * value); // AudioCapabilitiesStruct +Protocols::InteractionModel::Status +Set(EndpointId endpoint, chip::app::Clusters::CameraAvStreamManagement::Structs::AudioCapabilitiesStruct::Type value); +Protocols::InteractionModel::Status Set(EndpointId endpoint, + chip::app::Clusters::CameraAvStreamManagement::Structs::AudioCapabilitiesStruct::Type value, + MarkAttributeDirty markDirty); +} // namespace SpeakerCapabilities + namespace TwoWayTalkSupport { Protocols::InteractionModel::Status Get(EndpointId endpoint, @@ -5665,6 +5705,16 @@ Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters MarkAttributeDirty markDirty); } // namespace NightVisionIllum +namespace Viewport { +Protocols::InteractionModel::Status +Get(EndpointId endpoint, chip::app::Clusters::CameraAvStreamManagement::Structs::ViewportStruct::Type * value); // ViewportStruct +Protocols::InteractionModel::Status Set(EndpointId endpoint, + chip::app::Clusters::CameraAvStreamManagement::Structs::ViewportStruct::Type value); +Protocols::InteractionModel::Status Set(EndpointId endpoint, + chip::app::Clusters::CameraAvStreamManagement::Structs::ViewportStruct::Type value, + MarkAttributeDirty markDirty); +} // namespace Viewport + namespace SpeakerMuted { Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value); // boolean Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value); @@ -5814,9 +5864,67 @@ 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); // PushAVStreamTransportSupportedContainerFormatsBitmap +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); // PushAVStreamTransportSupportedIngestMethodsBitmap +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 { +namespace ActiveChimeID { +Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value); // int8u +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value); +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty); +} // namespace ActiveChimeID + +namespace Enabled { +Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value); // boolean +Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value); +Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty); +} // namespace Enabled + namespace FeatureMap { Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value); // bitmap32 Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value); 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..c180eb8426b45b 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 FindStreamConfiguration Command callback (from client) + */ +bool emberAfPushAvStreamTransportClusterFindStreamConfigurationCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::PushAvStreamTransport::Commands::FindStreamConfiguration::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..1a1243b434fe82 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,98 @@ static auto __attribute__((unused)) EnsureKnownEnumValue(CameraAvStreamManagemen } } +static auto __attribute__((unused)) EnsureKnownEnumValue(PushAvStreamTransport::PushAVStreamTransportContainerFormatEnum val) +{ + using EnumType = PushAvStreamTransport::PushAVStreamTransportContainerFormatEnum; + switch (val) + { + case EnumType::kCmaf: + return val; + default: + return EnumType::kUnknownEnumValue; + } +} +static auto __attribute__((unused)) EnsureKnownEnumValue(PushAvStreamTransport::PushAVStreamTransportIngestMethodEnum val) +{ + using EnumType = PushAvStreamTransport::PushAVStreamTransportIngestMethodEnum; + switch (val) + { + case EnumType::kCMAFIngest: + return val; + default: + return EnumType::kUnknownEnumValue; + } +} +static auto __attribute__((unused)) EnsureKnownEnumValue(PushAvStreamTransport::PushAVStreamTransportStatusEnum val) +{ + using EnumType = PushAvStreamTransport::PushAVStreamTransportStatusEnum; + switch (val) + { + case EnumType::kActive: + case EnumType::kInactive: + return val; + default: + return EnumType::kUnknownEnumValue; + } +} +static auto __attribute__((unused)) EnsureKnownEnumValue(PushAvStreamTransport::PushAVStreamTransportStreamMultiplexingEnum val) +{ + using EnumType = PushAvStreamTransport::PushAVStreamTransportStreamMultiplexingEnum; + switch (val) + { + case EnumType::kInterleaved: + return val; + default: + return EnumType::kUnknownEnumValue; + } +} +static auto __attribute__((unused)) +EnsureKnownEnumValue(PushAvStreamTransport::PushAVStreamTransportTriggerActivationReasonEnum val) +{ + using EnumType = PushAvStreamTransport::PushAVStreamTransportTriggerActivationReasonEnum; + switch (val) + { + case EnumType::kUserInitiated: + case EnumType::kAutomation: + case EnumType::kEmergency: + return val; + default: + return EnumType::kUnknownEnumValue; + } +} +static auto __attribute__((unused)) EnsureKnownEnumValue(PushAvStreamTransport::PushAVStreamTransportTriggerTypeEnum val) +{ + using EnumType = PushAvStreamTransport::PushAVStreamTransportTriggerTypeEnum; + switch (val) + { + case EnumType::kCommand: + case EnumType::kMotion: + case EnumType::kContinuous: + 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::kInvalidParameters: + case EnumType::kInvalidUrl: + case EnumType::kInvalidTriggerOptions: + case EnumType::kUnsupportedContainerFormat: + case EnumType::kUnsupportedIngestMethod: + case EnumType::kPavstNotInUse: + case EnumType::kInvalidTriggerFormat: + case EnumType::kInvalidTransportStatus: + 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..643f3f503cbe13 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,113 @@ using WebRTCEndReasonEnum = Clusters::detail::WebRTCEndReasonEnum; using WebRTCMetadataOptions = Clusters::detail::WebRTCMetadataOptions; } // namespace WebRTCTransportRequestor +namespace PushAvStreamTransport { + +// Enum for PushAVStreamTransportContainerFormatEnum +enum class PushAVStreamTransportContainerFormatEnum : 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 PushAVStreamTransportIngestMethodEnum +enum class PushAVStreamTransportIngestMethodEnum : 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 PushAVStreamTransportStatusEnum +enum class PushAVStreamTransportStatusEnum : 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 PushAVStreamTransportStreamMultiplexingEnum +enum class PushAVStreamTransportStreamMultiplexingEnum : 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, +}; + +// Enum for PushAVStreamTransportTriggerActivationReasonEnum +enum class PushAVStreamTransportTriggerActivationReasonEnum : 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, +}; + +// Enum for PushAVStreamTransportTriggerTypeEnum +enum class PushAVStreamTransportTriggerTypeEnum : 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 StatusCodeEnum +enum class StatusCodeEnum : uint8_t +{ + kAllocationNotPermitted = 0x02, + kInvalidParameters = 0x03, + kInvalidUrl = 0x04, + kInvalidTriggerOptions = 0x05, + kUnsupportedContainerFormat = 0x06, + kUnsupportedIngestMethod = 0x07, + kPavstNotInUse = 0x08, + kInvalidTriggerFormat = 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, +}; + +using StreamTypeEnum = Clusters::detail::StreamTypeEnum; + +// Bitmap for PushAVStreamTransportSupportedContainerFormatsBitmap +enum class PushAVStreamTransportSupportedContainerFormatsBitmap : uint8_t +{ + kCmaf = 0x1, +}; + +// Bitmap for PushAVStreamTransportSupportedIngestMethodsBitmap +enum class PushAVStreamTransportSupportedIngestMethodsBitmap : 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..1bb3e056f80ee2 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,774 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre namespace Events {} // namespace Events } // namespace WebRTCTransportRequestor +namespace PushAvStreamTransport { +namespace Structs { + +namespace PushAVStreamTransportMotionTriggerTimeControlStruct { +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 PushAVStreamTransportMotionTriggerTimeControlStruct + +namespace PushAVStreamTransportMetadataOptionsStruct { +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 PushAVStreamTransportMetadataOptionsStruct + +namespace PushAVStreamTransportTriggerOptionsStruct { +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::kActivationReason), activationReason); + 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::kActivationReason)) + { + err = DataModel::Decode(reader, activationReason); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} + +} // namespace PushAVStreamTransportTriggerOptionsStruct + +namespace PushAVStreamTransportCMAFContainerOptionsStruct { +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 PushAVStreamTransportCMAFContainerOptionsStruct + +namespace PushAVStreamTransportContainerOptionsStruct { +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 PushAVStreamTransportContainerOptionsStruct + +namespace PushAVStreamTransportOptionsStruct { +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::kTLSEndpointID), TLSEndpointID); + encoder.Encode(to_underlying(Fields::kUrl), url); + encoder.Encode(to_underlying(Fields::kTriggerOptions), triggerOptions); + encoder.Encode(to_underlying(Fields::kContainerFormat), containerFormat); + encoder.Encode(to_underlying(Fields::kIngestMethod), ingestMethod); + 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::kTLSEndpointID)) + { + err = DataModel::Decode(reader, TLSEndpointID); + } + 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::kContainerFormat)) + { + err = DataModel::Decode(reader, containerFormat); + } + else if (__context_tag == to_underlying(Fields::kIngestMethod)) + { + err = DataModel::Decode(reader, ingestMethod); + } + 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 PushAVStreamTransportOptionsStruct + +namespace PushAVStreamConfigurationStruct { +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::kStreamTransportStatus), streamTransportStatus); + encoder.Encode(to_underlying(Fields::kStreamTransportOptions), streamTransportOptions); + 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::kStreamTransportStatus)) + { + err = DataModel::Decode(reader, streamTransportStatus); + } + else if (__context_tag == to_underlying(Fields::kStreamTransportOptions)) + { + err = DataModel::Decode(reader, streamTransportOptions); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} + +} // namespace PushAVStreamConfigurationStruct +} // 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::kStreamTransportOptions), streamTransportOptions); + 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::kStreamTransportOptions)) + { + err = DataModel::Decode(reader, streamTransportOptions); + } + 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::kStreamTransportOptions), streamTransportOptions); + 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::kStreamTransportOptions)) + { + err = DataModel::Decode(reader, streamTransportOptions); + } + 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::kStreamTransportOptions), streamTransportOptions); + 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::kStreamTransportOptions)) + { + err = DataModel::Decode(reader, streamTransportOptions); + } + 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::kStreamTransportStatus), streamTransportStatus); + 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::kStreamTransportStatus)) + { + err = DataModel::Decode(reader, streamTransportStatus); + } + 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 FindStreamConfiguration { +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 FindStreamConfiguration. +namespace FindStreamConfigurationResponse { +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 FindStreamConfigurationResponse. +} // 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)); + 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); + } + } +} +} // 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::kTriggerDetails), triggerDetails)); + 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::kTriggerDetails)) + { + err = DataModel::Decode(reader, triggerDetails); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace PushTransportEnd. +} // namespace Events + +} // namespace PushAvStreamTransport namespace Chime { namespace Structs { @@ -34919,6 +35687,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..2447fe93fbbd2c 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,696 @@ struct TypeInfo }; } // namespace Attributes } // namespace WebRTCTransportRequestor +namespace PushAvStreamTransport { +namespace Structs { +namespace PushAVStreamTransportMotionTriggerTimeControlStruct { +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 PushAVStreamTransportMotionTriggerTimeControlStruct +namespace PushAVStreamTransportMetadataOptionsStruct { +enum class Fields : uint8_t +{ + kMultiplexing = 0, + kIncludeMotionZones = 1, + kEnableMetadataPrivacySensitive = 2, +}; + +struct Type +{ +public: + PushAVStreamTransportStreamMultiplexingEnum 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 PushAVStreamTransportMetadataOptionsStruct +namespace PushAVStreamTransportTriggerOptionsStruct { +enum class Fields : uint8_t +{ + kTriggerType = 0, + kMotionZones = 1, + kMotionSensitivity = 2, + kMotionTimeControl = 3, + kActivationReason = 4, +}; + +struct Type +{ +public: + PushAVStreamTransportTriggerTypeEnum triggerType = static_cast(0); + Optional>> motionZones; + Optional> motionSensitivity; + Optional> motionTimeControl; + Optional> activationReason; + + static constexpr bool kIsFabricScoped = false; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; +}; + +struct DecodableType +{ +public: + PushAVStreamTransportTriggerTypeEnum triggerType = static_cast(0); + Optional>> motionZones; + Optional> motionSensitivity; + Optional> motionTimeControl; + Optional> activationReason; + + CHIP_ERROR Decode(TLV::TLVReader & reader); + + static constexpr bool kIsFabricScoped = false; +}; + +} // namespace PushAVStreamTransportTriggerOptionsStruct +namespace PushAVStreamTransportCMAFContainerOptionsStruct { +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 PushAVStreamTransportCMAFContainerOptionsStruct +namespace PushAVStreamTransportContainerOptionsStruct { +enum class Fields : uint8_t +{ + kContainerType = 0, + kCMAFContainerOptions = 1, +}; + +struct Type +{ +public: + PushAVStreamTransportContainerFormatEnum 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 PushAVStreamTransportContainerOptionsStruct +namespace PushAVStreamTransportOptionsStruct { +enum class Fields : uint8_t +{ + kStreamType = 0, + kVideoStreamID = 1, + kAudioStreamID = 2, + kTLSEndpointID = 3, + kUrl = 4, + kTriggerOptions = 5, + kContainerFormat = 6, + kIngestMethod = 7, + kContainerOptions = 8, + kMetadataOptions = 9, + kExpiryTime = 10, +}; + +struct Type +{ +public: + StreamTypeEnum streamType = static_cast(0); + Optional> videoStreamID; + Optional> audioStreamID; + uint16_t TLSEndpointID = static_cast(0); + chip::CharSpan url; + Structs::PushAVStreamTransportTriggerOptionsStruct::Type triggerOptions; + PushAVStreamTransportContainerFormatEnum containerFormat = static_cast(0); + PushAVStreamTransportIngestMethodEnum ingestMethod = static_cast(0); + Structs::PushAVStreamTransportContainerOptionsStruct::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 PushAVStreamTransportOptionsStruct +namespace PushAVStreamConfigurationStruct { +enum class Fields : uint8_t +{ + kConnectionID = 0, + kStreamTransportStatus = 1, + kStreamTransportOptions = 2, +}; + +struct Type +{ +public: + uint16_t connectionID = static_cast(0); + PushAVStreamTransportStatusEnum streamTransportStatus = static_cast(0); + Structs::PushAVStreamTransportOptionsStruct::Type streamTransportOptions; + + 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 PushAVStreamConfigurationStruct +} // 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 FindStreamConfiguration { +struct Type; +struct DecodableType; +} // namespace FindStreamConfiguration + +namespace FindStreamConfigurationResponse { +struct Type; +struct DecodableType; +} // namespace FindStreamConfigurationResponse + +} // namespace Commands + +namespace Commands { +namespace AllocatePushTransport { +enum class Fields : uint8_t +{ + kStreamTransportOptions = 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::PushAVStreamTransportOptionsStruct::Type streamTransportOptions; + + 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::PushAVStreamTransportOptionsStruct::DecodableType streamTransportOptions; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace AllocatePushTransport +namespace AllocatePushTransportResponse { +enum class Fields : uint8_t +{ + kConnectionID = 0, + kStreamTransportOptions = 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::PushAVStreamTransportOptionsStruct::Type streamTransportOptions; + PushAVStreamTransportStatusEnum 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::PushAVStreamTransportOptionsStruct::DecodableType streamTransportOptions; + PushAVStreamTransportStatusEnum 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, + kStreamTransportOptions = 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::PushAVStreamTransportOptionsStruct::Type streamTransportOptions; + + 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::PushAVStreamTransportOptionsStruct::DecodableType streamTransportOptions; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace ModifyPushTransport +namespace SetTransportStatus { +enum class Fields : uint8_t +{ + kConnectionID = 0, + kStreamTransportStatus = 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; } + + DataModel::Nullable connectionID; + PushAVStreamTransportStatusEnum streamTransportStatus = 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; } + + DataModel::Nullable connectionID; + PushAVStreamTransportStatusEnum streamTransportStatus = 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); + DataModel::Nullable activationReason; + 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); + DataModel::Nullable activationReason; + Optional> timeControl; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace ManuallyTriggerTransport +namespace FindStreamConfiguration { +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::FindStreamConfiguration::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::FindStreamConfigurationResponse::DecodableType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::FindStreamConfiguration::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PushAvStreamTransport::Id; } + + Optional> connectionID; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace FindStreamConfiguration +namespace FindStreamConfigurationResponse { +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::FindStreamConfigurationResponse::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::FindStreamConfigurationResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PushAvStreamTransport::Id; } + + DataModel::DecodableList streamConfigurations; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace FindStreamConfigurationResponse +} // 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< + chip::BitMask>(0); + Attributes::SupportedIngestMethods::TypeInfo::DecodableType supportedIngestMethods = static_cast< + chip::BitMask>(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 +{ +}; + +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; + + 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; } + + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +} // namespace PushTransportBegin +namespace PushTransportEnd { +static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; + +enum class Fields : uint8_t +{ + kConnectionID = 0, + kTriggerDetails = 1, +}; + +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); + Structs::PushAVStreamTransportTriggerOptionsStruct::Type triggerDetails; + + 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); + Structs::PushAVStreamTransportTriggerOptionsStruct::DecodableType triggerDetails; + + 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..c1006f29449c0b 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 FindStreamConfiguration { +static constexpr CommandId Id = 0x00000006; +} // namespace FindStreamConfiguration + +namespace FindStreamConfigurationResponse { +static constexpr CommandId Id = 0x00000007; +} // namespace FindStreamConfigurationResponse + +} // 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..6dfc357f1188c2 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,273 @@ 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 | +| * FindStreamConfiguration | 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_StreamTransportOptions(&mRequest.streamTransportOptions) + { + AddArgument("StreamTransportOptions", &mComplex_StreamTransportOptions); + 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_StreamTransportOptions; +}; + +/* + * 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_StreamTransportOptions(&mRequest.streamTransportOptions) + { + AddArgument("ConnectionID", 0, UINT16_MAX, &mRequest.connectionID); + AddArgument("StreamTransportOptions", &mComplex_StreamTransportOptions); + 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_StreamTransportOptions; +}; + +/* + * Command SetTransportStatus + */ +class PushAvStreamTransportSetTransportStatus : public ClusterCommand +{ +public: + PushAvStreamTransportSetTransportStatus(CredentialIssuerCommands * credsIssuerConfig) : + ClusterCommand("set-transport-status", credsIssuerConfig) + { + AddArgument("ConnectionID", 0, UINT16_MAX, &mRequest.connectionID); + AddArgument("StreamTransportStatus", 0, UINT8_MAX, &mRequest.streamTransportStatus); + 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>> + mComplex_TimeControl; +}; + +/* + * Command FindStreamConfiguration + */ +class PushAvStreamTransportFindStreamConfiguration : public ClusterCommand +{ +public: + PushAvStreamTransportFindStreamConfiguration(CredentialIssuerCommands * credsIssuerConfig) : + ClusterCommand("find-stream-configuration", 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::FindStreamConfiguration::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::FindStreamConfiguration::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::FindStreamConfiguration::Type mRequest; +}; + /*----------------------------------------------------------------------------*\ | Cluster Chime | 0x0556 | |------------------------------------------------------------------------------| @@ -27103,6 +27371,82 @@ 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 +28355,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..e3af1bef11b8bf 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp @@ -6477,6 +6477,374 @@ void ComplexArgumentParser::Finalize( ComplexArgumentParser::Finalize(request.maxHDRFPS); } +CHIP_ERROR ComplexArgumentParser::Setup( + const char * label, + chip::app::Clusters::PushAvStreamTransport::Structs::PushAVStreamTransportMotionTriggerTimeControlStruct::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("PushAVStreamTransportMotionTriggerTimeControlStruct.initialDuration", + "initialDuration", value.isMember("initialDuration"))); + ReturnErrorOnFailure( + ComplexArgumentParser::EnsureMemberExist("PushAVStreamTransportMotionTriggerTimeControlStruct.augmentationDuration", + "augmentationDuration", value.isMember("augmentationDuration"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("PushAVStreamTransportMotionTriggerTimeControlStruct.maxDuration", + "maxDuration", value.isMember("maxDuration"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist( + "PushAVStreamTransportMotionTriggerTimeControlStruct.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::PushAVStreamTransportMotionTriggerTimeControlStruct::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::PushAVStreamTransportMetadataOptionsStruct::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("PushAVStreamTransportMetadataOptionsStruct.multiplexing", + "multiplexing", value.isMember("multiplexing"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("PushAVStreamTransportMetadataOptionsStruct.includeMotionZones", + "includeMotionZones", value.isMember("includeMotionZones"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist( + "PushAVStreamTransportMetadataOptionsStruct.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::PushAVStreamTransportMetadataOptionsStruct::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::PushAVStreamTransportTriggerOptionsStruct::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("PushAVStreamTransportTriggerOptionsStruct.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("activationReason")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "activationReason"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.activationReason, value["activationReason"])); + } + valueCopy.removeMember("activationReason"); + + return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); +} + +void ComplexArgumentParser::Finalize( + chip::app::Clusters::PushAvStreamTransport::Structs::PushAVStreamTransportTriggerOptionsStruct::Type & request) +{ + ComplexArgumentParser::Finalize(request.triggerType); + ComplexArgumentParser::Finalize(request.motionZones); + ComplexArgumentParser::Finalize(request.motionSensitivity); + ComplexArgumentParser::Finalize(request.motionTimeControl); + ComplexArgumentParser::Finalize(request.activationReason); +} + +CHIP_ERROR ComplexArgumentParser::Setup( + const char * label, + chip::app::Clusters::PushAvStreamTransport::Structs::PushAVStreamTransportCMAFContainerOptionsStruct::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("PushAVStreamTransportCMAFContainerOptionsStruct.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::PushAVStreamTransportCMAFContainerOptionsStruct::Type & request) +{ + ComplexArgumentParser::Finalize(request.chunkDuration); + ComplexArgumentParser::Finalize(request.CENCKey); +} + +CHIP_ERROR ComplexArgumentParser::Setup( + const char * label, + chip::app::Clusters::PushAvStreamTransport::Structs::PushAVStreamTransportContainerOptionsStruct::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("PushAVStreamTransportContainerOptionsStruct.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::PushAVStreamTransportContainerOptionsStruct::Type & request) +{ + ComplexArgumentParser::Finalize(request.containerType); + ComplexArgumentParser::Finalize(request.CMAFContainerOptions); +} + +CHIP_ERROR ComplexArgumentParser::Setup( + const char * label, chip::app::Clusters::PushAvStreamTransport::Structs::PushAVStreamTransportOptionsStruct::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("PushAVStreamTransportOptionsStruct.streamType", "streamType", + value.isMember("streamType"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("PushAVStreamTransportOptionsStruct.TLSEndpointID", + "TLSEndpointID", value.isMember("TLSEndpointID"))); + ReturnErrorOnFailure( + ComplexArgumentParser::EnsureMemberExist("PushAVStreamTransportOptionsStruct.url", "url", value.isMember("url"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("PushAVStreamTransportOptionsStruct.triggerOptions", + "triggerOptions", value.isMember("triggerOptions"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("PushAVStreamTransportOptionsStruct.containerFormat", + "containerFormat", value.isMember("containerFormat"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("PushAVStreamTransportOptionsStruct.ingestMethod", "ingestMethod", + value.isMember("ingestMethod"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("PushAVStreamTransportOptionsStruct.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, "TLSEndpointID"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.TLSEndpointID, value["TLSEndpointID"])); + valueCopy.removeMember("TLSEndpointID"); + + 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, "containerFormat"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.containerFormat, value["containerFormat"])); + valueCopy.removeMember("containerFormat"); + + 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, "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::PushAVStreamTransportOptionsStruct::Type & request) +{ + ComplexArgumentParser::Finalize(request.streamType); + ComplexArgumentParser::Finalize(request.videoStreamID); + ComplexArgumentParser::Finalize(request.audioStreamID); + ComplexArgumentParser::Finalize(request.TLSEndpointID); + ComplexArgumentParser::Finalize(request.url); + ComplexArgumentParser::Finalize(request.triggerOptions); + ComplexArgumentParser::Finalize(request.containerFormat); + ComplexArgumentParser::Finalize(request.ingestMethod); + ComplexArgumentParser::Finalize(request.containerOptions); + ComplexArgumentParser::Finalize(request.metadataOptions); + ComplexArgumentParser::Finalize(request.expiryTime); +} + +CHIP_ERROR +ComplexArgumentParser::Setup(const char * label, + chip::app::Clusters::PushAvStreamTransport::Structs::PushAVStreamConfigurationStruct::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("PushAVStreamConfigurationStruct.connectionID", "connectionID", + value.isMember("connectionID"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist( + "PushAVStreamConfigurationStruct.streamTransportStatus", "streamTransportStatus", value.isMember("streamTransportStatus"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("PushAVStreamConfigurationStruct.streamTransportOptions", + "streamTransportOptions", + value.isMember("streamTransportOptions"))); + + 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, "streamTransportStatus"); + ReturnErrorOnFailure( + ComplexArgumentParser::Setup(labelWithMember, request.streamTransportStatus, value["streamTransportStatus"])); + valueCopy.removeMember("streamTransportStatus"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "streamTransportOptions"); + ReturnErrorOnFailure( + ComplexArgumentParser::Setup(labelWithMember, request.streamTransportOptions, value["streamTransportOptions"])); + valueCopy.removeMember("streamTransportOptions"); + + return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); +} + +void ComplexArgumentParser::Finalize( + chip::app::Clusters::PushAvStreamTransport::Structs::PushAVStreamConfigurationStruct::Type & request) +{ + ComplexArgumentParser::Finalize(request.connectionID); + ComplexArgumentParser::Finalize(request.streamTransportStatus); + ComplexArgumentParser::Finalize(request.streamTransportOptions); +} + 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..d1aadb58e01682 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h @@ -741,6 +741,58 @@ 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::PushAVStreamTransportMotionTriggerTimeControlStruct::Type & request, + Json::Value & value); + +static void +Finalize(chip::app::Clusters::PushAvStreamTransport::Structs::PushAVStreamTransportMotionTriggerTimeControlStruct::Type & request); + +static CHIP_ERROR +Setup(const char * label, + chip::app::Clusters::PushAvStreamTransport::Structs::PushAVStreamTransportMetadataOptionsStruct::Type & request, + Json::Value & value); + +static void +Finalize(chip::app::Clusters::PushAvStreamTransport::Structs::PushAVStreamTransportMetadataOptionsStruct::Type & request); + +static CHIP_ERROR +Setup(const char * label, + chip::app::Clusters::PushAvStreamTransport::Structs::PushAVStreamTransportTriggerOptionsStruct::Type & request, + Json::Value & value); + +static void +Finalize(chip::app::Clusters::PushAvStreamTransport::Structs::PushAVStreamTransportTriggerOptionsStruct::Type & request); + +static CHIP_ERROR +Setup(const char * label, + chip::app::Clusters::PushAvStreamTransport::Structs::PushAVStreamTransportCMAFContainerOptionsStruct::Type & request, + Json::Value & value); + +static void +Finalize(chip::app::Clusters::PushAvStreamTransport::Structs::PushAVStreamTransportCMAFContainerOptionsStruct::Type & request); + +static CHIP_ERROR +Setup(const char * label, + chip::app::Clusters::PushAvStreamTransport::Structs::PushAVStreamTransportContainerOptionsStruct::Type & request, + Json::Value & value); + +static void +Finalize(chip::app::Clusters::PushAvStreamTransport::Structs::PushAVStreamTransportContainerOptionsStruct::Type & request); + +static CHIP_ERROR Setup(const char * label, + chip::app::Clusters::PushAvStreamTransport::Structs::PushAVStreamTransportOptionsStruct::Type & request, + Json::Value & value); + +static void Finalize(chip::app::Clusters::PushAvStreamTransport::Structs::PushAVStreamTransportOptionsStruct::Type & request); + +static CHIP_ERROR Setup(const char * label, + chip::app::Clusters::PushAvStreamTransport::Structs::PushAVStreamConfigurationStruct::Type & request, + Json::Value & value); + +static void Finalize(chip::app::Clusters::PushAvStreamTransport::Structs::PushAVStreamConfigurationStruct::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..d53b95eff2bdd3 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,318 @@ CHIP_ERROR DataModelLogger::LogValue( return CHIP_NO_ERROR; } +CHIP_ERROR DataModelLogger::LogValue( + const char * label, size_t indent, + const chip::app::Clusters::PushAvStreamTransport::Structs::PushAVStreamTransportMotionTriggerTimeControlStruct::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::PushAVStreamTransportMetadataOptionsStruct::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::PushAVStreamTransportTriggerOptionsStruct::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("ActivationReason", indent + 1, value.activationReason); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct 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 chip::app::Clusters::PushAvStreamTransport::Structs::PushAVStreamTransportCMAFContainerOptionsStruct::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::PushAVStreamTransportContainerOptionsStruct::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::PushAVStreamTransportOptionsStruct::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("TLSEndpointID", indent + 1, value.TLSEndpointID); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'TLSEndpointID'"); + 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("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("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("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::PushAVStreamConfigurationStruct::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("StreamTransportStatus", indent + 1, value.streamTransportStatus); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'StreamTransportStatus'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("StreamTransportOptions", indent + 1, value.streamTransportOptions); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'StreamTransportOptions'"); + 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 +9260,38 @@ 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, "{"); + 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("TriggerDetails", indent + 1, value.triggerDetails); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'TriggerDetails'"); + 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 +10184,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("streamTransportOptions", indent + 1, value.streamTransportOptions)); + 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::FindStreamConfigurationResponse::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 +19170,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 +20551,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::FindStreamConfigurationResponse::Id: { + PushAvStreamTransport::Commands::FindStreamConfigurationResponse::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("FindStreamConfigurationResponse", 1, value); + } + } + break; + } case CommissionerControl::Id: { switch (path.mCommandId) { @@ -21093,6 +21517,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..1f5741fdfee66f 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,36 @@ 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::PushAVStreamTransportMotionTriggerTimeControlStruct::DecodableType & + value); + +static CHIP_ERROR LogValue( + const char * label, size_t indent, + const chip::app::Clusters::PushAvStreamTransport::Structs::PushAVStreamTransportMetadataOptionsStruct::DecodableType & value); + +static CHIP_ERROR LogValue( + const char * label, size_t indent, + const chip::app::Clusters::PushAvStreamTransport::Structs::PushAVStreamTransportTriggerOptionsStruct::DecodableType & value); + +static CHIP_ERROR +LogValue(const char * label, size_t indent, + const chip::app::Clusters::PushAvStreamTransport::Structs::PushAVStreamTransportCMAFContainerOptionsStruct::DecodableType & + value); + +static CHIP_ERROR LogValue( + const char * label, size_t indent, + const chip::app::Clusters::PushAvStreamTransport::Structs::PushAVStreamTransportContainerOptionsStruct::DecodableType & value); + +static CHIP_ERROR +LogValue(const char * label, size_t indent, + const chip::app::Clusters::PushAvStreamTransport::Structs::PushAVStreamTransportOptionsStruct::DecodableType & value); + +static CHIP_ERROR +LogValue(const char * label, size_t indent, + const chip::app::Clusters::PushAvStreamTransport::Structs::PushAVStreamConfigurationStruct::DecodableType & value); + static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::Chime::Structs::ChimeSoundStruct::DecodableType & value); @@ -737,6 +767,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 +968,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::FindStreamConfigurationResponse::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..600577d852914e 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::FindStreamConfiguration::Id: + return "FindStreamConfiguration"; + 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::FindStreamConfigurationResponse::Id: + return "FindStreamConfigurationResponse"; + 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..1b7a6c94f91b71 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,1333 @@ 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 | +| * FindStreamConfiguration | 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_StreamTransportOptions(&mRequest.streamTransportOptions) + { +#if MTR_ENABLE_PROVISIONAL + AddArgument("StreamTransportOptions", &mComplex_StreamTransportOptions); +#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.streamTransportOptions = [MTRPushAVStreamTransportClusterPushAVStreamTransportOptionsStruct new]; + params.streamTransportOptions.streamType = [NSNumber numberWithUnsignedChar:chip::to_underlying(mRequest.streamTransportOptions.streamType)]; + if (mRequest.streamTransportOptions.videoStreamID.HasValue()) { + if (mRequest.streamTransportOptions.videoStreamID.Value().IsNull()) { + params.streamTransportOptions.videoStreamID = nil; + } else { + params.streamTransportOptions.videoStreamID = [NSNumber numberWithUnsignedShort:mRequest.streamTransportOptions.videoStreamID.Value().Value()]; + } + } else { + params.streamTransportOptions.videoStreamID = nil; + } + if (mRequest.streamTransportOptions.audioStreamID.HasValue()) { + if (mRequest.streamTransportOptions.audioStreamID.Value().IsNull()) { + params.streamTransportOptions.audioStreamID = nil; + } else { + params.streamTransportOptions.audioStreamID = [NSNumber numberWithUnsignedShort:mRequest.streamTransportOptions.audioStreamID.Value().Value()]; + } + } else { + params.streamTransportOptions.audioStreamID = nil; + } + params.streamTransportOptions.tlsEndpointID = [NSNumber numberWithUnsignedShort:mRequest.streamTransportOptions.TLSEndpointID]; + params.streamTransportOptions.url = [[NSString alloc] initWithBytes:mRequest.streamTransportOptions.url.data() length:mRequest.streamTransportOptions.url.size() encoding:NSUTF8StringEncoding]; + params.streamTransportOptions.triggerOptions = [MTRPushAVStreamTransportClusterPushAVStreamTransportTriggerOptionsStruct new]; + params.streamTransportOptions.triggerOptions.triggerType = [NSNumber numberWithUnsignedChar:chip::to_underlying(mRequest.streamTransportOptions.triggerOptions.triggerType)]; + if (mRequest.streamTransportOptions.triggerOptions.motionZones.HasValue()) { + if (mRequest.streamTransportOptions.triggerOptions.motionZones.Value().IsNull()) { + params.streamTransportOptions.triggerOptions.motionZones = nil; + } else { + { // Scope for our temporary variables + auto * array_4 = [NSMutableArray new]; + for (auto & entry_4 : mRequest.streamTransportOptions.triggerOptions.motionZones.Value().Value()) { + NSNumber * newElement_4; + newElement_4 = [NSNumber numberWithUnsignedShort:entry_4]; + [array_4 addObject:newElement_4]; + } + params.streamTransportOptions.triggerOptions.motionZones = array_4; + } + } + } else { + params.streamTransportOptions.triggerOptions.motionZones = nil; + } + if (mRequest.streamTransportOptions.triggerOptions.motionSensitivity.HasValue()) { + if (mRequest.streamTransportOptions.triggerOptions.motionSensitivity.Value().IsNull()) { + params.streamTransportOptions.triggerOptions.motionSensitivity = nil; + } else { + params.streamTransportOptions.triggerOptions.motionSensitivity = [NSNumber numberWithUnsignedChar:mRequest.streamTransportOptions.triggerOptions.motionSensitivity.Value().Value()]; + } + } else { + params.streamTransportOptions.triggerOptions.motionSensitivity = nil; + } + if (mRequest.streamTransportOptions.triggerOptions.motionTimeControl.HasValue()) { + if (mRequest.streamTransportOptions.triggerOptions.motionTimeControl.Value().IsNull()) { + params.streamTransportOptions.triggerOptions.motionTimeControl = nil; + } else { + params.streamTransportOptions.triggerOptions.motionTimeControl = [MTRPushAVStreamTransportClusterPushAVStreamTransportMotionTriggerTimeControlStruct new]; + params.streamTransportOptions.triggerOptions.motionTimeControl.initialDuration = [NSNumber numberWithUnsignedShort:mRequest.streamTransportOptions.triggerOptions.motionTimeControl.Value().Value().initialDuration]; + params.streamTransportOptions.triggerOptions.motionTimeControl.augmentationDuration = [NSNumber numberWithUnsignedShort:mRequest.streamTransportOptions.triggerOptions.motionTimeControl.Value().Value().augmentationDuration]; + params.streamTransportOptions.triggerOptions.motionTimeControl.maxDuration = [NSNumber numberWithUnsignedInt:mRequest.streamTransportOptions.triggerOptions.motionTimeControl.Value().Value().maxDuration]; + params.streamTransportOptions.triggerOptions.motionTimeControl.blindDuration = [NSNumber numberWithUnsignedShort:mRequest.streamTransportOptions.triggerOptions.motionTimeControl.Value().Value().blindDuration]; + } + } else { + params.streamTransportOptions.triggerOptions.motionTimeControl = nil; + } + if (mRequest.streamTransportOptions.triggerOptions.activationReason.HasValue()) { + if (mRequest.streamTransportOptions.triggerOptions.activationReason.Value().IsNull()) { + params.streamTransportOptions.triggerOptions.activationReason = nil; + } else { + params.streamTransportOptions.triggerOptions.activationReason = [NSNumber numberWithUnsignedChar:chip::to_underlying(mRequest.streamTransportOptions.triggerOptions.activationReason.Value().Value())]; + } + } else { + params.streamTransportOptions.triggerOptions.activationReason = nil; + } + params.streamTransportOptions.containerFormat = [NSNumber numberWithUnsignedChar:chip::to_underlying(mRequest.streamTransportOptions.containerFormat)]; + params.streamTransportOptions.ingestMethod = [NSNumber numberWithUnsignedChar:chip::to_underlying(mRequest.streamTransportOptions.ingestMethod)]; + params.streamTransportOptions.containerOptions = [MTRPushAVStreamTransportClusterPushAVStreamTransportContainerOptionsStruct new]; + params.streamTransportOptions.containerOptions.containerType = [NSNumber numberWithUnsignedChar:chip::to_underlying(mRequest.streamTransportOptions.containerOptions.containerType)]; + if (mRequest.streamTransportOptions.containerOptions.CMAFContainerOptions.HasValue()) { + if (mRequest.streamTransportOptions.containerOptions.CMAFContainerOptions.Value().IsNull()) { + params.streamTransportOptions.containerOptions.cmafContainerOptions = nil; + } else { + params.streamTransportOptions.containerOptions.cmafContainerOptions = [MTRPushAVStreamTransportClusterPushAVStreamTransportCMAFContainerOptionsStruct new]; + params.streamTransportOptions.containerOptions.cmafContainerOptions.chunkDuration = [NSNumber numberWithUnsignedShort:mRequest.streamTransportOptions.containerOptions.CMAFContainerOptions.Value().Value().chunkDuration]; + if (mRequest.streamTransportOptions.containerOptions.CMAFContainerOptions.Value().Value().CENCKey.HasValue()) { + if (mRequest.streamTransportOptions.containerOptions.CMAFContainerOptions.Value().Value().CENCKey.Value().IsNull()) { + params.streamTransportOptions.containerOptions.cmafContainerOptions.cencKey = nil; + } else { + params.streamTransportOptions.containerOptions.cmafContainerOptions.cencKey = [NSData dataWithBytes:mRequest.streamTransportOptions.containerOptions.CMAFContainerOptions.Value().Value().CENCKey.Value().Value().data() length:mRequest.streamTransportOptions.containerOptions.CMAFContainerOptions.Value().Value().CENCKey.Value().Value().size()]; + } + } else { + params.streamTransportOptions.containerOptions.cmafContainerOptions.cencKey = nil; + } + } + } else { + params.streamTransportOptions.containerOptions.cmafContainerOptions = nil; + } + if (mRequest.streamTransportOptions.metadataOptions.HasValue()) { + if (mRequest.streamTransportOptions.metadataOptions.Value().IsNull()) { + params.streamTransportOptions.metadataOptions = nil; + } else { + params.streamTransportOptions.metadataOptions = [MTRPushAVStreamTransportClusterPushAVStreamTransportMetadataOptionsStruct new]; + params.streamTransportOptions.metadataOptions.multiplexing = [NSNumber numberWithUnsignedChar:chip::to_underlying(mRequest.streamTransportOptions.metadataOptions.Value().Value().multiplexing)]; + params.streamTransportOptions.metadataOptions.includeMotionZones = [NSNumber numberWithBool:mRequest.streamTransportOptions.metadataOptions.Value().Value().includeMotionZones]; + params.streamTransportOptions.metadataOptions.enableMetadataPrivacySensitive = [NSNumber numberWithBool:mRequest.streamTransportOptions.metadataOptions.Value().Value().enableMetadataPrivacySensitive]; + } + } else { + params.streamTransportOptions.metadataOptions = nil; + } + if (mRequest.streamTransportOptions.expiryTime.HasValue()) { + if (mRequest.streamTransportOptions.expiryTime.Value().IsNull()) { + params.streamTransportOptions.expiryTime = nil; + } else { + params.streamTransportOptions.expiryTime = [NSNumber numberWithUnsignedInt:mRequest.streamTransportOptions.expiryTime.Value().Value()]; + } + } else { + params.streamTransportOptions.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_StreamTransportOptions; +}; + +#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_StreamTransportOptions(&mRequest.streamTransportOptions) + { +#if MTR_ENABLE_PROVISIONAL + AddArgument("ConnectionID", 0, UINT16_MAX, &mRequest.connectionID); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("StreamTransportOptions", &mComplex_StreamTransportOptions); +#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.streamTransportOptions = [MTRPushAVStreamTransportClusterPushAVStreamTransportOptionsStruct new]; + params.streamTransportOptions.streamType = [NSNumber numberWithUnsignedChar:chip::to_underlying(mRequest.streamTransportOptions.streamType)]; + if (mRequest.streamTransportOptions.videoStreamID.HasValue()) { + if (mRequest.streamTransportOptions.videoStreamID.Value().IsNull()) { + params.streamTransportOptions.videoStreamID = nil; + } else { + params.streamTransportOptions.videoStreamID = [NSNumber numberWithUnsignedShort:mRequest.streamTransportOptions.videoStreamID.Value().Value()]; + } + } else { + params.streamTransportOptions.videoStreamID = nil; + } + if (mRequest.streamTransportOptions.audioStreamID.HasValue()) { + if (mRequest.streamTransportOptions.audioStreamID.Value().IsNull()) { + params.streamTransportOptions.audioStreamID = nil; + } else { + params.streamTransportOptions.audioStreamID = [NSNumber numberWithUnsignedShort:mRequest.streamTransportOptions.audioStreamID.Value().Value()]; + } + } else { + params.streamTransportOptions.audioStreamID = nil; + } + params.streamTransportOptions.tlsEndpointID = [NSNumber numberWithUnsignedShort:mRequest.streamTransportOptions.TLSEndpointID]; + params.streamTransportOptions.url = [[NSString alloc] initWithBytes:mRequest.streamTransportOptions.url.data() length:mRequest.streamTransportOptions.url.size() encoding:NSUTF8StringEncoding]; + params.streamTransportOptions.triggerOptions = [MTRPushAVStreamTransportClusterPushAVStreamTransportTriggerOptionsStruct new]; + params.streamTransportOptions.triggerOptions.triggerType = [NSNumber numberWithUnsignedChar:chip::to_underlying(mRequest.streamTransportOptions.triggerOptions.triggerType)]; + if (mRequest.streamTransportOptions.triggerOptions.motionZones.HasValue()) { + if (mRequest.streamTransportOptions.triggerOptions.motionZones.Value().IsNull()) { + params.streamTransportOptions.triggerOptions.motionZones = nil; + } else { + { // Scope for our temporary variables + auto * array_4 = [NSMutableArray new]; + for (auto & entry_4 : mRequest.streamTransportOptions.triggerOptions.motionZones.Value().Value()) { + NSNumber * newElement_4; + newElement_4 = [NSNumber numberWithUnsignedShort:entry_4]; + [array_4 addObject:newElement_4]; + } + params.streamTransportOptions.triggerOptions.motionZones = array_4; + } + } + } else { + params.streamTransportOptions.triggerOptions.motionZones = nil; + } + if (mRequest.streamTransportOptions.triggerOptions.motionSensitivity.HasValue()) { + if (mRequest.streamTransportOptions.triggerOptions.motionSensitivity.Value().IsNull()) { + params.streamTransportOptions.triggerOptions.motionSensitivity = nil; + } else { + params.streamTransportOptions.triggerOptions.motionSensitivity = [NSNumber numberWithUnsignedChar:mRequest.streamTransportOptions.triggerOptions.motionSensitivity.Value().Value()]; + } + } else { + params.streamTransportOptions.triggerOptions.motionSensitivity = nil; + } + if (mRequest.streamTransportOptions.triggerOptions.motionTimeControl.HasValue()) { + if (mRequest.streamTransportOptions.triggerOptions.motionTimeControl.Value().IsNull()) { + params.streamTransportOptions.triggerOptions.motionTimeControl = nil; + } else { + params.streamTransportOptions.triggerOptions.motionTimeControl = [MTRPushAVStreamTransportClusterPushAVStreamTransportMotionTriggerTimeControlStruct new]; + params.streamTransportOptions.triggerOptions.motionTimeControl.initialDuration = [NSNumber numberWithUnsignedShort:mRequest.streamTransportOptions.triggerOptions.motionTimeControl.Value().Value().initialDuration]; + params.streamTransportOptions.triggerOptions.motionTimeControl.augmentationDuration = [NSNumber numberWithUnsignedShort:mRequest.streamTransportOptions.triggerOptions.motionTimeControl.Value().Value().augmentationDuration]; + params.streamTransportOptions.triggerOptions.motionTimeControl.maxDuration = [NSNumber numberWithUnsignedInt:mRequest.streamTransportOptions.triggerOptions.motionTimeControl.Value().Value().maxDuration]; + params.streamTransportOptions.triggerOptions.motionTimeControl.blindDuration = [NSNumber numberWithUnsignedShort:mRequest.streamTransportOptions.triggerOptions.motionTimeControl.Value().Value().blindDuration]; + } + } else { + params.streamTransportOptions.triggerOptions.motionTimeControl = nil; + } + if (mRequest.streamTransportOptions.triggerOptions.activationReason.HasValue()) { + if (mRequest.streamTransportOptions.triggerOptions.activationReason.Value().IsNull()) { + params.streamTransportOptions.triggerOptions.activationReason = nil; + } else { + params.streamTransportOptions.triggerOptions.activationReason = [NSNumber numberWithUnsignedChar:chip::to_underlying(mRequest.streamTransportOptions.triggerOptions.activationReason.Value().Value())]; + } + } else { + params.streamTransportOptions.triggerOptions.activationReason = nil; + } + params.streamTransportOptions.containerFormat = [NSNumber numberWithUnsignedChar:chip::to_underlying(mRequest.streamTransportOptions.containerFormat)]; + params.streamTransportOptions.ingestMethod = [NSNumber numberWithUnsignedChar:chip::to_underlying(mRequest.streamTransportOptions.ingestMethod)]; + params.streamTransportOptions.containerOptions = [MTRPushAVStreamTransportClusterPushAVStreamTransportContainerOptionsStruct new]; + params.streamTransportOptions.containerOptions.containerType = [NSNumber numberWithUnsignedChar:chip::to_underlying(mRequest.streamTransportOptions.containerOptions.containerType)]; + if (mRequest.streamTransportOptions.containerOptions.CMAFContainerOptions.HasValue()) { + if (mRequest.streamTransportOptions.containerOptions.CMAFContainerOptions.Value().IsNull()) { + params.streamTransportOptions.containerOptions.cmafContainerOptions = nil; + } else { + params.streamTransportOptions.containerOptions.cmafContainerOptions = [MTRPushAVStreamTransportClusterPushAVStreamTransportCMAFContainerOptionsStruct new]; + params.streamTransportOptions.containerOptions.cmafContainerOptions.chunkDuration = [NSNumber numberWithUnsignedShort:mRequest.streamTransportOptions.containerOptions.CMAFContainerOptions.Value().Value().chunkDuration]; + if (mRequest.streamTransportOptions.containerOptions.CMAFContainerOptions.Value().Value().CENCKey.HasValue()) { + if (mRequest.streamTransportOptions.containerOptions.CMAFContainerOptions.Value().Value().CENCKey.Value().IsNull()) { + params.streamTransportOptions.containerOptions.cmafContainerOptions.cencKey = nil; + } else { + params.streamTransportOptions.containerOptions.cmafContainerOptions.cencKey = [NSData dataWithBytes:mRequest.streamTransportOptions.containerOptions.CMAFContainerOptions.Value().Value().CENCKey.Value().Value().data() length:mRequest.streamTransportOptions.containerOptions.CMAFContainerOptions.Value().Value().CENCKey.Value().Value().size()]; + } + } else { + params.streamTransportOptions.containerOptions.cmafContainerOptions.cencKey = nil; + } + } + } else { + params.streamTransportOptions.containerOptions.cmafContainerOptions = nil; + } + if (mRequest.streamTransportOptions.metadataOptions.HasValue()) { + if (mRequest.streamTransportOptions.metadataOptions.Value().IsNull()) { + params.streamTransportOptions.metadataOptions = nil; + } else { + params.streamTransportOptions.metadataOptions = [MTRPushAVStreamTransportClusterPushAVStreamTransportMetadataOptionsStruct new]; + params.streamTransportOptions.metadataOptions.multiplexing = [NSNumber numberWithUnsignedChar:chip::to_underlying(mRequest.streamTransportOptions.metadataOptions.Value().Value().multiplexing)]; + params.streamTransportOptions.metadataOptions.includeMotionZones = [NSNumber numberWithBool:mRequest.streamTransportOptions.metadataOptions.Value().Value().includeMotionZones]; + params.streamTransportOptions.metadataOptions.enableMetadataPrivacySensitive = [NSNumber numberWithBool:mRequest.streamTransportOptions.metadataOptions.Value().Value().enableMetadataPrivacySensitive]; + } + } else { + params.streamTransportOptions.metadataOptions = nil; + } + if (mRequest.streamTransportOptions.expiryTime.HasValue()) { + if (mRequest.streamTransportOptions.expiryTime.Value().IsNull()) { + params.streamTransportOptions.expiryTime = nil; + } else { + params.streamTransportOptions.expiryTime = [NSNumber numberWithUnsignedInt:mRequest.streamTransportOptions.expiryTime.Value().Value()]; + } + } else { + params.streamTransportOptions.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_StreamTransportOptions; +}; + +#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("StreamTransportStatus", 0, UINT8_MAX, &mRequest.streamTransportStatus); +#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 + if (mRequest.connectionID.IsNull()) { + params.connectionID = nil; + } else { + params.connectionID = [NSNumber numberWithUnsignedShort:mRequest.connectionID.Value()]; + } +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + params.streamTransportStatus = [NSNumber numberWithUnsignedChar:chip::to_underlying(mRequest.streamTransportStatus)]; +#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 + if (mRequest.activationReason.IsNull()) { + params.activationReason = nil; + } else { + params.activationReason = [NSNumber numberWithUnsignedChar:chip::to_underlying(mRequest.activationReason.Value())]; + } +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + if (mRequest.timeControl.HasValue()) { + if (mRequest.timeControl.Value().IsNull()) { + params.timeControl = nil; + } else { + params.timeControl = [MTRPushAVStreamTransportClusterPushAVStreamTransportMotionTriggerTimeControlStruct new]; + params.timeControl.initialDuration = [NSNumber numberWithUnsignedShort:mRequest.timeControl.Value().Value().initialDuration]; + params.timeControl.augmentationDuration = [NSNumber numberWithUnsignedShort:mRequest.timeControl.Value().Value().augmentationDuration]; + params.timeControl.maxDuration = [NSNumber numberWithUnsignedInt:mRequest.timeControl.Value().Value().maxDuration]; + params.timeControl.blindDuration = [NSNumber numberWithUnsignedShort:mRequest.timeControl.Value().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 FindStreamConfiguration + */ +class PushAvStreamTransportFindStreamConfiguration : public ClusterCommand { +public: + PushAvStreamTransportFindStreamConfiguration() + : ClusterCommand("find-stream-configuration") + { +#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::FindStreamConfiguration::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 = [[MTRPushAVStreamTransportClusterFindStreamConfigurationParams 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 findStreamConfigurationWithParams:params completion: + ^(MTRPushAVStreamTransportClusterFindStreamConfigurationResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId = chip::app::Clusters::PushAvStreamTransport::Commands::FindStreamConfigurationResponse::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::FindStreamConfigurationResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return CHIP_NO_ERROR; + } + +private: + chip::app::Clusters::PushAvStreamTransport::Commands::FindStreamConfiguration::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 +180710,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 +181461,7 @@ void registerClusters(Commands & commands) registerClusterCameraAvStreamManagement(commands); registerClusterWebRTCTransportProvider(commands); registerClusterWebRTCTransportRequestor(commands); + registerClusterPushAvStreamTransport(commands); registerClusterChime(commands); registerClusterEcosystemInformation(commands); registerClusterCommissionerControl(commands);