diff --git a/docs/zap_clusters.md b/docs/zap_clusters.md index 5803545d3e9533..ec6419f70616d6 100644 --- a/docs/zap_clusters.md +++ b/docs/zap_clusters.md @@ -129,6 +129,7 @@ Generally regenerate using one of: | 1294 | 0x50E | AccountLogin | | 1295 | 0x50F | ContentControl | | 1296 | 0x510 | ContentAppObserver | +| 1361 | 0x551 | CameraAvStreamManagement | | 1363 | 0x553 | WebRTCTransportProvider | | 1364 | 0x554 | WebRTCTransportRequestor | | 1366 | 0x556 | Chime | diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index 07b98b17953af9..38282d96064738 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -9416,6 +9416,356 @@ provisional cluster ContentAppObserver = 1296 { command ContentAppMessage(ContentAppMessageRequest): ContentAppMessageResponse = 0; } +/** The Camera AV Stream Management cluster is used to allow clients to manage, control, and configure various audio, video, and snapshot streams on a camera. */ +cluster CameraAvStreamManagement = 1361 { + revision 1; + + enum AudioCodecEnum : enum8 { + kOPUS = 0; + kAACLC = 1; + } + + enum ImageCodecEnum : enum8 { + kJPEG = 0; + } + + enum StreamTypeEnum : enum8 { + kInternal = 0; + kRecording = 1; + kAnalysis = 2; + kLiveView = 3; + } + + enum TriStateAutoEnum : enum8 { + kOff = 0; + kOn = 1; + kAuto = 2; + } + + enum TwoWayTalkSupportTypeEnum : enum8 { + kNotSupported = 0; + kHalfDuplex = 1; + kFullDuplex = 2; + } + + enum VideoCodecEnum : enum8 { + kH264 = 0; + kHEVC = 1; + kVVC = 2; + kAV1 = 3; + } + + bitmap Feature : bitmap32 { + kPrivacy = 0x1; + kSensorControl = 0x2; + kAudio = 0x4; + kImageControl = 0x8; + kVideo = 0x10; + kSnapshot = 0x20; + kLocalStorage = 0x40; + } + + struct VideoResolutionStruct { + int16u width = 0; + int16u height = 1; + } + + struct VideoStreamStruct { + int16u videoStreamID = 0; + StreamTypeEnum streamType = 1; + VideoCodecEnum videoCodec = 2; + int16u minFrameRate = 3; + int16u maxFrameRate = 4; + VideoResolutionStruct minResolution = 5; + VideoResolutionStruct maxResolution = 6; + int16u minBitRate = 7; + int16u maxBitRate = 8; + int16u minFragmentLen = 9; + int16u maxFragmentLen = 10; + int8u referenceCount = 11; + } + + struct SnapshotStreamStruct { + int16u snapshotStreamID = 0; + ImageCodecEnum imageCodec = 1; + int16u frameRate = 2; + int32u bitRate = 3; + VideoResolutionStruct minResolution = 4; + VideoResolutionStruct maxResolution = 5; + int8u quality = 6; + int8u referenceCount = 7; + } + + struct SnapshotParamsStruct { + VideoResolutionStruct resolution = 0; + int16u maxFrameRate = 1; + ImageCodecEnum imageCodec = 2; + } + + struct RateDistortionTradeOffPointsStruct { + VideoCodecEnum codec = 0; + VideoResolutionStruct resolution = 1; + int32u minBitRate = 2; + } + + struct AudioCapabilitiesStruct { + int8u maxNumberOfChannels = 0; + AudioCodecEnum supportedCodecs[] = 1; + int32u supportedSampleRates[] = 2; + int32u supportedBitDepths[] = 3; + } + + struct AudioStreamStruct { + int16u audioStreamID = 0; + StreamTypeEnum streamType = 1; + AudioCodecEnum audioCodec = 2; + int8u channelCount = 3; + int32u sampleRate = 4; + int32u bitRate = 5; + int8u bitDepth = 6; + int8u referenceCount = 7; + } + + struct PerStreamStruct { + int16u streamID = 0; + boolean enabled = 1; + } + + struct VideoSensorParamsStruct { + int16u sensorWidth = 0; + int16u sensorHeight = 1; + boolean HDRCapable = 2; + int16u maxFPS = 3; + int16u maxHDRFPS = 4; + } + + struct ViewportStruct { + int16u x1 = 0; + int16u y1 = 1; + int16u x2 = 2; + int16u y2 = 3; + } + + info event VideoStreamChanged = 0 { + int16u videoStreamID = 0; + optional StreamTypeEnum streamType = 1; + optional VideoCodecEnum videoCodec = 2; + optional int16u minFrameRate = 3; + optional int16u maxFrameRate = 4; + optional VideoResolutionStruct minResolution = 5; + optional VideoResolutionStruct maxResolution = 6; + optional int16u minBitRate = 7; + optional int16u maxBitRate = 8; + optional int16u minFragmentLen = 9; + optional int16u maxFragmentLen = 10; + } + + info event AudioStreamChanged = 1 { + int16u audioStreamID = 0; + optional StreamTypeEnum streamType = 1; + optional AudioCodecEnum audioCodec = 2; + optional int8u channelCount = 3; + optional int32u sampleRate = 4; + optional int32u bitRate = 5; + optional int8u bitDepth = 6; + } + + info event SnapshotStreamChanged = 2 { + int16u snapshotStreamID = 0; + optional ImageCodecEnum imageCodec = 1; + optional int16u frameRate = 2; + optional int32u bitRate = 3; + optional VideoResolutionStruct minResolution = 4; + optional VideoResolutionStruct maxResolution = 5; + optional int8u quality = 6; + } + + readonly attribute access(read: administer) optional int8u maxConcurrentVideoEncoders = 0; + readonly attribute access(read: administer) optional int32u maxEncodedPixelRate = 1; + readonly attribute access(read: administer) optional VideoSensorParamsStruct videoSensorParams = 2; + readonly attribute access(read: administer) optional boolean nightVisionCapable = 3; + readonly attribute access(read: administer) optional VideoResolutionStruct minViewPortWidth = 4; + readonly attribute access(read: administer) optional VideoResolutionStruct minViewPortHeight = 5; + readonly attribute access(read: administer) optional RateDistortionTradeOffPointsStruct rateDistortionTradeOffPoints[] = 6; + readonly attribute access(read: administer) optional int32u maxPreRollBufferSize = 7; + readonly attribute access(read: administer) optional AudioCapabilitiesStruct microphoneCapabilities = 8; + readonly attribute access(read: administer) optional nullable AudioCapabilitiesStruct speakerCapabilities = 9; + readonly attribute access(read: administer) optional TwoWayTalkSupportTypeEnum twoWayTalkSupport = 10; + readonly attribute access(read: administer) optional SnapshotParamsStruct supportedSnapshotParams[] = 11; + readonly attribute access(read: administer) optional boolean HDRCapable = 12; + readonly attribute access(read: administer) int32u maxNetworkBandwidth = 13; + readonly attribute access(read: administer) optional int16u currentFrameRate = 14; + attribute access(read: administer, write: administer) optional boolean HDRMode = 15; + readonly attribute access(read: administer) optional VideoCodecEnum currentVideoCodecs[] = 16; + readonly attribute access(read: administer) optional SnapshotParamsStruct currentSnapshotConfig = 17; + readonly attribute access(read: administer) fabric_idx fabricsUsingCamera[] = 18; + readonly attribute access(read: administer) optional VideoStreamStruct allocatedVideoStreams[] = 19; + readonly attribute access(read: administer) optional AudioStreamStruct allocatedAudioStreams[] = 20; + readonly attribute access(read: administer) optional SnapshotStreamStruct allocatedSnapshotStreams[] = 21; + attribute access(read: administer, write: administer) optional StreamTypeEnum rankedVideoStreamPrioritiesList[] = 22; + attribute access(read: administer, write: administer) optional boolean softRecordingPrivacyModeSetting = 23; + attribute access(read: administer, write: administer) optional boolean softLivestreamPrivacyModeSetting = 24; + readonly attribute access(read: administer) optional boolean hardPrivacyMode = 25; + attribute access(read: administer, write: administer) optional TriStateAutoEnum nightVision = 26; + attribute access(read: administer, write: administer) optional TriStateAutoEnum nightVisionIllum = 27; + attribute access(read: administer, write: administer) optional boolean awb = 28; + attribute access(read: administer, write: administer) optional boolean shutterSpeed = 29; + attribute access(read: administer, write: administer) optional boolean iso = 30; + readonly attribute access(read: administer) optional ViewportStruct viewport = 31; + attribute access(read: administer, write: administer) optional boolean speakerEnabled = 32; + attribute access(read: administer, write: administer) optional int8u speakerVolumeLevel = 33; + attribute access(read: administer, write: administer) optional int8u speakerMaxLevel = 34; + attribute access(read: administer, write: administer) optional int8u speakerMinLevel = 35; + attribute access(read: administer, write: administer) optional boolean micStatus = 36; + attribute access(read: administer, write: administer) optional int8u micVolumeLevel = 37; + attribute access(read: administer, write: administer) optional int8u micMaxLevel = 38; + attribute access(read: administer, write: administer) optional int8u micMinLevel = 39; + attribute access(read: administer, write: administer) optional boolean micAGCEnabled = 40; + readonly attribute access(read: administer) optional int16u imageRotation = 41; + readonly attribute access(read: administer) optional boolean imageFlipHorizontal = 42; + readonly attribute access(read: administer) optional boolean imageFlipVertical = 43; + attribute access(read: administer, write: administer) optional boolean localVideoRecordingEnabled = 44; + attribute access(read: administer, write: administer) optional boolean localSnapshotRecordingEnabled = 45; + attribute access(read: administer, write: administer) optional boolean statusLight = 46; + attribute access(read: administer, write: administer) optional ThreeLevelAutoEnum statusLightBrightness = 47; + attribute access(read: administer, write: administer) optional TriStateAutoEnum depthSensorStatus = 48; + readonly attribute access(read: administer) optional PerStreamStruct watermarkEnabled[] = 49; + readonly attribute access(read: administer) optional PerStreamStruct OSDEnabled[] = 50; + 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 AudioStreamAllocateRequest { + StreamTypeEnum streamType = 0; + AudioCodecEnum audioCodec = 1; + int8u channelCount = 2; + int32u sampleRate = 3; + int32u bitRate = 4; + int8u bitDepth = 5; + } + + response struct AudioStreamAllocateResponse = 1 { + int16u audioStreamID = 0; + } + + request struct AudioStreamDeallocateRequest { + int16u audioStreamID = 0; + } + + request struct VideoStreamAllocateRequest { + StreamTypeEnum streamType = 0; + VideoCodecEnum videoCodec = 1; + int16u minFrameRate = 2; + int16u maxFrameRate = 3; + VideoResolutionStruct minResolution = 4; + VideoResolutionStruct maxResolution = 5; + int32u minBitRate = 6; + int32u maxBitRate = 7; + int16u minFragmentLen = 8; + int16u maxFragmentLen = 9; + } + + response struct VideoStreamAllocateResponse = 4 { + int16u videoStreamID = 0; + } + + request struct VideoStreamModifyRequest { + int16u videoStreamID = 0; + VideoResolutionStruct resolution = 1; + } + + request struct VideoStreamDeallocateRequest { + int16u videoStreamID = 0; + } + + request struct SnapshotStreamAllocateRequest { + ImageCodecEnum imageCodec = 0; + int16u frameRate = 1; + int32u bitRate = 2; + VideoResolutionStruct minResolution = 3; + VideoResolutionStruct maxResolution = 4; + int8u quality = 5; + } + + response struct SnapshotStreamAllocateResponse = 8 { + int16u snapshotStreamID = 0; + } + + request struct SnapshotStreamDeallocateRequest { + int16u snapshotStreamID = 0; + } + + request struct CaptureSnapshotRequest { + int16u snapshotStreamID = 0; + VideoResolutionStruct requestedResolution = 1; + } + + response struct CaptureSnapshotResponse = 12 { + octet_string data = 0; + ImageCodecEnum imageCodec = 1; + VideoResolutionStruct resolution = 2; + } + + request struct SetViewportRequest { + ViewportStruct viewport = 0; + } + + request struct SetImageRotationRequest { + int16u angle = 0; + } + + request struct SetImageFlipHorizontalRequest { + boolean enabled = 0; + } + + request struct SetImageFlipVerticalRequest { + boolean enabled = 0; + } + + request struct SetWatermarkRequest { + int16u videoStreamID = 0; + boolean enabled = 1; + } + + request struct SetOSDRequest { + int16u videoStreamID = 0; + boolean enabled = 1; + } + + /** This command SHALL allocate an audio stream on the camera and return an allocated audio stream identifier. */ + command access(invoke: administer) AudioStreamAllocate(AudioStreamAllocateRequest): AudioStreamAllocateResponse = 0; + /** This command SHALL deallocate an audio stream on the camera, corresponding to the given audio stream identifier. */ + command access(invoke: administer) AudioStreamDeallocate(AudioStreamDeallocateRequest): DefaultSuccess = 2; + /** This command SHALL allocate a video stream on the camera and return an allocated video stream identifier. */ + command access(invoke: administer) VideoStreamAllocate(VideoStreamAllocateRequest): VideoStreamAllocateResponse = 3; + /** This command SHALL be used to modify the resolution of a stream specified by the VideoStreamID. */ + command access(invoke: administer) VideoStreamModify(VideoStreamModifyRequest): DefaultSuccess = 5; + /** This command SHALL deallocate a video stream on the camera, corresponding to the given video stream identifier. */ + command access(invoke: administer) VideoStreamDeallocate(VideoStreamDeallocateRequest): DefaultSuccess = 6; + /** This command SHALL allocate a snapshot stream on the device and return an allocated snapshot stream identifier. */ + command access(invoke: administer) SnapshotStreamAllocate(SnapshotStreamAllocateRequest): SnapshotStreamAllocateResponse = 7; + /** This command SHALL deallocate an snapshot stream on the camera, corresponding to the given snapshot stream identifier. */ + command access(invoke: administer) SnapshotStreamDeallocate(SnapshotStreamDeallocateRequest): DefaultSuccess = 9; + command access(invoke: administer) SetStreamPriority(): DefaultSuccess = 10; + /** This command SHALL return a Snapshot from the camera. */ + command access(invoke: administer) CaptureSnapshot(CaptureSnapshotRequest): DefaultSuccess = 11; + /** This command SHALL set the viewport in all video streams. */ + command SetViewport(SetViewportRequest): DefaultSuccess = 13; + /** The data fields for this command SHALL be as follows: */ + command SetImageRotation(SetImageRotationRequest): DefaultSuccess = 14; + /** The data fields for this command SHALL be as follows: */ + command SetImageFlipHorizontal(SetImageFlipHorizontalRequest): DefaultSuccess = 15; + /** The data fields for this command SHALL be as follows: */ + command SetImageFlipVertical(SetImageFlipVerticalRequest): DefaultSuccess = 16; + /** This command controls if the manufacturer watermark logo is enabled for a given video stream. */ + command SetWatermark(SetWatermarkRequest): DefaultSuccess = 17; + /** This command controls if the On Screen Display (OSD) of text such as date, time, timezone, and/or device name, is enabled for a given video stream. */ + command SetOSD(SetOSDRequest): DefaultSuccess = 18; +} + /** The WebRTC transport provider cluster provides a way for stream providers (e.g. Cameras) to stream or receive their data through WebRTC. */ provisional cluster WebRTCTransportProvider = 1363 { 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 4104a75abb3fa5..91f26dd70b3c46 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java @@ -59518,6 +59518,2281 @@ public void onSuccess(byte[] tlv) { } } + public static class CameraAvStreamManagementCluster extends BaseChipCluster { + public static final long CLUSTER_ID = 1361L; + + private static final long MAX_CONCURRENT_VIDEO_ENCODERS_ATTRIBUTE_ID = 0L; + private static final long MAX_ENCODED_PIXEL_RATE_ATTRIBUTE_ID = 1L; + private static final long VIDEO_SENSOR_PARAMS_ATTRIBUTE_ID = 2L; + private static final long NIGHT_VISION_CAPABLE_ATTRIBUTE_ID = 3L; + private static final long MIN_VIEW_PORT_WIDTH_ATTRIBUTE_ID = 4L; + private static final long MIN_VIEW_PORT_HEIGHT_ATTRIBUTE_ID = 5L; + private static final long RATE_DISTORTION_TRADE_OFF_POINTS_ATTRIBUTE_ID = 6L; + private static final long MAX_PRE_ROLL_BUFFER_SIZE_ATTRIBUTE_ID = 7L; + private static final long MICROPHONE_CAPABILITIES_ATTRIBUTE_ID = 8L; + private static final long SPEAKER_CAPABILITIES_ATTRIBUTE_ID = 9L; + private static final long TWO_WAY_TALK_SUPPORT_ATTRIBUTE_ID = 10L; + private static final long SUPPORTED_SNAPSHOT_PARAMS_ATTRIBUTE_ID = 11L; + private static final long HDR_CAPABLE_ATTRIBUTE_ID = 12L; + private static final long MAX_NETWORK_BANDWIDTH_ATTRIBUTE_ID = 13L; + private static final long CURRENT_FRAME_RATE_ATTRIBUTE_ID = 14L; + private static final long HDR_MODE_ATTRIBUTE_ID = 15L; + private static final long CURRENT_VIDEO_CODECS_ATTRIBUTE_ID = 16L; + private static final long CURRENT_SNAPSHOT_CONFIG_ATTRIBUTE_ID = 17L; + private static final long FABRICS_USING_CAMERA_ATTRIBUTE_ID = 18L; + private static final long ALLOCATED_VIDEO_STREAMS_ATTRIBUTE_ID = 19L; + private static final long ALLOCATED_AUDIO_STREAMS_ATTRIBUTE_ID = 20L; + private static final long ALLOCATED_SNAPSHOT_STREAMS_ATTRIBUTE_ID = 21L; + private static final long RANKED_VIDEO_STREAM_PRIORITIES_LIST_ATTRIBUTE_ID = 22L; + private static final long SOFT_RECORDING_PRIVACY_MODE_SETTING_ATTRIBUTE_ID = 23L; + private static final long SOFT_LIVESTREAM_PRIVACY_MODE_SETTING_ATTRIBUTE_ID = 24L; + private static final long HARD_PRIVACY_MODE_ATTRIBUTE_ID = 25L; + private static final long NIGHT_VISION_ATTRIBUTE_ID = 26L; + private static final long NIGHT_VISION_ILLUM_ATTRIBUTE_ID = 27L; + private static final long AWB_ATTRIBUTE_ID = 28L; + private static final long SHUTTER_SPEED_ATTRIBUTE_ID = 29L; + private static final long ISO_ATTRIBUTE_ID = 30L; + private static final long VIEWPORT_ATTRIBUTE_ID = 31L; + private static final long SPEAKER_ENABLED_ATTRIBUTE_ID = 32L; + private static final long SPEAKER_VOLUME_LEVEL_ATTRIBUTE_ID = 33L; + private static final long SPEAKER_MAX_LEVEL_ATTRIBUTE_ID = 34L; + private static final long SPEAKER_MIN_LEVEL_ATTRIBUTE_ID = 35L; + private static final long MIC_STATUS_ATTRIBUTE_ID = 36L; + private static final long MIC_VOLUME_LEVEL_ATTRIBUTE_ID = 37L; + private static final long MIC_MAX_LEVEL_ATTRIBUTE_ID = 38L; + private static final long MIC_MIN_LEVEL_ATTRIBUTE_ID = 39L; + private static final long MIC_AGC_ENABLED_ATTRIBUTE_ID = 40L; + private static final long IMAGE_ROTATION_ATTRIBUTE_ID = 41L; + private static final long IMAGE_FLIP_HORIZONTAL_ATTRIBUTE_ID = 42L; + private static final long IMAGE_FLIP_VERTICAL_ATTRIBUTE_ID = 43L; + private static final long LOCAL_VIDEO_RECORDING_ENABLED_ATTRIBUTE_ID = 44L; + private static final long LOCAL_SNAPSHOT_RECORDING_ENABLED_ATTRIBUTE_ID = 45L; + private static final long STATUS_LIGHT_ATTRIBUTE_ID = 46L; + private static final long STATUS_LIGHT_BRIGHTNESS_ATTRIBUTE_ID = 47L; + private static final long DEPTH_SENSOR_STATUS_ATTRIBUTE_ID = 48L; + private static final long WATERMARK_ENABLED_ATTRIBUTE_ID = 49L; + private static final long OSD_ENABLED_ATTRIBUTE_ID = 50L; + 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 CameraAvStreamManagementCluster(long devicePtr, int endpointId) { + super(devicePtr, endpointId, CLUSTER_ID); + } + + @Override + @Deprecated + public long initWithDevice(long devicePtr, int endpointId) { + return 0L; + } + + public void audioStreamAllocate(AudioStreamAllocateResponseCallback callback, Integer streamType, Integer audioCodec, Integer channelCount, Long sampleRate, Long bitRate, Integer bitDepth) { + audioStreamAllocate(callback, streamType, audioCodec, channelCount, sampleRate, bitRate, bitDepth, 0); + } + + public void audioStreamAllocate(AudioStreamAllocateResponseCallback callback, Integer streamType, Integer audioCodec, Integer channelCount, Long sampleRate, Long bitRate, Integer bitDepth, int timedInvokeTimeoutMs) { + final long commandId = 0L; + + ArrayList elements = new ArrayList<>(); + final long streamTypeFieldID = 0L; + BaseTLVType streamTypetlvValue = new UIntType(streamType); + elements.add(new StructElement(streamTypeFieldID, streamTypetlvValue)); + + final long audioCodecFieldID = 1L; + BaseTLVType audioCodectlvValue = new UIntType(audioCodec); + elements.add(new StructElement(audioCodecFieldID, audioCodectlvValue)); + + final long channelCountFieldID = 2L; + BaseTLVType channelCounttlvValue = new UIntType(channelCount); + elements.add(new StructElement(channelCountFieldID, channelCounttlvValue)); + + final long sampleRateFieldID = 3L; + BaseTLVType sampleRatetlvValue = new UIntType(sampleRate); + elements.add(new StructElement(sampleRateFieldID, sampleRatetlvValue)); + + final long bitRateFieldID = 4L; + BaseTLVType bitRatetlvValue = new UIntType(bitRate); + elements.add(new StructElement(bitRateFieldID, bitRatetlvValue)); + + final long bitDepthFieldID = 5L; + BaseTLVType bitDepthtlvValue = new UIntType(bitDepth); + elements.add(new StructElement(bitDepthFieldID, bitDepthtlvValue)); + + StructType commandArgs = new StructType(elements); + invoke(new InvokeCallbackImpl(callback) { + @Override + public void onResponse(StructType invokeStructValue) { + final long audioStreamIDFieldID = 0L; + Integer audioStreamID = null; + for (StructElement element: invokeStructValue.value()) { + if (element.contextTagNum() == audioStreamIDFieldID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + audioStreamID = castingValue.value(Integer.class); + } + } + } + callback.onSuccess(audioStreamID); + }}, commandId, commandArgs, timedInvokeTimeoutMs); + } + + public void audioStreamDeallocate(DefaultClusterCallback callback, Integer audioStreamID) { + audioStreamDeallocate(callback, audioStreamID, 0); + } + + public void audioStreamDeallocate(DefaultClusterCallback callback, Integer audioStreamID, int timedInvokeTimeoutMs) { + final long commandId = 2L; + + ArrayList elements = new ArrayList<>(); + final long audioStreamIDFieldID = 0L; + BaseTLVType audioStreamIDtlvValue = new UIntType(audioStreamID); + elements.add(new StructElement(audioStreamIDFieldID, audioStreamIDtlvValue)); + + StructType commandArgs = new StructType(elements); + invoke(new InvokeCallbackImpl(callback) { + @Override + public void onResponse(StructType invokeStructValue) { + callback.onSuccess(); + }}, commandId, commandArgs, timedInvokeTimeoutMs); + } + + public void videoStreamAllocate(VideoStreamAllocateResponseCallback callback, Integer streamType, Integer videoCodec, Integer minFrameRate, Integer maxFrameRate, ChipStructs.CameraAvStreamManagementClusterVideoResolutionStruct minResolution, ChipStructs.CameraAvStreamManagementClusterVideoResolutionStruct maxResolution, Long minBitRate, Long maxBitRate, Integer minFragmentLen, Integer maxFragmentLen) { + videoStreamAllocate(callback, streamType, videoCodec, minFrameRate, maxFrameRate, minResolution, maxResolution, minBitRate, maxBitRate, minFragmentLen, maxFragmentLen, 0); + } + + public void videoStreamAllocate(VideoStreamAllocateResponseCallback callback, Integer streamType, Integer videoCodec, Integer minFrameRate, Integer maxFrameRate, ChipStructs.CameraAvStreamManagementClusterVideoResolutionStruct minResolution, ChipStructs.CameraAvStreamManagementClusterVideoResolutionStruct maxResolution, Long minBitRate, Long maxBitRate, Integer minFragmentLen, Integer maxFragmentLen, int timedInvokeTimeoutMs) { + final long commandId = 3L; + + ArrayList elements = new ArrayList<>(); + final long streamTypeFieldID = 0L; + BaseTLVType streamTypetlvValue = new UIntType(streamType); + elements.add(new StructElement(streamTypeFieldID, streamTypetlvValue)); + + final long videoCodecFieldID = 1L; + BaseTLVType videoCodectlvValue = new UIntType(videoCodec); + elements.add(new StructElement(videoCodecFieldID, videoCodectlvValue)); + + final long minFrameRateFieldID = 2L; + BaseTLVType minFrameRatetlvValue = new UIntType(minFrameRate); + elements.add(new StructElement(minFrameRateFieldID, minFrameRatetlvValue)); + + final long maxFrameRateFieldID = 3L; + BaseTLVType maxFrameRatetlvValue = new UIntType(maxFrameRate); + elements.add(new StructElement(maxFrameRateFieldID, maxFrameRatetlvValue)); + + final long minResolutionFieldID = 4L; + BaseTLVType minResolutiontlvValue = minResolution.encodeTlv(); + elements.add(new StructElement(minResolutionFieldID, minResolutiontlvValue)); + + final long maxResolutionFieldID = 5L; + BaseTLVType maxResolutiontlvValue = maxResolution.encodeTlv(); + elements.add(new StructElement(maxResolutionFieldID, maxResolutiontlvValue)); + + final long minBitRateFieldID = 6L; + BaseTLVType minBitRatetlvValue = new UIntType(minBitRate); + elements.add(new StructElement(minBitRateFieldID, minBitRatetlvValue)); + + final long maxBitRateFieldID = 7L; + BaseTLVType maxBitRatetlvValue = new UIntType(maxBitRate); + elements.add(new StructElement(maxBitRateFieldID, maxBitRatetlvValue)); + + final long minFragmentLenFieldID = 8L; + BaseTLVType minFragmentLentlvValue = new UIntType(minFragmentLen); + elements.add(new StructElement(minFragmentLenFieldID, minFragmentLentlvValue)); + + final long maxFragmentLenFieldID = 9L; + BaseTLVType maxFragmentLentlvValue = new UIntType(maxFragmentLen); + elements.add(new StructElement(maxFragmentLenFieldID, maxFragmentLentlvValue)); + + StructType commandArgs = new StructType(elements); + invoke(new InvokeCallbackImpl(callback) { + @Override + public void onResponse(StructType invokeStructValue) { + final long videoStreamIDFieldID = 0L; + Integer videoStreamID = null; + for (StructElement element: invokeStructValue.value()) { + if (element.contextTagNum() == videoStreamIDFieldID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + videoStreamID = castingValue.value(Integer.class); + } + } + } + callback.onSuccess(videoStreamID); + }}, commandId, commandArgs, timedInvokeTimeoutMs); + } + + public void videoStreamModify(DefaultClusterCallback callback, Integer videoStreamID, ChipStructs.CameraAvStreamManagementClusterVideoResolutionStruct resolution) { + videoStreamModify(callback, videoStreamID, resolution, 0); + } + + public void videoStreamModify(DefaultClusterCallback callback, Integer videoStreamID, ChipStructs.CameraAvStreamManagementClusterVideoResolutionStruct resolution, int timedInvokeTimeoutMs) { + final long commandId = 5L; + + ArrayList elements = new ArrayList<>(); + final long videoStreamIDFieldID = 0L; + BaseTLVType videoStreamIDtlvValue = new UIntType(videoStreamID); + elements.add(new StructElement(videoStreamIDFieldID, videoStreamIDtlvValue)); + + final long resolutionFieldID = 1L; + BaseTLVType resolutiontlvValue = resolution.encodeTlv(); + elements.add(new StructElement(resolutionFieldID, resolutiontlvValue)); + + StructType commandArgs = new StructType(elements); + invoke(new InvokeCallbackImpl(callback) { + @Override + public void onResponse(StructType invokeStructValue) { + callback.onSuccess(); + }}, commandId, commandArgs, timedInvokeTimeoutMs); + } + + public void videoStreamDeallocate(DefaultClusterCallback callback, Integer videoStreamID) { + videoStreamDeallocate(callback, videoStreamID, 0); + } + + public void videoStreamDeallocate(DefaultClusterCallback callback, Integer videoStreamID, int timedInvokeTimeoutMs) { + final long commandId = 6L; + + ArrayList elements = new ArrayList<>(); + final long videoStreamIDFieldID = 0L; + BaseTLVType videoStreamIDtlvValue = new UIntType(videoStreamID); + elements.add(new StructElement(videoStreamIDFieldID, videoStreamIDtlvValue)); + + StructType commandArgs = new StructType(elements); + invoke(new InvokeCallbackImpl(callback) { + @Override + public void onResponse(StructType invokeStructValue) { + callback.onSuccess(); + }}, commandId, commandArgs, timedInvokeTimeoutMs); + } + + public void snapshotStreamAllocate(SnapshotStreamAllocateResponseCallback callback, Integer imageCodec, Integer frameRate, Long bitRate, ChipStructs.CameraAvStreamManagementClusterVideoResolutionStruct minResolution, ChipStructs.CameraAvStreamManagementClusterVideoResolutionStruct maxResolution, Integer quality) { + snapshotStreamAllocate(callback, imageCodec, frameRate, bitRate, minResolution, maxResolution, quality, 0); + } + + public void snapshotStreamAllocate(SnapshotStreamAllocateResponseCallback callback, Integer imageCodec, Integer frameRate, Long bitRate, ChipStructs.CameraAvStreamManagementClusterVideoResolutionStruct minResolution, ChipStructs.CameraAvStreamManagementClusterVideoResolutionStruct maxResolution, Integer quality, int timedInvokeTimeoutMs) { + final long commandId = 7L; + + ArrayList elements = new ArrayList<>(); + final long imageCodecFieldID = 0L; + BaseTLVType imageCodectlvValue = new UIntType(imageCodec); + elements.add(new StructElement(imageCodecFieldID, imageCodectlvValue)); + + final long frameRateFieldID = 1L; + BaseTLVType frameRatetlvValue = new UIntType(frameRate); + elements.add(new StructElement(frameRateFieldID, frameRatetlvValue)); + + final long bitRateFieldID = 2L; + BaseTLVType bitRatetlvValue = new UIntType(bitRate); + elements.add(new StructElement(bitRateFieldID, bitRatetlvValue)); + + final long minResolutionFieldID = 3L; + BaseTLVType minResolutiontlvValue = minResolution.encodeTlv(); + elements.add(new StructElement(minResolutionFieldID, minResolutiontlvValue)); + + final long maxResolutionFieldID = 4L; + BaseTLVType maxResolutiontlvValue = maxResolution.encodeTlv(); + elements.add(new StructElement(maxResolutionFieldID, maxResolutiontlvValue)); + + final long qualityFieldID = 5L; + BaseTLVType qualitytlvValue = new UIntType(quality); + elements.add(new StructElement(qualityFieldID, qualitytlvValue)); + + StructType commandArgs = new StructType(elements); + invoke(new InvokeCallbackImpl(callback) { + @Override + public void onResponse(StructType invokeStructValue) { + final long snapshotStreamIDFieldID = 0L; + Integer snapshotStreamID = null; + for (StructElement element: invokeStructValue.value()) { + if (element.contextTagNum() == snapshotStreamIDFieldID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + snapshotStreamID = castingValue.value(Integer.class); + } + } + } + callback.onSuccess(snapshotStreamID); + }}, commandId, commandArgs, timedInvokeTimeoutMs); + } + + public void snapshotStreamDeallocate(DefaultClusterCallback callback, Integer snapshotStreamID) { + snapshotStreamDeallocate(callback, snapshotStreamID, 0); + } + + public void snapshotStreamDeallocate(DefaultClusterCallback callback, Integer snapshotStreamID, int timedInvokeTimeoutMs) { + final long commandId = 9L; + + ArrayList elements = new ArrayList<>(); + final long snapshotStreamIDFieldID = 0L; + BaseTLVType snapshotStreamIDtlvValue = new UIntType(snapshotStreamID); + elements.add(new StructElement(snapshotStreamIDFieldID, snapshotStreamIDtlvValue)); + + StructType commandArgs = new StructType(elements); + invoke(new InvokeCallbackImpl(callback) { + @Override + public void onResponse(StructType invokeStructValue) { + callback.onSuccess(); + }}, commandId, commandArgs, timedInvokeTimeoutMs); + } + + public void setStreamPriority(DefaultClusterCallback callback) { + setStreamPriority(callback, 0); + } + + public void setStreamPriority(DefaultClusterCallback callback, int timedInvokeTimeoutMs) { + final long commandId = 10L; + + ArrayList elements = new ArrayList<>(); + StructType commandArgs = new StructType(elements); + invoke(new InvokeCallbackImpl(callback) { + @Override + public void onResponse(StructType invokeStructValue) { + callback.onSuccess(); + }}, commandId, commandArgs, timedInvokeTimeoutMs); + } + + public void captureSnapshot(DefaultClusterCallback callback, Integer snapshotStreamID, ChipStructs.CameraAvStreamManagementClusterVideoResolutionStruct requestedResolution) { + captureSnapshot(callback, snapshotStreamID, requestedResolution, 0); + } + + public void captureSnapshot(DefaultClusterCallback callback, Integer snapshotStreamID, ChipStructs.CameraAvStreamManagementClusterVideoResolutionStruct requestedResolution, int timedInvokeTimeoutMs) { + final long commandId = 11L; + + ArrayList elements = new ArrayList<>(); + final long snapshotStreamIDFieldID = 0L; + BaseTLVType snapshotStreamIDtlvValue = new UIntType(snapshotStreamID); + elements.add(new StructElement(snapshotStreamIDFieldID, snapshotStreamIDtlvValue)); + + final long requestedResolutionFieldID = 1L; + BaseTLVType requestedResolutiontlvValue = requestedResolution.encodeTlv(); + elements.add(new StructElement(requestedResolutionFieldID, requestedResolutiontlvValue)); + + StructType commandArgs = new StructType(elements); + invoke(new InvokeCallbackImpl(callback) { + @Override + public void onResponse(StructType invokeStructValue) { + callback.onSuccess(); + }}, commandId, commandArgs, timedInvokeTimeoutMs); + } + + public void setViewport(DefaultClusterCallback callback, ChipStructs.CameraAvStreamManagementClusterViewportStruct viewport) { + setViewport(callback, viewport, 0); + } + + public void setViewport(DefaultClusterCallback callback, ChipStructs.CameraAvStreamManagementClusterViewportStruct viewport, int timedInvokeTimeoutMs) { + final long commandId = 13L; + + ArrayList elements = new ArrayList<>(); + final long viewportFieldID = 0L; + BaseTLVType viewporttlvValue = viewport.encodeTlv(); + elements.add(new StructElement(viewportFieldID, viewporttlvValue)); + + StructType commandArgs = new StructType(elements); + invoke(new InvokeCallbackImpl(callback) { + @Override + public void onResponse(StructType invokeStructValue) { + callback.onSuccess(); + }}, commandId, commandArgs, timedInvokeTimeoutMs); + } + + public void setImageRotation(DefaultClusterCallback callback, Integer angle) { + setImageRotation(callback, angle, 0); + } + + public void setImageRotation(DefaultClusterCallback callback, Integer angle, int timedInvokeTimeoutMs) { + final long commandId = 14L; + + ArrayList elements = new ArrayList<>(); + final long angleFieldID = 0L; + BaseTLVType angletlvValue = new UIntType(angle); + elements.add(new StructElement(angleFieldID, angletlvValue)); + + StructType commandArgs = new StructType(elements); + invoke(new InvokeCallbackImpl(callback) { + @Override + public void onResponse(StructType invokeStructValue) { + callback.onSuccess(); + }}, commandId, commandArgs, timedInvokeTimeoutMs); + } + + public void setImageFlipHorizontal(DefaultClusterCallback callback, Boolean enabled) { + setImageFlipHorizontal(callback, enabled, 0); + } + + public void setImageFlipHorizontal(DefaultClusterCallback callback, Boolean enabled, int timedInvokeTimeoutMs) { + final long commandId = 15L; + + ArrayList elements = new ArrayList<>(); + final long enabledFieldID = 0L; + BaseTLVType enabledtlvValue = new BooleanType(enabled); + elements.add(new StructElement(enabledFieldID, enabledtlvValue)); + + StructType commandArgs = new StructType(elements); + invoke(new InvokeCallbackImpl(callback) { + @Override + public void onResponse(StructType invokeStructValue) { + callback.onSuccess(); + }}, commandId, commandArgs, timedInvokeTimeoutMs); + } + + public void setImageFlipVertical(DefaultClusterCallback callback, Boolean enabled) { + setImageFlipVertical(callback, enabled, 0); + } + + public void setImageFlipVertical(DefaultClusterCallback callback, Boolean enabled, int timedInvokeTimeoutMs) { + final long commandId = 16L; + + ArrayList elements = new ArrayList<>(); + final long enabledFieldID = 0L; + BaseTLVType enabledtlvValue = new BooleanType(enabled); + elements.add(new StructElement(enabledFieldID, enabledtlvValue)); + + StructType commandArgs = new StructType(elements); + invoke(new InvokeCallbackImpl(callback) { + @Override + public void onResponse(StructType invokeStructValue) { + callback.onSuccess(); + }}, commandId, commandArgs, timedInvokeTimeoutMs); + } + + public void setWatermark(DefaultClusterCallback callback, Integer videoStreamID, Boolean enabled) { + setWatermark(callback, videoStreamID, enabled, 0); + } + + public void setWatermark(DefaultClusterCallback callback, Integer videoStreamID, Boolean enabled, int timedInvokeTimeoutMs) { + final long commandId = 17L; + + ArrayList elements = new ArrayList<>(); + final long videoStreamIDFieldID = 0L; + BaseTLVType videoStreamIDtlvValue = new UIntType(videoStreamID); + elements.add(new StructElement(videoStreamIDFieldID, videoStreamIDtlvValue)); + + final long enabledFieldID = 1L; + BaseTLVType enabledtlvValue = new BooleanType(enabled); + elements.add(new StructElement(enabledFieldID, enabledtlvValue)); + + StructType commandArgs = new StructType(elements); + invoke(new InvokeCallbackImpl(callback) { + @Override + public void onResponse(StructType invokeStructValue) { + callback.onSuccess(); + }}, commandId, commandArgs, timedInvokeTimeoutMs); + } + + public void setOSD(DefaultClusterCallback callback, Integer videoStreamID, Boolean enabled) { + setOSD(callback, videoStreamID, enabled, 0); + } + + public void setOSD(DefaultClusterCallback callback, Integer videoStreamID, Boolean enabled, int timedInvokeTimeoutMs) { + final long commandId = 18L; + + ArrayList elements = new ArrayList<>(); + final long videoStreamIDFieldID = 0L; + BaseTLVType videoStreamIDtlvValue = new UIntType(videoStreamID); + elements.add(new StructElement(videoStreamIDFieldID, videoStreamIDtlvValue)); + + final long enabledFieldID = 1L; + BaseTLVType enabledtlvValue = new BooleanType(enabled); + elements.add(new StructElement(enabledFieldID, enabledtlvValue)); + + StructType commandArgs = new StructType(elements); + invoke(new InvokeCallbackImpl(callback) { + @Override + public void onResponse(StructType invokeStructValue) { + callback.onSuccess(); + }}, commandId, commandArgs, timedInvokeTimeoutMs); + } + + public interface AudioStreamAllocateResponseCallback extends BaseClusterCallback { + void onSuccess(Integer audioStreamID); + } + + public interface VideoStreamAllocateResponseCallback extends BaseClusterCallback { + void onSuccess(Integer videoStreamID); + } + + public interface SnapshotStreamAllocateResponseCallback extends BaseClusterCallback { + void onSuccess(Integer snapshotStreamID); + } + + public interface VideoSensorParamsAttributeCallback extends BaseAttributeCallback { + void onSuccess(ChipStructs.CameraAvStreamManagementClusterVideoSensorParamsStruct value); + } + + public interface MinViewPortWidthAttributeCallback extends BaseAttributeCallback { + void onSuccess(ChipStructs.CameraAvStreamManagementClusterVideoResolutionStruct value); + } + + public interface MinViewPortHeightAttributeCallback extends BaseAttributeCallback { + void onSuccess(ChipStructs.CameraAvStreamManagementClusterVideoResolutionStruct value); + } + + public interface RateDistortionTradeOffPointsAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); + } + + public interface MicrophoneCapabilitiesAttributeCallback extends BaseAttributeCallback { + void onSuccess(ChipStructs.CameraAvStreamManagementClusterAudioCapabilitiesStruct value); + } + + public interface SpeakerCapabilitiesAttributeCallback extends BaseAttributeCallback { + void onSuccess(@Nullable ChipStructs.CameraAvStreamManagementClusterAudioCapabilitiesStruct value); + } + + public interface SupportedSnapshotParamsAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); + } + + public interface CurrentVideoCodecsAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); + } + + public interface CurrentSnapshotConfigAttributeCallback extends BaseAttributeCallback { + void onSuccess(ChipStructs.CameraAvStreamManagementClusterSnapshotParamsStruct value); + } + + public interface FabricsUsingCameraAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); + } + + public interface AllocatedVideoStreamsAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); + } + + public interface AllocatedAudioStreamsAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); + } + + public interface AllocatedSnapshotStreamsAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); + } + + public interface RankedVideoStreamPrioritiesListAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); + } + + public interface ViewportAttributeCallback extends BaseAttributeCallback { + void onSuccess(ChipStructs.CameraAvStreamManagementClusterViewportStruct value); + } + + public interface WatermarkEnabledAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); + } + + public interface OSDEnabledAttributeCallback 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 readMaxConcurrentVideoEncodersAttribute( + IntegerAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MAX_CONCURRENT_VIDEO_ENCODERS_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, MAX_CONCURRENT_VIDEO_ENCODERS_ATTRIBUTE_ID, true); + } + + public void subscribeMaxConcurrentVideoEncodersAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MAX_CONCURRENT_VIDEO_ENCODERS_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, MAX_CONCURRENT_VIDEO_ENCODERS_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readMaxEncodedPixelRateAttribute( + LongAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MAX_ENCODED_PIXEL_RATE_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, MAX_ENCODED_PIXEL_RATE_ATTRIBUTE_ID, true); + } + + public void subscribeMaxEncodedPixelRateAttribute( + LongAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MAX_ENCODED_PIXEL_RATE_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, MAX_ENCODED_PIXEL_RATE_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readVideoSensorParamsAttribute( + VideoSensorParamsAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, VIDEO_SENSOR_PARAMS_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + ChipStructs.CameraAvStreamManagementClusterVideoSensorParamsStruct value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, VIDEO_SENSOR_PARAMS_ATTRIBUTE_ID, true); + } + + public void subscribeVideoSensorParamsAttribute( + VideoSensorParamsAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, VIDEO_SENSOR_PARAMS_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + ChipStructs.CameraAvStreamManagementClusterVideoSensorParamsStruct value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, VIDEO_SENSOR_PARAMS_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readNightVisionCapableAttribute( + BooleanAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, NIGHT_VISION_CAPABLE_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Boolean value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, NIGHT_VISION_CAPABLE_ATTRIBUTE_ID, true); + } + + public void subscribeNightVisionCapableAttribute( + BooleanAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, NIGHT_VISION_CAPABLE_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Boolean value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, NIGHT_VISION_CAPABLE_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readMinViewPortWidthAttribute( + MinViewPortWidthAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MIN_VIEW_PORT_WIDTH_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + ChipStructs.CameraAvStreamManagementClusterVideoResolutionStruct value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, MIN_VIEW_PORT_WIDTH_ATTRIBUTE_ID, true); + } + + public void subscribeMinViewPortWidthAttribute( + MinViewPortWidthAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MIN_VIEW_PORT_WIDTH_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + ChipStructs.CameraAvStreamManagementClusterVideoResolutionStruct value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, MIN_VIEW_PORT_WIDTH_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readMinViewPortHeightAttribute( + MinViewPortHeightAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MIN_VIEW_PORT_HEIGHT_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + ChipStructs.CameraAvStreamManagementClusterVideoResolutionStruct value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, MIN_VIEW_PORT_HEIGHT_ATTRIBUTE_ID, true); + } + + public void subscribeMinViewPortHeightAttribute( + MinViewPortHeightAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MIN_VIEW_PORT_HEIGHT_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + ChipStructs.CameraAvStreamManagementClusterVideoResolutionStruct value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, MIN_VIEW_PORT_HEIGHT_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readRateDistortionTradeOffPointsAttribute( + RateDistortionTradeOffPointsAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RATE_DISTORTION_TRADE_OFF_POINTS_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, RATE_DISTORTION_TRADE_OFF_POINTS_ATTRIBUTE_ID, true); + } + + public void subscribeRateDistortionTradeOffPointsAttribute( + RateDistortionTradeOffPointsAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RATE_DISTORTION_TRADE_OFF_POINTS_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, RATE_DISTORTION_TRADE_OFF_POINTS_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readMaxPreRollBufferSizeAttribute( + LongAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MAX_PRE_ROLL_BUFFER_SIZE_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, MAX_PRE_ROLL_BUFFER_SIZE_ATTRIBUTE_ID, true); + } + + public void subscribeMaxPreRollBufferSizeAttribute( + LongAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MAX_PRE_ROLL_BUFFER_SIZE_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, MAX_PRE_ROLL_BUFFER_SIZE_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readMicrophoneCapabilitiesAttribute( + MicrophoneCapabilitiesAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MICROPHONE_CAPABILITIES_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + ChipStructs.CameraAvStreamManagementClusterAudioCapabilitiesStruct value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, MICROPHONE_CAPABILITIES_ATTRIBUTE_ID, true); + } + + public void subscribeMicrophoneCapabilitiesAttribute( + MicrophoneCapabilitiesAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MICROPHONE_CAPABILITIES_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + ChipStructs.CameraAvStreamManagementClusterAudioCapabilitiesStruct value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, MICROPHONE_CAPABILITIES_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readSpeakerCapabilitiesAttribute( + SpeakerCapabilitiesAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, SPEAKER_CAPABILITIES_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + @Nullable ChipStructs.CameraAvStreamManagementClusterAudioCapabilitiesStruct value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, SPEAKER_CAPABILITIES_ATTRIBUTE_ID, true); + } + + public void subscribeSpeakerCapabilitiesAttribute( + SpeakerCapabilitiesAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, SPEAKER_CAPABILITIES_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + @Nullable ChipStructs.CameraAvStreamManagementClusterAudioCapabilitiesStruct value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, SPEAKER_CAPABILITIES_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readTwoWayTalkSupportAttribute( + IntegerAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, TWO_WAY_TALK_SUPPORT_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, TWO_WAY_TALK_SUPPORT_ATTRIBUTE_ID, true); + } + + public void subscribeTwoWayTalkSupportAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, TWO_WAY_TALK_SUPPORT_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, TWO_WAY_TALK_SUPPORT_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readSupportedSnapshotParamsAttribute( + SupportedSnapshotParamsAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, SUPPORTED_SNAPSHOT_PARAMS_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, SUPPORTED_SNAPSHOT_PARAMS_ATTRIBUTE_ID, true); + } + + public void subscribeSupportedSnapshotParamsAttribute( + SupportedSnapshotParamsAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, SUPPORTED_SNAPSHOT_PARAMS_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, SUPPORTED_SNAPSHOT_PARAMS_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readHDRCapableAttribute( + BooleanAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, HDR_CAPABLE_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Boolean value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, HDR_CAPABLE_ATTRIBUTE_ID, true); + } + + public void subscribeHDRCapableAttribute( + BooleanAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, HDR_CAPABLE_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Boolean value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, HDR_CAPABLE_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readMaxNetworkBandwidthAttribute( + LongAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MAX_NETWORK_BANDWIDTH_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, MAX_NETWORK_BANDWIDTH_ATTRIBUTE_ID, true); + } + + public void subscribeMaxNetworkBandwidthAttribute( + LongAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MAX_NETWORK_BANDWIDTH_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, MAX_NETWORK_BANDWIDTH_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readCurrentFrameRateAttribute( + IntegerAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, CURRENT_FRAME_RATE_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, CURRENT_FRAME_RATE_ATTRIBUTE_ID, true); + } + + public void subscribeCurrentFrameRateAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, CURRENT_FRAME_RATE_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, CURRENT_FRAME_RATE_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readHDRModeAttribute( + BooleanAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, HDR_MODE_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Boolean value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, HDR_MODE_ATTRIBUTE_ID, true); + } + + public void writeHDRModeAttribute(DefaultClusterCallback callback, Boolean value) { + writeHDRModeAttribute(callback, value, 0); + } + + public void writeHDRModeAttribute(DefaultClusterCallback callback, Boolean value, int timedWriteTimeoutMs) { + BaseTLVType tlvValue = new BooleanType(value); + writeAttribute(new WriteAttributesCallbackImpl(callback), HDR_MODE_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); + } + + public void subscribeHDRModeAttribute( + BooleanAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, HDR_MODE_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Boolean value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, HDR_MODE_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readCurrentVideoCodecsAttribute( + CurrentVideoCodecsAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, CURRENT_VIDEO_CODECS_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, CURRENT_VIDEO_CODECS_ATTRIBUTE_ID, true); + } + + public void subscribeCurrentVideoCodecsAttribute( + CurrentVideoCodecsAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, CURRENT_VIDEO_CODECS_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, CURRENT_VIDEO_CODECS_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readCurrentSnapshotConfigAttribute( + CurrentSnapshotConfigAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, CURRENT_SNAPSHOT_CONFIG_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + ChipStructs.CameraAvStreamManagementClusterSnapshotParamsStruct value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, CURRENT_SNAPSHOT_CONFIG_ATTRIBUTE_ID, true); + } + + public void subscribeCurrentSnapshotConfigAttribute( + CurrentSnapshotConfigAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, CURRENT_SNAPSHOT_CONFIG_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + ChipStructs.CameraAvStreamManagementClusterSnapshotParamsStruct value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, CURRENT_SNAPSHOT_CONFIG_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readFabricsUsingCameraAttribute( + FabricsUsingCameraAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, FABRICS_USING_CAMERA_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, FABRICS_USING_CAMERA_ATTRIBUTE_ID, true); + } + + public void subscribeFabricsUsingCameraAttribute( + FabricsUsingCameraAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, FABRICS_USING_CAMERA_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, FABRICS_USING_CAMERA_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readAllocatedVideoStreamsAttribute( + AllocatedVideoStreamsAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ALLOCATED_VIDEO_STREAMS_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, ALLOCATED_VIDEO_STREAMS_ATTRIBUTE_ID, true); + } + + public void subscribeAllocatedVideoStreamsAttribute( + AllocatedVideoStreamsAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ALLOCATED_VIDEO_STREAMS_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, ALLOCATED_VIDEO_STREAMS_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readAllocatedAudioStreamsAttribute( + AllocatedAudioStreamsAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ALLOCATED_AUDIO_STREAMS_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, ALLOCATED_AUDIO_STREAMS_ATTRIBUTE_ID, true); + } + + public void subscribeAllocatedAudioStreamsAttribute( + AllocatedAudioStreamsAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ALLOCATED_AUDIO_STREAMS_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, ALLOCATED_AUDIO_STREAMS_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readAllocatedSnapshotStreamsAttribute( + AllocatedSnapshotStreamsAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ALLOCATED_SNAPSHOT_STREAMS_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, ALLOCATED_SNAPSHOT_STREAMS_ATTRIBUTE_ID, true); + } + + public void subscribeAllocatedSnapshotStreamsAttribute( + AllocatedSnapshotStreamsAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ALLOCATED_SNAPSHOT_STREAMS_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, ALLOCATED_SNAPSHOT_STREAMS_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readRankedVideoStreamPrioritiesListAttribute( + RankedVideoStreamPrioritiesListAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RANKED_VIDEO_STREAM_PRIORITIES_LIST_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, RANKED_VIDEO_STREAM_PRIORITIES_LIST_ATTRIBUTE_ID, true); + } + + public void writeRankedVideoStreamPrioritiesListAttribute(DefaultClusterCallback callback, ArrayList value) { + writeRankedVideoStreamPrioritiesListAttribute(callback, value, 0); + } + + public void writeRankedVideoStreamPrioritiesListAttribute(DefaultClusterCallback callback, ArrayList value, int timedWriteTimeoutMs) { + BaseTLVType tlvValue = ArrayType.generateArrayType(value, (elementvalue) -> new UIntType(elementvalue)); + writeAttribute(new WriteAttributesCallbackImpl(callback), RANKED_VIDEO_STREAM_PRIORITIES_LIST_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); + } + + public void subscribeRankedVideoStreamPrioritiesListAttribute( + RankedVideoStreamPrioritiesListAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RANKED_VIDEO_STREAM_PRIORITIES_LIST_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, RANKED_VIDEO_STREAM_PRIORITIES_LIST_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readSoftRecordingPrivacyModeSettingAttribute( + BooleanAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, SOFT_RECORDING_PRIVACY_MODE_SETTING_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Boolean value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, SOFT_RECORDING_PRIVACY_MODE_SETTING_ATTRIBUTE_ID, true); + } + + public void writeSoftRecordingPrivacyModeSettingAttribute(DefaultClusterCallback callback, Boolean value) { + writeSoftRecordingPrivacyModeSettingAttribute(callback, value, 0); + } + + public void writeSoftRecordingPrivacyModeSettingAttribute(DefaultClusterCallback callback, Boolean value, int timedWriteTimeoutMs) { + BaseTLVType tlvValue = new BooleanType(value); + writeAttribute(new WriteAttributesCallbackImpl(callback), SOFT_RECORDING_PRIVACY_MODE_SETTING_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); + } + + public void subscribeSoftRecordingPrivacyModeSettingAttribute( + BooleanAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, SOFT_RECORDING_PRIVACY_MODE_SETTING_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Boolean value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, SOFT_RECORDING_PRIVACY_MODE_SETTING_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readSoftLivestreamPrivacyModeSettingAttribute( + BooleanAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, SOFT_LIVESTREAM_PRIVACY_MODE_SETTING_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Boolean value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, SOFT_LIVESTREAM_PRIVACY_MODE_SETTING_ATTRIBUTE_ID, true); + } + + public void writeSoftLivestreamPrivacyModeSettingAttribute(DefaultClusterCallback callback, Boolean value) { + writeSoftLivestreamPrivacyModeSettingAttribute(callback, value, 0); + } + + public void writeSoftLivestreamPrivacyModeSettingAttribute(DefaultClusterCallback callback, Boolean value, int timedWriteTimeoutMs) { + BaseTLVType tlvValue = new BooleanType(value); + writeAttribute(new WriteAttributesCallbackImpl(callback), SOFT_LIVESTREAM_PRIVACY_MODE_SETTING_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); + } + + public void subscribeSoftLivestreamPrivacyModeSettingAttribute( + BooleanAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, SOFT_LIVESTREAM_PRIVACY_MODE_SETTING_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Boolean value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, SOFT_LIVESTREAM_PRIVACY_MODE_SETTING_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readHardPrivacyModeAttribute( + BooleanAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, HARD_PRIVACY_MODE_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Boolean value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, HARD_PRIVACY_MODE_ATTRIBUTE_ID, true); + } + + public void subscribeHardPrivacyModeAttribute( + BooleanAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, HARD_PRIVACY_MODE_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Boolean value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, HARD_PRIVACY_MODE_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readNightVisionAttribute( + IntegerAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, NIGHT_VISION_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, NIGHT_VISION_ATTRIBUTE_ID, true); + } + + public void writeNightVisionAttribute(DefaultClusterCallback callback, Integer value) { + writeNightVisionAttribute(callback, value, 0); + } + + public void writeNightVisionAttribute(DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { + BaseTLVType tlvValue = new UIntType(value); + writeAttribute(new WriteAttributesCallbackImpl(callback), NIGHT_VISION_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); + } + + public void subscribeNightVisionAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, NIGHT_VISION_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, NIGHT_VISION_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readNightVisionIllumAttribute( + IntegerAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, NIGHT_VISION_ILLUM_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, NIGHT_VISION_ILLUM_ATTRIBUTE_ID, true); + } + + public void writeNightVisionIllumAttribute(DefaultClusterCallback callback, Integer value) { + writeNightVisionIllumAttribute(callback, value, 0); + } + + public void writeNightVisionIllumAttribute(DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { + BaseTLVType tlvValue = new UIntType(value); + writeAttribute(new WriteAttributesCallbackImpl(callback), NIGHT_VISION_ILLUM_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); + } + + public void subscribeNightVisionIllumAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, NIGHT_VISION_ILLUM_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, NIGHT_VISION_ILLUM_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readAwbAttribute( + BooleanAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AWB_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Boolean value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, AWB_ATTRIBUTE_ID, true); + } + + public void writeAwbAttribute(DefaultClusterCallback callback, Boolean value) { + writeAwbAttribute(callback, value, 0); + } + + public void writeAwbAttribute(DefaultClusterCallback callback, Boolean value, int timedWriteTimeoutMs) { + BaseTLVType tlvValue = new BooleanType(value); + writeAttribute(new WriteAttributesCallbackImpl(callback), AWB_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); + } + + public void subscribeAwbAttribute( + BooleanAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AWB_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Boolean value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, AWB_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readShutterSpeedAttribute( + BooleanAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, SHUTTER_SPEED_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Boolean value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, SHUTTER_SPEED_ATTRIBUTE_ID, true); + } + + public void writeShutterSpeedAttribute(DefaultClusterCallback callback, Boolean value) { + writeShutterSpeedAttribute(callback, value, 0); + } + + public void writeShutterSpeedAttribute(DefaultClusterCallback callback, Boolean value, int timedWriteTimeoutMs) { + BaseTLVType tlvValue = new BooleanType(value); + writeAttribute(new WriteAttributesCallbackImpl(callback), SHUTTER_SPEED_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); + } + + public void subscribeShutterSpeedAttribute( + BooleanAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, SHUTTER_SPEED_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Boolean value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, SHUTTER_SPEED_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readIsoAttribute( + BooleanAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ISO_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Boolean value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, ISO_ATTRIBUTE_ID, true); + } + + public void writeIsoAttribute(DefaultClusterCallback callback, Boolean value) { + writeIsoAttribute(callback, value, 0); + } + + public void writeIsoAttribute(DefaultClusterCallback callback, Boolean value, int timedWriteTimeoutMs) { + BaseTLVType tlvValue = new BooleanType(value); + writeAttribute(new WriteAttributesCallbackImpl(callback), ISO_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); + } + + public void subscribeIsoAttribute( + BooleanAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ISO_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Boolean value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, ISO_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readViewportAttribute( + ViewportAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, VIEWPORT_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + ChipStructs.CameraAvStreamManagementClusterViewportStruct value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, VIEWPORT_ATTRIBUTE_ID, true); + } + + public void subscribeViewportAttribute( + ViewportAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, VIEWPORT_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + ChipStructs.CameraAvStreamManagementClusterViewportStruct value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, VIEWPORT_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readSpeakerEnabledAttribute( + BooleanAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, SPEAKER_ENABLED_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Boolean value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, SPEAKER_ENABLED_ATTRIBUTE_ID, true); + } + + public void writeSpeakerEnabledAttribute(DefaultClusterCallback callback, Boolean value) { + writeSpeakerEnabledAttribute(callback, value, 0); + } + + public void writeSpeakerEnabledAttribute(DefaultClusterCallback callback, Boolean value, int timedWriteTimeoutMs) { + BaseTLVType tlvValue = new BooleanType(value); + writeAttribute(new WriteAttributesCallbackImpl(callback), SPEAKER_ENABLED_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); + } + + public void subscribeSpeakerEnabledAttribute( + BooleanAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, SPEAKER_ENABLED_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Boolean value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, SPEAKER_ENABLED_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readSpeakerVolumeLevelAttribute( + IntegerAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, SPEAKER_VOLUME_LEVEL_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, SPEAKER_VOLUME_LEVEL_ATTRIBUTE_ID, true); + } + + public void writeSpeakerVolumeLevelAttribute(DefaultClusterCallback callback, Integer value) { + writeSpeakerVolumeLevelAttribute(callback, value, 0); + } + + public void writeSpeakerVolumeLevelAttribute(DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { + BaseTLVType tlvValue = new UIntType(value); + writeAttribute(new WriteAttributesCallbackImpl(callback), SPEAKER_VOLUME_LEVEL_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); + } + + public void subscribeSpeakerVolumeLevelAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, SPEAKER_VOLUME_LEVEL_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, SPEAKER_VOLUME_LEVEL_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readSpeakerMaxLevelAttribute( + IntegerAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, SPEAKER_MAX_LEVEL_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, SPEAKER_MAX_LEVEL_ATTRIBUTE_ID, true); + } + + public void writeSpeakerMaxLevelAttribute(DefaultClusterCallback callback, Integer value) { + writeSpeakerMaxLevelAttribute(callback, value, 0); + } + + public void writeSpeakerMaxLevelAttribute(DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { + BaseTLVType tlvValue = new UIntType(value); + writeAttribute(new WriteAttributesCallbackImpl(callback), SPEAKER_MAX_LEVEL_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); + } + + public void subscribeSpeakerMaxLevelAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, SPEAKER_MAX_LEVEL_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, SPEAKER_MAX_LEVEL_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readSpeakerMinLevelAttribute( + IntegerAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, SPEAKER_MIN_LEVEL_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, SPEAKER_MIN_LEVEL_ATTRIBUTE_ID, true); + } + + public void writeSpeakerMinLevelAttribute(DefaultClusterCallback callback, Integer value) { + writeSpeakerMinLevelAttribute(callback, value, 0); + } + + public void writeSpeakerMinLevelAttribute(DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { + BaseTLVType tlvValue = new UIntType(value); + writeAttribute(new WriteAttributesCallbackImpl(callback), SPEAKER_MIN_LEVEL_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); + } + + public void subscribeSpeakerMinLevelAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, SPEAKER_MIN_LEVEL_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, SPEAKER_MIN_LEVEL_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readMicStatusAttribute( + BooleanAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MIC_STATUS_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Boolean value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, MIC_STATUS_ATTRIBUTE_ID, true); + } + + public void writeMicStatusAttribute(DefaultClusterCallback callback, Boolean value) { + writeMicStatusAttribute(callback, value, 0); + } + + public void writeMicStatusAttribute(DefaultClusterCallback callback, Boolean value, int timedWriteTimeoutMs) { + BaseTLVType tlvValue = new BooleanType(value); + writeAttribute(new WriteAttributesCallbackImpl(callback), MIC_STATUS_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); + } + + public void subscribeMicStatusAttribute( + BooleanAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MIC_STATUS_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Boolean value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, MIC_STATUS_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readMicVolumeLevelAttribute( + IntegerAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MIC_VOLUME_LEVEL_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, MIC_VOLUME_LEVEL_ATTRIBUTE_ID, true); + } + + public void writeMicVolumeLevelAttribute(DefaultClusterCallback callback, Integer value) { + writeMicVolumeLevelAttribute(callback, value, 0); + } + + public void writeMicVolumeLevelAttribute(DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { + BaseTLVType tlvValue = new UIntType(value); + writeAttribute(new WriteAttributesCallbackImpl(callback), MIC_VOLUME_LEVEL_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); + } + + public void subscribeMicVolumeLevelAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MIC_VOLUME_LEVEL_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, MIC_VOLUME_LEVEL_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readMicMaxLevelAttribute( + IntegerAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MIC_MAX_LEVEL_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, MIC_MAX_LEVEL_ATTRIBUTE_ID, true); + } + + public void writeMicMaxLevelAttribute(DefaultClusterCallback callback, Integer value) { + writeMicMaxLevelAttribute(callback, value, 0); + } + + public void writeMicMaxLevelAttribute(DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { + BaseTLVType tlvValue = new UIntType(value); + writeAttribute(new WriteAttributesCallbackImpl(callback), MIC_MAX_LEVEL_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); + } + + public void subscribeMicMaxLevelAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MIC_MAX_LEVEL_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, MIC_MAX_LEVEL_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readMicMinLevelAttribute( + IntegerAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MIC_MIN_LEVEL_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, MIC_MIN_LEVEL_ATTRIBUTE_ID, true); + } + + public void writeMicMinLevelAttribute(DefaultClusterCallback callback, Integer value) { + writeMicMinLevelAttribute(callback, value, 0); + } + + public void writeMicMinLevelAttribute(DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { + BaseTLVType tlvValue = new UIntType(value); + writeAttribute(new WriteAttributesCallbackImpl(callback), MIC_MIN_LEVEL_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); + } + + public void subscribeMicMinLevelAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MIC_MIN_LEVEL_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, MIC_MIN_LEVEL_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readMicAGCEnabledAttribute( + BooleanAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MIC_AGC_ENABLED_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Boolean value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, MIC_AGC_ENABLED_ATTRIBUTE_ID, true); + } + + public void writeMicAGCEnabledAttribute(DefaultClusterCallback callback, Boolean value) { + writeMicAGCEnabledAttribute(callback, value, 0); + } + + public void writeMicAGCEnabledAttribute(DefaultClusterCallback callback, Boolean value, int timedWriteTimeoutMs) { + BaseTLVType tlvValue = new BooleanType(value); + writeAttribute(new WriteAttributesCallbackImpl(callback), MIC_AGC_ENABLED_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); + } + + public void subscribeMicAGCEnabledAttribute( + BooleanAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MIC_AGC_ENABLED_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Boolean value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, MIC_AGC_ENABLED_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readImageRotationAttribute( + IntegerAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, IMAGE_ROTATION_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, IMAGE_ROTATION_ATTRIBUTE_ID, true); + } + + public void subscribeImageRotationAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, IMAGE_ROTATION_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, IMAGE_ROTATION_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readImageFlipHorizontalAttribute( + BooleanAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, IMAGE_FLIP_HORIZONTAL_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Boolean value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, IMAGE_FLIP_HORIZONTAL_ATTRIBUTE_ID, true); + } + + public void subscribeImageFlipHorizontalAttribute( + BooleanAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, IMAGE_FLIP_HORIZONTAL_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Boolean value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, IMAGE_FLIP_HORIZONTAL_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readImageFlipVerticalAttribute( + BooleanAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, IMAGE_FLIP_VERTICAL_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Boolean value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, IMAGE_FLIP_VERTICAL_ATTRIBUTE_ID, true); + } + + public void subscribeImageFlipVerticalAttribute( + BooleanAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, IMAGE_FLIP_VERTICAL_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Boolean value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, IMAGE_FLIP_VERTICAL_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readLocalVideoRecordingEnabledAttribute( + BooleanAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, LOCAL_VIDEO_RECORDING_ENABLED_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Boolean value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, LOCAL_VIDEO_RECORDING_ENABLED_ATTRIBUTE_ID, true); + } + + public void writeLocalVideoRecordingEnabledAttribute(DefaultClusterCallback callback, Boolean value) { + writeLocalVideoRecordingEnabledAttribute(callback, value, 0); + } + + public void writeLocalVideoRecordingEnabledAttribute(DefaultClusterCallback callback, Boolean value, int timedWriteTimeoutMs) { + BaseTLVType tlvValue = new BooleanType(value); + writeAttribute(new WriteAttributesCallbackImpl(callback), LOCAL_VIDEO_RECORDING_ENABLED_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); + } + + public void subscribeLocalVideoRecordingEnabledAttribute( + BooleanAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, LOCAL_VIDEO_RECORDING_ENABLED_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Boolean value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, LOCAL_VIDEO_RECORDING_ENABLED_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readLocalSnapshotRecordingEnabledAttribute( + BooleanAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, LOCAL_SNAPSHOT_RECORDING_ENABLED_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Boolean value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, LOCAL_SNAPSHOT_RECORDING_ENABLED_ATTRIBUTE_ID, true); + } + + public void writeLocalSnapshotRecordingEnabledAttribute(DefaultClusterCallback callback, Boolean value) { + writeLocalSnapshotRecordingEnabledAttribute(callback, value, 0); + } + + public void writeLocalSnapshotRecordingEnabledAttribute(DefaultClusterCallback callback, Boolean value, int timedWriteTimeoutMs) { + BaseTLVType tlvValue = new BooleanType(value); + writeAttribute(new WriteAttributesCallbackImpl(callback), LOCAL_SNAPSHOT_RECORDING_ENABLED_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); + } + + public void subscribeLocalSnapshotRecordingEnabledAttribute( + BooleanAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, LOCAL_SNAPSHOT_RECORDING_ENABLED_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Boolean value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, LOCAL_SNAPSHOT_RECORDING_ENABLED_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readStatusLightAttribute( + BooleanAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, STATUS_LIGHT_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Boolean value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, STATUS_LIGHT_ATTRIBUTE_ID, true); + } + + public void writeStatusLightAttribute(DefaultClusterCallback callback, Boolean value) { + writeStatusLightAttribute(callback, value, 0); + } + + public void writeStatusLightAttribute(DefaultClusterCallback callback, Boolean value, int timedWriteTimeoutMs) { + BaseTLVType tlvValue = new BooleanType(value); + writeAttribute(new WriteAttributesCallbackImpl(callback), STATUS_LIGHT_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); + } + + public void subscribeStatusLightAttribute( + BooleanAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, STATUS_LIGHT_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Boolean value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, STATUS_LIGHT_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readStatusLightBrightnessAttribute( + IntegerAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, STATUS_LIGHT_BRIGHTNESS_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, STATUS_LIGHT_BRIGHTNESS_ATTRIBUTE_ID, true); + } + + public void writeStatusLightBrightnessAttribute(DefaultClusterCallback callback, Integer value) { + writeStatusLightBrightnessAttribute(callback, value, 0); + } + + public void writeStatusLightBrightnessAttribute(DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { + BaseTLVType tlvValue = new UIntType(value); + writeAttribute(new WriteAttributesCallbackImpl(callback), STATUS_LIGHT_BRIGHTNESS_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); + } + + public void subscribeStatusLightBrightnessAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, STATUS_LIGHT_BRIGHTNESS_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, STATUS_LIGHT_BRIGHTNESS_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readDepthSensorStatusAttribute( + IntegerAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, DEPTH_SENSOR_STATUS_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, DEPTH_SENSOR_STATUS_ATTRIBUTE_ID, true); + } + + public void writeDepthSensorStatusAttribute(DefaultClusterCallback callback, Integer value) { + writeDepthSensorStatusAttribute(callback, value, 0); + } + + public void writeDepthSensorStatusAttribute(DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { + BaseTLVType tlvValue = new UIntType(value); + writeAttribute(new WriteAttributesCallbackImpl(callback), DEPTH_SENSOR_STATUS_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); + } + + public void subscribeDepthSensorStatusAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, DEPTH_SENSOR_STATUS_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, DEPTH_SENSOR_STATUS_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readWatermarkEnabledAttribute( + WatermarkEnabledAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, WATERMARK_ENABLED_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, WATERMARK_ENABLED_ATTRIBUTE_ID, true); + } + + public void subscribeWatermarkEnabledAttribute( + WatermarkEnabledAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, WATERMARK_ENABLED_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, WATERMARK_ENABLED_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readOSDEnabledAttribute( + OSDEnabledAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, OSD_ENABLED_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, OSD_ENABLED_ATTRIBUTE_ID, true); + } + + public void subscribeOSDEnabledAttribute( + OSDEnabledAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, OSD_ENABLED_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, OSD_ENABLED_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 WebRTCTransportProviderCluster extends BaseChipCluster { public static final long CLUSTER_ID = 1363L; diff --git a/src/controller/java/generated/java/chip/devicecontroller/ChipEventStructs.java b/src/controller/java/generated/java/chip/devicecontroller/ChipEventStructs.java index 737462f3da184d..c59e735a9afd1c 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ChipEventStructs.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ChipEventStructs.java @@ -6187,6 +6187,474 @@ public String toString() { return output.toString(); } } +public static class CameraAvStreamManagementClusterVideoStreamChangedEvent { + public Integer videoStreamID; + public Optional streamType; + public Optional videoCodec; + public Optional minFrameRate; + public Optional maxFrameRate; + public Optional minResolution; + public Optional maxResolution; + public Optional minBitRate; + public Optional maxBitRate; + public Optional minFragmentLen; + public Optional maxFragmentLen; + private static final long VIDEO_STREAM_ID_ID = 0L; + private static final long STREAM_TYPE_ID = 1L; + private static final long VIDEO_CODEC_ID = 2L; + private static final long MIN_FRAME_RATE_ID = 3L; + private static final long MAX_FRAME_RATE_ID = 4L; + private static final long MIN_RESOLUTION_ID = 5L; + private static final long MAX_RESOLUTION_ID = 6L; + private static final long MIN_BIT_RATE_ID = 7L; + private static final long MAX_BIT_RATE_ID = 8L; + private static final long MIN_FRAGMENT_LEN_ID = 9L; + private static final long MAX_FRAGMENT_LEN_ID = 10L; + + public CameraAvStreamManagementClusterVideoStreamChangedEvent( + Integer videoStreamID, + Optional streamType, + Optional videoCodec, + Optional minFrameRate, + Optional maxFrameRate, + Optional minResolution, + Optional maxResolution, + Optional minBitRate, + Optional maxBitRate, + Optional minFragmentLen, + Optional maxFragmentLen + ) { + this.videoStreamID = videoStreamID; + this.streamType = streamType; + this.videoCodec = videoCodec; + this.minFrameRate = minFrameRate; + this.maxFrameRate = maxFrameRate; + this.minResolution = minResolution; + this.maxResolution = maxResolution; + this.minBitRate = minBitRate; + this.maxBitRate = maxBitRate; + this.minFragmentLen = minFragmentLen; + this.maxFragmentLen = maxFragmentLen; + } + + public StructType encodeTlv() { + ArrayList values = new ArrayList<>(); + values.add(new StructElement(VIDEO_STREAM_ID_ID, new UIntType(videoStreamID))); + values.add(new StructElement(STREAM_TYPE_ID, streamType.map((nonOptionalstreamType) -> new UIntType(nonOptionalstreamType)).orElse(new EmptyType()))); + values.add(new StructElement(VIDEO_CODEC_ID, videoCodec.map((nonOptionalvideoCodec) -> new UIntType(nonOptionalvideoCodec)).orElse(new EmptyType()))); + values.add(new StructElement(MIN_FRAME_RATE_ID, minFrameRate.map((nonOptionalminFrameRate) -> new UIntType(nonOptionalminFrameRate)).orElse(new EmptyType()))); + values.add(new StructElement(MAX_FRAME_RATE_ID, maxFrameRate.map((nonOptionalmaxFrameRate) -> new UIntType(nonOptionalmaxFrameRate)).orElse(new EmptyType()))); + values.add(new StructElement(MIN_RESOLUTION_ID, minResolution.map((nonOptionalminResolution) -> nonOptionalminResolution.encodeTlv()).orElse(new EmptyType()))); + values.add(new StructElement(MAX_RESOLUTION_ID, maxResolution.map((nonOptionalmaxResolution) -> nonOptionalmaxResolution.encodeTlv()).orElse(new EmptyType()))); + values.add(new StructElement(MIN_BIT_RATE_ID, minBitRate.map((nonOptionalminBitRate) -> new UIntType(nonOptionalminBitRate)).orElse(new EmptyType()))); + values.add(new StructElement(MAX_BIT_RATE_ID, maxBitRate.map((nonOptionalmaxBitRate) -> new UIntType(nonOptionalmaxBitRate)).orElse(new EmptyType()))); + values.add(new StructElement(MIN_FRAGMENT_LEN_ID, minFragmentLen.map((nonOptionalminFragmentLen) -> new UIntType(nonOptionalminFragmentLen)).orElse(new EmptyType()))); + values.add(new StructElement(MAX_FRAGMENT_LEN_ID, maxFragmentLen.map((nonOptionalmaxFragmentLen) -> new UIntType(nonOptionalmaxFragmentLen)).orElse(new EmptyType()))); + + return new StructType(values); + } + + public static CameraAvStreamManagementClusterVideoStreamChangedEvent decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + Integer videoStreamID = null; + Optional streamType = Optional.empty(); + Optional videoCodec = Optional.empty(); + Optional minFrameRate = Optional.empty(); + Optional maxFrameRate = Optional.empty(); + Optional minResolution = Optional.empty(); + Optional maxResolution = Optional.empty(); + Optional minBitRate = Optional.empty(); + Optional maxBitRate = Optional.empty(); + Optional minFragmentLen = Optional.empty(); + Optional maxFragmentLen = Optional.empty(); + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == VIDEO_STREAM_ID_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + videoStreamID = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == STREAM_TYPE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + streamType = Optional.of(castingValue.value(Integer.class)); + } + } else if (element.contextTagNum() == VIDEO_CODEC_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + videoCodec = Optional.of(castingValue.value(Integer.class)); + } + } else if (element.contextTagNum() == MIN_FRAME_RATE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + minFrameRate = Optional.of(castingValue.value(Integer.class)); + } + } else if (element.contextTagNum() == MAX_FRAME_RATE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + maxFrameRate = Optional.of(castingValue.value(Integer.class)); + } + } else if (element.contextTagNum() == MIN_RESOLUTION_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Struct) { + StructType castingValue = element.value(StructType.class); + minResolution = Optional.of(ChipStructs.CameraAvStreamManagementClusterVideoResolutionStruct.decodeTlv(castingValue)); + } + } else if (element.contextTagNum() == MAX_RESOLUTION_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Struct) { + StructType castingValue = element.value(StructType.class); + maxResolution = Optional.of(ChipStructs.CameraAvStreamManagementClusterVideoResolutionStruct.decodeTlv(castingValue)); + } + } else if (element.contextTagNum() == MIN_BIT_RATE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + minBitRate = Optional.of(castingValue.value(Integer.class)); + } + } else if (element.contextTagNum() == MAX_BIT_RATE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + maxBitRate = Optional.of(castingValue.value(Integer.class)); + } + } else if (element.contextTagNum() == MIN_FRAGMENT_LEN_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + minFragmentLen = Optional.of(castingValue.value(Integer.class)); + } + } else if (element.contextTagNum() == MAX_FRAGMENT_LEN_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + maxFragmentLen = Optional.of(castingValue.value(Integer.class)); + } + } + } + return new CameraAvStreamManagementClusterVideoStreamChangedEvent( + videoStreamID, + streamType, + videoCodec, + minFrameRate, + maxFrameRate, + minResolution, + maxResolution, + minBitRate, + maxBitRate, + minFragmentLen, + maxFragmentLen + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("CameraAvStreamManagementClusterVideoStreamChangedEvent {\n"); + output.append("\tvideoStreamID: "); + output.append(videoStreamID); + output.append("\n"); + output.append("\tstreamType: "); + output.append(streamType); + output.append("\n"); + output.append("\tvideoCodec: "); + output.append(videoCodec); + output.append("\n"); + output.append("\tminFrameRate: "); + output.append(minFrameRate); + output.append("\n"); + output.append("\tmaxFrameRate: "); + output.append(maxFrameRate); + output.append("\n"); + output.append("\tminResolution: "); + output.append(minResolution); + output.append("\n"); + output.append("\tmaxResolution: "); + output.append(maxResolution); + output.append("\n"); + output.append("\tminBitRate: "); + output.append(minBitRate); + output.append("\n"); + output.append("\tmaxBitRate: "); + output.append(maxBitRate); + output.append("\n"); + output.append("\tminFragmentLen: "); + output.append(minFragmentLen); + output.append("\n"); + output.append("\tmaxFragmentLen: "); + output.append(maxFragmentLen); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} +public static class CameraAvStreamManagementClusterAudioStreamChangedEvent { + public Integer audioStreamID; + public Optional streamType; + public Optional audioCodec; + public Optional channelCount; + public Optional sampleRate; + public Optional bitRate; + public Optional bitDepth; + private static final long AUDIO_STREAM_ID_ID = 0L; + private static final long STREAM_TYPE_ID = 1L; + private static final long AUDIO_CODEC_ID = 2L; + private static final long CHANNEL_COUNT_ID = 3L; + private static final long SAMPLE_RATE_ID = 4L; + private static final long BIT_RATE_ID = 5L; + private static final long BIT_DEPTH_ID = 6L; + + public CameraAvStreamManagementClusterAudioStreamChangedEvent( + Integer audioStreamID, + Optional streamType, + Optional audioCodec, + Optional channelCount, + Optional sampleRate, + Optional bitRate, + Optional bitDepth + ) { + this.audioStreamID = audioStreamID; + this.streamType = streamType; + this.audioCodec = audioCodec; + this.channelCount = channelCount; + this.sampleRate = sampleRate; + this.bitRate = bitRate; + this.bitDepth = bitDepth; + } + + public StructType encodeTlv() { + ArrayList values = new ArrayList<>(); + values.add(new StructElement(AUDIO_STREAM_ID_ID, new UIntType(audioStreamID))); + values.add(new StructElement(STREAM_TYPE_ID, streamType.map((nonOptionalstreamType) -> new UIntType(nonOptionalstreamType)).orElse(new EmptyType()))); + values.add(new StructElement(AUDIO_CODEC_ID, audioCodec.map((nonOptionalaudioCodec) -> new UIntType(nonOptionalaudioCodec)).orElse(new EmptyType()))); + values.add(new StructElement(CHANNEL_COUNT_ID, channelCount.map((nonOptionalchannelCount) -> new UIntType(nonOptionalchannelCount)).orElse(new EmptyType()))); + values.add(new StructElement(SAMPLE_RATE_ID, sampleRate.map((nonOptionalsampleRate) -> new UIntType(nonOptionalsampleRate)).orElse(new EmptyType()))); + values.add(new StructElement(BIT_RATE_ID, bitRate.map((nonOptionalbitRate) -> new UIntType(nonOptionalbitRate)).orElse(new EmptyType()))); + values.add(new StructElement(BIT_DEPTH_ID, bitDepth.map((nonOptionalbitDepth) -> new UIntType(nonOptionalbitDepth)).orElse(new EmptyType()))); + + return new StructType(values); + } + + public static CameraAvStreamManagementClusterAudioStreamChangedEvent decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + Integer audioStreamID = null; + Optional streamType = Optional.empty(); + Optional audioCodec = Optional.empty(); + Optional channelCount = Optional.empty(); + Optional sampleRate = Optional.empty(); + Optional bitRate = Optional.empty(); + Optional bitDepth = Optional.empty(); + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == AUDIO_STREAM_ID_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + audioStreamID = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == STREAM_TYPE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + streamType = Optional.of(castingValue.value(Integer.class)); + } + } else if (element.contextTagNum() == AUDIO_CODEC_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + audioCodec = Optional.of(castingValue.value(Integer.class)); + } + } else if (element.contextTagNum() == CHANNEL_COUNT_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + channelCount = Optional.of(castingValue.value(Integer.class)); + } + } else if (element.contextTagNum() == SAMPLE_RATE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + sampleRate = Optional.of(castingValue.value(Long.class)); + } + } else if (element.contextTagNum() == BIT_RATE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + bitRate = Optional.of(castingValue.value(Long.class)); + } + } else if (element.contextTagNum() == BIT_DEPTH_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + bitDepth = Optional.of(castingValue.value(Integer.class)); + } + } + } + return new CameraAvStreamManagementClusterAudioStreamChangedEvent( + audioStreamID, + streamType, + audioCodec, + channelCount, + sampleRate, + bitRate, + bitDepth + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("CameraAvStreamManagementClusterAudioStreamChangedEvent {\n"); + output.append("\taudioStreamID: "); + output.append(audioStreamID); + output.append("\n"); + output.append("\tstreamType: "); + output.append(streamType); + output.append("\n"); + output.append("\taudioCodec: "); + output.append(audioCodec); + output.append("\n"); + output.append("\tchannelCount: "); + output.append(channelCount); + output.append("\n"); + output.append("\tsampleRate: "); + output.append(sampleRate); + output.append("\n"); + output.append("\tbitRate: "); + output.append(bitRate); + output.append("\n"); + output.append("\tbitDepth: "); + output.append(bitDepth); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} +public static class CameraAvStreamManagementClusterSnapshotStreamChangedEvent { + public Integer snapshotStreamID; + public Optional imageCodec; + public Optional frameRate; + public Optional bitRate; + public Optional minResolution; + public Optional maxResolution; + public Optional quality; + private static final long SNAPSHOT_STREAM_ID_ID = 0L; + private static final long IMAGE_CODEC_ID = 1L; + private static final long FRAME_RATE_ID = 2L; + private static final long BIT_RATE_ID = 3L; + private static final long MIN_RESOLUTION_ID = 4L; + private static final long MAX_RESOLUTION_ID = 5L; + private static final long QUALITY_ID = 6L; + + public CameraAvStreamManagementClusterSnapshotStreamChangedEvent( + Integer snapshotStreamID, + Optional imageCodec, + Optional frameRate, + Optional bitRate, + Optional minResolution, + Optional maxResolution, + Optional quality + ) { + this.snapshotStreamID = snapshotStreamID; + this.imageCodec = imageCodec; + this.frameRate = frameRate; + this.bitRate = bitRate; + this.minResolution = minResolution; + this.maxResolution = maxResolution; + this.quality = quality; + } + + public StructType encodeTlv() { + ArrayList values = new ArrayList<>(); + values.add(new StructElement(SNAPSHOT_STREAM_ID_ID, new UIntType(snapshotStreamID))); + values.add(new StructElement(IMAGE_CODEC_ID, imageCodec.map((nonOptionalimageCodec) -> new UIntType(nonOptionalimageCodec)).orElse(new EmptyType()))); + values.add(new StructElement(FRAME_RATE_ID, frameRate.map((nonOptionalframeRate) -> new UIntType(nonOptionalframeRate)).orElse(new EmptyType()))); + values.add(new StructElement(BIT_RATE_ID, bitRate.map((nonOptionalbitRate) -> new UIntType(nonOptionalbitRate)).orElse(new EmptyType()))); + values.add(new StructElement(MIN_RESOLUTION_ID, minResolution.map((nonOptionalminResolution) -> nonOptionalminResolution.encodeTlv()).orElse(new EmptyType()))); + values.add(new StructElement(MAX_RESOLUTION_ID, maxResolution.map((nonOptionalmaxResolution) -> nonOptionalmaxResolution.encodeTlv()).orElse(new EmptyType()))); + values.add(new StructElement(QUALITY_ID, quality.map((nonOptionalquality) -> new UIntType(nonOptionalquality)).orElse(new EmptyType()))); + + return new StructType(values); + } + + public static CameraAvStreamManagementClusterSnapshotStreamChangedEvent decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + Integer snapshotStreamID = null; + Optional imageCodec = Optional.empty(); + Optional frameRate = Optional.empty(); + Optional bitRate = Optional.empty(); + Optional minResolution = Optional.empty(); + Optional maxResolution = Optional.empty(); + Optional quality = Optional.empty(); + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == SNAPSHOT_STREAM_ID_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + snapshotStreamID = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == IMAGE_CODEC_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + imageCodec = Optional.of(castingValue.value(Integer.class)); + } + } else if (element.contextTagNum() == FRAME_RATE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + frameRate = Optional.of(castingValue.value(Integer.class)); + } + } else if (element.contextTagNum() == BIT_RATE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + bitRate = Optional.of(castingValue.value(Long.class)); + } + } else if (element.contextTagNum() == MIN_RESOLUTION_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Struct) { + StructType castingValue = element.value(StructType.class); + minResolution = Optional.of(ChipStructs.CameraAvStreamManagementClusterVideoResolutionStruct.decodeTlv(castingValue)); + } + } else if (element.contextTagNum() == MAX_RESOLUTION_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Struct) { + StructType castingValue = element.value(StructType.class); + maxResolution = Optional.of(ChipStructs.CameraAvStreamManagementClusterVideoResolutionStruct.decodeTlv(castingValue)); + } + } else if (element.contextTagNum() == QUALITY_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + quality = Optional.of(castingValue.value(Integer.class)); + } + } + } + return new CameraAvStreamManagementClusterSnapshotStreamChangedEvent( + snapshotStreamID, + imageCodec, + frameRate, + bitRate, + minResolution, + maxResolution, + quality + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("CameraAvStreamManagementClusterSnapshotStreamChangedEvent {\n"); + output.append("\tsnapshotStreamID: "); + output.append(snapshotStreamID); + output.append("\n"); + output.append("\timageCodec: "); + output.append(imageCodec); + output.append("\n"); + output.append("\tframeRate: "); + output.append(frameRate); + output.append("\n"); + output.append("\tbitRate: "); + output.append(bitRate); + output.append("\n"); + output.append("\tminResolution: "); + output.append(minResolution); + output.append("\n"); + output.append("\tmaxResolution: "); + output.append(maxResolution); + output.append("\n"); + output.append("\tquality: "); + output.append(quality); + 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 88684160d1ed81..57853a9bdb5fd6 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java @@ -12724,6 +12724,1081 @@ public String toString() { return output.toString(); } } +public static class CameraAvStreamManagementClusterVideoResolutionStruct { + public Integer width; + public Integer height; + private static final long WIDTH_ID = 0L; + private static final long HEIGHT_ID = 1L; + + public CameraAvStreamManagementClusterVideoResolutionStruct( + Integer width, + Integer height + ) { + this.width = width; + this.height = height; + } + + public StructType encodeTlv() { + ArrayList values = new ArrayList<>(); + values.add(new StructElement(WIDTH_ID, new UIntType(width))); + values.add(new StructElement(HEIGHT_ID, new UIntType(height))); + + return new StructType(values); + } + + public static CameraAvStreamManagementClusterVideoResolutionStruct decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + Integer width = null; + Integer height = null; + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == WIDTH_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + width = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == HEIGHT_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + height = castingValue.value(Integer.class); + } + } + } + return new CameraAvStreamManagementClusterVideoResolutionStruct( + width, + height + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("CameraAvStreamManagementClusterVideoResolutionStruct {\n"); + output.append("\twidth: "); + output.append(width); + output.append("\n"); + output.append("\theight: "); + output.append(height); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} +public static class CameraAvStreamManagementClusterVideoStreamStruct { + public Integer videoStreamID; + public Integer streamType; + public Integer videoCodec; + public Integer minFrameRate; + public Integer maxFrameRate; + public ChipStructs.CameraAvStreamManagementClusterVideoResolutionStruct minResolution; + public ChipStructs.CameraAvStreamManagementClusterVideoResolutionStruct maxResolution; + public Integer minBitRate; + public Integer maxBitRate; + public Integer minFragmentLen; + public Integer maxFragmentLen; + public Integer referenceCount; + private static final long VIDEO_STREAM_ID_ID = 0L; + private static final long STREAM_TYPE_ID = 1L; + private static final long VIDEO_CODEC_ID = 2L; + private static final long MIN_FRAME_RATE_ID = 3L; + private static final long MAX_FRAME_RATE_ID = 4L; + private static final long MIN_RESOLUTION_ID = 5L; + private static final long MAX_RESOLUTION_ID = 6L; + private static final long MIN_BIT_RATE_ID = 7L; + private static final long MAX_BIT_RATE_ID = 8L; + private static final long MIN_FRAGMENT_LEN_ID = 9L; + private static final long MAX_FRAGMENT_LEN_ID = 10L; + private static final long REFERENCE_COUNT_ID = 11L; + + public CameraAvStreamManagementClusterVideoStreamStruct( + Integer videoStreamID, + Integer streamType, + Integer videoCodec, + Integer minFrameRate, + Integer maxFrameRate, + ChipStructs.CameraAvStreamManagementClusterVideoResolutionStruct minResolution, + ChipStructs.CameraAvStreamManagementClusterVideoResolutionStruct maxResolution, + Integer minBitRate, + Integer maxBitRate, + Integer minFragmentLen, + Integer maxFragmentLen, + Integer referenceCount + ) { + this.videoStreamID = videoStreamID; + this.streamType = streamType; + this.videoCodec = videoCodec; + this.minFrameRate = minFrameRate; + this.maxFrameRate = maxFrameRate; + this.minResolution = minResolution; + this.maxResolution = maxResolution; + this.minBitRate = minBitRate; + this.maxBitRate = maxBitRate; + this.minFragmentLen = minFragmentLen; + this.maxFragmentLen = maxFragmentLen; + this.referenceCount = referenceCount; + } + + public StructType encodeTlv() { + ArrayList values = new ArrayList<>(); + values.add(new StructElement(VIDEO_STREAM_ID_ID, new UIntType(videoStreamID))); + values.add(new StructElement(STREAM_TYPE_ID, new UIntType(streamType))); + values.add(new StructElement(VIDEO_CODEC_ID, new UIntType(videoCodec))); + values.add(new StructElement(MIN_FRAME_RATE_ID, new UIntType(minFrameRate))); + values.add(new StructElement(MAX_FRAME_RATE_ID, new UIntType(maxFrameRate))); + values.add(new StructElement(MIN_RESOLUTION_ID, minResolution.encodeTlv())); + values.add(new StructElement(MAX_RESOLUTION_ID, maxResolution.encodeTlv())); + values.add(new StructElement(MIN_BIT_RATE_ID, new UIntType(minBitRate))); + values.add(new StructElement(MAX_BIT_RATE_ID, new UIntType(maxBitRate))); + values.add(new StructElement(MIN_FRAGMENT_LEN_ID, new UIntType(minFragmentLen))); + values.add(new StructElement(MAX_FRAGMENT_LEN_ID, new UIntType(maxFragmentLen))); + values.add(new StructElement(REFERENCE_COUNT_ID, new UIntType(referenceCount))); + + return new StructType(values); + } + + public static CameraAvStreamManagementClusterVideoStreamStruct decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + Integer videoStreamID = null; + Integer streamType = null; + Integer videoCodec = null; + Integer minFrameRate = null; + Integer maxFrameRate = null; + ChipStructs.CameraAvStreamManagementClusterVideoResolutionStruct minResolution = null; + ChipStructs.CameraAvStreamManagementClusterVideoResolutionStruct maxResolution = null; + Integer minBitRate = null; + Integer maxBitRate = null; + Integer minFragmentLen = null; + Integer maxFragmentLen = null; + Integer referenceCount = null; + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == VIDEO_STREAM_ID_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + videoStreamID = castingValue.value(Integer.class); + } + } else 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_CODEC_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + videoCodec = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == MIN_FRAME_RATE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + minFrameRate = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == MAX_FRAME_RATE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + maxFrameRate = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == MIN_RESOLUTION_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Struct) { + StructType castingValue = element.value(StructType.class); + minResolution = ChipStructs.CameraAvStreamManagementClusterVideoResolutionStruct.decodeTlv(castingValue); + } + } else if (element.contextTagNum() == MAX_RESOLUTION_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Struct) { + StructType castingValue = element.value(StructType.class); + maxResolution = ChipStructs.CameraAvStreamManagementClusterVideoResolutionStruct.decodeTlv(castingValue); + } + } else if (element.contextTagNum() == MIN_BIT_RATE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + minBitRate = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == MAX_BIT_RATE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + maxBitRate = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == MIN_FRAGMENT_LEN_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + minFragmentLen = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == MAX_FRAGMENT_LEN_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + maxFragmentLen = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == REFERENCE_COUNT_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + referenceCount = castingValue.value(Integer.class); + } + } + } + return new CameraAvStreamManagementClusterVideoStreamStruct( + videoStreamID, + streamType, + videoCodec, + minFrameRate, + maxFrameRate, + minResolution, + maxResolution, + minBitRate, + maxBitRate, + minFragmentLen, + maxFragmentLen, + referenceCount + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("CameraAvStreamManagementClusterVideoStreamStruct {\n"); + output.append("\tvideoStreamID: "); + output.append(videoStreamID); + output.append("\n"); + output.append("\tstreamType: "); + output.append(streamType); + output.append("\n"); + output.append("\tvideoCodec: "); + output.append(videoCodec); + output.append("\n"); + output.append("\tminFrameRate: "); + output.append(minFrameRate); + output.append("\n"); + output.append("\tmaxFrameRate: "); + output.append(maxFrameRate); + output.append("\n"); + output.append("\tminResolution: "); + output.append(minResolution); + output.append("\n"); + output.append("\tmaxResolution: "); + output.append(maxResolution); + output.append("\n"); + output.append("\tminBitRate: "); + output.append(minBitRate); + output.append("\n"); + output.append("\tmaxBitRate: "); + output.append(maxBitRate); + output.append("\n"); + output.append("\tminFragmentLen: "); + output.append(minFragmentLen); + output.append("\n"); + output.append("\tmaxFragmentLen: "); + output.append(maxFragmentLen); + output.append("\n"); + output.append("\treferenceCount: "); + output.append(referenceCount); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} +public static class CameraAvStreamManagementClusterSnapshotStreamStruct { + public Integer snapshotStreamID; + public Integer imageCodec; + public Integer frameRate; + public Long bitRate; + public ChipStructs.CameraAvStreamManagementClusterVideoResolutionStruct minResolution; + public ChipStructs.CameraAvStreamManagementClusterVideoResolutionStruct maxResolution; + public Integer quality; + public Integer referenceCount; + private static final long SNAPSHOT_STREAM_ID_ID = 0L; + private static final long IMAGE_CODEC_ID = 1L; + private static final long FRAME_RATE_ID = 2L; + private static final long BIT_RATE_ID = 3L; + private static final long MIN_RESOLUTION_ID = 4L; + private static final long MAX_RESOLUTION_ID = 5L; + private static final long QUALITY_ID = 6L; + private static final long REFERENCE_COUNT_ID = 7L; + + public CameraAvStreamManagementClusterSnapshotStreamStruct( + Integer snapshotStreamID, + Integer imageCodec, + Integer frameRate, + Long bitRate, + ChipStructs.CameraAvStreamManagementClusterVideoResolutionStruct minResolution, + ChipStructs.CameraAvStreamManagementClusterVideoResolutionStruct maxResolution, + Integer quality, + Integer referenceCount + ) { + this.snapshotStreamID = snapshotStreamID; + this.imageCodec = imageCodec; + this.frameRate = frameRate; + this.bitRate = bitRate; + this.minResolution = minResolution; + this.maxResolution = maxResolution; + this.quality = quality; + this.referenceCount = referenceCount; + } + + public StructType encodeTlv() { + ArrayList values = new ArrayList<>(); + values.add(new StructElement(SNAPSHOT_STREAM_ID_ID, new UIntType(snapshotStreamID))); + values.add(new StructElement(IMAGE_CODEC_ID, new UIntType(imageCodec))); + values.add(new StructElement(FRAME_RATE_ID, new UIntType(frameRate))); + values.add(new StructElement(BIT_RATE_ID, new UIntType(bitRate))); + values.add(new StructElement(MIN_RESOLUTION_ID, minResolution.encodeTlv())); + values.add(new StructElement(MAX_RESOLUTION_ID, maxResolution.encodeTlv())); + values.add(new StructElement(QUALITY_ID, new UIntType(quality))); + values.add(new StructElement(REFERENCE_COUNT_ID, new UIntType(referenceCount))); + + return new StructType(values); + } + + public static CameraAvStreamManagementClusterSnapshotStreamStruct decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + Integer snapshotStreamID = null; + Integer imageCodec = null; + Integer frameRate = null; + Long bitRate = null; + ChipStructs.CameraAvStreamManagementClusterVideoResolutionStruct minResolution = null; + ChipStructs.CameraAvStreamManagementClusterVideoResolutionStruct maxResolution = null; + Integer quality = null; + Integer referenceCount = null; + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == SNAPSHOT_STREAM_ID_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + snapshotStreamID = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == IMAGE_CODEC_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + imageCodec = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == FRAME_RATE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + frameRate = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == BIT_RATE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + bitRate = castingValue.value(Long.class); + } + } else if (element.contextTagNum() == MIN_RESOLUTION_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Struct) { + StructType castingValue = element.value(StructType.class); + minResolution = ChipStructs.CameraAvStreamManagementClusterVideoResolutionStruct.decodeTlv(castingValue); + } + } else if (element.contextTagNum() == MAX_RESOLUTION_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Struct) { + StructType castingValue = element.value(StructType.class); + maxResolution = ChipStructs.CameraAvStreamManagementClusterVideoResolutionStruct.decodeTlv(castingValue); + } + } else if (element.contextTagNum() == QUALITY_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + quality = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == REFERENCE_COUNT_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + referenceCount = castingValue.value(Integer.class); + } + } + } + return new CameraAvStreamManagementClusterSnapshotStreamStruct( + snapshotStreamID, + imageCodec, + frameRate, + bitRate, + minResolution, + maxResolution, + quality, + referenceCount + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("CameraAvStreamManagementClusterSnapshotStreamStruct {\n"); + output.append("\tsnapshotStreamID: "); + output.append(snapshotStreamID); + output.append("\n"); + output.append("\timageCodec: "); + output.append(imageCodec); + output.append("\n"); + output.append("\tframeRate: "); + output.append(frameRate); + output.append("\n"); + output.append("\tbitRate: "); + output.append(bitRate); + output.append("\n"); + output.append("\tminResolution: "); + output.append(minResolution); + output.append("\n"); + output.append("\tmaxResolution: "); + output.append(maxResolution); + output.append("\n"); + output.append("\tquality: "); + output.append(quality); + output.append("\n"); + output.append("\treferenceCount: "); + output.append(referenceCount); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} +public static class CameraAvStreamManagementClusterSnapshotParamsStruct { + public ChipStructs.CameraAvStreamManagementClusterVideoResolutionStruct resolution; + public Integer maxFrameRate; + public Integer imageCodec; + private static final long RESOLUTION_ID = 0L; + private static final long MAX_FRAME_RATE_ID = 1L; + private static final long IMAGE_CODEC_ID = 2L; + + public CameraAvStreamManagementClusterSnapshotParamsStruct( + ChipStructs.CameraAvStreamManagementClusterVideoResolutionStruct resolution, + Integer maxFrameRate, + Integer imageCodec + ) { + this.resolution = resolution; + this.maxFrameRate = maxFrameRate; + this.imageCodec = imageCodec; + } + + public StructType encodeTlv() { + ArrayList values = new ArrayList<>(); + values.add(new StructElement(RESOLUTION_ID, resolution.encodeTlv())); + values.add(new StructElement(MAX_FRAME_RATE_ID, new UIntType(maxFrameRate))); + values.add(new StructElement(IMAGE_CODEC_ID, new UIntType(imageCodec))); + + return new StructType(values); + } + + public static CameraAvStreamManagementClusterSnapshotParamsStruct decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + ChipStructs.CameraAvStreamManagementClusterVideoResolutionStruct resolution = null; + Integer maxFrameRate = null; + Integer imageCodec = null; + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == RESOLUTION_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Struct) { + StructType castingValue = element.value(StructType.class); + resolution = ChipStructs.CameraAvStreamManagementClusterVideoResolutionStruct.decodeTlv(castingValue); + } + } else if (element.contextTagNum() == MAX_FRAME_RATE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + maxFrameRate = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == IMAGE_CODEC_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + imageCodec = castingValue.value(Integer.class); + } + } + } + return new CameraAvStreamManagementClusterSnapshotParamsStruct( + resolution, + maxFrameRate, + imageCodec + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("CameraAvStreamManagementClusterSnapshotParamsStruct {\n"); + output.append("\tresolution: "); + output.append(resolution); + output.append("\n"); + output.append("\tmaxFrameRate: "); + output.append(maxFrameRate); + output.append("\n"); + output.append("\timageCodec: "); + output.append(imageCodec); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} +public static class CameraAvStreamManagementClusterRateDistortionTradeOffPointsStruct { + public Integer codec; + public ChipStructs.CameraAvStreamManagementClusterVideoResolutionStruct resolution; + public Long minBitRate; + private static final long CODEC_ID = 0L; + private static final long RESOLUTION_ID = 1L; + private static final long MIN_BIT_RATE_ID = 2L; + + public CameraAvStreamManagementClusterRateDistortionTradeOffPointsStruct( + Integer codec, + ChipStructs.CameraAvStreamManagementClusterVideoResolutionStruct resolution, + Long minBitRate + ) { + this.codec = codec; + this.resolution = resolution; + this.minBitRate = minBitRate; + } + + public StructType encodeTlv() { + ArrayList values = new ArrayList<>(); + values.add(new StructElement(CODEC_ID, new UIntType(codec))); + values.add(new StructElement(RESOLUTION_ID, resolution.encodeTlv())); + values.add(new StructElement(MIN_BIT_RATE_ID, new UIntType(minBitRate))); + + return new StructType(values); + } + + public static CameraAvStreamManagementClusterRateDistortionTradeOffPointsStruct decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + Integer codec = null; + ChipStructs.CameraAvStreamManagementClusterVideoResolutionStruct resolution = null; + Long minBitRate = null; + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == CODEC_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + codec = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == RESOLUTION_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Struct) { + StructType castingValue = element.value(StructType.class); + resolution = ChipStructs.CameraAvStreamManagementClusterVideoResolutionStruct.decodeTlv(castingValue); + } + } else if (element.contextTagNum() == MIN_BIT_RATE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + minBitRate = castingValue.value(Long.class); + } + } + } + return new CameraAvStreamManagementClusterRateDistortionTradeOffPointsStruct( + codec, + resolution, + minBitRate + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("CameraAvStreamManagementClusterRateDistortionTradeOffPointsStruct {\n"); + output.append("\tcodec: "); + output.append(codec); + output.append("\n"); + output.append("\tresolution: "); + output.append(resolution); + output.append("\n"); + output.append("\tminBitRate: "); + output.append(minBitRate); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} +public static class CameraAvStreamManagementClusterAudioCapabilitiesStruct { + public Integer maxNumberOfChannels; + public ArrayList supportedCodecs; + public ArrayList supportedSampleRates; + public ArrayList supportedBitDepths; + private static final long MAX_NUMBER_OF_CHANNELS_ID = 0L; + private static final long SUPPORTED_CODECS_ID = 1L; + private static final long SUPPORTED_SAMPLE_RATES_ID = 2L; + private static final long SUPPORTED_BIT_DEPTHS_ID = 3L; + + public CameraAvStreamManagementClusterAudioCapabilitiesStruct( + Integer maxNumberOfChannels, + ArrayList supportedCodecs, + ArrayList supportedSampleRates, + ArrayList supportedBitDepths + ) { + this.maxNumberOfChannels = maxNumberOfChannels; + this.supportedCodecs = supportedCodecs; + this.supportedSampleRates = supportedSampleRates; + this.supportedBitDepths = supportedBitDepths; + } + + public StructType encodeTlv() { + ArrayList values = new ArrayList<>(); + values.add(new StructElement(MAX_NUMBER_OF_CHANNELS_ID, new UIntType(maxNumberOfChannels))); + values.add(new StructElement(SUPPORTED_CODECS_ID, ArrayType.generateArrayType(supportedCodecs, (elementsupportedCodecs) -> new UIntType(elementsupportedCodecs)))); + values.add(new StructElement(SUPPORTED_SAMPLE_RATES_ID, ArrayType.generateArrayType(supportedSampleRates, (elementsupportedSampleRates) -> new UIntType(elementsupportedSampleRates)))); + values.add(new StructElement(SUPPORTED_BIT_DEPTHS_ID, ArrayType.generateArrayType(supportedBitDepths, (elementsupportedBitDepths) -> new UIntType(elementsupportedBitDepths)))); + + return new StructType(values); + } + + public static CameraAvStreamManagementClusterAudioCapabilitiesStruct decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + Integer maxNumberOfChannels = null; + ArrayList supportedCodecs = null; + ArrayList supportedSampleRates = null; + ArrayList supportedBitDepths = null; + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == MAX_NUMBER_OF_CHANNELS_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + maxNumberOfChannels = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == SUPPORTED_CODECS_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Array) { + ArrayType castingValue = element.value(ArrayType.class); + supportedCodecs = castingValue.map((elementcastingValue) -> elementcastingValue.value(Integer.class)); + } + } else if (element.contextTagNum() == SUPPORTED_SAMPLE_RATES_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Array) { + ArrayType castingValue = element.value(ArrayType.class); + supportedSampleRates = castingValue.map((elementcastingValue) -> elementcastingValue.value(Long.class)); + } + } else if (element.contextTagNum() == SUPPORTED_BIT_DEPTHS_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Array) { + ArrayType castingValue = element.value(ArrayType.class); + supportedBitDepths = castingValue.map((elementcastingValue) -> elementcastingValue.value(Long.class)); + } + } + } + return new CameraAvStreamManagementClusterAudioCapabilitiesStruct( + maxNumberOfChannels, + supportedCodecs, + supportedSampleRates, + supportedBitDepths + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("CameraAvStreamManagementClusterAudioCapabilitiesStruct {\n"); + output.append("\tmaxNumberOfChannels: "); + output.append(maxNumberOfChannels); + output.append("\n"); + output.append("\tsupportedCodecs: "); + output.append(supportedCodecs); + output.append("\n"); + output.append("\tsupportedSampleRates: "); + output.append(supportedSampleRates); + output.append("\n"); + output.append("\tsupportedBitDepths: "); + output.append(supportedBitDepths); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} +public static class CameraAvStreamManagementClusterAudioStreamStruct { + public Integer audioStreamID; + public Integer streamType; + public Integer audioCodec; + public Integer channelCount; + public Long sampleRate; + public Long bitRate; + public Integer bitDepth; + public Integer referenceCount; + private static final long AUDIO_STREAM_ID_ID = 0L; + private static final long STREAM_TYPE_ID = 1L; + private static final long AUDIO_CODEC_ID = 2L; + private static final long CHANNEL_COUNT_ID = 3L; + private static final long SAMPLE_RATE_ID = 4L; + private static final long BIT_RATE_ID = 5L; + private static final long BIT_DEPTH_ID = 6L; + private static final long REFERENCE_COUNT_ID = 7L; + + public CameraAvStreamManagementClusterAudioStreamStruct( + Integer audioStreamID, + Integer streamType, + Integer audioCodec, + Integer channelCount, + Long sampleRate, + Long bitRate, + Integer bitDepth, + Integer referenceCount + ) { + this.audioStreamID = audioStreamID; + this.streamType = streamType; + this.audioCodec = audioCodec; + this.channelCount = channelCount; + this.sampleRate = sampleRate; + this.bitRate = bitRate; + this.bitDepth = bitDepth; + this.referenceCount = referenceCount; + } + + public StructType encodeTlv() { + ArrayList values = new ArrayList<>(); + values.add(new StructElement(AUDIO_STREAM_ID_ID, new UIntType(audioStreamID))); + values.add(new StructElement(STREAM_TYPE_ID, new UIntType(streamType))); + values.add(new StructElement(AUDIO_CODEC_ID, new UIntType(audioCodec))); + values.add(new StructElement(CHANNEL_COUNT_ID, new UIntType(channelCount))); + values.add(new StructElement(SAMPLE_RATE_ID, new UIntType(sampleRate))); + values.add(new StructElement(BIT_RATE_ID, new UIntType(bitRate))); + values.add(new StructElement(BIT_DEPTH_ID, new UIntType(bitDepth))); + values.add(new StructElement(REFERENCE_COUNT_ID, new UIntType(referenceCount))); + + return new StructType(values); + } + + public static CameraAvStreamManagementClusterAudioStreamStruct decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + Integer audioStreamID = null; + Integer streamType = null; + Integer audioCodec = null; + Integer channelCount = null; + Long sampleRate = null; + Long bitRate = null; + Integer bitDepth = null; + Integer referenceCount = null; + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == AUDIO_STREAM_ID_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + audioStreamID = castingValue.value(Integer.class); + } + } else 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() == AUDIO_CODEC_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + audioCodec = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == CHANNEL_COUNT_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + channelCount = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == SAMPLE_RATE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + sampleRate = castingValue.value(Long.class); + } + } else if (element.contextTagNum() == BIT_RATE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + bitRate = castingValue.value(Long.class); + } + } else if (element.contextTagNum() == BIT_DEPTH_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + bitDepth = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == REFERENCE_COUNT_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + referenceCount = castingValue.value(Integer.class); + } + } + } + return new CameraAvStreamManagementClusterAudioStreamStruct( + audioStreamID, + streamType, + audioCodec, + channelCount, + sampleRate, + bitRate, + bitDepth, + referenceCount + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("CameraAvStreamManagementClusterAudioStreamStruct {\n"); + output.append("\taudioStreamID: "); + output.append(audioStreamID); + output.append("\n"); + output.append("\tstreamType: "); + output.append(streamType); + output.append("\n"); + output.append("\taudioCodec: "); + output.append(audioCodec); + output.append("\n"); + output.append("\tchannelCount: "); + output.append(channelCount); + output.append("\n"); + output.append("\tsampleRate: "); + output.append(sampleRate); + output.append("\n"); + output.append("\tbitRate: "); + output.append(bitRate); + output.append("\n"); + output.append("\tbitDepth: "); + output.append(bitDepth); + output.append("\n"); + output.append("\treferenceCount: "); + output.append(referenceCount); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} +public static class CameraAvStreamManagementClusterPerStreamStruct { + public Integer streamID; + public Boolean enabled; + private static final long STREAM_ID_ID = 0L; + private static final long ENABLED_ID = 1L; + + public CameraAvStreamManagementClusterPerStreamStruct( + Integer streamID, + Boolean enabled + ) { + this.streamID = streamID; + this.enabled = enabled; + } + + public StructType encodeTlv() { + ArrayList values = new ArrayList<>(); + values.add(new StructElement(STREAM_ID_ID, new UIntType(streamID))); + values.add(new StructElement(ENABLED_ID, new BooleanType(enabled))); + + return new StructType(values); + } + + public static CameraAvStreamManagementClusterPerStreamStruct decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + Integer streamID = null; + Boolean enabled = null; + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == STREAM_ID_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + streamID = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == ENABLED_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Boolean) { + BooleanType castingValue = element.value(BooleanType.class); + enabled = castingValue.value(Boolean.class); + } + } + } + return new CameraAvStreamManagementClusterPerStreamStruct( + streamID, + enabled + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("CameraAvStreamManagementClusterPerStreamStruct {\n"); + output.append("\tstreamID: "); + output.append(streamID); + output.append("\n"); + output.append("\tenabled: "); + output.append(enabled); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} +public static class CameraAvStreamManagementClusterVideoSensorParamsStruct { + public Integer sensorWidth; + public Integer sensorHeight; + public Boolean HDRCapable; + public Integer maxFPS; + public Integer maxHDRFPS; + private static final long SENSOR_WIDTH_ID = 0L; + private static final long SENSOR_HEIGHT_ID = 1L; + private static final long HDR_CAPABLE_ID = 2L; + private static final long MAX_FPS_ID = 3L; + private static final long MAX_HDRFPS_ID = 4L; + + public CameraAvStreamManagementClusterVideoSensorParamsStruct( + Integer sensorWidth, + Integer sensorHeight, + Boolean HDRCapable, + Integer maxFPS, + Integer maxHDRFPS + ) { + this.sensorWidth = sensorWidth; + this.sensorHeight = sensorHeight; + this.HDRCapable = HDRCapable; + this.maxFPS = maxFPS; + this.maxHDRFPS = maxHDRFPS; + } + + public StructType encodeTlv() { + ArrayList values = new ArrayList<>(); + values.add(new StructElement(SENSOR_WIDTH_ID, new UIntType(sensorWidth))); + values.add(new StructElement(SENSOR_HEIGHT_ID, new UIntType(sensorHeight))); + values.add(new StructElement(HDR_CAPABLE_ID, new BooleanType(HDRCapable))); + values.add(new StructElement(MAX_FPS_ID, new UIntType(maxFPS))); + values.add(new StructElement(MAX_HDRFPS_ID, new UIntType(maxHDRFPS))); + + return new StructType(values); + } + + public static CameraAvStreamManagementClusterVideoSensorParamsStruct decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + Integer sensorWidth = null; + Integer sensorHeight = null; + Boolean HDRCapable = null; + Integer maxFPS = null; + Integer maxHDRFPS = null; + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == SENSOR_WIDTH_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + sensorWidth = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == SENSOR_HEIGHT_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + sensorHeight = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == HDR_CAPABLE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Boolean) { + BooleanType castingValue = element.value(BooleanType.class); + HDRCapable = castingValue.value(Boolean.class); + } + } else if (element.contextTagNum() == MAX_FPS_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + maxFPS = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == MAX_HDRFPS_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + maxHDRFPS = castingValue.value(Integer.class); + } + } + } + return new CameraAvStreamManagementClusterVideoSensorParamsStruct( + sensorWidth, + sensorHeight, + HDRCapable, + maxFPS, + maxHDRFPS + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("CameraAvStreamManagementClusterVideoSensorParamsStruct {\n"); + output.append("\tsensorWidth: "); + output.append(sensorWidth); + output.append("\n"); + output.append("\tsensorHeight: "); + output.append(sensorHeight); + output.append("\n"); + output.append("\tHDRCapable: "); + output.append(HDRCapable); + output.append("\n"); + output.append("\tmaxFPS: "); + output.append(maxFPS); + output.append("\n"); + output.append("\tmaxHDRFPS: "); + output.append(maxHDRFPS); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} +public static class CameraAvStreamManagementClusterViewportStruct { + public Integer x1; + public Integer y1; + public Integer x2; + public Integer y2; + private static final long X1_ID = 0L; + private static final long Y1_ID = 1L; + private static final long X2_ID = 2L; + private static final long Y2_ID = 3L; + + public CameraAvStreamManagementClusterViewportStruct( + Integer x1, + Integer y1, + Integer x2, + Integer y2 + ) { + this.x1 = x1; + this.y1 = y1; + this.x2 = x2; + this.y2 = y2; + } + + public StructType encodeTlv() { + ArrayList values = new ArrayList<>(); + values.add(new StructElement(X1_ID, new UIntType(x1))); + values.add(new StructElement(Y1_ID, new UIntType(y1))); + values.add(new StructElement(X2_ID, new UIntType(x2))); + values.add(new StructElement(Y2_ID, new UIntType(y2))); + + return new StructType(values); + } + + public static CameraAvStreamManagementClusterViewportStruct decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + Integer x1 = null; + Integer y1 = null; + Integer x2 = null; + Integer y2 = null; + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == X1_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + x1 = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == Y1_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + y1 = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == X2_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + x2 = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == Y2_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + y2 = castingValue.value(Integer.class); + } + } + } + return new CameraAvStreamManagementClusterViewportStruct( + x1, + y1, + x2, + y2 + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("CameraAvStreamManagementClusterViewportStruct {\n"); + output.append("\tx1: "); + output.append(x1); + output.append("\n"); + output.append("\ty1: "); + output.append(y1); + output.append("\n"); + output.append("\tx2: "); + output.append(x2); + output.append("\n"); + output.append("\ty2: "); + output.append(y2); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} public static class WebRTCTransportProviderClusterICEServerStruct { public ArrayList urls; public Optional username; diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java index 28a415a3008fc1..457c28285aa05e 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java @@ -379,6 +379,9 @@ public static BaseCluster getCluster(long clusterId) { if (clusterId == ContentAppObserver.ID) { return new ContentAppObserver(); } + if (clusterId == CameraAvStreamManagement.ID) { + return new CameraAvStreamManagement(); + } if (clusterId == WebRTCTransportProvider.ID) { return new WebRTCTransportProvider(); } @@ -16888,6 +16891,413 @@ public long getCommandID(String name) throws IllegalArgumentException { return Command.valueOf(name).getID(); } } + public static class CameraAvStreamManagement implements BaseCluster { + public static final long ID = 1361L; + public long getID() { + return ID; + } + + public enum Attribute { + MaxConcurrentVideoEncoders(0L), + MaxEncodedPixelRate(1L), + VideoSensorParams(2L), + NightVisionCapable(3L), + MinViewPortWidth(4L), + MinViewPortHeight(5L), + RateDistortionTradeOffPoints(6L), + MaxPreRollBufferSize(7L), + MicrophoneCapabilities(8L), + SpeakerCapabilities(9L), + TwoWayTalkSupport(10L), + SupportedSnapshotParams(11L), + HDRCapable(12L), + MaxNetworkBandwidth(13L), + CurrentFrameRate(14L), + HDRMode(15L), + CurrentVideoCodecs(16L), + CurrentSnapshotConfig(17L), + FabricsUsingCamera(18L), + AllocatedVideoStreams(19L), + AllocatedAudioStreams(20L), + AllocatedSnapshotStreams(21L), + RankedVideoStreamPrioritiesList(22L), + SoftRecordingPrivacyModeSetting(23L), + SoftLivestreamPrivacyModeSetting(24L), + HardPrivacyMode(25L), + NightVision(26L), + NightVisionIllum(27L), + Awb(28L), + ShutterSpeed(29L), + Iso(30L), + Viewport(31L), + SpeakerEnabled(32L), + SpeakerVolumeLevel(33L), + SpeakerMaxLevel(34L), + SpeakerMinLevel(35L), + MicStatus(36L), + MicVolumeLevel(37L), + MicMaxLevel(38L), + MicMinLevel(39L), + MicAGCEnabled(40L), + ImageRotation(41L), + ImageFlipHorizontal(42L), + ImageFlipVertical(43L), + LocalVideoRecordingEnabled(44L), + LocalSnapshotRecordingEnabled(45L), + StatusLight(46L), + StatusLightBrightness(47L), + DepthSensorStatus(48L), + WatermarkEnabled(49L), + OSDEnabled(50L), + 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 { + VideoStreamChanged(0L), + AudioStreamChanged(1L), + SnapshotStreamChanged(2L),; + 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 { + AudioStreamAllocate(0L), + AudioStreamDeallocate(2L), + VideoStreamAllocate(3L), + VideoStreamModify(5L), + VideoStreamDeallocate(6L), + SnapshotStreamAllocate(7L), + SnapshotStreamDeallocate(9L), + SetStreamPriority(10L), + CaptureSnapshot(11L), + SetViewport(13L), + SetImageRotation(14L), + SetImageFlipHorizontal(15L), + SetImageFlipVertical(16L), + SetWatermark(17L), + SetOSD(18L),; + 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 AudioStreamAllocateCommandField {StreamType(0),AudioCodec(1),ChannelCount(2),SampleRate(3),BitRate(4),BitDepth(5),; + private final int id; + AudioStreamAllocateCommandField(int id) { + this.id = id; + } + + public int getID() { + return id; + } + public static AudioStreamAllocateCommandField value(int id) throws NoSuchFieldError { + for (AudioStreamAllocateCommandField field : AudioStreamAllocateCommandField.values()) { + if (field.getID() == id) { + return field; + } + } + throw new NoSuchFieldError(); + } + }public enum AudioStreamDeallocateCommandField {AudioStreamID(0),; + private final int id; + AudioStreamDeallocateCommandField(int id) { + this.id = id; + } + + public int getID() { + return id; + } + public static AudioStreamDeallocateCommandField value(int id) throws NoSuchFieldError { + for (AudioStreamDeallocateCommandField field : AudioStreamDeallocateCommandField.values()) { + if (field.getID() == id) { + return field; + } + } + throw new NoSuchFieldError(); + } + }public enum VideoStreamAllocateCommandField {StreamType(0),VideoCodec(1),MinFrameRate(2),MaxFrameRate(3),MinResolution(4),MaxResolution(5),MinBitRate(6),MaxBitRate(7),MinFragmentLen(8),MaxFragmentLen(9),; + private final int id; + VideoStreamAllocateCommandField(int id) { + this.id = id; + } + + public int getID() { + return id; + } + public static VideoStreamAllocateCommandField value(int id) throws NoSuchFieldError { + for (VideoStreamAllocateCommandField field : VideoStreamAllocateCommandField.values()) { + if (field.getID() == id) { + return field; + } + } + throw new NoSuchFieldError(); + } + }public enum VideoStreamModifyCommandField {VideoStreamID(0),Resolution(1),; + private final int id; + VideoStreamModifyCommandField(int id) { + this.id = id; + } + + public int getID() { + return id; + } + public static VideoStreamModifyCommandField value(int id) throws NoSuchFieldError { + for (VideoStreamModifyCommandField field : VideoStreamModifyCommandField.values()) { + if (field.getID() == id) { + return field; + } + } + throw new NoSuchFieldError(); + } + }public enum VideoStreamDeallocateCommandField {VideoStreamID(0),; + private final int id; + VideoStreamDeallocateCommandField(int id) { + this.id = id; + } + + public int getID() { + return id; + } + public static VideoStreamDeallocateCommandField value(int id) throws NoSuchFieldError { + for (VideoStreamDeallocateCommandField field : VideoStreamDeallocateCommandField.values()) { + if (field.getID() == id) { + return field; + } + } + throw new NoSuchFieldError(); + } + }public enum SnapshotStreamAllocateCommandField {ImageCodec(0),FrameRate(1),BitRate(2),MinResolution(3),MaxResolution(4),Quality(5),; + private final int id; + SnapshotStreamAllocateCommandField(int id) { + this.id = id; + } + + public int getID() { + return id; + } + public static SnapshotStreamAllocateCommandField value(int id) throws NoSuchFieldError { + for (SnapshotStreamAllocateCommandField field : SnapshotStreamAllocateCommandField.values()) { + if (field.getID() == id) { + return field; + } + } + throw new NoSuchFieldError(); + } + }public enum SnapshotStreamDeallocateCommandField {SnapshotStreamID(0),; + private final int id; + SnapshotStreamDeallocateCommandField(int id) { + this.id = id; + } + + public int getID() { + return id; + } + public static SnapshotStreamDeallocateCommandField value(int id) throws NoSuchFieldError { + for (SnapshotStreamDeallocateCommandField field : SnapshotStreamDeallocateCommandField.values()) { + if (field.getID() == id) { + return field; + } + } + throw new NoSuchFieldError(); + } + }public enum CaptureSnapshotCommandField {SnapshotStreamID(0),RequestedResolution(1),; + private final int id; + CaptureSnapshotCommandField(int id) { + this.id = id; + } + + public int getID() { + return id; + } + public static CaptureSnapshotCommandField value(int id) throws NoSuchFieldError { + for (CaptureSnapshotCommandField field : CaptureSnapshotCommandField.values()) { + if (field.getID() == id) { + return field; + } + } + throw new NoSuchFieldError(); + } + }public enum SetViewportCommandField {Viewport(0),; + private final int id; + SetViewportCommandField(int id) { + this.id = id; + } + + public int getID() { + return id; + } + public static SetViewportCommandField value(int id) throws NoSuchFieldError { + for (SetViewportCommandField field : SetViewportCommandField.values()) { + if (field.getID() == id) { + return field; + } + } + throw new NoSuchFieldError(); + } + }public enum SetImageRotationCommandField {Angle(0),; + private final int id; + SetImageRotationCommandField(int id) { + this.id = id; + } + + public int getID() { + return id; + } + public static SetImageRotationCommandField value(int id) throws NoSuchFieldError { + for (SetImageRotationCommandField field : SetImageRotationCommandField.values()) { + if (field.getID() == id) { + return field; + } + } + throw new NoSuchFieldError(); + } + }public enum SetImageFlipHorizontalCommandField {Enabled(0),; + private final int id; + SetImageFlipHorizontalCommandField(int id) { + this.id = id; + } + + public int getID() { + return id; + } + public static SetImageFlipHorizontalCommandField value(int id) throws NoSuchFieldError { + for (SetImageFlipHorizontalCommandField field : SetImageFlipHorizontalCommandField.values()) { + if (field.getID() == id) { + return field; + } + } + throw new NoSuchFieldError(); + } + }public enum SetImageFlipVerticalCommandField {Enabled(0),; + private final int id; + SetImageFlipVerticalCommandField(int id) { + this.id = id; + } + + public int getID() { + return id; + } + public static SetImageFlipVerticalCommandField value(int id) throws NoSuchFieldError { + for (SetImageFlipVerticalCommandField field : SetImageFlipVerticalCommandField.values()) { + if (field.getID() == id) { + return field; + } + } + throw new NoSuchFieldError(); + } + }public enum SetWatermarkCommandField {VideoStreamID(0),Enabled(1),; + private final int id; + SetWatermarkCommandField(int id) { + this.id = id; + } + + public int getID() { + return id; + } + public static SetWatermarkCommandField value(int id) throws NoSuchFieldError { + for (SetWatermarkCommandField field : SetWatermarkCommandField.values()) { + if (field.getID() == id) { + return field; + } + } + throw new NoSuchFieldError(); + } + }public enum SetOSDCommandField {VideoStreamID(0),Enabled(1),; + private final int id; + SetOSDCommandField(int id) { + this.id = id; + } + + public int getID() { + return id; + } + public static SetOSDCommandField value(int id) throws NoSuchFieldError { + for (SetOSDCommandField field : SetOSDCommandField.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 WebRTCTransportProvider implements BaseCluster { public static final long ID = 1363L; 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 27dda463b3b0f3..b4ad000d5a8050 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java @@ -19995,6 +19995,513 @@ public void onError(Exception ex) { } + public static class DelegatedCameraAvStreamManagementClusterAudioStreamAllocateResponseCallback implements ChipClusters.CameraAvStreamManagementCluster.AudioStreamAllocateResponseCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(Integer audioStreamID) { + Map responseValues = new LinkedHashMap<>(); + + CommandResponseInfo audioStreamIDResponseValue = new CommandResponseInfo("audioStreamID", "Integer"); + responseValues.put(audioStreamIDResponseValue, audioStreamID); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception error) { + callback.onFailure(error); + } + } + + public static class DelegatedCameraAvStreamManagementClusterVideoStreamAllocateResponseCallback implements ChipClusters.CameraAvStreamManagementCluster.VideoStreamAllocateResponseCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(Integer videoStreamID) { + Map responseValues = new LinkedHashMap<>(); + + CommandResponseInfo videoStreamIDResponseValue = new CommandResponseInfo("videoStreamID", "Integer"); + responseValues.put(videoStreamIDResponseValue, videoStreamID); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception error) { + callback.onFailure(error); + } + } + + public static class DelegatedCameraAvStreamManagementClusterSnapshotStreamAllocateResponseCallback implements ChipClusters.CameraAvStreamManagementCluster.SnapshotStreamAllocateResponseCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(Integer snapshotStreamID) { + Map responseValues = new LinkedHashMap<>(); + + CommandResponseInfo snapshotStreamIDResponseValue = new CommandResponseInfo("snapshotStreamID", "Integer"); + responseValues.put(snapshotStreamIDResponseValue, snapshotStreamID); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception error) { + callback.onFailure(error); + } + } + public static class DelegatedCameraAvStreamManagementClusterVideoSensorParamsAttributeCallback implements ChipClusters.CameraAvStreamManagementCluster.VideoSensorParamsAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(ChipStructs.CameraAvStreamManagementClusterVideoSensorParamsStruct value) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "ChipStructs.CameraAvStreamManagementClusterVideoSensorParamsStruct"); + responseValues.put(commandResponseInfo, value); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedCameraAvStreamManagementClusterMinViewPortWidthAttributeCallback implements ChipClusters.CameraAvStreamManagementCluster.MinViewPortWidthAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(ChipStructs.CameraAvStreamManagementClusterVideoResolutionStruct value) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "ChipStructs.CameraAvStreamManagementClusterVideoResolutionStruct"); + responseValues.put(commandResponseInfo, value); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedCameraAvStreamManagementClusterMinViewPortHeightAttributeCallback implements ChipClusters.CameraAvStreamManagementCluster.MinViewPortHeightAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(ChipStructs.CameraAvStreamManagementClusterVideoResolutionStruct value) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "ChipStructs.CameraAvStreamManagementClusterVideoResolutionStruct"); + responseValues.put(commandResponseInfo, value); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedCameraAvStreamManagementClusterRateDistortionTradeOffPointsAttributeCallback implements ChipClusters.CameraAvStreamManagementCluster.RateDistortionTradeOffPointsAttributeCallback, 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 DelegatedCameraAvStreamManagementClusterMicrophoneCapabilitiesAttributeCallback implements ChipClusters.CameraAvStreamManagementCluster.MicrophoneCapabilitiesAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(ChipStructs.CameraAvStreamManagementClusterAudioCapabilitiesStruct value) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "ChipStructs.CameraAvStreamManagementClusterAudioCapabilitiesStruct"); + responseValues.put(commandResponseInfo, value); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedCameraAvStreamManagementClusterSpeakerCapabilitiesAttributeCallback implements ChipClusters.CameraAvStreamManagementCluster.SpeakerCapabilitiesAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(@Nullable ChipStructs.CameraAvStreamManagementClusterAudioCapabilitiesStruct value) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "ChipStructs.CameraAvStreamManagementClusterAudioCapabilitiesStruct"); + responseValues.put(commandResponseInfo, value); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedCameraAvStreamManagementClusterSupportedSnapshotParamsAttributeCallback implements ChipClusters.CameraAvStreamManagementCluster.SupportedSnapshotParamsAttributeCallback, 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 DelegatedCameraAvStreamManagementClusterCurrentVideoCodecsAttributeCallback implements ChipClusters.CameraAvStreamManagementCluster.CurrentVideoCodecsAttributeCallback, 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 DelegatedCameraAvStreamManagementClusterCurrentSnapshotConfigAttributeCallback implements ChipClusters.CameraAvStreamManagementCluster.CurrentSnapshotConfigAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(ChipStructs.CameraAvStreamManagementClusterSnapshotParamsStruct value) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "ChipStructs.CameraAvStreamManagementClusterSnapshotParamsStruct"); + responseValues.put(commandResponseInfo, value); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedCameraAvStreamManagementClusterFabricsUsingCameraAttributeCallback implements ChipClusters.CameraAvStreamManagementCluster.FabricsUsingCameraAttributeCallback, 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 DelegatedCameraAvStreamManagementClusterAllocatedVideoStreamsAttributeCallback implements ChipClusters.CameraAvStreamManagementCluster.AllocatedVideoStreamsAttributeCallback, 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 DelegatedCameraAvStreamManagementClusterAllocatedAudioStreamsAttributeCallback implements ChipClusters.CameraAvStreamManagementCluster.AllocatedAudioStreamsAttributeCallback, 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 DelegatedCameraAvStreamManagementClusterAllocatedSnapshotStreamsAttributeCallback implements ChipClusters.CameraAvStreamManagementCluster.AllocatedSnapshotStreamsAttributeCallback, 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 DelegatedCameraAvStreamManagementClusterRankedVideoStreamPrioritiesListAttributeCallback implements ChipClusters.CameraAvStreamManagementCluster.RankedVideoStreamPrioritiesListAttributeCallback, 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 DelegatedCameraAvStreamManagementClusterViewportAttributeCallback implements ChipClusters.CameraAvStreamManagementCluster.ViewportAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(ChipStructs.CameraAvStreamManagementClusterViewportStruct value) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "ChipStructs.CameraAvStreamManagementClusterViewportStruct"); + responseValues.put(commandResponseInfo, value); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedCameraAvStreamManagementClusterWatermarkEnabledAttributeCallback implements ChipClusters.CameraAvStreamManagementCluster.WatermarkEnabledAttributeCallback, 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 DelegatedCameraAvStreamManagementClusterOSDEnabledAttributeCallback implements ChipClusters.CameraAvStreamManagementCluster.OSDEnabledAttributeCallback, 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 DelegatedCameraAvStreamManagementClusterGeneratedCommandListAttributeCallback implements ChipClusters.CameraAvStreamManagementCluster.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 DelegatedCameraAvStreamManagementClusterAcceptedCommandListAttributeCallback implements ChipClusters.CameraAvStreamManagementCluster.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 DelegatedCameraAvStreamManagementClusterEventListAttributeCallback implements ChipClusters.CameraAvStreamManagementCluster.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 DelegatedCameraAvStreamManagementClusterAttributeListAttributeCallback implements ChipClusters.CameraAvStreamManagementCluster.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 DelegatedWebRTCTransportProviderClusterSolicitOfferResponseCallback implements ChipClusters.WebRTCTransportProviderCluster.SolicitOfferResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override @@ -22699,6 +23206,10 @@ public Map initializeClusterMap() { (ptr, endpointId) -> new ChipClusters.ContentAppObserverCluster(ptr, endpointId), new HashMap<>()); clusterMap.put("contentAppObserver", contentAppObserverClusterInfo); + ClusterInfo cameraAvStreamManagementClusterInfo = new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.CameraAvStreamManagementCluster(ptr, endpointId), new HashMap<>()); + clusterMap.put("cameraAvStreamManagement", cameraAvStreamManagementClusterInfo); + ClusterInfo webRTCTransportProviderClusterInfo = new ClusterInfo( (ptr, endpointId) -> new ChipClusters.WebRTCTransportProviderCluster(ptr, endpointId), new HashMap<>()); clusterMap.put("webRTCTransportProvider", webRTCTransportProviderClusterInfo); @@ -22852,6 +23363,7 @@ public void combineCommand(Map destination, Map> getCommandMap() { commandMap.put("contentAppObserver", contentAppObserverClusterInteractionInfoMap); + Map cameraAvStreamManagementClusterInteractionInfoMap = new LinkedHashMap<>(); + + Map cameraAvStreamManagementaudioStreamAllocateCommandParams = new LinkedHashMap(); + + CommandParameterInfo cameraAvStreamManagementaudioStreamAllocatestreamTypeCommandParameterInfo = new CommandParameterInfo("streamType", Integer.class, Integer.class); + cameraAvStreamManagementaudioStreamAllocateCommandParams.put("streamType",cameraAvStreamManagementaudioStreamAllocatestreamTypeCommandParameterInfo); + + CommandParameterInfo cameraAvStreamManagementaudioStreamAllocateaudioCodecCommandParameterInfo = new CommandParameterInfo("audioCodec", Integer.class, Integer.class); + cameraAvStreamManagementaudioStreamAllocateCommandParams.put("audioCodec",cameraAvStreamManagementaudioStreamAllocateaudioCodecCommandParameterInfo); + + CommandParameterInfo cameraAvStreamManagementaudioStreamAllocatechannelCountCommandParameterInfo = new CommandParameterInfo("channelCount", Integer.class, Integer.class); + cameraAvStreamManagementaudioStreamAllocateCommandParams.put("channelCount",cameraAvStreamManagementaudioStreamAllocatechannelCountCommandParameterInfo); + + CommandParameterInfo cameraAvStreamManagementaudioStreamAllocatesampleRateCommandParameterInfo = new CommandParameterInfo("sampleRate", Long.class, Long.class); + cameraAvStreamManagementaudioStreamAllocateCommandParams.put("sampleRate",cameraAvStreamManagementaudioStreamAllocatesampleRateCommandParameterInfo); + + CommandParameterInfo cameraAvStreamManagementaudioStreamAllocatebitRateCommandParameterInfo = new CommandParameterInfo("bitRate", Long.class, Long.class); + cameraAvStreamManagementaudioStreamAllocateCommandParams.put("bitRate",cameraAvStreamManagementaudioStreamAllocatebitRateCommandParameterInfo); + + CommandParameterInfo cameraAvStreamManagementaudioStreamAllocatebitDepthCommandParameterInfo = new CommandParameterInfo("bitDepth", Integer.class, Integer.class); + cameraAvStreamManagementaudioStreamAllocateCommandParams.put("bitDepth",cameraAvStreamManagementaudioStreamAllocatebitDepthCommandParameterInfo); + InteractionInfo cameraAvStreamManagementaudioStreamAllocateInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster) + .audioStreamAllocate((ChipClusters.CameraAvStreamManagementCluster.AudioStreamAllocateResponseCallback) callback + , (Integer) + commandArguments.get("streamType") + + , (Integer) + commandArguments.get("audioCodec") + + , (Integer) + commandArguments.get("channelCount") + + , (Long) + commandArguments.get("sampleRate") + + , (Long) + commandArguments.get("bitRate") + + , (Integer) + commandArguments.get("bitDepth") + + ); + }, + () -> new DelegatedCameraAvStreamManagementClusterAudioStreamAllocateResponseCallback(), + cameraAvStreamManagementaudioStreamAllocateCommandParams + ); + cameraAvStreamManagementClusterInteractionInfoMap.put("audioStreamAllocate", cameraAvStreamManagementaudioStreamAllocateInteractionInfo); + + Map cameraAvStreamManagementaudioStreamDeallocateCommandParams = new LinkedHashMap(); + + CommandParameterInfo cameraAvStreamManagementaudioStreamDeallocateaudioStreamIDCommandParameterInfo = new CommandParameterInfo("audioStreamID", Integer.class, Integer.class); + cameraAvStreamManagementaudioStreamDeallocateCommandParams.put("audioStreamID",cameraAvStreamManagementaudioStreamDeallocateaudioStreamIDCommandParameterInfo); + InteractionInfo cameraAvStreamManagementaudioStreamDeallocateInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster) + .audioStreamDeallocate((DefaultClusterCallback) callback + , (Integer) + commandArguments.get("audioStreamID") + ); + }, + () -> new DelegatedDefaultClusterCallback(), + cameraAvStreamManagementaudioStreamDeallocateCommandParams + ); + cameraAvStreamManagementClusterInteractionInfoMap.put("audioStreamDeallocate", cameraAvStreamManagementaudioStreamDeallocateInteractionInfo); + + Map cameraAvStreamManagementvideoStreamAllocateCommandParams = new LinkedHashMap(); + + CommandParameterInfo cameraAvStreamManagementvideoStreamAllocatestreamTypeCommandParameterInfo = new CommandParameterInfo("streamType", Integer.class, Integer.class); + cameraAvStreamManagementvideoStreamAllocateCommandParams.put("streamType",cameraAvStreamManagementvideoStreamAllocatestreamTypeCommandParameterInfo); + + CommandParameterInfo cameraAvStreamManagementvideoStreamAllocatevideoCodecCommandParameterInfo = new CommandParameterInfo("videoCodec", Integer.class, Integer.class); + cameraAvStreamManagementvideoStreamAllocateCommandParams.put("videoCodec",cameraAvStreamManagementvideoStreamAllocatevideoCodecCommandParameterInfo); + + CommandParameterInfo cameraAvStreamManagementvideoStreamAllocateminFrameRateCommandParameterInfo = new CommandParameterInfo("minFrameRate", Integer.class, Integer.class); + cameraAvStreamManagementvideoStreamAllocateCommandParams.put("minFrameRate",cameraAvStreamManagementvideoStreamAllocateminFrameRateCommandParameterInfo); + + CommandParameterInfo cameraAvStreamManagementvideoStreamAllocatemaxFrameRateCommandParameterInfo = new CommandParameterInfo("maxFrameRate", Integer.class, Integer.class); + cameraAvStreamManagementvideoStreamAllocateCommandParams.put("maxFrameRate",cameraAvStreamManagementvideoStreamAllocatemaxFrameRateCommandParameterInfo); + + + + CommandParameterInfo cameraAvStreamManagementvideoStreamAllocateminBitRateCommandParameterInfo = new CommandParameterInfo("minBitRate", Long.class, Long.class); + cameraAvStreamManagementvideoStreamAllocateCommandParams.put("minBitRate",cameraAvStreamManagementvideoStreamAllocateminBitRateCommandParameterInfo); + + CommandParameterInfo cameraAvStreamManagementvideoStreamAllocatemaxBitRateCommandParameterInfo = new CommandParameterInfo("maxBitRate", Long.class, Long.class); + cameraAvStreamManagementvideoStreamAllocateCommandParams.put("maxBitRate",cameraAvStreamManagementvideoStreamAllocatemaxBitRateCommandParameterInfo); + + CommandParameterInfo cameraAvStreamManagementvideoStreamAllocateminFragmentLenCommandParameterInfo = new CommandParameterInfo("minFragmentLen", Integer.class, Integer.class); + cameraAvStreamManagementvideoStreamAllocateCommandParams.put("minFragmentLen",cameraAvStreamManagementvideoStreamAllocateminFragmentLenCommandParameterInfo); + + CommandParameterInfo cameraAvStreamManagementvideoStreamAllocatemaxFragmentLenCommandParameterInfo = new CommandParameterInfo("maxFragmentLen", Integer.class, Integer.class); + cameraAvStreamManagementvideoStreamAllocateCommandParams.put("maxFragmentLen",cameraAvStreamManagementvideoStreamAllocatemaxFragmentLenCommandParameterInfo); + InteractionInfo cameraAvStreamManagementvideoStreamAllocateInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster) + .videoStreamAllocate((ChipClusters.CameraAvStreamManagementCluster.VideoStreamAllocateResponseCallback) callback + , (Integer) + commandArguments.get("streamType") + + , (Integer) + commandArguments.get("videoCodec") + + , (Integer) + commandArguments.get("minFrameRate") + + , (Integer) + commandArguments.get("maxFrameRate") + + , (ChipStructs.CameraAvStreamManagementClusterVideoResolutionStruct) + commandArguments.get("minResolution") + + , (ChipStructs.CameraAvStreamManagementClusterVideoResolutionStruct) + commandArguments.get("maxResolution") + + , (Long) + commandArguments.get("minBitRate") + + , (Long) + commandArguments.get("maxBitRate") + + , (Integer) + commandArguments.get("minFragmentLen") + + , (Integer) + commandArguments.get("maxFragmentLen") + + ); + }, + () -> new DelegatedCameraAvStreamManagementClusterVideoStreamAllocateResponseCallback(), + cameraAvStreamManagementvideoStreamAllocateCommandParams + ); + cameraAvStreamManagementClusterInteractionInfoMap.put("videoStreamAllocate", cameraAvStreamManagementvideoStreamAllocateInteractionInfo); + + Map cameraAvStreamManagementvideoStreamModifyCommandParams = new LinkedHashMap(); + + CommandParameterInfo cameraAvStreamManagementvideoStreamModifyvideoStreamIDCommandParameterInfo = new CommandParameterInfo("videoStreamID", Integer.class, Integer.class); + cameraAvStreamManagementvideoStreamModifyCommandParams.put("videoStreamID",cameraAvStreamManagementvideoStreamModifyvideoStreamIDCommandParameterInfo); + + InteractionInfo cameraAvStreamManagementvideoStreamModifyInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster) + .videoStreamModify((DefaultClusterCallback) callback + , (Integer) + commandArguments.get("videoStreamID") + , (ChipStructs.CameraAvStreamManagementClusterVideoResolutionStruct) + commandArguments.get("resolution") + ); + }, + () -> new DelegatedDefaultClusterCallback(), + cameraAvStreamManagementvideoStreamModifyCommandParams + ); + cameraAvStreamManagementClusterInteractionInfoMap.put("videoStreamModify", cameraAvStreamManagementvideoStreamModifyInteractionInfo); + + Map cameraAvStreamManagementvideoStreamDeallocateCommandParams = new LinkedHashMap(); + + CommandParameterInfo cameraAvStreamManagementvideoStreamDeallocatevideoStreamIDCommandParameterInfo = new CommandParameterInfo("videoStreamID", Integer.class, Integer.class); + cameraAvStreamManagementvideoStreamDeallocateCommandParams.put("videoStreamID",cameraAvStreamManagementvideoStreamDeallocatevideoStreamIDCommandParameterInfo); + InteractionInfo cameraAvStreamManagementvideoStreamDeallocateInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster) + .videoStreamDeallocate((DefaultClusterCallback) callback + , (Integer) + commandArguments.get("videoStreamID") + ); + }, + () -> new DelegatedDefaultClusterCallback(), + cameraAvStreamManagementvideoStreamDeallocateCommandParams + ); + cameraAvStreamManagementClusterInteractionInfoMap.put("videoStreamDeallocate", cameraAvStreamManagementvideoStreamDeallocateInteractionInfo); + + Map cameraAvStreamManagementsnapshotStreamAllocateCommandParams = new LinkedHashMap(); + + CommandParameterInfo cameraAvStreamManagementsnapshotStreamAllocateimageCodecCommandParameterInfo = new CommandParameterInfo("imageCodec", Integer.class, Integer.class); + cameraAvStreamManagementsnapshotStreamAllocateCommandParams.put("imageCodec",cameraAvStreamManagementsnapshotStreamAllocateimageCodecCommandParameterInfo); + + CommandParameterInfo cameraAvStreamManagementsnapshotStreamAllocateframeRateCommandParameterInfo = new CommandParameterInfo("frameRate", Integer.class, Integer.class); + cameraAvStreamManagementsnapshotStreamAllocateCommandParams.put("frameRate",cameraAvStreamManagementsnapshotStreamAllocateframeRateCommandParameterInfo); + + CommandParameterInfo cameraAvStreamManagementsnapshotStreamAllocatebitRateCommandParameterInfo = new CommandParameterInfo("bitRate", Long.class, Long.class); + cameraAvStreamManagementsnapshotStreamAllocateCommandParams.put("bitRate",cameraAvStreamManagementsnapshotStreamAllocatebitRateCommandParameterInfo); + + + + CommandParameterInfo cameraAvStreamManagementsnapshotStreamAllocatequalityCommandParameterInfo = new CommandParameterInfo("quality", Integer.class, Integer.class); + cameraAvStreamManagementsnapshotStreamAllocateCommandParams.put("quality",cameraAvStreamManagementsnapshotStreamAllocatequalityCommandParameterInfo); + InteractionInfo cameraAvStreamManagementsnapshotStreamAllocateInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster) + .snapshotStreamAllocate((ChipClusters.CameraAvStreamManagementCluster.SnapshotStreamAllocateResponseCallback) callback + , (Integer) + commandArguments.get("imageCodec") + + , (Integer) + commandArguments.get("frameRate") + + , (Long) + commandArguments.get("bitRate") + + , (ChipStructs.CameraAvStreamManagementClusterVideoResolutionStruct) + commandArguments.get("minResolution") + + , (ChipStructs.CameraAvStreamManagementClusterVideoResolutionStruct) + commandArguments.get("maxResolution") + + , (Integer) + commandArguments.get("quality") + + ); + }, + () -> new DelegatedCameraAvStreamManagementClusterSnapshotStreamAllocateResponseCallback(), + cameraAvStreamManagementsnapshotStreamAllocateCommandParams + ); + cameraAvStreamManagementClusterInteractionInfoMap.put("snapshotStreamAllocate", cameraAvStreamManagementsnapshotStreamAllocateInteractionInfo); + + Map cameraAvStreamManagementsnapshotStreamDeallocateCommandParams = new LinkedHashMap(); + + CommandParameterInfo cameraAvStreamManagementsnapshotStreamDeallocatesnapshotStreamIDCommandParameterInfo = new CommandParameterInfo("snapshotStreamID", Integer.class, Integer.class); + cameraAvStreamManagementsnapshotStreamDeallocateCommandParams.put("snapshotStreamID",cameraAvStreamManagementsnapshotStreamDeallocatesnapshotStreamIDCommandParameterInfo); + InteractionInfo cameraAvStreamManagementsnapshotStreamDeallocateInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster) + .snapshotStreamDeallocate((DefaultClusterCallback) callback + , (Integer) + commandArguments.get("snapshotStreamID") + ); + }, + () -> new DelegatedDefaultClusterCallback(), + cameraAvStreamManagementsnapshotStreamDeallocateCommandParams + ); + cameraAvStreamManagementClusterInteractionInfoMap.put("snapshotStreamDeallocate", cameraAvStreamManagementsnapshotStreamDeallocateInteractionInfo); + + Map cameraAvStreamManagementsetStreamPriorityCommandParams = new LinkedHashMap(); + InteractionInfo cameraAvStreamManagementsetStreamPriorityInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster) + .setStreamPriority((DefaultClusterCallback) callback + ); + }, + () -> new DelegatedDefaultClusterCallback(), + cameraAvStreamManagementsetStreamPriorityCommandParams + ); + cameraAvStreamManagementClusterInteractionInfoMap.put("setStreamPriority", cameraAvStreamManagementsetStreamPriorityInteractionInfo); + + Map cameraAvStreamManagementcaptureSnapshotCommandParams = new LinkedHashMap(); + + CommandParameterInfo cameraAvStreamManagementcaptureSnapshotsnapshotStreamIDCommandParameterInfo = new CommandParameterInfo("snapshotStreamID", Integer.class, Integer.class); + cameraAvStreamManagementcaptureSnapshotCommandParams.put("snapshotStreamID",cameraAvStreamManagementcaptureSnapshotsnapshotStreamIDCommandParameterInfo); + + InteractionInfo cameraAvStreamManagementcaptureSnapshotInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster) + .captureSnapshot((DefaultClusterCallback) callback + , (Integer) + commandArguments.get("snapshotStreamID") + , (ChipStructs.CameraAvStreamManagementClusterVideoResolutionStruct) + commandArguments.get("requestedResolution") + ); + }, + () -> new DelegatedDefaultClusterCallback(), + cameraAvStreamManagementcaptureSnapshotCommandParams + ); + cameraAvStreamManagementClusterInteractionInfoMap.put("captureSnapshot", cameraAvStreamManagementcaptureSnapshotInteractionInfo); + + Map cameraAvStreamManagementsetViewportCommandParams = new LinkedHashMap(); + + InteractionInfo cameraAvStreamManagementsetViewportInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster) + .setViewport((DefaultClusterCallback) callback + , (ChipStructs.CameraAvStreamManagementClusterViewportStruct) + commandArguments.get("viewport") + ); + }, + () -> new DelegatedDefaultClusterCallback(), + cameraAvStreamManagementsetViewportCommandParams + ); + cameraAvStreamManagementClusterInteractionInfoMap.put("setViewport", cameraAvStreamManagementsetViewportInteractionInfo); + + Map cameraAvStreamManagementsetImageRotationCommandParams = new LinkedHashMap(); + + CommandParameterInfo cameraAvStreamManagementsetImageRotationangleCommandParameterInfo = new CommandParameterInfo("angle", Integer.class, Integer.class); + cameraAvStreamManagementsetImageRotationCommandParams.put("angle",cameraAvStreamManagementsetImageRotationangleCommandParameterInfo); + InteractionInfo cameraAvStreamManagementsetImageRotationInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster) + .setImageRotation((DefaultClusterCallback) callback + , (Integer) + commandArguments.get("angle") + ); + }, + () -> new DelegatedDefaultClusterCallback(), + cameraAvStreamManagementsetImageRotationCommandParams + ); + cameraAvStreamManagementClusterInteractionInfoMap.put("setImageRotation", cameraAvStreamManagementsetImageRotationInteractionInfo); + + Map cameraAvStreamManagementsetImageFlipHorizontalCommandParams = new LinkedHashMap(); + + CommandParameterInfo cameraAvStreamManagementsetImageFlipHorizontalenabledCommandParameterInfo = new CommandParameterInfo("enabled", Boolean.class, Boolean.class); + cameraAvStreamManagementsetImageFlipHorizontalCommandParams.put("enabled",cameraAvStreamManagementsetImageFlipHorizontalenabledCommandParameterInfo); + InteractionInfo cameraAvStreamManagementsetImageFlipHorizontalInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster) + .setImageFlipHorizontal((DefaultClusterCallback) callback + , (Boolean) + commandArguments.get("enabled") + ); + }, + () -> new DelegatedDefaultClusterCallback(), + cameraAvStreamManagementsetImageFlipHorizontalCommandParams + ); + cameraAvStreamManagementClusterInteractionInfoMap.put("setImageFlipHorizontal", cameraAvStreamManagementsetImageFlipHorizontalInteractionInfo); + + Map cameraAvStreamManagementsetImageFlipVerticalCommandParams = new LinkedHashMap(); + + CommandParameterInfo cameraAvStreamManagementsetImageFlipVerticalenabledCommandParameterInfo = new CommandParameterInfo("enabled", Boolean.class, Boolean.class); + cameraAvStreamManagementsetImageFlipVerticalCommandParams.put("enabled",cameraAvStreamManagementsetImageFlipVerticalenabledCommandParameterInfo); + InteractionInfo cameraAvStreamManagementsetImageFlipVerticalInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster) + .setImageFlipVertical((DefaultClusterCallback) callback + , (Boolean) + commandArguments.get("enabled") + ); + }, + () -> new DelegatedDefaultClusterCallback(), + cameraAvStreamManagementsetImageFlipVerticalCommandParams + ); + cameraAvStreamManagementClusterInteractionInfoMap.put("setImageFlipVertical", cameraAvStreamManagementsetImageFlipVerticalInteractionInfo); + + Map cameraAvStreamManagementsetWatermarkCommandParams = new LinkedHashMap(); + + CommandParameterInfo cameraAvStreamManagementsetWatermarkvideoStreamIDCommandParameterInfo = new CommandParameterInfo("videoStreamID", Integer.class, Integer.class); + cameraAvStreamManagementsetWatermarkCommandParams.put("videoStreamID",cameraAvStreamManagementsetWatermarkvideoStreamIDCommandParameterInfo); + + CommandParameterInfo cameraAvStreamManagementsetWatermarkenabledCommandParameterInfo = new CommandParameterInfo("enabled", Boolean.class, Boolean.class); + cameraAvStreamManagementsetWatermarkCommandParams.put("enabled",cameraAvStreamManagementsetWatermarkenabledCommandParameterInfo); + InteractionInfo cameraAvStreamManagementsetWatermarkInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster) + .setWatermark((DefaultClusterCallback) callback + , (Integer) + commandArguments.get("videoStreamID") + , (Boolean) + commandArguments.get("enabled") + ); + }, + () -> new DelegatedDefaultClusterCallback(), + cameraAvStreamManagementsetWatermarkCommandParams + ); + cameraAvStreamManagementClusterInteractionInfoMap.put("setWatermark", cameraAvStreamManagementsetWatermarkInteractionInfo); + + Map cameraAvStreamManagementsetOSDCommandParams = new LinkedHashMap(); + + CommandParameterInfo cameraAvStreamManagementsetOSDvideoStreamIDCommandParameterInfo = new CommandParameterInfo("videoStreamID", Integer.class, Integer.class); + cameraAvStreamManagementsetOSDCommandParams.put("videoStreamID",cameraAvStreamManagementsetOSDvideoStreamIDCommandParameterInfo); + + CommandParameterInfo cameraAvStreamManagementsetOSDenabledCommandParameterInfo = new CommandParameterInfo("enabled", Boolean.class, Boolean.class); + cameraAvStreamManagementsetOSDCommandParams.put("enabled",cameraAvStreamManagementsetOSDenabledCommandParameterInfo); + InteractionInfo cameraAvStreamManagementsetOSDInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster) + .setOSD((DefaultClusterCallback) callback + , (Integer) + commandArguments.get("videoStreamID") + , (Boolean) + commandArguments.get("enabled") + ); + }, + () -> new DelegatedDefaultClusterCallback(), + cameraAvStreamManagementsetOSDCommandParams + ); + cameraAvStreamManagementClusterInteractionInfoMap.put("setOSD", cameraAvStreamManagementsetOSDInteractionInfo); + + commandMap.put("cameraAvStreamManagement", cameraAvStreamManagementClusterInteractionInfoMap); + Map webRTCTransportProviderClusterInteractionInfoMap = new LinkedHashMap<>(); Map webRTCTransportProvidersolicitOfferCommandParams = 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 41df5ac5c85aff..d5a32080030a11 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java @@ -18247,6 +18247,560 @@ private static Map readContentAppObserverInteractionInf return result; } + private static Map readCameraAvStreamManagementInteractionInfo() { + Map result = new LinkedHashMap<>();Map readCameraAvStreamManagementMaxConcurrentVideoEncodersCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvStreamManagementMaxConcurrentVideoEncodersAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).readMaxConcurrentVideoEncodersAttribute( + (ChipClusters.IntegerAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readCameraAvStreamManagementMaxConcurrentVideoEncodersCommandParams + ); + result.put("readMaxConcurrentVideoEncodersAttribute", readCameraAvStreamManagementMaxConcurrentVideoEncodersAttributeInteractionInfo); + Map readCameraAvStreamManagementMaxEncodedPixelRateCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvStreamManagementMaxEncodedPixelRateAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).readMaxEncodedPixelRateAttribute( + (ChipClusters.LongAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readCameraAvStreamManagementMaxEncodedPixelRateCommandParams + ); + result.put("readMaxEncodedPixelRateAttribute", readCameraAvStreamManagementMaxEncodedPixelRateAttributeInteractionInfo); + Map readCameraAvStreamManagementNightVisionCapableCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvStreamManagementNightVisionCapableAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).readNightVisionCapableAttribute( + (ChipClusters.BooleanAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedBooleanAttributeCallback(), + readCameraAvStreamManagementNightVisionCapableCommandParams + ); + result.put("readNightVisionCapableAttribute", readCameraAvStreamManagementNightVisionCapableAttributeInteractionInfo); + Map readCameraAvStreamManagementRateDistortionTradeOffPointsCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvStreamManagementRateDistortionTradeOffPointsAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).readRateDistortionTradeOffPointsAttribute( + (ChipClusters.CameraAvStreamManagementCluster.RateDistortionTradeOffPointsAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedCameraAvStreamManagementClusterRateDistortionTradeOffPointsAttributeCallback(), + readCameraAvStreamManagementRateDistortionTradeOffPointsCommandParams + ); + result.put("readRateDistortionTradeOffPointsAttribute", readCameraAvStreamManagementRateDistortionTradeOffPointsAttributeInteractionInfo); + Map readCameraAvStreamManagementMaxPreRollBufferSizeCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvStreamManagementMaxPreRollBufferSizeAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).readMaxPreRollBufferSizeAttribute( + (ChipClusters.LongAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readCameraAvStreamManagementMaxPreRollBufferSizeCommandParams + ); + result.put("readMaxPreRollBufferSizeAttribute", readCameraAvStreamManagementMaxPreRollBufferSizeAttributeInteractionInfo); + Map readCameraAvStreamManagementTwoWayTalkSupportCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvStreamManagementTwoWayTalkSupportAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).readTwoWayTalkSupportAttribute( + (ChipClusters.IntegerAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readCameraAvStreamManagementTwoWayTalkSupportCommandParams + ); + result.put("readTwoWayTalkSupportAttribute", readCameraAvStreamManagementTwoWayTalkSupportAttributeInteractionInfo); + Map readCameraAvStreamManagementSupportedSnapshotParamsCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvStreamManagementSupportedSnapshotParamsAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).readSupportedSnapshotParamsAttribute( + (ChipClusters.CameraAvStreamManagementCluster.SupportedSnapshotParamsAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedCameraAvStreamManagementClusterSupportedSnapshotParamsAttributeCallback(), + readCameraAvStreamManagementSupportedSnapshotParamsCommandParams + ); + result.put("readSupportedSnapshotParamsAttribute", readCameraAvStreamManagementSupportedSnapshotParamsAttributeInteractionInfo); + Map readCameraAvStreamManagementHDRCapableCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvStreamManagementHDRCapableAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).readHDRCapableAttribute( + (ChipClusters.BooleanAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedBooleanAttributeCallback(), + readCameraAvStreamManagementHDRCapableCommandParams + ); + result.put("readHDRCapableAttribute", readCameraAvStreamManagementHDRCapableAttributeInteractionInfo); + Map readCameraAvStreamManagementMaxNetworkBandwidthCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvStreamManagementMaxNetworkBandwidthAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).readMaxNetworkBandwidthAttribute( + (ChipClusters.LongAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readCameraAvStreamManagementMaxNetworkBandwidthCommandParams + ); + result.put("readMaxNetworkBandwidthAttribute", readCameraAvStreamManagementMaxNetworkBandwidthAttributeInteractionInfo); + Map readCameraAvStreamManagementCurrentFrameRateCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvStreamManagementCurrentFrameRateAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).readCurrentFrameRateAttribute( + (ChipClusters.IntegerAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readCameraAvStreamManagementCurrentFrameRateCommandParams + ); + result.put("readCurrentFrameRateAttribute", readCameraAvStreamManagementCurrentFrameRateAttributeInteractionInfo); + Map readCameraAvStreamManagementHDRModeCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvStreamManagementHDRModeAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).readHDRModeAttribute( + (ChipClusters.BooleanAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedBooleanAttributeCallback(), + readCameraAvStreamManagementHDRModeCommandParams + ); + result.put("readHDRModeAttribute", readCameraAvStreamManagementHDRModeAttributeInteractionInfo); + Map readCameraAvStreamManagementCurrentVideoCodecsCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvStreamManagementCurrentVideoCodecsAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).readCurrentVideoCodecsAttribute( + (ChipClusters.CameraAvStreamManagementCluster.CurrentVideoCodecsAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedCameraAvStreamManagementClusterCurrentVideoCodecsAttributeCallback(), + readCameraAvStreamManagementCurrentVideoCodecsCommandParams + ); + result.put("readCurrentVideoCodecsAttribute", readCameraAvStreamManagementCurrentVideoCodecsAttributeInteractionInfo); + Map readCameraAvStreamManagementFabricsUsingCameraCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvStreamManagementFabricsUsingCameraAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).readFabricsUsingCameraAttribute( + (ChipClusters.CameraAvStreamManagementCluster.FabricsUsingCameraAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedCameraAvStreamManagementClusterFabricsUsingCameraAttributeCallback(), + readCameraAvStreamManagementFabricsUsingCameraCommandParams + ); + result.put("readFabricsUsingCameraAttribute", readCameraAvStreamManagementFabricsUsingCameraAttributeInteractionInfo); + Map readCameraAvStreamManagementAllocatedVideoStreamsCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvStreamManagementAllocatedVideoStreamsAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).readAllocatedVideoStreamsAttribute( + (ChipClusters.CameraAvStreamManagementCluster.AllocatedVideoStreamsAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedCameraAvStreamManagementClusterAllocatedVideoStreamsAttributeCallback(), + readCameraAvStreamManagementAllocatedVideoStreamsCommandParams + ); + result.put("readAllocatedVideoStreamsAttribute", readCameraAvStreamManagementAllocatedVideoStreamsAttributeInteractionInfo); + Map readCameraAvStreamManagementAllocatedAudioStreamsCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvStreamManagementAllocatedAudioStreamsAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).readAllocatedAudioStreamsAttribute( + (ChipClusters.CameraAvStreamManagementCluster.AllocatedAudioStreamsAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedCameraAvStreamManagementClusterAllocatedAudioStreamsAttributeCallback(), + readCameraAvStreamManagementAllocatedAudioStreamsCommandParams + ); + result.put("readAllocatedAudioStreamsAttribute", readCameraAvStreamManagementAllocatedAudioStreamsAttributeInteractionInfo); + Map readCameraAvStreamManagementAllocatedSnapshotStreamsCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvStreamManagementAllocatedSnapshotStreamsAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).readAllocatedSnapshotStreamsAttribute( + (ChipClusters.CameraAvStreamManagementCluster.AllocatedSnapshotStreamsAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedCameraAvStreamManagementClusterAllocatedSnapshotStreamsAttributeCallback(), + readCameraAvStreamManagementAllocatedSnapshotStreamsCommandParams + ); + result.put("readAllocatedSnapshotStreamsAttribute", readCameraAvStreamManagementAllocatedSnapshotStreamsAttributeInteractionInfo); + Map readCameraAvStreamManagementRankedVideoStreamPrioritiesListCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvStreamManagementRankedVideoStreamPrioritiesListAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).readRankedVideoStreamPrioritiesListAttribute( + (ChipClusters.CameraAvStreamManagementCluster.RankedVideoStreamPrioritiesListAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedCameraAvStreamManagementClusterRankedVideoStreamPrioritiesListAttributeCallback(), + readCameraAvStreamManagementRankedVideoStreamPrioritiesListCommandParams + ); + result.put("readRankedVideoStreamPrioritiesListAttribute", readCameraAvStreamManagementRankedVideoStreamPrioritiesListAttributeInteractionInfo); + Map readCameraAvStreamManagementSoftRecordingPrivacyModeSettingCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvStreamManagementSoftRecordingPrivacyModeSettingAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).readSoftRecordingPrivacyModeSettingAttribute( + (ChipClusters.BooleanAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedBooleanAttributeCallback(), + readCameraAvStreamManagementSoftRecordingPrivacyModeSettingCommandParams + ); + result.put("readSoftRecordingPrivacyModeSettingAttribute", readCameraAvStreamManagementSoftRecordingPrivacyModeSettingAttributeInteractionInfo); + Map readCameraAvStreamManagementSoftLivestreamPrivacyModeSettingCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvStreamManagementSoftLivestreamPrivacyModeSettingAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).readSoftLivestreamPrivacyModeSettingAttribute( + (ChipClusters.BooleanAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedBooleanAttributeCallback(), + readCameraAvStreamManagementSoftLivestreamPrivacyModeSettingCommandParams + ); + result.put("readSoftLivestreamPrivacyModeSettingAttribute", readCameraAvStreamManagementSoftLivestreamPrivacyModeSettingAttributeInteractionInfo); + Map readCameraAvStreamManagementHardPrivacyModeCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvStreamManagementHardPrivacyModeAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).readHardPrivacyModeAttribute( + (ChipClusters.BooleanAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedBooleanAttributeCallback(), + readCameraAvStreamManagementHardPrivacyModeCommandParams + ); + result.put("readHardPrivacyModeAttribute", readCameraAvStreamManagementHardPrivacyModeAttributeInteractionInfo); + Map readCameraAvStreamManagementNightVisionCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvStreamManagementNightVisionAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).readNightVisionAttribute( + (ChipClusters.IntegerAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readCameraAvStreamManagementNightVisionCommandParams + ); + result.put("readNightVisionAttribute", readCameraAvStreamManagementNightVisionAttributeInteractionInfo); + Map readCameraAvStreamManagementNightVisionIllumCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvStreamManagementNightVisionIllumAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).readNightVisionIllumAttribute( + (ChipClusters.IntegerAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readCameraAvStreamManagementNightVisionIllumCommandParams + ); + result.put("readNightVisionIllumAttribute", readCameraAvStreamManagementNightVisionIllumAttributeInteractionInfo); + Map readCameraAvStreamManagementAwbCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvStreamManagementAwbAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).readAwbAttribute( + (ChipClusters.BooleanAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedBooleanAttributeCallback(), + readCameraAvStreamManagementAwbCommandParams + ); + result.put("readAwbAttribute", readCameraAvStreamManagementAwbAttributeInteractionInfo); + Map readCameraAvStreamManagementShutterSpeedCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvStreamManagementShutterSpeedAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).readShutterSpeedAttribute( + (ChipClusters.BooleanAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedBooleanAttributeCallback(), + readCameraAvStreamManagementShutterSpeedCommandParams + ); + result.put("readShutterSpeedAttribute", readCameraAvStreamManagementShutterSpeedAttributeInteractionInfo); + Map readCameraAvStreamManagementIsoCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvStreamManagementIsoAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).readIsoAttribute( + (ChipClusters.BooleanAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedBooleanAttributeCallback(), + readCameraAvStreamManagementIsoCommandParams + ); + result.put("readIsoAttribute", readCameraAvStreamManagementIsoAttributeInteractionInfo); + Map readCameraAvStreamManagementSpeakerEnabledCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvStreamManagementSpeakerEnabledAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).readSpeakerEnabledAttribute( + (ChipClusters.BooleanAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedBooleanAttributeCallback(), + readCameraAvStreamManagementSpeakerEnabledCommandParams + ); + result.put("readSpeakerEnabledAttribute", readCameraAvStreamManagementSpeakerEnabledAttributeInteractionInfo); + Map readCameraAvStreamManagementSpeakerVolumeLevelCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvStreamManagementSpeakerVolumeLevelAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).readSpeakerVolumeLevelAttribute( + (ChipClusters.IntegerAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readCameraAvStreamManagementSpeakerVolumeLevelCommandParams + ); + result.put("readSpeakerVolumeLevelAttribute", readCameraAvStreamManagementSpeakerVolumeLevelAttributeInteractionInfo); + Map readCameraAvStreamManagementSpeakerMaxLevelCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvStreamManagementSpeakerMaxLevelAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).readSpeakerMaxLevelAttribute( + (ChipClusters.IntegerAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readCameraAvStreamManagementSpeakerMaxLevelCommandParams + ); + result.put("readSpeakerMaxLevelAttribute", readCameraAvStreamManagementSpeakerMaxLevelAttributeInteractionInfo); + Map readCameraAvStreamManagementSpeakerMinLevelCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvStreamManagementSpeakerMinLevelAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).readSpeakerMinLevelAttribute( + (ChipClusters.IntegerAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readCameraAvStreamManagementSpeakerMinLevelCommandParams + ); + result.put("readSpeakerMinLevelAttribute", readCameraAvStreamManagementSpeakerMinLevelAttributeInteractionInfo); + Map readCameraAvStreamManagementMicStatusCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvStreamManagementMicStatusAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).readMicStatusAttribute( + (ChipClusters.BooleanAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedBooleanAttributeCallback(), + readCameraAvStreamManagementMicStatusCommandParams + ); + result.put("readMicStatusAttribute", readCameraAvStreamManagementMicStatusAttributeInteractionInfo); + Map readCameraAvStreamManagementMicVolumeLevelCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvStreamManagementMicVolumeLevelAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).readMicVolumeLevelAttribute( + (ChipClusters.IntegerAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readCameraAvStreamManagementMicVolumeLevelCommandParams + ); + result.put("readMicVolumeLevelAttribute", readCameraAvStreamManagementMicVolumeLevelAttributeInteractionInfo); + Map readCameraAvStreamManagementMicMaxLevelCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvStreamManagementMicMaxLevelAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).readMicMaxLevelAttribute( + (ChipClusters.IntegerAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readCameraAvStreamManagementMicMaxLevelCommandParams + ); + result.put("readMicMaxLevelAttribute", readCameraAvStreamManagementMicMaxLevelAttributeInteractionInfo); + Map readCameraAvStreamManagementMicMinLevelCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvStreamManagementMicMinLevelAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).readMicMinLevelAttribute( + (ChipClusters.IntegerAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readCameraAvStreamManagementMicMinLevelCommandParams + ); + result.put("readMicMinLevelAttribute", readCameraAvStreamManagementMicMinLevelAttributeInteractionInfo); + Map readCameraAvStreamManagementMicAGCEnabledCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvStreamManagementMicAGCEnabledAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).readMicAGCEnabledAttribute( + (ChipClusters.BooleanAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedBooleanAttributeCallback(), + readCameraAvStreamManagementMicAGCEnabledCommandParams + ); + result.put("readMicAGCEnabledAttribute", readCameraAvStreamManagementMicAGCEnabledAttributeInteractionInfo); + Map readCameraAvStreamManagementImageRotationCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvStreamManagementImageRotationAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).readImageRotationAttribute( + (ChipClusters.IntegerAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readCameraAvStreamManagementImageRotationCommandParams + ); + result.put("readImageRotationAttribute", readCameraAvStreamManagementImageRotationAttributeInteractionInfo); + Map readCameraAvStreamManagementImageFlipHorizontalCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvStreamManagementImageFlipHorizontalAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).readImageFlipHorizontalAttribute( + (ChipClusters.BooleanAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedBooleanAttributeCallback(), + readCameraAvStreamManagementImageFlipHorizontalCommandParams + ); + result.put("readImageFlipHorizontalAttribute", readCameraAvStreamManagementImageFlipHorizontalAttributeInteractionInfo); + Map readCameraAvStreamManagementImageFlipVerticalCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvStreamManagementImageFlipVerticalAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).readImageFlipVerticalAttribute( + (ChipClusters.BooleanAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedBooleanAttributeCallback(), + readCameraAvStreamManagementImageFlipVerticalCommandParams + ); + result.put("readImageFlipVerticalAttribute", readCameraAvStreamManagementImageFlipVerticalAttributeInteractionInfo); + Map readCameraAvStreamManagementLocalVideoRecordingEnabledCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvStreamManagementLocalVideoRecordingEnabledAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).readLocalVideoRecordingEnabledAttribute( + (ChipClusters.BooleanAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedBooleanAttributeCallback(), + readCameraAvStreamManagementLocalVideoRecordingEnabledCommandParams + ); + result.put("readLocalVideoRecordingEnabledAttribute", readCameraAvStreamManagementLocalVideoRecordingEnabledAttributeInteractionInfo); + Map readCameraAvStreamManagementLocalSnapshotRecordingEnabledCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvStreamManagementLocalSnapshotRecordingEnabledAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).readLocalSnapshotRecordingEnabledAttribute( + (ChipClusters.BooleanAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedBooleanAttributeCallback(), + readCameraAvStreamManagementLocalSnapshotRecordingEnabledCommandParams + ); + result.put("readLocalSnapshotRecordingEnabledAttribute", readCameraAvStreamManagementLocalSnapshotRecordingEnabledAttributeInteractionInfo); + Map readCameraAvStreamManagementStatusLightCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvStreamManagementStatusLightAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).readStatusLightAttribute( + (ChipClusters.BooleanAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedBooleanAttributeCallback(), + readCameraAvStreamManagementStatusLightCommandParams + ); + result.put("readStatusLightAttribute", readCameraAvStreamManagementStatusLightAttributeInteractionInfo); + Map readCameraAvStreamManagementStatusLightBrightnessCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvStreamManagementStatusLightBrightnessAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).readStatusLightBrightnessAttribute( + (ChipClusters.IntegerAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readCameraAvStreamManagementStatusLightBrightnessCommandParams + ); + result.put("readStatusLightBrightnessAttribute", readCameraAvStreamManagementStatusLightBrightnessAttributeInteractionInfo); + Map readCameraAvStreamManagementDepthSensorStatusCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvStreamManagementDepthSensorStatusAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).readDepthSensorStatusAttribute( + (ChipClusters.IntegerAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readCameraAvStreamManagementDepthSensorStatusCommandParams + ); + result.put("readDepthSensorStatusAttribute", readCameraAvStreamManagementDepthSensorStatusAttributeInteractionInfo); + Map readCameraAvStreamManagementWatermarkEnabledCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvStreamManagementWatermarkEnabledAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).readWatermarkEnabledAttribute( + (ChipClusters.CameraAvStreamManagementCluster.WatermarkEnabledAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedCameraAvStreamManagementClusterWatermarkEnabledAttributeCallback(), + readCameraAvStreamManagementWatermarkEnabledCommandParams + ); + result.put("readWatermarkEnabledAttribute", readCameraAvStreamManagementWatermarkEnabledAttributeInteractionInfo); + Map readCameraAvStreamManagementOSDEnabledCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvStreamManagementOSDEnabledAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).readOSDEnabledAttribute( + (ChipClusters.CameraAvStreamManagementCluster.OSDEnabledAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedCameraAvStreamManagementClusterOSDEnabledAttributeCallback(), + readCameraAvStreamManagementOSDEnabledCommandParams + ); + result.put("readOSDEnabledAttribute", readCameraAvStreamManagementOSDEnabledAttributeInteractionInfo); + Map readCameraAvStreamManagementGeneratedCommandListCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvStreamManagementGeneratedCommandListAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).readGeneratedCommandListAttribute( + (ChipClusters.CameraAvStreamManagementCluster.GeneratedCommandListAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedCameraAvStreamManagementClusterGeneratedCommandListAttributeCallback(), + readCameraAvStreamManagementGeneratedCommandListCommandParams + ); + result.put("readGeneratedCommandListAttribute", readCameraAvStreamManagementGeneratedCommandListAttributeInteractionInfo); + Map readCameraAvStreamManagementAcceptedCommandListCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvStreamManagementAcceptedCommandListAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).readAcceptedCommandListAttribute( + (ChipClusters.CameraAvStreamManagementCluster.AcceptedCommandListAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedCameraAvStreamManagementClusterAcceptedCommandListAttributeCallback(), + readCameraAvStreamManagementAcceptedCommandListCommandParams + ); + result.put("readAcceptedCommandListAttribute", readCameraAvStreamManagementAcceptedCommandListAttributeInteractionInfo); + Map readCameraAvStreamManagementEventListCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvStreamManagementEventListAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).readEventListAttribute( + (ChipClusters.CameraAvStreamManagementCluster.EventListAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedCameraAvStreamManagementClusterEventListAttributeCallback(), + readCameraAvStreamManagementEventListCommandParams + ); + result.put("readEventListAttribute", readCameraAvStreamManagementEventListAttributeInteractionInfo); + Map readCameraAvStreamManagementAttributeListCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvStreamManagementAttributeListAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).readAttributeListAttribute( + (ChipClusters.CameraAvStreamManagementCluster.AttributeListAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedCameraAvStreamManagementClusterAttributeListAttributeCallback(), + readCameraAvStreamManagementAttributeListCommandParams + ); + result.put("readAttributeListAttribute", readCameraAvStreamManagementAttributeListAttributeInteractionInfo); + Map readCameraAvStreamManagementFeatureMapCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvStreamManagementFeatureMapAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).readFeatureMapAttribute( + (ChipClusters.LongAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readCameraAvStreamManagementFeatureMapCommandParams + ); + result.put("readFeatureMapAttribute", readCameraAvStreamManagementFeatureMapAttributeInteractionInfo); + Map readCameraAvStreamManagementClusterRevisionCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvStreamManagementClusterRevisionAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).readClusterRevisionAttribute( + (ChipClusters.IntegerAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readCameraAvStreamManagementClusterRevisionCommandParams + ); + result.put("readClusterRevisionAttribute", readCameraAvStreamManagementClusterRevisionAttributeInteractionInfo); + + return result; + } private static Map readWebRTCTransportProviderInteractionInfo() { Map result = new LinkedHashMap<>();Map readWebRTCTransportProviderCurrentSessionsCommandParams = new LinkedHashMap(); InteractionInfo readWebRTCTransportProviderCurrentSessionsAttributeInteractionInfo = new InteractionInfo( @@ -19962,6 +20516,7 @@ public Map> getReadAttributeMap() { put("accountLogin", readAccountLoginInteractionInfo()); put("contentControl", readContentControlInteractionInfo()); put("contentAppObserver", readContentAppObserverInteractionInfo()); + put("cameraAvStreamManagement", readCameraAvStreamManagementInteractionInfo()); put("webRTCTransportProvider", readWebRTCTransportProviderInteractionInfo()); put("webRTCTransportRequestor", readWebRTCTransportRequestorInteractionInfo()); put("chime", readChimeInteractionInfo()); diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java index b2ffaac83a4110..d2801ecd47a46e 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java @@ -3472,6 +3472,492 @@ public Map> getWriteAttributeMap() { writeAttributeMap.put("contentControl", writeContentControlInteractionInfo); Map writeContentAppObserverInteractionInfo = new LinkedHashMap<>(); writeAttributeMap.put("contentAppObserver", writeContentAppObserverInteractionInfo); + Map writeCameraAvStreamManagementInteractionInfo = new LinkedHashMap<>(); + Map writeCameraAvStreamManagementHDRModeCommandParams = new LinkedHashMap(); + CommandParameterInfo cameraAvStreamManagementHDRModeCommandParameterInfo = + new CommandParameterInfo( + "value", + Boolean.class, + Boolean.class + ); + writeCameraAvStreamManagementHDRModeCommandParams.put( + "value", + cameraAvStreamManagementHDRModeCommandParameterInfo + ); + InteractionInfo writeCameraAvStreamManagementHDRModeAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).writeHDRModeAttribute( + (DefaultClusterCallback) callback, + (Boolean) commandArguments.get("value") + ); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeCameraAvStreamManagementHDRModeCommandParams + ); + writeCameraAvStreamManagementInteractionInfo.put("writeHDRModeAttribute", writeCameraAvStreamManagementHDRModeAttributeInteractionInfo); + Map writeCameraAvStreamManagementSoftRecordingPrivacyModeSettingCommandParams = new LinkedHashMap(); + CommandParameterInfo cameraAvStreamManagementsoftRecordingPrivacyModeSettingCommandParameterInfo = + new CommandParameterInfo( + "value", + Boolean.class, + Boolean.class + ); + writeCameraAvStreamManagementSoftRecordingPrivacyModeSettingCommandParams.put( + "value", + cameraAvStreamManagementsoftRecordingPrivacyModeSettingCommandParameterInfo + ); + InteractionInfo writeCameraAvStreamManagementSoftRecordingPrivacyModeSettingAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).writeSoftRecordingPrivacyModeSettingAttribute( + (DefaultClusterCallback) callback, + (Boolean) commandArguments.get("value") + ); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeCameraAvStreamManagementSoftRecordingPrivacyModeSettingCommandParams + ); + writeCameraAvStreamManagementInteractionInfo.put("writeSoftRecordingPrivacyModeSettingAttribute", writeCameraAvStreamManagementSoftRecordingPrivacyModeSettingAttributeInteractionInfo); + Map writeCameraAvStreamManagementSoftLivestreamPrivacyModeSettingCommandParams = new LinkedHashMap(); + CommandParameterInfo cameraAvStreamManagementsoftLivestreamPrivacyModeSettingCommandParameterInfo = + new CommandParameterInfo( + "value", + Boolean.class, + Boolean.class + ); + writeCameraAvStreamManagementSoftLivestreamPrivacyModeSettingCommandParams.put( + "value", + cameraAvStreamManagementsoftLivestreamPrivacyModeSettingCommandParameterInfo + ); + InteractionInfo writeCameraAvStreamManagementSoftLivestreamPrivacyModeSettingAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).writeSoftLivestreamPrivacyModeSettingAttribute( + (DefaultClusterCallback) callback, + (Boolean) commandArguments.get("value") + ); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeCameraAvStreamManagementSoftLivestreamPrivacyModeSettingCommandParams + ); + writeCameraAvStreamManagementInteractionInfo.put("writeSoftLivestreamPrivacyModeSettingAttribute", writeCameraAvStreamManagementSoftLivestreamPrivacyModeSettingAttributeInteractionInfo); + Map writeCameraAvStreamManagementNightVisionCommandParams = new LinkedHashMap(); + CommandParameterInfo cameraAvStreamManagementnightVisionCommandParameterInfo = + new CommandParameterInfo( + "value", + Integer.class, + Integer.class + ); + writeCameraAvStreamManagementNightVisionCommandParams.put( + "value", + cameraAvStreamManagementnightVisionCommandParameterInfo + ); + InteractionInfo writeCameraAvStreamManagementNightVisionAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).writeNightVisionAttribute( + (DefaultClusterCallback) callback, + (Integer) commandArguments.get("value") + ); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeCameraAvStreamManagementNightVisionCommandParams + ); + writeCameraAvStreamManagementInteractionInfo.put("writeNightVisionAttribute", writeCameraAvStreamManagementNightVisionAttributeInteractionInfo); + Map writeCameraAvStreamManagementNightVisionIllumCommandParams = new LinkedHashMap(); + CommandParameterInfo cameraAvStreamManagementnightVisionIllumCommandParameterInfo = + new CommandParameterInfo( + "value", + Integer.class, + Integer.class + ); + writeCameraAvStreamManagementNightVisionIllumCommandParams.put( + "value", + cameraAvStreamManagementnightVisionIllumCommandParameterInfo + ); + InteractionInfo writeCameraAvStreamManagementNightVisionIllumAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).writeNightVisionIllumAttribute( + (DefaultClusterCallback) callback, + (Integer) commandArguments.get("value") + ); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeCameraAvStreamManagementNightVisionIllumCommandParams + ); + writeCameraAvStreamManagementInteractionInfo.put("writeNightVisionIllumAttribute", writeCameraAvStreamManagementNightVisionIllumAttributeInteractionInfo); + Map writeCameraAvStreamManagementAwbCommandParams = new LinkedHashMap(); + CommandParameterInfo cameraAvStreamManagementawbCommandParameterInfo = + new CommandParameterInfo( + "value", + Boolean.class, + Boolean.class + ); + writeCameraAvStreamManagementAwbCommandParams.put( + "value", + cameraAvStreamManagementawbCommandParameterInfo + ); + InteractionInfo writeCameraAvStreamManagementAwbAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).writeAwbAttribute( + (DefaultClusterCallback) callback, + (Boolean) commandArguments.get("value") + ); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeCameraAvStreamManagementAwbCommandParams + ); + writeCameraAvStreamManagementInteractionInfo.put("writeAwbAttribute", writeCameraAvStreamManagementAwbAttributeInteractionInfo); + Map writeCameraAvStreamManagementShutterSpeedCommandParams = new LinkedHashMap(); + CommandParameterInfo cameraAvStreamManagementshutterSpeedCommandParameterInfo = + new CommandParameterInfo( + "value", + Boolean.class, + Boolean.class + ); + writeCameraAvStreamManagementShutterSpeedCommandParams.put( + "value", + cameraAvStreamManagementshutterSpeedCommandParameterInfo + ); + InteractionInfo writeCameraAvStreamManagementShutterSpeedAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).writeShutterSpeedAttribute( + (DefaultClusterCallback) callback, + (Boolean) commandArguments.get("value") + ); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeCameraAvStreamManagementShutterSpeedCommandParams + ); + writeCameraAvStreamManagementInteractionInfo.put("writeShutterSpeedAttribute", writeCameraAvStreamManagementShutterSpeedAttributeInteractionInfo); + Map writeCameraAvStreamManagementIsoCommandParams = new LinkedHashMap(); + CommandParameterInfo cameraAvStreamManagementisoCommandParameterInfo = + new CommandParameterInfo( + "value", + Boolean.class, + Boolean.class + ); + writeCameraAvStreamManagementIsoCommandParams.put( + "value", + cameraAvStreamManagementisoCommandParameterInfo + ); + InteractionInfo writeCameraAvStreamManagementIsoAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).writeIsoAttribute( + (DefaultClusterCallback) callback, + (Boolean) commandArguments.get("value") + ); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeCameraAvStreamManagementIsoCommandParams + ); + writeCameraAvStreamManagementInteractionInfo.put("writeIsoAttribute", writeCameraAvStreamManagementIsoAttributeInteractionInfo); + Map writeCameraAvStreamManagementSpeakerEnabledCommandParams = new LinkedHashMap(); + CommandParameterInfo cameraAvStreamManagementspeakerEnabledCommandParameterInfo = + new CommandParameterInfo( + "value", + Boolean.class, + Boolean.class + ); + writeCameraAvStreamManagementSpeakerEnabledCommandParams.put( + "value", + cameraAvStreamManagementspeakerEnabledCommandParameterInfo + ); + InteractionInfo writeCameraAvStreamManagementSpeakerEnabledAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).writeSpeakerEnabledAttribute( + (DefaultClusterCallback) callback, + (Boolean) commandArguments.get("value") + ); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeCameraAvStreamManagementSpeakerEnabledCommandParams + ); + writeCameraAvStreamManagementInteractionInfo.put("writeSpeakerEnabledAttribute", writeCameraAvStreamManagementSpeakerEnabledAttributeInteractionInfo); + Map writeCameraAvStreamManagementSpeakerVolumeLevelCommandParams = new LinkedHashMap(); + CommandParameterInfo cameraAvStreamManagementspeakerVolumeLevelCommandParameterInfo = + new CommandParameterInfo( + "value", + Integer.class, + Integer.class + ); + writeCameraAvStreamManagementSpeakerVolumeLevelCommandParams.put( + "value", + cameraAvStreamManagementspeakerVolumeLevelCommandParameterInfo + ); + InteractionInfo writeCameraAvStreamManagementSpeakerVolumeLevelAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).writeSpeakerVolumeLevelAttribute( + (DefaultClusterCallback) callback, + (Integer) commandArguments.get("value") + ); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeCameraAvStreamManagementSpeakerVolumeLevelCommandParams + ); + writeCameraAvStreamManagementInteractionInfo.put("writeSpeakerVolumeLevelAttribute", writeCameraAvStreamManagementSpeakerVolumeLevelAttributeInteractionInfo); + Map writeCameraAvStreamManagementSpeakerMaxLevelCommandParams = new LinkedHashMap(); + CommandParameterInfo cameraAvStreamManagementspeakerMaxLevelCommandParameterInfo = + new CommandParameterInfo( + "value", + Integer.class, + Integer.class + ); + writeCameraAvStreamManagementSpeakerMaxLevelCommandParams.put( + "value", + cameraAvStreamManagementspeakerMaxLevelCommandParameterInfo + ); + InteractionInfo writeCameraAvStreamManagementSpeakerMaxLevelAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).writeSpeakerMaxLevelAttribute( + (DefaultClusterCallback) callback, + (Integer) commandArguments.get("value") + ); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeCameraAvStreamManagementSpeakerMaxLevelCommandParams + ); + writeCameraAvStreamManagementInteractionInfo.put("writeSpeakerMaxLevelAttribute", writeCameraAvStreamManagementSpeakerMaxLevelAttributeInteractionInfo); + Map writeCameraAvStreamManagementSpeakerMinLevelCommandParams = new LinkedHashMap(); + CommandParameterInfo cameraAvStreamManagementspeakerMinLevelCommandParameterInfo = + new CommandParameterInfo( + "value", + Integer.class, + Integer.class + ); + writeCameraAvStreamManagementSpeakerMinLevelCommandParams.put( + "value", + cameraAvStreamManagementspeakerMinLevelCommandParameterInfo + ); + InteractionInfo writeCameraAvStreamManagementSpeakerMinLevelAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).writeSpeakerMinLevelAttribute( + (DefaultClusterCallback) callback, + (Integer) commandArguments.get("value") + ); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeCameraAvStreamManagementSpeakerMinLevelCommandParams + ); + writeCameraAvStreamManagementInteractionInfo.put("writeSpeakerMinLevelAttribute", writeCameraAvStreamManagementSpeakerMinLevelAttributeInteractionInfo); + Map writeCameraAvStreamManagementMicStatusCommandParams = new LinkedHashMap(); + CommandParameterInfo cameraAvStreamManagementmicStatusCommandParameterInfo = + new CommandParameterInfo( + "value", + Boolean.class, + Boolean.class + ); + writeCameraAvStreamManagementMicStatusCommandParams.put( + "value", + cameraAvStreamManagementmicStatusCommandParameterInfo + ); + InteractionInfo writeCameraAvStreamManagementMicStatusAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).writeMicStatusAttribute( + (DefaultClusterCallback) callback, + (Boolean) commandArguments.get("value") + ); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeCameraAvStreamManagementMicStatusCommandParams + ); + writeCameraAvStreamManagementInteractionInfo.put("writeMicStatusAttribute", writeCameraAvStreamManagementMicStatusAttributeInteractionInfo); + Map writeCameraAvStreamManagementMicVolumeLevelCommandParams = new LinkedHashMap(); + CommandParameterInfo cameraAvStreamManagementmicVolumeLevelCommandParameterInfo = + new CommandParameterInfo( + "value", + Integer.class, + Integer.class + ); + writeCameraAvStreamManagementMicVolumeLevelCommandParams.put( + "value", + cameraAvStreamManagementmicVolumeLevelCommandParameterInfo + ); + InteractionInfo writeCameraAvStreamManagementMicVolumeLevelAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).writeMicVolumeLevelAttribute( + (DefaultClusterCallback) callback, + (Integer) commandArguments.get("value") + ); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeCameraAvStreamManagementMicVolumeLevelCommandParams + ); + writeCameraAvStreamManagementInteractionInfo.put("writeMicVolumeLevelAttribute", writeCameraAvStreamManagementMicVolumeLevelAttributeInteractionInfo); + Map writeCameraAvStreamManagementMicMaxLevelCommandParams = new LinkedHashMap(); + CommandParameterInfo cameraAvStreamManagementmicMaxLevelCommandParameterInfo = + new CommandParameterInfo( + "value", + Integer.class, + Integer.class + ); + writeCameraAvStreamManagementMicMaxLevelCommandParams.put( + "value", + cameraAvStreamManagementmicMaxLevelCommandParameterInfo + ); + InteractionInfo writeCameraAvStreamManagementMicMaxLevelAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).writeMicMaxLevelAttribute( + (DefaultClusterCallback) callback, + (Integer) commandArguments.get("value") + ); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeCameraAvStreamManagementMicMaxLevelCommandParams + ); + writeCameraAvStreamManagementInteractionInfo.put("writeMicMaxLevelAttribute", writeCameraAvStreamManagementMicMaxLevelAttributeInteractionInfo); + Map writeCameraAvStreamManagementMicMinLevelCommandParams = new LinkedHashMap(); + CommandParameterInfo cameraAvStreamManagementmicMinLevelCommandParameterInfo = + new CommandParameterInfo( + "value", + Integer.class, + Integer.class + ); + writeCameraAvStreamManagementMicMinLevelCommandParams.put( + "value", + cameraAvStreamManagementmicMinLevelCommandParameterInfo + ); + InteractionInfo writeCameraAvStreamManagementMicMinLevelAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).writeMicMinLevelAttribute( + (DefaultClusterCallback) callback, + (Integer) commandArguments.get("value") + ); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeCameraAvStreamManagementMicMinLevelCommandParams + ); + writeCameraAvStreamManagementInteractionInfo.put("writeMicMinLevelAttribute", writeCameraAvStreamManagementMicMinLevelAttributeInteractionInfo); + Map writeCameraAvStreamManagementMicAGCEnabledCommandParams = new LinkedHashMap(); + CommandParameterInfo cameraAvStreamManagementmicAGCEnabledCommandParameterInfo = + new CommandParameterInfo( + "value", + Boolean.class, + Boolean.class + ); + writeCameraAvStreamManagementMicAGCEnabledCommandParams.put( + "value", + cameraAvStreamManagementmicAGCEnabledCommandParameterInfo + ); + InteractionInfo writeCameraAvStreamManagementMicAGCEnabledAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).writeMicAGCEnabledAttribute( + (DefaultClusterCallback) callback, + (Boolean) commandArguments.get("value") + ); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeCameraAvStreamManagementMicAGCEnabledCommandParams + ); + writeCameraAvStreamManagementInteractionInfo.put("writeMicAGCEnabledAttribute", writeCameraAvStreamManagementMicAGCEnabledAttributeInteractionInfo); + Map writeCameraAvStreamManagementLocalVideoRecordingEnabledCommandParams = new LinkedHashMap(); + CommandParameterInfo cameraAvStreamManagementlocalVideoRecordingEnabledCommandParameterInfo = + new CommandParameterInfo( + "value", + Boolean.class, + Boolean.class + ); + writeCameraAvStreamManagementLocalVideoRecordingEnabledCommandParams.put( + "value", + cameraAvStreamManagementlocalVideoRecordingEnabledCommandParameterInfo + ); + InteractionInfo writeCameraAvStreamManagementLocalVideoRecordingEnabledAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).writeLocalVideoRecordingEnabledAttribute( + (DefaultClusterCallback) callback, + (Boolean) commandArguments.get("value") + ); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeCameraAvStreamManagementLocalVideoRecordingEnabledCommandParams + ); + writeCameraAvStreamManagementInteractionInfo.put("writeLocalVideoRecordingEnabledAttribute", writeCameraAvStreamManagementLocalVideoRecordingEnabledAttributeInteractionInfo); + Map writeCameraAvStreamManagementLocalSnapshotRecordingEnabledCommandParams = new LinkedHashMap(); + CommandParameterInfo cameraAvStreamManagementlocalSnapshotRecordingEnabledCommandParameterInfo = + new CommandParameterInfo( + "value", + Boolean.class, + Boolean.class + ); + writeCameraAvStreamManagementLocalSnapshotRecordingEnabledCommandParams.put( + "value", + cameraAvStreamManagementlocalSnapshotRecordingEnabledCommandParameterInfo + ); + InteractionInfo writeCameraAvStreamManagementLocalSnapshotRecordingEnabledAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).writeLocalSnapshotRecordingEnabledAttribute( + (DefaultClusterCallback) callback, + (Boolean) commandArguments.get("value") + ); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeCameraAvStreamManagementLocalSnapshotRecordingEnabledCommandParams + ); + writeCameraAvStreamManagementInteractionInfo.put("writeLocalSnapshotRecordingEnabledAttribute", writeCameraAvStreamManagementLocalSnapshotRecordingEnabledAttributeInteractionInfo); + Map writeCameraAvStreamManagementStatusLightCommandParams = new LinkedHashMap(); + CommandParameterInfo cameraAvStreamManagementstatusLightCommandParameterInfo = + new CommandParameterInfo( + "value", + Boolean.class, + Boolean.class + ); + writeCameraAvStreamManagementStatusLightCommandParams.put( + "value", + cameraAvStreamManagementstatusLightCommandParameterInfo + ); + InteractionInfo writeCameraAvStreamManagementStatusLightAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).writeStatusLightAttribute( + (DefaultClusterCallback) callback, + (Boolean) commandArguments.get("value") + ); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeCameraAvStreamManagementStatusLightCommandParams + ); + writeCameraAvStreamManagementInteractionInfo.put("writeStatusLightAttribute", writeCameraAvStreamManagementStatusLightAttributeInteractionInfo); + Map writeCameraAvStreamManagementStatusLightBrightnessCommandParams = new LinkedHashMap(); + CommandParameterInfo cameraAvStreamManagementstatusLightBrightnessCommandParameterInfo = + new CommandParameterInfo( + "value", + Integer.class, + Integer.class + ); + writeCameraAvStreamManagementStatusLightBrightnessCommandParams.put( + "value", + cameraAvStreamManagementstatusLightBrightnessCommandParameterInfo + ); + InteractionInfo writeCameraAvStreamManagementStatusLightBrightnessAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).writeStatusLightBrightnessAttribute( + (DefaultClusterCallback) callback, + (Integer) commandArguments.get("value") + ); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeCameraAvStreamManagementStatusLightBrightnessCommandParams + ); + writeCameraAvStreamManagementInteractionInfo.put("writeStatusLightBrightnessAttribute", writeCameraAvStreamManagementStatusLightBrightnessAttributeInteractionInfo); + Map writeCameraAvStreamManagementDepthSensorStatusCommandParams = new LinkedHashMap(); + CommandParameterInfo cameraAvStreamManagementdepthSensorStatusCommandParameterInfo = + new CommandParameterInfo( + "value", + Integer.class, + Integer.class + ); + writeCameraAvStreamManagementDepthSensorStatusCommandParams.put( + "value", + cameraAvStreamManagementdepthSensorStatusCommandParameterInfo + ); + InteractionInfo writeCameraAvStreamManagementDepthSensorStatusAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).writeDepthSensorStatusAttribute( + (DefaultClusterCallback) callback, + (Integer) commandArguments.get("value") + ); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeCameraAvStreamManagementDepthSensorStatusCommandParams + ); + writeCameraAvStreamManagementInteractionInfo.put("writeDepthSensorStatusAttribute", writeCameraAvStreamManagementDepthSensorStatusAttributeInteractionInfo); + writeAttributeMap.put("cameraAvStreamManagement", writeCameraAvStreamManagementInteractionInfo); Map writeWebRTCTransportProviderInteractionInfo = new LinkedHashMap<>(); writeAttributeMap.put("webRTCTransportProvider", writeWebRTCTransportProviderInteractionInfo); Map writeWebRTCTransportRequestorInteractionInfo = new LinkedHashMap<>(); diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/CameraAvStreamManagementClusterAudioStreamChangedEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/CameraAvStreamManagementClusterAudioStreamChangedEvent.kt new file mode 100644 index 00000000000000..912de2937772c3 --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/CameraAvStreamManagementClusterAudioStreamChangedEvent.kt @@ -0,0 +1,144 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package chip.devicecontroller.cluster.eventstructs + +import chip.devicecontroller.cluster.* +import java.util.Optional +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class CameraAvStreamManagementClusterAudioStreamChangedEvent( + val audioStreamID: UInt, + val streamType: Optional, + val audioCodec: Optional, + val channelCount: Optional, + val sampleRate: Optional, + val bitRate: Optional, + val bitDepth: Optional, +) { + override fun toString(): String = buildString { + append("CameraAvStreamManagementClusterAudioStreamChangedEvent {\n") + append("\taudioStreamID : $audioStreamID\n") + append("\tstreamType : $streamType\n") + append("\taudioCodec : $audioCodec\n") + append("\tchannelCount : $channelCount\n") + append("\tsampleRate : $sampleRate\n") + append("\tbitRate : $bitRate\n") + append("\tbitDepth : $bitDepth\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_AUDIO_STREAM_ID), audioStreamID) + if (streamType.isPresent) { + val optstreamType = streamType.get() + put(ContextSpecificTag(TAG_STREAM_TYPE), optstreamType) + } + if (audioCodec.isPresent) { + val optaudioCodec = audioCodec.get() + put(ContextSpecificTag(TAG_AUDIO_CODEC), optaudioCodec) + } + if (channelCount.isPresent) { + val optchannelCount = channelCount.get() + put(ContextSpecificTag(TAG_CHANNEL_COUNT), optchannelCount) + } + if (sampleRate.isPresent) { + val optsampleRate = sampleRate.get() + put(ContextSpecificTag(TAG_SAMPLE_RATE), optsampleRate) + } + if (bitRate.isPresent) { + val optbitRate = bitRate.get() + put(ContextSpecificTag(TAG_BIT_RATE), optbitRate) + } + if (bitDepth.isPresent) { + val optbitDepth = bitDepth.get() + put(ContextSpecificTag(TAG_BIT_DEPTH), optbitDepth) + } + endStructure() + } + } + + companion object { + private const val TAG_AUDIO_STREAM_ID = 0 + private const val TAG_STREAM_TYPE = 1 + private const val TAG_AUDIO_CODEC = 2 + private const val TAG_CHANNEL_COUNT = 3 + private const val TAG_SAMPLE_RATE = 4 + private const val TAG_BIT_RATE = 5 + private const val TAG_BIT_DEPTH = 6 + + fun fromTlv( + tlvTag: Tag, + tlvReader: TlvReader, + ): CameraAvStreamManagementClusterAudioStreamChangedEvent { + tlvReader.enterStructure(tlvTag) + val audioStreamID = tlvReader.getUInt(ContextSpecificTag(TAG_AUDIO_STREAM_ID)) + val streamType = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_STREAM_TYPE))) { + Optional.of(tlvReader.getUInt(ContextSpecificTag(TAG_STREAM_TYPE))) + } else { + Optional.empty() + } + val audioCodec = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_AUDIO_CODEC))) { + Optional.of(tlvReader.getUInt(ContextSpecificTag(TAG_AUDIO_CODEC))) + } else { + Optional.empty() + } + val channelCount = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_CHANNEL_COUNT))) { + Optional.of(tlvReader.getUInt(ContextSpecificTag(TAG_CHANNEL_COUNT))) + } else { + Optional.empty() + } + val sampleRate = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_SAMPLE_RATE))) { + Optional.of(tlvReader.getULong(ContextSpecificTag(TAG_SAMPLE_RATE))) + } else { + Optional.empty() + } + val bitRate = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_BIT_RATE))) { + Optional.of(tlvReader.getULong(ContextSpecificTag(TAG_BIT_RATE))) + } else { + Optional.empty() + } + val bitDepth = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_BIT_DEPTH))) { + Optional.of(tlvReader.getUInt(ContextSpecificTag(TAG_BIT_DEPTH))) + } else { + Optional.empty() + } + + tlvReader.exitContainer() + + return CameraAvStreamManagementClusterAudioStreamChangedEvent( + audioStreamID, + streamType, + audioCodec, + channelCount, + sampleRate, + bitRate, + bitDepth, + ) + } + } +} diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/CameraAvStreamManagementClusterSnapshotStreamChangedEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/CameraAvStreamManagementClusterSnapshotStreamChangedEvent.kt new file mode 100644 index 00000000000000..7863af3d86b853 --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/CameraAvStreamManagementClusterSnapshotStreamChangedEvent.kt @@ -0,0 +1,158 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package chip.devicecontroller.cluster.eventstructs + +import chip.devicecontroller.cluster.* +import java.util.Optional +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class CameraAvStreamManagementClusterSnapshotStreamChangedEvent( + val snapshotStreamID: UInt, + val imageCodec: Optional, + val frameRate: Optional, + val bitRate: Optional, + val minResolution: + Optional< + chip.devicecontroller.cluster.structs.CameraAvStreamManagementClusterVideoResolutionStruct + >, + val maxResolution: + Optional< + chip.devicecontroller.cluster.structs.CameraAvStreamManagementClusterVideoResolutionStruct + >, + val quality: Optional, +) { + override fun toString(): String = buildString { + append("CameraAvStreamManagementClusterSnapshotStreamChangedEvent {\n") + append("\tsnapshotStreamID : $snapshotStreamID\n") + append("\timageCodec : $imageCodec\n") + append("\tframeRate : $frameRate\n") + append("\tbitRate : $bitRate\n") + append("\tminResolution : $minResolution\n") + append("\tmaxResolution : $maxResolution\n") + append("\tquality : $quality\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_SNAPSHOT_STREAM_ID), snapshotStreamID) + if (imageCodec.isPresent) { + val optimageCodec = imageCodec.get() + put(ContextSpecificTag(TAG_IMAGE_CODEC), optimageCodec) + } + if (frameRate.isPresent) { + val optframeRate = frameRate.get() + put(ContextSpecificTag(TAG_FRAME_RATE), optframeRate) + } + if (bitRate.isPresent) { + val optbitRate = bitRate.get() + put(ContextSpecificTag(TAG_BIT_RATE), optbitRate) + } + if (minResolution.isPresent) { + val optminResolution = minResolution.get() + optminResolution.toTlv(ContextSpecificTag(TAG_MIN_RESOLUTION), this) + } + if (maxResolution.isPresent) { + val optmaxResolution = maxResolution.get() + optmaxResolution.toTlv(ContextSpecificTag(TAG_MAX_RESOLUTION), this) + } + if (quality.isPresent) { + val optquality = quality.get() + put(ContextSpecificTag(TAG_QUALITY), optquality) + } + endStructure() + } + } + + companion object { + private const val TAG_SNAPSHOT_STREAM_ID = 0 + private const val TAG_IMAGE_CODEC = 1 + private const val TAG_FRAME_RATE = 2 + private const val TAG_BIT_RATE = 3 + private const val TAG_MIN_RESOLUTION = 4 + private const val TAG_MAX_RESOLUTION = 5 + private const val TAG_QUALITY = 6 + + fun fromTlv( + tlvTag: Tag, + tlvReader: TlvReader, + ): CameraAvStreamManagementClusterSnapshotStreamChangedEvent { + tlvReader.enterStructure(tlvTag) + val snapshotStreamID = tlvReader.getUInt(ContextSpecificTag(TAG_SNAPSHOT_STREAM_ID)) + val imageCodec = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_IMAGE_CODEC))) { + Optional.of(tlvReader.getUInt(ContextSpecificTag(TAG_IMAGE_CODEC))) + } else { + Optional.empty() + } + val frameRate = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_FRAME_RATE))) { + Optional.of(tlvReader.getUInt(ContextSpecificTag(TAG_FRAME_RATE))) + } else { + Optional.empty() + } + val bitRate = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_BIT_RATE))) { + Optional.of(tlvReader.getULong(ContextSpecificTag(TAG_BIT_RATE))) + } else { + Optional.empty() + } + val minResolution = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_MIN_RESOLUTION))) { + Optional.of( + chip.devicecontroller.cluster.structs + .CameraAvStreamManagementClusterVideoResolutionStruct + .fromTlv(ContextSpecificTag(TAG_MIN_RESOLUTION), tlvReader) + ) + } else { + Optional.empty() + } + val maxResolution = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_MAX_RESOLUTION))) { + Optional.of( + chip.devicecontroller.cluster.structs + .CameraAvStreamManagementClusterVideoResolutionStruct + .fromTlv(ContextSpecificTag(TAG_MAX_RESOLUTION), tlvReader) + ) + } else { + Optional.empty() + } + val quality = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_QUALITY))) { + Optional.of(tlvReader.getUInt(ContextSpecificTag(TAG_QUALITY))) + } else { + Optional.empty() + } + + tlvReader.exitContainer() + + return CameraAvStreamManagementClusterSnapshotStreamChangedEvent( + snapshotStreamID, + imageCodec, + frameRate, + bitRate, + minResolution, + maxResolution, + quality, + ) + } + } +} diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/CameraAvStreamManagementClusterVideoStreamChangedEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/CameraAvStreamManagementClusterVideoStreamChangedEvent.kt new file mode 100644 index 00000000000000..764bec47e7f10c --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/CameraAvStreamManagementClusterVideoStreamChangedEvent.kt @@ -0,0 +1,214 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package chip.devicecontroller.cluster.eventstructs + +import chip.devicecontroller.cluster.* +import java.util.Optional +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class CameraAvStreamManagementClusterVideoStreamChangedEvent( + val videoStreamID: UInt, + val streamType: Optional, + val videoCodec: Optional, + val minFrameRate: Optional, + val maxFrameRate: Optional, + val minResolution: + Optional< + chip.devicecontroller.cluster.structs.CameraAvStreamManagementClusterVideoResolutionStruct + >, + val maxResolution: + Optional< + chip.devicecontroller.cluster.structs.CameraAvStreamManagementClusterVideoResolutionStruct + >, + val minBitRate: Optional, + val maxBitRate: Optional, + val minFragmentLen: Optional, + val maxFragmentLen: Optional, +) { + override fun toString(): String = buildString { + append("CameraAvStreamManagementClusterVideoStreamChangedEvent {\n") + append("\tvideoStreamID : $videoStreamID\n") + append("\tstreamType : $streamType\n") + append("\tvideoCodec : $videoCodec\n") + append("\tminFrameRate : $minFrameRate\n") + append("\tmaxFrameRate : $maxFrameRate\n") + append("\tminResolution : $minResolution\n") + append("\tmaxResolution : $maxResolution\n") + append("\tminBitRate : $minBitRate\n") + append("\tmaxBitRate : $maxBitRate\n") + append("\tminFragmentLen : $minFragmentLen\n") + append("\tmaxFragmentLen : $maxFragmentLen\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_VIDEO_STREAM_ID), videoStreamID) + if (streamType.isPresent) { + val optstreamType = streamType.get() + put(ContextSpecificTag(TAG_STREAM_TYPE), optstreamType) + } + if (videoCodec.isPresent) { + val optvideoCodec = videoCodec.get() + put(ContextSpecificTag(TAG_VIDEO_CODEC), optvideoCodec) + } + if (minFrameRate.isPresent) { + val optminFrameRate = minFrameRate.get() + put(ContextSpecificTag(TAG_MIN_FRAME_RATE), optminFrameRate) + } + if (maxFrameRate.isPresent) { + val optmaxFrameRate = maxFrameRate.get() + put(ContextSpecificTag(TAG_MAX_FRAME_RATE), optmaxFrameRate) + } + if (minResolution.isPresent) { + val optminResolution = minResolution.get() + optminResolution.toTlv(ContextSpecificTag(TAG_MIN_RESOLUTION), this) + } + if (maxResolution.isPresent) { + val optmaxResolution = maxResolution.get() + optmaxResolution.toTlv(ContextSpecificTag(TAG_MAX_RESOLUTION), this) + } + if (minBitRate.isPresent) { + val optminBitRate = minBitRate.get() + put(ContextSpecificTag(TAG_MIN_BIT_RATE), optminBitRate) + } + if (maxBitRate.isPresent) { + val optmaxBitRate = maxBitRate.get() + put(ContextSpecificTag(TAG_MAX_BIT_RATE), optmaxBitRate) + } + if (minFragmentLen.isPresent) { + val optminFragmentLen = minFragmentLen.get() + put(ContextSpecificTag(TAG_MIN_FRAGMENT_LEN), optminFragmentLen) + } + if (maxFragmentLen.isPresent) { + val optmaxFragmentLen = maxFragmentLen.get() + put(ContextSpecificTag(TAG_MAX_FRAGMENT_LEN), optmaxFragmentLen) + } + endStructure() + } + } + + companion object { + private const val TAG_VIDEO_STREAM_ID = 0 + private const val TAG_STREAM_TYPE = 1 + private const val TAG_VIDEO_CODEC = 2 + private const val TAG_MIN_FRAME_RATE = 3 + private const val TAG_MAX_FRAME_RATE = 4 + private const val TAG_MIN_RESOLUTION = 5 + private const val TAG_MAX_RESOLUTION = 6 + private const val TAG_MIN_BIT_RATE = 7 + private const val TAG_MAX_BIT_RATE = 8 + private const val TAG_MIN_FRAGMENT_LEN = 9 + private const val TAG_MAX_FRAGMENT_LEN = 10 + + fun fromTlv( + tlvTag: Tag, + tlvReader: TlvReader, + ): CameraAvStreamManagementClusterVideoStreamChangedEvent { + tlvReader.enterStructure(tlvTag) + val videoStreamID = tlvReader.getUInt(ContextSpecificTag(TAG_VIDEO_STREAM_ID)) + val streamType = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_STREAM_TYPE))) { + Optional.of(tlvReader.getUInt(ContextSpecificTag(TAG_STREAM_TYPE))) + } else { + Optional.empty() + } + val videoCodec = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_VIDEO_CODEC))) { + Optional.of(tlvReader.getUInt(ContextSpecificTag(TAG_VIDEO_CODEC))) + } else { + Optional.empty() + } + val minFrameRate = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_MIN_FRAME_RATE))) { + Optional.of(tlvReader.getUInt(ContextSpecificTag(TAG_MIN_FRAME_RATE))) + } else { + Optional.empty() + } + val maxFrameRate = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_MAX_FRAME_RATE))) { + Optional.of(tlvReader.getUInt(ContextSpecificTag(TAG_MAX_FRAME_RATE))) + } else { + Optional.empty() + } + val minResolution = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_MIN_RESOLUTION))) { + Optional.of( + chip.devicecontroller.cluster.structs + .CameraAvStreamManagementClusterVideoResolutionStruct + .fromTlv(ContextSpecificTag(TAG_MIN_RESOLUTION), tlvReader) + ) + } else { + Optional.empty() + } + val maxResolution = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_MAX_RESOLUTION))) { + Optional.of( + chip.devicecontroller.cluster.structs + .CameraAvStreamManagementClusterVideoResolutionStruct + .fromTlv(ContextSpecificTag(TAG_MAX_RESOLUTION), tlvReader) + ) + } else { + Optional.empty() + } + val minBitRate = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_MIN_BIT_RATE))) { + Optional.of(tlvReader.getUInt(ContextSpecificTag(TAG_MIN_BIT_RATE))) + } else { + Optional.empty() + } + val maxBitRate = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_MAX_BIT_RATE))) { + Optional.of(tlvReader.getUInt(ContextSpecificTag(TAG_MAX_BIT_RATE))) + } else { + Optional.empty() + } + val minFragmentLen = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_MIN_FRAGMENT_LEN))) { + Optional.of(tlvReader.getUInt(ContextSpecificTag(TAG_MIN_FRAGMENT_LEN))) + } else { + Optional.empty() + } + val maxFragmentLen = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_MAX_FRAGMENT_LEN))) { + Optional.of(tlvReader.getUInt(ContextSpecificTag(TAG_MAX_FRAGMENT_LEN))) + } else { + Optional.empty() + } + + tlvReader.exitContainer() + + return CameraAvStreamManagementClusterVideoStreamChangedEvent( + videoStreamID, + streamType, + videoCodec, + minFrameRate, + maxFrameRate, + minResolution, + maxResolution, + minBitRate, + maxBitRate, + minFragmentLen, + maxFragmentLen, + ) + } + } +} 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 115bbe53cb3c6d..d518396efe4671 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/files.gni +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/files.gni @@ -19,6 +19,16 @@ structs_sources = [ "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/BasicInformationClusterProductAppearanceStruct.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/BindingClusterTargetStruct.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/BridgedDeviceBasicInformationClusterProductAppearanceStruct.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/CameraAvStreamManagementClusterAudioCapabilitiesStruct.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/CameraAvStreamManagementClusterAudioStreamStruct.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/CameraAvStreamManagementClusterPerStreamStruct.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/CameraAvStreamManagementClusterRateDistortionTradeOffPointsStruct.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/CameraAvStreamManagementClusterSnapshotParamsStruct.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/CameraAvStreamManagementClusterSnapshotStreamStruct.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/CameraAvStreamManagementClusterVideoResolutionStruct.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/CameraAvStreamManagementClusterVideoSensorParamsStruct.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/CameraAvStreamManagementClusterVideoStreamStruct.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/CameraAvStreamManagementClusterViewportStruct.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ChannelClusterAdditionalInfoStruct.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ChannelClusterChannelInfoStruct.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ChannelClusterChannelPagingStruct.kt", @@ -182,6 +192,9 @@ eventstructs_sources = [ "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/BridgedDeviceBasicInformationClusterActiveChangedEvent.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/BridgedDeviceBasicInformationClusterReachableChangedEvent.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/BridgedDeviceBasicInformationClusterStartUpEvent.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/CameraAvStreamManagementClusterAudioStreamChangedEvent.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/CameraAvStreamManagementClusterSnapshotStreamChangedEvent.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/CameraAvStreamManagementClusterVideoStreamChangedEvent.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/CommissionerControlClusterCommissioningRequestResultEvent.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/DemandResponseLoadControlClusterLoadControlEventStatusChangeEvent.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/DeviceEnergyManagementClusterPowerAdjustEndEvent.kt", diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/CameraAvStreamManagementClusterAudioCapabilitiesStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/CameraAvStreamManagementClusterAudioCapabilitiesStruct.kt new file mode 100644 index 00000000000000..4c3e6b2ed6b553 --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/CameraAvStreamManagementClusterAudioCapabilitiesStruct.kt @@ -0,0 +1,111 @@ +/* + * + * 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.AnonymousTag +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class CameraAvStreamManagementClusterAudioCapabilitiesStruct( + val maxNumberOfChannels: UInt, + val supportedCodecs: List, + val supportedSampleRates: List, + val supportedBitDepths: List, +) { + override fun toString(): String = buildString { + append("CameraAvStreamManagementClusterAudioCapabilitiesStruct {\n") + append("\tmaxNumberOfChannels : $maxNumberOfChannels\n") + append("\tsupportedCodecs : $supportedCodecs\n") + append("\tsupportedSampleRates : $supportedSampleRates\n") + append("\tsupportedBitDepths : $supportedBitDepths\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_MAX_NUMBER_OF_CHANNELS), maxNumberOfChannels) + startArray(ContextSpecificTag(TAG_SUPPORTED_CODECS)) + for (item in supportedCodecs.iterator()) { + put(AnonymousTag, item) + } + endArray() + startArray(ContextSpecificTag(TAG_SUPPORTED_SAMPLE_RATES)) + for (item in supportedSampleRates.iterator()) { + put(AnonymousTag, item) + } + endArray() + startArray(ContextSpecificTag(TAG_SUPPORTED_BIT_DEPTHS)) + for (item in supportedBitDepths.iterator()) { + put(AnonymousTag, item) + } + endArray() + endStructure() + } + } + + companion object { + private const val TAG_MAX_NUMBER_OF_CHANNELS = 0 + private const val TAG_SUPPORTED_CODECS = 1 + private const val TAG_SUPPORTED_SAMPLE_RATES = 2 + private const val TAG_SUPPORTED_BIT_DEPTHS = 3 + + fun fromTlv( + tlvTag: Tag, + tlvReader: TlvReader, + ): CameraAvStreamManagementClusterAudioCapabilitiesStruct { + tlvReader.enterStructure(tlvTag) + val maxNumberOfChannels = tlvReader.getUInt(ContextSpecificTag(TAG_MAX_NUMBER_OF_CHANNELS)) + val supportedCodecs = + buildList { + tlvReader.enterArray(ContextSpecificTag(TAG_SUPPORTED_CODECS)) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + val supportedSampleRates = + buildList { + tlvReader.enterArray(ContextSpecificTag(TAG_SUPPORTED_SAMPLE_RATES)) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getULong(AnonymousTag)) + } + tlvReader.exitContainer() + } + val supportedBitDepths = + buildList { + tlvReader.enterArray(ContextSpecificTag(TAG_SUPPORTED_BIT_DEPTHS)) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getULong(AnonymousTag)) + } + tlvReader.exitContainer() + } + + tlvReader.exitContainer() + + return CameraAvStreamManagementClusterAudioCapabilitiesStruct( + maxNumberOfChannels, + supportedCodecs, + supportedSampleRates, + supportedBitDepths, + ) + } + } +} diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/CameraAvStreamManagementClusterAudioStreamStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/CameraAvStreamManagementClusterAudioStreamStruct.kt new file mode 100644 index 00000000000000..5acfc37aadfad9 --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/CameraAvStreamManagementClusterAudioStreamStruct.kt @@ -0,0 +1,101 @@ +/* + * + * 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 CameraAvStreamManagementClusterAudioStreamStruct( + val audioStreamID: UInt, + val streamType: UInt, + val audioCodec: UInt, + val channelCount: UInt, + val sampleRate: ULong, + val bitRate: ULong, + val bitDepth: UInt, + val referenceCount: UInt, +) { + override fun toString(): String = buildString { + append("CameraAvStreamManagementClusterAudioStreamStruct {\n") + append("\taudioStreamID : $audioStreamID\n") + append("\tstreamType : $streamType\n") + append("\taudioCodec : $audioCodec\n") + append("\tchannelCount : $channelCount\n") + append("\tsampleRate : $sampleRate\n") + append("\tbitRate : $bitRate\n") + append("\tbitDepth : $bitDepth\n") + append("\treferenceCount : $referenceCount\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_AUDIO_STREAM_ID), audioStreamID) + put(ContextSpecificTag(TAG_STREAM_TYPE), streamType) + put(ContextSpecificTag(TAG_AUDIO_CODEC), audioCodec) + put(ContextSpecificTag(TAG_CHANNEL_COUNT), channelCount) + put(ContextSpecificTag(TAG_SAMPLE_RATE), sampleRate) + put(ContextSpecificTag(TAG_BIT_RATE), bitRate) + put(ContextSpecificTag(TAG_BIT_DEPTH), bitDepth) + put(ContextSpecificTag(TAG_REFERENCE_COUNT), referenceCount) + endStructure() + } + } + + companion object { + private const val TAG_AUDIO_STREAM_ID = 0 + private const val TAG_STREAM_TYPE = 1 + private const val TAG_AUDIO_CODEC = 2 + private const val TAG_CHANNEL_COUNT = 3 + private const val TAG_SAMPLE_RATE = 4 + private const val TAG_BIT_RATE = 5 + private const val TAG_BIT_DEPTH = 6 + private const val TAG_REFERENCE_COUNT = 7 + + fun fromTlv( + tlvTag: Tag, + tlvReader: TlvReader, + ): CameraAvStreamManagementClusterAudioStreamStruct { + tlvReader.enterStructure(tlvTag) + val audioStreamID = tlvReader.getUInt(ContextSpecificTag(TAG_AUDIO_STREAM_ID)) + val streamType = tlvReader.getUInt(ContextSpecificTag(TAG_STREAM_TYPE)) + val audioCodec = tlvReader.getUInt(ContextSpecificTag(TAG_AUDIO_CODEC)) + val channelCount = tlvReader.getUInt(ContextSpecificTag(TAG_CHANNEL_COUNT)) + val sampleRate = tlvReader.getULong(ContextSpecificTag(TAG_SAMPLE_RATE)) + val bitRate = tlvReader.getULong(ContextSpecificTag(TAG_BIT_RATE)) + val bitDepth = tlvReader.getUInt(ContextSpecificTag(TAG_BIT_DEPTH)) + val referenceCount = tlvReader.getUInt(ContextSpecificTag(TAG_REFERENCE_COUNT)) + + tlvReader.exitContainer() + + return CameraAvStreamManagementClusterAudioStreamStruct( + audioStreamID, + streamType, + audioCodec, + channelCount, + sampleRate, + bitRate, + bitDepth, + referenceCount, + ) + } + } +} diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/CameraAvStreamManagementClusterPerStreamStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/CameraAvStreamManagementClusterPerStreamStruct.kt new file mode 100644 index 00000000000000..53835618b200d0 --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/CameraAvStreamManagementClusterPerStreamStruct.kt @@ -0,0 +1,56 @@ +/* + * + * 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 CameraAvStreamManagementClusterPerStreamStruct(val streamID: UInt, val enabled: Boolean) { + override fun toString(): String = buildString { + append("CameraAvStreamManagementClusterPerStreamStruct {\n") + append("\tstreamID : $streamID\n") + append("\tenabled : $enabled\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_STREAM_ID), streamID) + put(ContextSpecificTag(TAG_ENABLED), enabled) + endStructure() + } + } + + companion object { + private const val TAG_STREAM_ID = 0 + private const val TAG_ENABLED = 1 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): CameraAvStreamManagementClusterPerStreamStruct { + tlvReader.enterStructure(tlvTag) + val streamID = tlvReader.getUInt(ContextSpecificTag(TAG_STREAM_ID)) + val enabled = tlvReader.getBoolean(ContextSpecificTag(TAG_ENABLED)) + + tlvReader.exitContainer() + + return CameraAvStreamManagementClusterPerStreamStruct(streamID, enabled) + } + } +} diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/CameraAvStreamManagementClusterRateDistortionTradeOffPointsStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/CameraAvStreamManagementClusterRateDistortionTradeOffPointsStruct.kt new file mode 100644 index 00000000000000..4bdf703326580b --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/CameraAvStreamManagementClusterRateDistortionTradeOffPointsStruct.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 CameraAvStreamManagementClusterRateDistortionTradeOffPointsStruct( + val codec: UInt, + val resolution: CameraAvStreamManagementClusterVideoResolutionStruct, + val minBitRate: ULong, +) { + override fun toString(): String = buildString { + append("CameraAvStreamManagementClusterRateDistortionTradeOffPointsStruct {\n") + append("\tcodec : $codec\n") + append("\tresolution : $resolution\n") + append("\tminBitRate : $minBitRate\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_CODEC), codec) + resolution.toTlv(ContextSpecificTag(TAG_RESOLUTION), this) + put(ContextSpecificTag(TAG_MIN_BIT_RATE), minBitRate) + endStructure() + } + } + + companion object { + private const val TAG_CODEC = 0 + private const val TAG_RESOLUTION = 1 + private const val TAG_MIN_BIT_RATE = 2 + + fun fromTlv( + tlvTag: Tag, + tlvReader: TlvReader, + ): CameraAvStreamManagementClusterRateDistortionTradeOffPointsStruct { + tlvReader.enterStructure(tlvTag) + val codec = tlvReader.getUInt(ContextSpecificTag(TAG_CODEC)) + val resolution = + CameraAvStreamManagementClusterVideoResolutionStruct.fromTlv( + ContextSpecificTag(TAG_RESOLUTION), + tlvReader, + ) + val minBitRate = tlvReader.getULong(ContextSpecificTag(TAG_MIN_BIT_RATE)) + + tlvReader.exitContainer() + + return CameraAvStreamManagementClusterRateDistortionTradeOffPointsStruct( + codec, + resolution, + minBitRate, + ) + } + } +} diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/CameraAvStreamManagementClusterSnapshotParamsStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/CameraAvStreamManagementClusterSnapshotParamsStruct.kt new file mode 100644 index 00000000000000..fa66c969ca6b45 --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/CameraAvStreamManagementClusterSnapshotParamsStruct.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 CameraAvStreamManagementClusterSnapshotParamsStruct( + val resolution: CameraAvStreamManagementClusterVideoResolutionStruct, + val maxFrameRate: UInt, + val imageCodec: UInt, +) { + override fun toString(): String = buildString { + append("CameraAvStreamManagementClusterSnapshotParamsStruct {\n") + append("\tresolution : $resolution\n") + append("\tmaxFrameRate : $maxFrameRate\n") + append("\timageCodec : $imageCodec\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + resolution.toTlv(ContextSpecificTag(TAG_RESOLUTION), this) + put(ContextSpecificTag(TAG_MAX_FRAME_RATE), maxFrameRate) + put(ContextSpecificTag(TAG_IMAGE_CODEC), imageCodec) + endStructure() + } + } + + companion object { + private const val TAG_RESOLUTION = 0 + private const val TAG_MAX_FRAME_RATE = 1 + private const val TAG_IMAGE_CODEC = 2 + + fun fromTlv( + tlvTag: Tag, + tlvReader: TlvReader, + ): CameraAvStreamManagementClusterSnapshotParamsStruct { + tlvReader.enterStructure(tlvTag) + val resolution = + CameraAvStreamManagementClusterVideoResolutionStruct.fromTlv( + ContextSpecificTag(TAG_RESOLUTION), + tlvReader, + ) + val maxFrameRate = tlvReader.getUInt(ContextSpecificTag(TAG_MAX_FRAME_RATE)) + val imageCodec = tlvReader.getUInt(ContextSpecificTag(TAG_IMAGE_CODEC)) + + tlvReader.exitContainer() + + return CameraAvStreamManagementClusterSnapshotParamsStruct( + resolution, + maxFrameRate, + imageCodec, + ) + } + } +} diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/CameraAvStreamManagementClusterSnapshotStreamStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/CameraAvStreamManagementClusterSnapshotStreamStruct.kt new file mode 100644 index 00000000000000..8686343573982d --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/CameraAvStreamManagementClusterSnapshotStreamStruct.kt @@ -0,0 +1,109 @@ +/* + * + * 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 CameraAvStreamManagementClusterSnapshotStreamStruct( + val snapshotStreamID: UInt, + val imageCodec: UInt, + val frameRate: UInt, + val bitRate: ULong, + val minResolution: CameraAvStreamManagementClusterVideoResolutionStruct, + val maxResolution: CameraAvStreamManagementClusterVideoResolutionStruct, + val quality: UInt, + val referenceCount: UInt, +) { + override fun toString(): String = buildString { + append("CameraAvStreamManagementClusterSnapshotStreamStruct {\n") + append("\tsnapshotStreamID : $snapshotStreamID\n") + append("\timageCodec : $imageCodec\n") + append("\tframeRate : $frameRate\n") + append("\tbitRate : $bitRate\n") + append("\tminResolution : $minResolution\n") + append("\tmaxResolution : $maxResolution\n") + append("\tquality : $quality\n") + append("\treferenceCount : $referenceCount\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_SNAPSHOT_STREAM_ID), snapshotStreamID) + put(ContextSpecificTag(TAG_IMAGE_CODEC), imageCodec) + put(ContextSpecificTag(TAG_FRAME_RATE), frameRate) + put(ContextSpecificTag(TAG_BIT_RATE), bitRate) + minResolution.toTlv(ContextSpecificTag(TAG_MIN_RESOLUTION), this) + maxResolution.toTlv(ContextSpecificTag(TAG_MAX_RESOLUTION), this) + put(ContextSpecificTag(TAG_QUALITY), quality) + put(ContextSpecificTag(TAG_REFERENCE_COUNT), referenceCount) + endStructure() + } + } + + companion object { + private const val TAG_SNAPSHOT_STREAM_ID = 0 + private const val TAG_IMAGE_CODEC = 1 + private const val TAG_FRAME_RATE = 2 + private const val TAG_BIT_RATE = 3 + private const val TAG_MIN_RESOLUTION = 4 + private const val TAG_MAX_RESOLUTION = 5 + private const val TAG_QUALITY = 6 + private const val TAG_REFERENCE_COUNT = 7 + + fun fromTlv( + tlvTag: Tag, + tlvReader: TlvReader, + ): CameraAvStreamManagementClusterSnapshotStreamStruct { + tlvReader.enterStructure(tlvTag) + val snapshotStreamID = tlvReader.getUInt(ContextSpecificTag(TAG_SNAPSHOT_STREAM_ID)) + val imageCodec = tlvReader.getUInt(ContextSpecificTag(TAG_IMAGE_CODEC)) + val frameRate = tlvReader.getUInt(ContextSpecificTag(TAG_FRAME_RATE)) + val bitRate = tlvReader.getULong(ContextSpecificTag(TAG_BIT_RATE)) + val minResolution = + CameraAvStreamManagementClusterVideoResolutionStruct.fromTlv( + ContextSpecificTag(TAG_MIN_RESOLUTION), + tlvReader, + ) + val maxResolution = + CameraAvStreamManagementClusterVideoResolutionStruct.fromTlv( + ContextSpecificTag(TAG_MAX_RESOLUTION), + tlvReader, + ) + val quality = tlvReader.getUInt(ContextSpecificTag(TAG_QUALITY)) + val referenceCount = tlvReader.getUInt(ContextSpecificTag(TAG_REFERENCE_COUNT)) + + tlvReader.exitContainer() + + return CameraAvStreamManagementClusterSnapshotStreamStruct( + snapshotStreamID, + imageCodec, + frameRate, + bitRate, + minResolution, + maxResolution, + quality, + referenceCount, + ) + } + } +} diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/CameraAvStreamManagementClusterVideoResolutionStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/CameraAvStreamManagementClusterVideoResolutionStruct.kt new file mode 100644 index 00000000000000..f8fde5e2c8c7dd --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/CameraAvStreamManagementClusterVideoResolutionStruct.kt @@ -0,0 +1,59 @@ +/* + * + * 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 CameraAvStreamManagementClusterVideoResolutionStruct(val width: UInt, val height: UInt) { + override fun toString(): String = buildString { + append("CameraAvStreamManagementClusterVideoResolutionStruct {\n") + append("\twidth : $width\n") + append("\theight : $height\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_WIDTH), width) + put(ContextSpecificTag(TAG_HEIGHT), height) + endStructure() + } + } + + companion object { + private const val TAG_WIDTH = 0 + private const val TAG_HEIGHT = 1 + + fun fromTlv( + tlvTag: Tag, + tlvReader: TlvReader, + ): CameraAvStreamManagementClusterVideoResolutionStruct { + tlvReader.enterStructure(tlvTag) + val width = tlvReader.getUInt(ContextSpecificTag(TAG_WIDTH)) + val height = tlvReader.getUInt(ContextSpecificTag(TAG_HEIGHT)) + + tlvReader.exitContainer() + + return CameraAvStreamManagementClusterVideoResolutionStruct(width, height) + } + } +} diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/CameraAvStreamManagementClusterVideoSensorParamsStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/CameraAvStreamManagementClusterVideoSensorParamsStruct.kt new file mode 100644 index 00000000000000..ed6516bd11c587 --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/CameraAvStreamManagementClusterVideoSensorParamsStruct.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 matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class CameraAvStreamManagementClusterVideoSensorParamsStruct( + val sensorWidth: UInt, + val sensorHeight: UInt, + val HDRCapable: Boolean, + val maxFPS: UInt, + val maxHDRFPS: UInt, +) { + override fun toString(): String = buildString { + append("CameraAvStreamManagementClusterVideoSensorParamsStruct {\n") + append("\tsensorWidth : $sensorWidth\n") + append("\tsensorHeight : $sensorHeight\n") + append("\tHDRCapable : $HDRCapable\n") + append("\tmaxFPS : $maxFPS\n") + append("\tmaxHDRFPS : $maxHDRFPS\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_SENSOR_WIDTH), sensorWidth) + put(ContextSpecificTag(TAG_SENSOR_HEIGHT), sensorHeight) + put(ContextSpecificTag(TAG_HDR_CAPABLE), HDRCapable) + put(ContextSpecificTag(TAG_MAX_FPS), maxFPS) + put(ContextSpecificTag(TAG_MAX_HDRFPS), maxHDRFPS) + endStructure() + } + } + + companion object { + private const val TAG_SENSOR_WIDTH = 0 + private const val TAG_SENSOR_HEIGHT = 1 + private const val TAG_HDR_CAPABLE = 2 + private const val TAG_MAX_FPS = 3 + private const val TAG_MAX_HDRFPS = 4 + + fun fromTlv( + tlvTag: Tag, + tlvReader: TlvReader, + ): CameraAvStreamManagementClusterVideoSensorParamsStruct { + tlvReader.enterStructure(tlvTag) + val sensorWidth = tlvReader.getUInt(ContextSpecificTag(TAG_SENSOR_WIDTH)) + val sensorHeight = tlvReader.getUInt(ContextSpecificTag(TAG_SENSOR_HEIGHT)) + val HDRCapable = tlvReader.getBoolean(ContextSpecificTag(TAG_HDR_CAPABLE)) + val maxFPS = tlvReader.getUInt(ContextSpecificTag(TAG_MAX_FPS)) + val maxHDRFPS = tlvReader.getUInt(ContextSpecificTag(TAG_MAX_HDRFPS)) + + tlvReader.exitContainer() + + return CameraAvStreamManagementClusterVideoSensorParamsStruct( + sensorWidth, + sensorHeight, + HDRCapable, + maxFPS, + maxHDRFPS, + ) + } + } +} diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/CameraAvStreamManagementClusterVideoStreamStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/CameraAvStreamManagementClusterVideoStreamStruct.kt new file mode 100644 index 00000000000000..3b83becc8ce0c4 --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/CameraAvStreamManagementClusterVideoStreamStruct.kt @@ -0,0 +1,133 @@ +/* + * + * 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 CameraAvStreamManagementClusterVideoStreamStruct( + val videoStreamID: UInt, + val streamType: UInt, + val videoCodec: UInt, + val minFrameRate: UInt, + val maxFrameRate: UInt, + val minResolution: CameraAvStreamManagementClusterVideoResolutionStruct, + val maxResolution: CameraAvStreamManagementClusterVideoResolutionStruct, + val minBitRate: UInt, + val maxBitRate: UInt, + val minFragmentLen: UInt, + val maxFragmentLen: UInt, + val referenceCount: UInt, +) { + override fun toString(): String = buildString { + append("CameraAvStreamManagementClusterVideoStreamStruct {\n") + append("\tvideoStreamID : $videoStreamID\n") + append("\tstreamType : $streamType\n") + append("\tvideoCodec : $videoCodec\n") + append("\tminFrameRate : $minFrameRate\n") + append("\tmaxFrameRate : $maxFrameRate\n") + append("\tminResolution : $minResolution\n") + append("\tmaxResolution : $maxResolution\n") + append("\tminBitRate : $minBitRate\n") + append("\tmaxBitRate : $maxBitRate\n") + append("\tminFragmentLen : $minFragmentLen\n") + append("\tmaxFragmentLen : $maxFragmentLen\n") + append("\treferenceCount : $referenceCount\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_VIDEO_STREAM_ID), videoStreamID) + put(ContextSpecificTag(TAG_STREAM_TYPE), streamType) + put(ContextSpecificTag(TAG_VIDEO_CODEC), videoCodec) + put(ContextSpecificTag(TAG_MIN_FRAME_RATE), minFrameRate) + put(ContextSpecificTag(TAG_MAX_FRAME_RATE), maxFrameRate) + minResolution.toTlv(ContextSpecificTag(TAG_MIN_RESOLUTION), this) + maxResolution.toTlv(ContextSpecificTag(TAG_MAX_RESOLUTION), this) + put(ContextSpecificTag(TAG_MIN_BIT_RATE), minBitRate) + put(ContextSpecificTag(TAG_MAX_BIT_RATE), maxBitRate) + put(ContextSpecificTag(TAG_MIN_FRAGMENT_LEN), minFragmentLen) + put(ContextSpecificTag(TAG_MAX_FRAGMENT_LEN), maxFragmentLen) + put(ContextSpecificTag(TAG_REFERENCE_COUNT), referenceCount) + endStructure() + } + } + + companion object { + private const val TAG_VIDEO_STREAM_ID = 0 + private const val TAG_STREAM_TYPE = 1 + private const val TAG_VIDEO_CODEC = 2 + private const val TAG_MIN_FRAME_RATE = 3 + private const val TAG_MAX_FRAME_RATE = 4 + private const val TAG_MIN_RESOLUTION = 5 + private const val TAG_MAX_RESOLUTION = 6 + private const val TAG_MIN_BIT_RATE = 7 + private const val TAG_MAX_BIT_RATE = 8 + private const val TAG_MIN_FRAGMENT_LEN = 9 + private const val TAG_MAX_FRAGMENT_LEN = 10 + private const val TAG_REFERENCE_COUNT = 11 + + fun fromTlv( + tlvTag: Tag, + tlvReader: TlvReader, + ): CameraAvStreamManagementClusterVideoStreamStruct { + tlvReader.enterStructure(tlvTag) + val videoStreamID = tlvReader.getUInt(ContextSpecificTag(TAG_VIDEO_STREAM_ID)) + val streamType = tlvReader.getUInt(ContextSpecificTag(TAG_STREAM_TYPE)) + val videoCodec = tlvReader.getUInt(ContextSpecificTag(TAG_VIDEO_CODEC)) + val minFrameRate = tlvReader.getUInt(ContextSpecificTag(TAG_MIN_FRAME_RATE)) + val maxFrameRate = tlvReader.getUInt(ContextSpecificTag(TAG_MAX_FRAME_RATE)) + val minResolution = + CameraAvStreamManagementClusterVideoResolutionStruct.fromTlv( + ContextSpecificTag(TAG_MIN_RESOLUTION), + tlvReader, + ) + val maxResolution = + CameraAvStreamManagementClusterVideoResolutionStruct.fromTlv( + ContextSpecificTag(TAG_MAX_RESOLUTION), + tlvReader, + ) + val minBitRate = tlvReader.getUInt(ContextSpecificTag(TAG_MIN_BIT_RATE)) + val maxBitRate = tlvReader.getUInt(ContextSpecificTag(TAG_MAX_BIT_RATE)) + val minFragmentLen = tlvReader.getUInt(ContextSpecificTag(TAG_MIN_FRAGMENT_LEN)) + val maxFragmentLen = tlvReader.getUInt(ContextSpecificTag(TAG_MAX_FRAGMENT_LEN)) + val referenceCount = tlvReader.getUInt(ContextSpecificTag(TAG_REFERENCE_COUNT)) + + tlvReader.exitContainer() + + return CameraAvStreamManagementClusterVideoStreamStruct( + videoStreamID, + streamType, + videoCodec, + minFrameRate, + maxFrameRate, + minResolution, + maxResolution, + minBitRate, + maxBitRate, + minFragmentLen, + maxFragmentLen, + referenceCount, + ) + } + } +} diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/CameraAvStreamManagementClusterViewportStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/CameraAvStreamManagementClusterViewportStruct.kt new file mode 100644 index 00000000000000..1e4804bc3abeb9 --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/CameraAvStreamManagementClusterViewportStruct.kt @@ -0,0 +1,69 @@ +/* + * + * 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 CameraAvStreamManagementClusterViewportStruct( + val x1: UInt, + val y1: UInt, + val x2: UInt, + val y2: UInt, +) { + override fun toString(): String = buildString { + append("CameraAvStreamManagementClusterViewportStruct {\n") + append("\tx1 : $x1\n") + append("\ty1 : $y1\n") + append("\tx2 : $x2\n") + append("\ty2 : $y2\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_X1), x1) + put(ContextSpecificTag(TAG_Y1), y1) + put(ContextSpecificTag(TAG_X2), x2) + put(ContextSpecificTag(TAG_Y2), y2) + endStructure() + } + } + + companion object { + private const val TAG_X1 = 0 + private const val TAG_Y1 = 1 + private const val TAG_X2 = 2 + private const val TAG_Y2 = 3 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): CameraAvStreamManagementClusterViewportStruct { + tlvReader.enterStructure(tlvTag) + val x1 = tlvReader.getUInt(ContextSpecificTag(TAG_X1)) + val y1 = tlvReader.getUInt(ContextSpecificTag(TAG_Y1)) + val x2 = tlvReader.getUInt(ContextSpecificTag(TAG_X2)) + val y2 = tlvReader.getUInt(ContextSpecificTag(TAG_Y2)) + + tlvReader.exitContainer() + + return CameraAvStreamManagementClusterViewportStruct(x1, y1, x2, y2) + } + } +} diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/CameraAvStreamManagementCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/CameraAvStreamManagementCluster.kt new file mode 100644 index 00000000000000..4c72ef16387586 --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/CameraAvStreamManagementCluster.kt @@ -0,0 +1,7189 @@ +/* + * + * 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.BooleanSubscriptionState +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.WriteRequest +import matter.controller.WriteRequests +import matter.controller.WriteResponse +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 CameraAvStreamManagementCluster( + private val controller: MatterController, + private val endpointId: UShort, +) { + class AudioStreamAllocateResponse(val audioStreamID: UShort) + + class VideoStreamAllocateResponse(val videoStreamID: UShort) + + class SnapshotStreamAllocateResponse(val snapshotStreamID: UShort) + + class VideoSensorParamsAttribute( + val value: CameraAvStreamManagementClusterVideoSensorParamsStruct? + ) + + sealed class VideoSensorParamsAttributeSubscriptionState { + data class Success(val value: CameraAvStreamManagementClusterVideoSensorParamsStruct?) : + VideoSensorParamsAttributeSubscriptionState() + + data class Error(val exception: Exception) : VideoSensorParamsAttributeSubscriptionState() + + object SubscriptionEstablished : VideoSensorParamsAttributeSubscriptionState() + } + + class MinViewPortWidthAttribute(val value: CameraAvStreamManagementClusterVideoResolutionStruct?) + + sealed class MinViewPortWidthAttributeSubscriptionState { + data class Success(val value: CameraAvStreamManagementClusterVideoResolutionStruct?) : + MinViewPortWidthAttributeSubscriptionState() + + data class Error(val exception: Exception) : MinViewPortWidthAttributeSubscriptionState() + + object SubscriptionEstablished : MinViewPortWidthAttributeSubscriptionState() + } + + class MinViewPortHeightAttribute( + val value: CameraAvStreamManagementClusterVideoResolutionStruct? + ) + + sealed class MinViewPortHeightAttributeSubscriptionState { + data class Success(val value: CameraAvStreamManagementClusterVideoResolutionStruct?) : + MinViewPortHeightAttributeSubscriptionState() + + data class Error(val exception: Exception) : MinViewPortHeightAttributeSubscriptionState() + + object SubscriptionEstablished : MinViewPortHeightAttributeSubscriptionState() + } + + class RateDistortionTradeOffPointsAttribute( + val value: List? + ) + + sealed class RateDistortionTradeOffPointsAttributeSubscriptionState { + data class Success( + val value: List? + ) : RateDistortionTradeOffPointsAttributeSubscriptionState() + + data class Error(val exception: Exception) : + RateDistortionTradeOffPointsAttributeSubscriptionState() + + object SubscriptionEstablished : RateDistortionTradeOffPointsAttributeSubscriptionState() + } + + class MicrophoneCapabilitiesAttribute( + val value: CameraAvStreamManagementClusterAudioCapabilitiesStruct? + ) + + sealed class MicrophoneCapabilitiesAttributeSubscriptionState { + data class Success(val value: CameraAvStreamManagementClusterAudioCapabilitiesStruct?) : + MicrophoneCapabilitiesAttributeSubscriptionState() + + data class Error(val exception: Exception) : MicrophoneCapabilitiesAttributeSubscriptionState() + + object SubscriptionEstablished : MicrophoneCapabilitiesAttributeSubscriptionState() + } + + class SpeakerCapabilitiesAttribute( + val value: CameraAvStreamManagementClusterAudioCapabilitiesStruct? + ) + + sealed class SpeakerCapabilitiesAttributeSubscriptionState { + data class Success(val value: CameraAvStreamManagementClusterAudioCapabilitiesStruct?) : + SpeakerCapabilitiesAttributeSubscriptionState() + + data class Error(val exception: Exception) : SpeakerCapabilitiesAttributeSubscriptionState() + + object SubscriptionEstablished : SpeakerCapabilitiesAttributeSubscriptionState() + } + + class SupportedSnapshotParamsAttribute( + val value: List? + ) + + sealed class SupportedSnapshotParamsAttributeSubscriptionState { + data class Success(val value: List?) : + SupportedSnapshotParamsAttributeSubscriptionState() + + data class Error(val exception: Exception) : + SupportedSnapshotParamsAttributeSubscriptionState() + + object SubscriptionEstablished : SupportedSnapshotParamsAttributeSubscriptionState() + } + + class CurrentVideoCodecsAttribute(val value: List?) + + sealed class CurrentVideoCodecsAttributeSubscriptionState { + data class Success(val value: List?) : CurrentVideoCodecsAttributeSubscriptionState() + + data class Error(val exception: Exception) : CurrentVideoCodecsAttributeSubscriptionState() + + object SubscriptionEstablished : CurrentVideoCodecsAttributeSubscriptionState() + } + + class CurrentSnapshotConfigAttribute( + val value: CameraAvStreamManagementClusterSnapshotParamsStruct? + ) + + sealed class CurrentSnapshotConfigAttributeSubscriptionState { + data class Success(val value: CameraAvStreamManagementClusterSnapshotParamsStruct?) : + CurrentSnapshotConfigAttributeSubscriptionState() + + data class Error(val exception: Exception) : CurrentSnapshotConfigAttributeSubscriptionState() + + object SubscriptionEstablished : CurrentSnapshotConfigAttributeSubscriptionState() + } + + class FabricsUsingCameraAttribute(val value: List) + + sealed class FabricsUsingCameraAttributeSubscriptionState { + data class Success(val value: List) : FabricsUsingCameraAttributeSubscriptionState() + + data class Error(val exception: Exception) : FabricsUsingCameraAttributeSubscriptionState() + + object SubscriptionEstablished : FabricsUsingCameraAttributeSubscriptionState() + } + + class AllocatedVideoStreamsAttribute( + val value: List? + ) + + sealed class AllocatedVideoStreamsAttributeSubscriptionState { + data class Success(val value: List?) : + AllocatedVideoStreamsAttributeSubscriptionState() + + data class Error(val exception: Exception) : AllocatedVideoStreamsAttributeSubscriptionState() + + object SubscriptionEstablished : AllocatedVideoStreamsAttributeSubscriptionState() + } + + class AllocatedAudioStreamsAttribute( + val value: List? + ) + + sealed class AllocatedAudioStreamsAttributeSubscriptionState { + data class Success(val value: List?) : + AllocatedAudioStreamsAttributeSubscriptionState() + + data class Error(val exception: Exception) : AllocatedAudioStreamsAttributeSubscriptionState() + + object SubscriptionEstablished : AllocatedAudioStreamsAttributeSubscriptionState() + } + + class AllocatedSnapshotStreamsAttribute( + val value: List? + ) + + sealed class AllocatedSnapshotStreamsAttributeSubscriptionState { + data class Success(val value: List?) : + AllocatedSnapshotStreamsAttributeSubscriptionState() + + data class Error(val exception: Exception) : + AllocatedSnapshotStreamsAttributeSubscriptionState() + + object SubscriptionEstablished : AllocatedSnapshotStreamsAttributeSubscriptionState() + } + + class RankedVideoStreamPrioritiesListAttribute(val value: List?) + + sealed class RankedVideoStreamPrioritiesListAttributeSubscriptionState { + data class Success(val value: List?) : + RankedVideoStreamPrioritiesListAttributeSubscriptionState() + + data class Error(val exception: Exception) : + RankedVideoStreamPrioritiesListAttributeSubscriptionState() + + object SubscriptionEstablished : RankedVideoStreamPrioritiesListAttributeSubscriptionState() + } + + class ViewportAttribute(val value: CameraAvStreamManagementClusterViewportStruct?) + + sealed class ViewportAttributeSubscriptionState { + data class Success(val value: CameraAvStreamManagementClusterViewportStruct?) : + ViewportAttributeSubscriptionState() + + data class Error(val exception: Exception) : ViewportAttributeSubscriptionState() + + object SubscriptionEstablished : ViewportAttributeSubscriptionState() + } + + class WatermarkEnabledAttribute(val value: List?) + + sealed class WatermarkEnabledAttributeSubscriptionState { + data class Success(val value: List?) : + WatermarkEnabledAttributeSubscriptionState() + + data class Error(val exception: Exception) : WatermarkEnabledAttributeSubscriptionState() + + object SubscriptionEstablished : WatermarkEnabledAttributeSubscriptionState() + } + + class OSDEnabledAttribute(val value: List?) + + sealed class OSDEnabledAttributeSubscriptionState { + data class Success(val value: List?) : + OSDEnabledAttributeSubscriptionState() + + data class Error(val exception: Exception) : OSDEnabledAttributeSubscriptionState() + + object SubscriptionEstablished : OSDEnabledAttributeSubscriptionState() + } + + 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 audioStreamAllocate( + streamType: UByte, + audioCodec: UByte, + channelCount: UByte, + sampleRate: UInt, + bitRate: UInt, + bitDepth: UByte, + timedInvokeTimeout: Duration? = null, + ): AudioStreamAllocateResponse { + val commandId: UInt = 0u + + val tlvWriter = TlvWriter() + tlvWriter.startStructure(AnonymousTag) + + val TAG_STREAM_TYPE_REQ: Int = 0 + tlvWriter.put(ContextSpecificTag(TAG_STREAM_TYPE_REQ), streamType) + + val TAG_AUDIO_CODEC_REQ: Int = 1 + tlvWriter.put(ContextSpecificTag(TAG_AUDIO_CODEC_REQ), audioCodec) + + val TAG_CHANNEL_COUNT_REQ: Int = 2 + tlvWriter.put(ContextSpecificTag(TAG_CHANNEL_COUNT_REQ), channelCount) + + val TAG_SAMPLE_RATE_REQ: Int = 3 + tlvWriter.put(ContextSpecificTag(TAG_SAMPLE_RATE_REQ), sampleRate) + + val TAG_BIT_RATE_REQ: Int = 4 + tlvWriter.put(ContextSpecificTag(TAG_BIT_RATE_REQ), bitRate) + + val TAG_BIT_DEPTH_REQ: Int = 5 + tlvWriter.put(ContextSpecificTag(TAG_BIT_DEPTH_REQ), bitDepth) + 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_AUDIO_STREAM_ID: Int = 0 + var audioStreamID_decoded: UShort? = null + + while (!tlvReader.isEndOfContainer()) { + val tag = tlvReader.peekElement().tag + + if (tag == ContextSpecificTag(TAG_AUDIO_STREAM_ID)) { + audioStreamID_decoded = tlvReader.getUShort(tag) + } else { + tlvReader.skipElement() + } + } + + if (audioStreamID_decoded == null) { + throw IllegalStateException("audioStreamID not found in TLV") + } + + tlvReader.exitContainer() + + return AudioStreamAllocateResponse(audioStreamID_decoded) + } + + suspend fun audioStreamDeallocate(audioStreamID: UShort, timedInvokeTimeout: Duration? = null) { + val commandId: UInt = 2u + + val tlvWriter = TlvWriter() + tlvWriter.startStructure(AnonymousTag) + + val TAG_AUDIO_STREAM_ID_REQ: Int = 0 + tlvWriter.put(ContextSpecificTag(TAG_AUDIO_STREAM_ID_REQ), audioStreamID) + 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 videoStreamAllocate( + streamType: UByte, + videoCodec: UByte, + minFrameRate: UShort, + maxFrameRate: UShort, + minResolution: CameraAvStreamManagementClusterVideoResolutionStruct, + maxResolution: CameraAvStreamManagementClusterVideoResolutionStruct, + minBitRate: UInt, + maxBitRate: UInt, + minFragmentLen: UShort, + maxFragmentLen: UShort, + timedInvokeTimeout: Duration? = null, + ): VideoStreamAllocateResponse { + val commandId: UInt = 3u + + val tlvWriter = TlvWriter() + tlvWriter.startStructure(AnonymousTag) + + val TAG_STREAM_TYPE_REQ: Int = 0 + tlvWriter.put(ContextSpecificTag(TAG_STREAM_TYPE_REQ), streamType) + + val TAG_VIDEO_CODEC_REQ: Int = 1 + tlvWriter.put(ContextSpecificTag(TAG_VIDEO_CODEC_REQ), videoCodec) + + val TAG_MIN_FRAME_RATE_REQ: Int = 2 + tlvWriter.put(ContextSpecificTag(TAG_MIN_FRAME_RATE_REQ), minFrameRate) + + val TAG_MAX_FRAME_RATE_REQ: Int = 3 + tlvWriter.put(ContextSpecificTag(TAG_MAX_FRAME_RATE_REQ), maxFrameRate) + + val TAG_MIN_RESOLUTION_REQ: Int = 4 + minResolution.toTlv(ContextSpecificTag(TAG_MIN_RESOLUTION_REQ), tlvWriter) + + val TAG_MAX_RESOLUTION_REQ: Int = 5 + maxResolution.toTlv(ContextSpecificTag(TAG_MAX_RESOLUTION_REQ), tlvWriter) + + val TAG_MIN_BIT_RATE_REQ: Int = 6 + tlvWriter.put(ContextSpecificTag(TAG_MIN_BIT_RATE_REQ), minBitRate) + + val TAG_MAX_BIT_RATE_REQ: Int = 7 + tlvWriter.put(ContextSpecificTag(TAG_MAX_BIT_RATE_REQ), maxBitRate) + + val TAG_MIN_FRAGMENT_LEN_REQ: Int = 8 + tlvWriter.put(ContextSpecificTag(TAG_MIN_FRAGMENT_LEN_REQ), minFragmentLen) + + val TAG_MAX_FRAGMENT_LEN_REQ: Int = 9 + tlvWriter.put(ContextSpecificTag(TAG_MAX_FRAGMENT_LEN_REQ), maxFragmentLen) + 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_VIDEO_STREAM_ID: Int = 0 + var videoStreamID_decoded: UShort? = null + + while (!tlvReader.isEndOfContainer()) { + val tag = tlvReader.peekElement().tag + + if (tag == ContextSpecificTag(TAG_VIDEO_STREAM_ID)) { + videoStreamID_decoded = tlvReader.getUShort(tag) + } else { + tlvReader.skipElement() + } + } + + if (videoStreamID_decoded == null) { + throw IllegalStateException("videoStreamID not found in TLV") + } + + tlvReader.exitContainer() + + return VideoStreamAllocateResponse(videoStreamID_decoded) + } + + suspend fun videoStreamModify( + videoStreamID: UShort, + resolution: CameraAvStreamManagementClusterVideoResolutionStruct, + timedInvokeTimeout: Duration? = null, + ) { + val commandId: UInt = 5u + + val tlvWriter = TlvWriter() + tlvWriter.startStructure(AnonymousTag) + + val TAG_VIDEO_STREAM_ID_REQ: Int = 0 + tlvWriter.put(ContextSpecificTag(TAG_VIDEO_STREAM_ID_REQ), videoStreamID) + + val TAG_RESOLUTION_REQ: Int = 1 + resolution.toTlv(ContextSpecificTag(TAG_RESOLUTION_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 videoStreamDeallocate(videoStreamID: UShort, timedInvokeTimeout: Duration? = null) { + val commandId: UInt = 6u + + val tlvWriter = TlvWriter() + tlvWriter.startStructure(AnonymousTag) + + val TAG_VIDEO_STREAM_ID_REQ: Int = 0 + tlvWriter.put(ContextSpecificTag(TAG_VIDEO_STREAM_ID_REQ), videoStreamID) + 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 snapshotStreamAllocate( + imageCodec: UByte, + frameRate: UShort, + bitRate: UInt, + minResolution: CameraAvStreamManagementClusterVideoResolutionStruct, + maxResolution: CameraAvStreamManagementClusterVideoResolutionStruct, + quality: UByte, + timedInvokeTimeout: Duration? = null, + ): SnapshotStreamAllocateResponse { + val commandId: UInt = 7u + + val tlvWriter = TlvWriter() + tlvWriter.startStructure(AnonymousTag) + + val TAG_IMAGE_CODEC_REQ: Int = 0 + tlvWriter.put(ContextSpecificTag(TAG_IMAGE_CODEC_REQ), imageCodec) + + val TAG_FRAME_RATE_REQ: Int = 1 + tlvWriter.put(ContextSpecificTag(TAG_FRAME_RATE_REQ), frameRate) + + val TAG_BIT_RATE_REQ: Int = 2 + tlvWriter.put(ContextSpecificTag(TAG_BIT_RATE_REQ), bitRate) + + val TAG_MIN_RESOLUTION_REQ: Int = 3 + minResolution.toTlv(ContextSpecificTag(TAG_MIN_RESOLUTION_REQ), tlvWriter) + + val TAG_MAX_RESOLUTION_REQ: Int = 4 + maxResolution.toTlv(ContextSpecificTag(TAG_MAX_RESOLUTION_REQ), tlvWriter) + + val TAG_QUALITY_REQ: Int = 5 + tlvWriter.put(ContextSpecificTag(TAG_QUALITY_REQ), quality) + 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_SNAPSHOT_STREAM_ID: Int = 0 + var snapshotStreamID_decoded: UShort? = null + + while (!tlvReader.isEndOfContainer()) { + val tag = tlvReader.peekElement().tag + + if (tag == ContextSpecificTag(TAG_SNAPSHOT_STREAM_ID)) { + snapshotStreamID_decoded = tlvReader.getUShort(tag) + } else { + tlvReader.skipElement() + } + } + + if (snapshotStreamID_decoded == null) { + throw IllegalStateException("snapshotStreamID not found in TLV") + } + + tlvReader.exitContainer() + + return SnapshotStreamAllocateResponse(snapshotStreamID_decoded) + } + + suspend fun snapshotStreamDeallocate( + snapshotStreamID: UShort, + timedInvokeTimeout: Duration? = null, + ) { + val commandId: UInt = 9u + + val tlvWriter = TlvWriter() + tlvWriter.startStructure(AnonymousTag) + + val TAG_SNAPSHOT_STREAM_ID_REQ: Int = 0 + tlvWriter.put(ContextSpecificTag(TAG_SNAPSHOT_STREAM_ID_REQ), snapshotStreamID) + 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 setStreamPriority(timedInvokeTimeout: Duration? = null) { + val commandId: UInt = 10u + + val tlvWriter = TlvWriter() + tlvWriter.startStructure(AnonymousTag) + 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 captureSnapshot( + snapshotStreamID: UShort, + requestedResolution: CameraAvStreamManagementClusterVideoResolutionStruct, + timedInvokeTimeout: Duration? = null, + ) { + val commandId: UInt = 11u + + val tlvWriter = TlvWriter() + tlvWriter.startStructure(AnonymousTag) + + val TAG_SNAPSHOT_STREAM_ID_REQ: Int = 0 + tlvWriter.put(ContextSpecificTag(TAG_SNAPSHOT_STREAM_ID_REQ), snapshotStreamID) + + val TAG_REQUESTED_RESOLUTION_REQ: Int = 1 + requestedResolution.toTlv(ContextSpecificTag(TAG_REQUESTED_RESOLUTION_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 setViewport( + viewport: CameraAvStreamManagementClusterViewportStruct, + timedInvokeTimeout: Duration? = null, + ) { + val commandId: UInt = 13u + + val tlvWriter = TlvWriter() + tlvWriter.startStructure(AnonymousTag) + + val TAG_VIEWPORT_REQ: Int = 0 + viewport.toTlv(ContextSpecificTag(TAG_VIEWPORT_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 setImageRotation(angle: UShort, timedInvokeTimeout: Duration? = null) { + val commandId: UInt = 14u + + val tlvWriter = TlvWriter() + tlvWriter.startStructure(AnonymousTag) + + val TAG_ANGLE_REQ: Int = 0 + tlvWriter.put(ContextSpecificTag(TAG_ANGLE_REQ), angle) + 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 setImageFlipHorizontal(enabled: Boolean, timedInvokeTimeout: Duration? = null) { + val commandId: UInt = 15u + + val tlvWriter = TlvWriter() + tlvWriter.startStructure(AnonymousTag) + + val TAG_ENABLED_REQ: Int = 0 + tlvWriter.put(ContextSpecificTag(TAG_ENABLED_REQ), enabled) + 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 setImageFlipVertical(enabled: Boolean, timedInvokeTimeout: Duration? = null) { + val commandId: UInt = 16u + + val tlvWriter = TlvWriter() + tlvWriter.startStructure(AnonymousTag) + + val TAG_ENABLED_REQ: Int = 0 + tlvWriter.put(ContextSpecificTag(TAG_ENABLED_REQ), enabled) + 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 setWatermark( + videoStreamID: UShort, + enabled: Boolean, + timedInvokeTimeout: Duration? = null, + ) { + val commandId: UInt = 17u + + val tlvWriter = TlvWriter() + tlvWriter.startStructure(AnonymousTag) + + val TAG_VIDEO_STREAM_ID_REQ: Int = 0 + tlvWriter.put(ContextSpecificTag(TAG_VIDEO_STREAM_ID_REQ), videoStreamID) + + val TAG_ENABLED_REQ: Int = 1 + tlvWriter.put(ContextSpecificTag(TAG_ENABLED_REQ), enabled) + 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 setOSD( + videoStreamID: UShort, + enabled: Boolean, + timedInvokeTimeout: Duration? = null, + ) { + val commandId: UInt = 18u + + val tlvWriter = TlvWriter() + tlvWriter.startStructure(AnonymousTag) + + val TAG_VIDEO_STREAM_ID_REQ: Int = 0 + tlvWriter.put(ContextSpecificTag(TAG_VIDEO_STREAM_ID_REQ), videoStreamID) + + val TAG_ENABLED_REQ: Int = 1 + tlvWriter.put(ContextSpecificTag(TAG_ENABLED_REQ), enabled) + 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 readMaxConcurrentVideoEncodersAttribute(): 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) { "Maxconcurrentvideoencoders attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UByte? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getUByte(AnonymousTag) + } else { + null + } + + return decodedValue + } + + suspend fun subscribeMaxConcurrentVideoEncodersAttribute( + 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) { + "Maxconcurrentvideoencoders attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UByte? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getUByte(AnonymousTag) + } else { + null + } + + decodedValue?.let { emit(UByteSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(UByteSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readMaxEncodedPixelRateAttribute(): UInt? { + 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) { "Maxencodedpixelrate attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UInt? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getUInt(AnonymousTag) + } else { + null + } + + return decodedValue + } + + suspend fun subscribeMaxEncodedPixelRateAttribute( + 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( + 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) { + "Maxencodedpixelrate attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UInt? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getUInt(AnonymousTag) + } else { + null + } + + decodedValue?.let { emit(UIntSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(UIntSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readVideoSensorParamsAttribute(): VideoSensorParamsAttribute { + 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) { "Videosensorparams attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: CameraAvStreamManagementClusterVideoSensorParamsStruct? = + if (tlvReader.isNextTag(AnonymousTag)) { + CameraAvStreamManagementClusterVideoSensorParamsStruct.fromTlv(AnonymousTag, tlvReader) + } else { + null + } + + return VideoSensorParamsAttribute(decodedValue) + } + + suspend fun subscribeVideoSensorParamsAttribute( + 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( + VideoSensorParamsAttributeSubscriptionState.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) { + "Videosensorparams attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: CameraAvStreamManagementClusterVideoSensorParamsStruct? = + if (tlvReader.isNextTag(AnonymousTag)) { + CameraAvStreamManagementClusterVideoSensorParamsStruct.fromTlv( + AnonymousTag, + tlvReader, + ) + } else { + null + } + + decodedValue?.let { emit(VideoSensorParamsAttributeSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(VideoSensorParamsAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readNightVisionCapableAttribute(): Boolean? { + val ATTRIBUTE_ID: UInt = 3u + + 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) { "Nightvisioncapable attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: Boolean? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getBoolean(AnonymousTag) + } else { + null + } + + return decodedValue + } + + suspend fun subscribeNightVisionCapableAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 3u + 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( + BooleanSubscriptionState.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) { + "Nightvisioncapable attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: Boolean? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getBoolean(AnonymousTag) + } else { + null + } + + decodedValue?.let { emit(BooleanSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(BooleanSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readMinViewPortWidthAttribute(): MinViewPortWidthAttribute { + val ATTRIBUTE_ID: UInt = 4u + + 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) { "Minviewportwidth attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: CameraAvStreamManagementClusterVideoResolutionStruct? = + if (tlvReader.isNextTag(AnonymousTag)) { + CameraAvStreamManagementClusterVideoResolutionStruct.fromTlv(AnonymousTag, tlvReader) + } else { + null + } + + return MinViewPortWidthAttribute(decodedValue) + } + + suspend fun subscribeMinViewPortWidthAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 4u + 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( + MinViewPortWidthAttributeSubscriptionState.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) { + "Minviewportwidth attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: CameraAvStreamManagementClusterVideoResolutionStruct? = + if (tlvReader.isNextTag(AnonymousTag)) { + CameraAvStreamManagementClusterVideoResolutionStruct.fromTlv(AnonymousTag, tlvReader) + } else { + null + } + + decodedValue?.let { emit(MinViewPortWidthAttributeSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(MinViewPortWidthAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readMinViewPortHeightAttribute(): MinViewPortHeightAttribute { + val ATTRIBUTE_ID: UInt = 5u + + 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) { "Minviewportheight attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: CameraAvStreamManagementClusterVideoResolutionStruct? = + if (tlvReader.isNextTag(AnonymousTag)) { + CameraAvStreamManagementClusterVideoResolutionStruct.fromTlv(AnonymousTag, tlvReader) + } else { + null + } + + return MinViewPortHeightAttribute(decodedValue) + } + + suspend fun subscribeMinViewPortHeightAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 5u + 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( + MinViewPortHeightAttributeSubscriptionState.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) { + "Minviewportheight attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: CameraAvStreamManagementClusterVideoResolutionStruct? = + if (tlvReader.isNextTag(AnonymousTag)) { + CameraAvStreamManagementClusterVideoResolutionStruct.fromTlv(AnonymousTag, tlvReader) + } else { + null + } + + decodedValue?.let { emit(MinViewPortHeightAttributeSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(MinViewPortHeightAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readRateDistortionTradeOffPointsAttribute(): RateDistortionTradeOffPointsAttribute { + val ATTRIBUTE_ID: UInt = 6u + + 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) { "Ratedistortiontradeoffpoints attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List? = + if (tlvReader.isNextTag(AnonymousTag)) { + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add( + CameraAvStreamManagementClusterRateDistortionTradeOffPointsStruct.fromTlv( + AnonymousTag, + tlvReader, + ) + ) + } + tlvReader.exitContainer() + } + } else { + null + } + + return RateDistortionTradeOffPointsAttribute(decodedValue) + } + + suspend fun subscribeRateDistortionTradeOffPointsAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 6u + 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( + RateDistortionTradeOffPointsAttributeSubscriptionState.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) { + "Ratedistortiontradeoffpoints attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: + List? = + if (tlvReader.isNextTag(AnonymousTag)) { + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add( + CameraAvStreamManagementClusterRateDistortionTradeOffPointsStruct.fromTlv( + AnonymousTag, + tlvReader, + ) + ) + } + tlvReader.exitContainer() + } + } else { + null + } + + decodedValue?.let { + emit(RateDistortionTradeOffPointsAttributeSubscriptionState.Success(it)) + } + } + SubscriptionState.SubscriptionEstablished -> { + emit(RateDistortionTradeOffPointsAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readMaxPreRollBufferSizeAttribute(): UInt? { + val ATTRIBUTE_ID: UInt = 7u + + 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) { "Maxprerollbuffersize attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UInt? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getUInt(AnonymousTag) + } else { + null + } + + return decodedValue + } + + suspend fun subscribeMaxPreRollBufferSizeAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 7u + 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) { + "Maxprerollbuffersize attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UInt? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getUInt(AnonymousTag) + } else { + null + } + + decodedValue?.let { emit(UIntSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(UIntSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readMicrophoneCapabilitiesAttribute(): MicrophoneCapabilitiesAttribute { + val ATTRIBUTE_ID: UInt = 8u + + 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) { "Microphonecapabilities attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: CameraAvStreamManagementClusterAudioCapabilitiesStruct? = + if (tlvReader.isNextTag(AnonymousTag)) { + CameraAvStreamManagementClusterAudioCapabilitiesStruct.fromTlv(AnonymousTag, tlvReader) + } else { + null + } + + return MicrophoneCapabilitiesAttribute(decodedValue) + } + + suspend fun subscribeMicrophoneCapabilitiesAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 8u + 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( + MicrophoneCapabilitiesAttributeSubscriptionState.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) { + "Microphonecapabilities attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: CameraAvStreamManagementClusterAudioCapabilitiesStruct? = + if (tlvReader.isNextTag(AnonymousTag)) { + CameraAvStreamManagementClusterAudioCapabilitiesStruct.fromTlv( + AnonymousTag, + tlvReader, + ) + } else { + null + } + + decodedValue?.let { emit(MicrophoneCapabilitiesAttributeSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(MicrophoneCapabilitiesAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readSpeakerCapabilitiesAttribute(): SpeakerCapabilitiesAttribute { + val ATTRIBUTE_ID: UInt = 9u + + 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) { "Speakercapabilities attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: CameraAvStreamManagementClusterAudioCapabilitiesStruct? = + if (!tlvReader.isNull()) { + if (tlvReader.isNextTag(AnonymousTag)) { + CameraAvStreamManagementClusterAudioCapabilitiesStruct.fromTlv(AnonymousTag, tlvReader) + } else { + null + } + } else { + tlvReader.getNull(AnonymousTag) + null + } + + return SpeakerCapabilitiesAttribute(decodedValue) + } + + suspend fun subscribeSpeakerCapabilitiesAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 9u + 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( + SpeakerCapabilitiesAttributeSubscriptionState.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) { + "Speakercapabilities attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: CameraAvStreamManagementClusterAudioCapabilitiesStruct? = + if (!tlvReader.isNull()) { + if (tlvReader.isNextTag(AnonymousTag)) { + CameraAvStreamManagementClusterAudioCapabilitiesStruct.fromTlv( + AnonymousTag, + tlvReader, + ) + } else { + null + } + } else { + tlvReader.getNull(AnonymousTag) + null + } + + decodedValue?.let { emit(SpeakerCapabilitiesAttributeSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(SpeakerCapabilitiesAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readTwoWayTalkSupportAttribute(): UByte? { + val ATTRIBUTE_ID: UInt = 10u + + 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) { "Twowaytalksupport attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UByte? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getUByte(AnonymousTag) + } else { + null + } + + return decodedValue + } + + suspend fun subscribeTwoWayTalkSupportAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 10u + 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) { + "Twowaytalksupport attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UByte? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getUByte(AnonymousTag) + } else { + null + } + + decodedValue?.let { emit(UByteSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(UByteSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readSupportedSnapshotParamsAttribute(): SupportedSnapshotParamsAttribute { + val ATTRIBUTE_ID: UInt = 11u + + 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) { "Supportedsnapshotparams attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List? = + if (tlvReader.isNextTag(AnonymousTag)) { + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add( + CameraAvStreamManagementClusterSnapshotParamsStruct.fromTlv(AnonymousTag, tlvReader) + ) + } + tlvReader.exitContainer() + } + } else { + null + } + + return SupportedSnapshotParamsAttribute(decodedValue) + } + + suspend fun subscribeSupportedSnapshotParamsAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 11u + 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( + SupportedSnapshotParamsAttributeSubscriptionState.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) { + "Supportedsnapshotparams attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List? = + if (tlvReader.isNextTag(AnonymousTag)) { + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add( + CameraAvStreamManagementClusterSnapshotParamsStruct.fromTlv( + AnonymousTag, + tlvReader, + ) + ) + } + tlvReader.exitContainer() + } + } else { + null + } + + decodedValue?.let { emit(SupportedSnapshotParamsAttributeSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(SupportedSnapshotParamsAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readHDRCapableAttribute(): Boolean? { + val ATTRIBUTE_ID: UInt = 12u + + 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) { "Hdrcapable attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: Boolean? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getBoolean(AnonymousTag) + } else { + null + } + + return decodedValue + } + + suspend fun subscribeHDRCapableAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 12u + 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( + BooleanSubscriptionState.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) { "Hdrcapable attribute not found in Node State update" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: Boolean? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getBoolean(AnonymousTag) + } else { + null + } + + decodedValue?.let { emit(BooleanSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(BooleanSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readMaxNetworkBandwidthAttribute(): UInt { + val ATTRIBUTE_ID: UInt = 13u + + 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) { "Maxnetworkbandwidth 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 subscribeMaxNetworkBandwidthAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 13u + 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) { + "Maxnetworkbandwidth 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 readCurrentFrameRateAttribute(): UShort? { + val ATTRIBUTE_ID: UInt = 14u + + 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) { "Currentframerate attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UShort? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getUShort(AnonymousTag) + } else { + null + } + + return decodedValue + } + + suspend fun subscribeCurrentFrameRateAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 14u + 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) { + "Currentframerate attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UShort? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getUShort(AnonymousTag) + } else { + null + } + + decodedValue?.let { emit(UShortSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(UShortSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readHDRModeAttribute(): Boolean? { + val ATTRIBUTE_ID: UInt = 15u + + 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) { "Hdrmode attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: Boolean? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getBoolean(AnonymousTag) + } else { + null + } + + return decodedValue + } + + suspend fun writeHDRModeAttribute(value: Boolean, timedWriteTimeout: Duration? = null) { + val ATTRIBUTE_ID: UInt = 15u + + val tlvWriter = TlvWriter() + tlvWriter.put(AnonymousTag, value) + + val writeRequests: WriteRequests = + WriteRequests( + requests = + listOf( + WriteRequest( + attributePath = + AttributePath(endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID), + tlvPayload = tlvWriter.getEncoded(), + ) + ), + timedRequest = timedWriteTimeout, + ) + + val response: WriteResponse = controller.write(writeRequests) + + when (response) { + is WriteResponse.Success -> { + logger.log(Level.FINE, "Write command succeeded") + } + is WriteResponse.PartialWriteFailure -> { + val aggregatedErrorMessage = + response.failures.joinToString("\n") { failure -> + "Error at ${failure.attributePath}: ${failure.ex.message}" + } + + response.failures.forEach { failure -> + logger.log(Level.WARNING, "Error at ${failure.attributePath}: ${failure.ex.message}") + } + + throw IllegalStateException("Write command failed with errors: \n$aggregatedErrorMessage") + } + } + } + + suspend fun subscribeHDRModeAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 15u + 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( + BooleanSubscriptionState.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) { "Hdrmode attribute not found in Node State update" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: Boolean? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getBoolean(AnonymousTag) + } else { + null + } + + decodedValue?.let { emit(BooleanSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(BooleanSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readCurrentVideoCodecsAttribute(): CurrentVideoCodecsAttribute { + val ATTRIBUTE_ID: UInt = 16u + + 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) { "Currentvideocodecs attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List? = + if (tlvReader.isNextTag(AnonymousTag)) { + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUByte(AnonymousTag)) + } + tlvReader.exitContainer() + } + } else { + null + } + + return CurrentVideoCodecsAttribute(decodedValue) + } + + suspend fun subscribeCurrentVideoCodecsAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 16u + 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( + CurrentVideoCodecsAttributeSubscriptionState.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) { + "Currentvideocodecs attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List? = + if (tlvReader.isNextTag(AnonymousTag)) { + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUByte(AnonymousTag)) + } + tlvReader.exitContainer() + } + } else { + null + } + + decodedValue?.let { emit(CurrentVideoCodecsAttributeSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(CurrentVideoCodecsAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readCurrentSnapshotConfigAttribute(): CurrentSnapshotConfigAttribute { + val ATTRIBUTE_ID: UInt = 17u + + 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) { "Currentsnapshotconfig attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: CameraAvStreamManagementClusterSnapshotParamsStruct? = + if (tlvReader.isNextTag(AnonymousTag)) { + CameraAvStreamManagementClusterSnapshotParamsStruct.fromTlv(AnonymousTag, tlvReader) + } else { + null + } + + return CurrentSnapshotConfigAttribute(decodedValue) + } + + suspend fun subscribeCurrentSnapshotConfigAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 17u + 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( + CurrentSnapshotConfigAttributeSubscriptionState.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) { + "Currentsnapshotconfig attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: CameraAvStreamManagementClusterSnapshotParamsStruct? = + if (tlvReader.isNextTag(AnonymousTag)) { + CameraAvStreamManagementClusterSnapshotParamsStruct.fromTlv(AnonymousTag, tlvReader) + } else { + null + } + + decodedValue?.let { emit(CurrentSnapshotConfigAttributeSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(CurrentSnapshotConfigAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readFabricsUsingCameraAttribute(): FabricsUsingCameraAttribute { + val ATTRIBUTE_ID: UInt = 18u + + 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) { "Fabricsusingcamera 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.getUByte(AnonymousTag)) + } + tlvReader.exitContainer() + } + + return FabricsUsingCameraAttribute(decodedValue) + } + + suspend fun subscribeFabricsUsingCameraAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 18u + 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( + FabricsUsingCameraAttributeSubscriptionState.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) { + "Fabricsusingcamera 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.getUByte(AnonymousTag)) + } + tlvReader.exitContainer() + } + + emit(FabricsUsingCameraAttributeSubscriptionState.Success(decodedValue)) + } + SubscriptionState.SubscriptionEstablished -> { + emit(FabricsUsingCameraAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readAllocatedVideoStreamsAttribute(): AllocatedVideoStreamsAttribute { + val ATTRIBUTE_ID: UInt = 19u + + 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) { "Allocatedvideostreams attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List? = + if (tlvReader.isNextTag(AnonymousTag)) { + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(CameraAvStreamManagementClusterVideoStreamStruct.fromTlv(AnonymousTag, tlvReader)) + } + tlvReader.exitContainer() + } + } else { + null + } + + return AllocatedVideoStreamsAttribute(decodedValue) + } + + suspend fun subscribeAllocatedVideoStreamsAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 19u + 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( + AllocatedVideoStreamsAttributeSubscriptionState.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) { + "Allocatedvideostreams attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List? = + if (tlvReader.isNextTag(AnonymousTag)) { + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add( + CameraAvStreamManagementClusterVideoStreamStruct.fromTlv( + AnonymousTag, + tlvReader, + ) + ) + } + tlvReader.exitContainer() + } + } else { + null + } + + decodedValue?.let { emit(AllocatedVideoStreamsAttributeSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(AllocatedVideoStreamsAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readAllocatedAudioStreamsAttribute(): AllocatedAudioStreamsAttribute { + val ATTRIBUTE_ID: UInt = 20u + + 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) { "Allocatedaudiostreams attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List? = + if (tlvReader.isNextTag(AnonymousTag)) { + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(CameraAvStreamManagementClusterAudioStreamStruct.fromTlv(AnonymousTag, tlvReader)) + } + tlvReader.exitContainer() + } + } else { + null + } + + return AllocatedAudioStreamsAttribute(decodedValue) + } + + suspend fun subscribeAllocatedAudioStreamsAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 20u + 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( + AllocatedAudioStreamsAttributeSubscriptionState.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) { + "Allocatedaudiostreams attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List? = + if (tlvReader.isNextTag(AnonymousTag)) { + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add( + CameraAvStreamManagementClusterAudioStreamStruct.fromTlv( + AnonymousTag, + tlvReader, + ) + ) + } + tlvReader.exitContainer() + } + } else { + null + } + + decodedValue?.let { emit(AllocatedAudioStreamsAttributeSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(AllocatedAudioStreamsAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readAllocatedSnapshotStreamsAttribute(): AllocatedSnapshotStreamsAttribute { + val ATTRIBUTE_ID: UInt = 21u + + 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) { "Allocatedsnapshotstreams attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List? = + if (tlvReader.isNextTag(AnonymousTag)) { + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add( + CameraAvStreamManagementClusterSnapshotStreamStruct.fromTlv(AnonymousTag, tlvReader) + ) + } + tlvReader.exitContainer() + } + } else { + null + } + + return AllocatedSnapshotStreamsAttribute(decodedValue) + } + + suspend fun subscribeAllocatedSnapshotStreamsAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 21u + 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( + AllocatedSnapshotStreamsAttributeSubscriptionState.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) { + "Allocatedsnapshotstreams attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List? = + if (tlvReader.isNextTag(AnonymousTag)) { + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add( + CameraAvStreamManagementClusterSnapshotStreamStruct.fromTlv( + AnonymousTag, + tlvReader, + ) + ) + } + tlvReader.exitContainer() + } + } else { + null + } + + decodedValue?.let { emit(AllocatedSnapshotStreamsAttributeSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(AllocatedSnapshotStreamsAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readRankedVideoStreamPrioritiesListAttribute(): + RankedVideoStreamPrioritiesListAttribute { + val ATTRIBUTE_ID: UInt = 22u + + 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) { + "Rankedvideostreamprioritieslist attribute not found in response" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List? = + if (tlvReader.isNextTag(AnonymousTag)) { + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUByte(AnonymousTag)) + } + tlvReader.exitContainer() + } + } else { + null + } + + return RankedVideoStreamPrioritiesListAttribute(decodedValue) + } + + suspend fun writeRankedVideoStreamPrioritiesListAttribute( + value: List, + timedWriteTimeout: Duration? = null, + ) { + val ATTRIBUTE_ID: UInt = 22u + + val tlvWriter = TlvWriter() + tlvWriter.startArray(AnonymousTag) + for (item in value.iterator()) { + tlvWriter.put(AnonymousTag, item) + } + tlvWriter.endArray() + + val writeRequests: WriteRequests = + WriteRequests( + requests = + listOf( + WriteRequest( + attributePath = + AttributePath(endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID), + tlvPayload = tlvWriter.getEncoded(), + ) + ), + timedRequest = timedWriteTimeout, + ) + + val response: WriteResponse = controller.write(writeRequests) + + when (response) { + is WriteResponse.Success -> { + logger.log(Level.FINE, "Write command succeeded") + } + is WriteResponse.PartialWriteFailure -> { + val aggregatedErrorMessage = + response.failures.joinToString("\n") { failure -> + "Error at ${failure.attributePath}: ${failure.ex.message}" + } + + response.failures.forEach { failure -> + logger.log(Level.WARNING, "Error at ${failure.attributePath}: ${failure.ex.message}") + } + + throw IllegalStateException("Write command failed with errors: \n$aggregatedErrorMessage") + } + } + } + + suspend fun subscribeRankedVideoStreamPrioritiesListAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 22u + 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( + RankedVideoStreamPrioritiesListAttributeSubscriptionState.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) { + "Rankedvideostreamprioritieslist attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List? = + if (tlvReader.isNextTag(AnonymousTag)) { + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUByte(AnonymousTag)) + } + tlvReader.exitContainer() + } + } else { + null + } + + decodedValue?.let { + emit(RankedVideoStreamPrioritiesListAttributeSubscriptionState.Success(it)) + } + } + SubscriptionState.SubscriptionEstablished -> { + emit(RankedVideoStreamPrioritiesListAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readSoftRecordingPrivacyModeSettingAttribute(): Boolean? { + val ATTRIBUTE_ID: UInt = 23u + + 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) { + "Softrecordingprivacymodesetting attribute not found in response" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: Boolean? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getBoolean(AnonymousTag) + } else { + null + } + + return decodedValue + } + + suspend fun writeSoftRecordingPrivacyModeSettingAttribute( + value: Boolean, + timedWriteTimeout: Duration? = null, + ) { + val ATTRIBUTE_ID: UInt = 23u + + val tlvWriter = TlvWriter() + tlvWriter.put(AnonymousTag, value) + + val writeRequests: WriteRequests = + WriteRequests( + requests = + listOf( + WriteRequest( + attributePath = + AttributePath(endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID), + tlvPayload = tlvWriter.getEncoded(), + ) + ), + timedRequest = timedWriteTimeout, + ) + + val response: WriteResponse = controller.write(writeRequests) + + when (response) { + is WriteResponse.Success -> { + logger.log(Level.FINE, "Write command succeeded") + } + is WriteResponse.PartialWriteFailure -> { + val aggregatedErrorMessage = + response.failures.joinToString("\n") { failure -> + "Error at ${failure.attributePath}: ${failure.ex.message}" + } + + response.failures.forEach { failure -> + logger.log(Level.WARNING, "Error at ${failure.attributePath}: ${failure.ex.message}") + } + + throw IllegalStateException("Write command failed with errors: \n$aggregatedErrorMessage") + } + } + } + + suspend fun subscribeSoftRecordingPrivacyModeSettingAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 23u + 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( + BooleanSubscriptionState.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) { + "Softrecordingprivacymodesetting attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: Boolean? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getBoolean(AnonymousTag) + } else { + null + } + + decodedValue?.let { emit(BooleanSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(BooleanSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readSoftLivestreamPrivacyModeSettingAttribute(): Boolean? { + val ATTRIBUTE_ID: UInt = 24u + + 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) { + "Softlivestreamprivacymodesetting attribute not found in response" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: Boolean? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getBoolean(AnonymousTag) + } else { + null + } + + return decodedValue + } + + suspend fun writeSoftLivestreamPrivacyModeSettingAttribute( + value: Boolean, + timedWriteTimeout: Duration? = null, + ) { + val ATTRIBUTE_ID: UInt = 24u + + val tlvWriter = TlvWriter() + tlvWriter.put(AnonymousTag, value) + + val writeRequests: WriteRequests = + WriteRequests( + requests = + listOf( + WriteRequest( + attributePath = + AttributePath(endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID), + tlvPayload = tlvWriter.getEncoded(), + ) + ), + timedRequest = timedWriteTimeout, + ) + + val response: WriteResponse = controller.write(writeRequests) + + when (response) { + is WriteResponse.Success -> { + logger.log(Level.FINE, "Write command succeeded") + } + is WriteResponse.PartialWriteFailure -> { + val aggregatedErrorMessage = + response.failures.joinToString("\n") { failure -> + "Error at ${failure.attributePath}: ${failure.ex.message}" + } + + response.failures.forEach { failure -> + logger.log(Level.WARNING, "Error at ${failure.attributePath}: ${failure.ex.message}") + } + + throw IllegalStateException("Write command failed with errors: \n$aggregatedErrorMessage") + } + } + } + + suspend fun subscribeSoftLivestreamPrivacyModeSettingAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 24u + 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( + BooleanSubscriptionState.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) { + "Softlivestreamprivacymodesetting attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: Boolean? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getBoolean(AnonymousTag) + } else { + null + } + + decodedValue?.let { emit(BooleanSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(BooleanSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readHardPrivacyModeAttribute(): Boolean? { + val ATTRIBUTE_ID: UInt = 25u + + 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) { "Hardprivacymode attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: Boolean? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getBoolean(AnonymousTag) + } else { + null + } + + return decodedValue + } + + suspend fun subscribeHardPrivacyModeAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 25u + 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( + BooleanSubscriptionState.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) { + "Hardprivacymode attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: Boolean? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getBoolean(AnonymousTag) + } else { + null + } + + decodedValue?.let { emit(BooleanSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(BooleanSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readNightVisionAttribute(): UByte? { + val ATTRIBUTE_ID: UInt = 26u + + 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) { "Nightvision attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UByte? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getUByte(AnonymousTag) + } else { + null + } + + return decodedValue + } + + suspend fun writeNightVisionAttribute(value: UByte, timedWriteTimeout: Duration? = null) { + val ATTRIBUTE_ID: UInt = 26u + + val tlvWriter = TlvWriter() + tlvWriter.put(AnonymousTag, value) + + val writeRequests: WriteRequests = + WriteRequests( + requests = + listOf( + WriteRequest( + attributePath = + AttributePath(endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID), + tlvPayload = tlvWriter.getEncoded(), + ) + ), + timedRequest = timedWriteTimeout, + ) + + val response: WriteResponse = controller.write(writeRequests) + + when (response) { + is WriteResponse.Success -> { + logger.log(Level.FINE, "Write command succeeded") + } + is WriteResponse.PartialWriteFailure -> { + val aggregatedErrorMessage = + response.failures.joinToString("\n") { failure -> + "Error at ${failure.attributePath}: ${failure.ex.message}" + } + + response.failures.forEach { failure -> + logger.log(Level.WARNING, "Error at ${failure.attributePath}: ${failure.ex.message}") + } + + throw IllegalStateException("Write command failed with errors: \n$aggregatedErrorMessage") + } + } + } + + suspend fun subscribeNightVisionAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 26u + 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) { "Nightvision attribute not found in Node State update" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UByte? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getUByte(AnonymousTag) + } else { + null + } + + decodedValue?.let { emit(UByteSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(UByteSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readNightVisionIllumAttribute(): UByte? { + val ATTRIBUTE_ID: UInt = 27u + + 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) { "Nightvisionillum attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UByte? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getUByte(AnonymousTag) + } else { + null + } + + return decodedValue + } + + suspend fun writeNightVisionIllumAttribute(value: UByte, timedWriteTimeout: Duration? = null) { + val ATTRIBUTE_ID: UInt = 27u + + val tlvWriter = TlvWriter() + tlvWriter.put(AnonymousTag, value) + + val writeRequests: WriteRequests = + WriteRequests( + requests = + listOf( + WriteRequest( + attributePath = + AttributePath(endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID), + tlvPayload = tlvWriter.getEncoded(), + ) + ), + timedRequest = timedWriteTimeout, + ) + + val response: WriteResponse = controller.write(writeRequests) + + when (response) { + is WriteResponse.Success -> { + logger.log(Level.FINE, "Write command succeeded") + } + is WriteResponse.PartialWriteFailure -> { + val aggregatedErrorMessage = + response.failures.joinToString("\n") { failure -> + "Error at ${failure.attributePath}: ${failure.ex.message}" + } + + response.failures.forEach { failure -> + logger.log(Level.WARNING, "Error at ${failure.attributePath}: ${failure.ex.message}") + } + + throw IllegalStateException("Write command failed with errors: \n$aggregatedErrorMessage") + } + } + } + + suspend fun subscribeNightVisionIllumAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 27u + 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) { + "Nightvisionillum attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UByte? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getUByte(AnonymousTag) + } else { + null + } + + decodedValue?.let { emit(UByteSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(UByteSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readAwbAttribute(): Boolean? { + val ATTRIBUTE_ID: UInt = 28u + + 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) { "Awb attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: Boolean? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getBoolean(AnonymousTag) + } else { + null + } + + return decodedValue + } + + suspend fun writeAwbAttribute(value: Boolean, timedWriteTimeout: Duration? = null) { + val ATTRIBUTE_ID: UInt = 28u + + val tlvWriter = TlvWriter() + tlvWriter.put(AnonymousTag, value) + + val writeRequests: WriteRequests = + WriteRequests( + requests = + listOf( + WriteRequest( + attributePath = + AttributePath(endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID), + tlvPayload = tlvWriter.getEncoded(), + ) + ), + timedRequest = timedWriteTimeout, + ) + + val response: WriteResponse = controller.write(writeRequests) + + when (response) { + is WriteResponse.Success -> { + logger.log(Level.FINE, "Write command succeeded") + } + is WriteResponse.PartialWriteFailure -> { + val aggregatedErrorMessage = + response.failures.joinToString("\n") { failure -> + "Error at ${failure.attributePath}: ${failure.ex.message}" + } + + response.failures.forEach { failure -> + logger.log(Level.WARNING, "Error at ${failure.attributePath}: ${failure.ex.message}") + } + + throw IllegalStateException("Write command failed with errors: \n$aggregatedErrorMessage") + } + } + } + + suspend fun subscribeAwbAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 28u + 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( + BooleanSubscriptionState.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) { "Awb attribute not found in Node State update" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: Boolean? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getBoolean(AnonymousTag) + } else { + null + } + + decodedValue?.let { emit(BooleanSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(BooleanSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readShutterSpeedAttribute(): Boolean? { + val ATTRIBUTE_ID: UInt = 29u + + 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) { "Shutterspeed attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: Boolean? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getBoolean(AnonymousTag) + } else { + null + } + + return decodedValue + } + + suspend fun writeShutterSpeedAttribute(value: Boolean, timedWriteTimeout: Duration? = null) { + val ATTRIBUTE_ID: UInt = 29u + + val tlvWriter = TlvWriter() + tlvWriter.put(AnonymousTag, value) + + val writeRequests: WriteRequests = + WriteRequests( + requests = + listOf( + WriteRequest( + attributePath = + AttributePath(endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID), + tlvPayload = tlvWriter.getEncoded(), + ) + ), + timedRequest = timedWriteTimeout, + ) + + val response: WriteResponse = controller.write(writeRequests) + + when (response) { + is WriteResponse.Success -> { + logger.log(Level.FINE, "Write command succeeded") + } + is WriteResponse.PartialWriteFailure -> { + val aggregatedErrorMessage = + response.failures.joinToString("\n") { failure -> + "Error at ${failure.attributePath}: ${failure.ex.message}" + } + + response.failures.forEach { failure -> + logger.log(Level.WARNING, "Error at ${failure.attributePath}: ${failure.ex.message}") + } + + throw IllegalStateException("Write command failed with errors: \n$aggregatedErrorMessage") + } + } + } + + suspend fun subscribeShutterSpeedAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 29u + 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( + BooleanSubscriptionState.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) { "Shutterspeed attribute not found in Node State update" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: Boolean? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getBoolean(AnonymousTag) + } else { + null + } + + decodedValue?.let { emit(BooleanSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(BooleanSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readIsoAttribute(): Boolean? { + val ATTRIBUTE_ID: UInt = 30u + + 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) { "Iso attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: Boolean? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getBoolean(AnonymousTag) + } else { + null + } + + return decodedValue + } + + suspend fun writeIsoAttribute(value: Boolean, timedWriteTimeout: Duration? = null) { + val ATTRIBUTE_ID: UInt = 30u + + val tlvWriter = TlvWriter() + tlvWriter.put(AnonymousTag, value) + + val writeRequests: WriteRequests = + WriteRequests( + requests = + listOf( + WriteRequest( + attributePath = + AttributePath(endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID), + tlvPayload = tlvWriter.getEncoded(), + ) + ), + timedRequest = timedWriteTimeout, + ) + + val response: WriteResponse = controller.write(writeRequests) + + when (response) { + is WriteResponse.Success -> { + logger.log(Level.FINE, "Write command succeeded") + } + is WriteResponse.PartialWriteFailure -> { + val aggregatedErrorMessage = + response.failures.joinToString("\n") { failure -> + "Error at ${failure.attributePath}: ${failure.ex.message}" + } + + response.failures.forEach { failure -> + logger.log(Level.WARNING, "Error at ${failure.attributePath}: ${failure.ex.message}") + } + + throw IllegalStateException("Write command failed with errors: \n$aggregatedErrorMessage") + } + } + } + + suspend fun subscribeIsoAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 30u + 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( + BooleanSubscriptionState.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) { "Iso attribute not found in Node State update" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: Boolean? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getBoolean(AnonymousTag) + } else { + null + } + + decodedValue?.let { emit(BooleanSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(BooleanSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readViewportAttribute(): ViewportAttribute { + val ATTRIBUTE_ID: UInt = 31u + + 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) { "Viewport attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: CameraAvStreamManagementClusterViewportStruct? = + if (tlvReader.isNextTag(AnonymousTag)) { + CameraAvStreamManagementClusterViewportStruct.fromTlv(AnonymousTag, tlvReader) + } else { + null + } + + return ViewportAttribute(decodedValue) + } + + suspend fun subscribeViewportAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 31u + 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( + ViewportAttributeSubscriptionState.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) { "Viewport attribute not found in Node State update" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: CameraAvStreamManagementClusterViewportStruct? = + if (tlvReader.isNextTag(AnonymousTag)) { + CameraAvStreamManagementClusterViewportStruct.fromTlv(AnonymousTag, tlvReader) + } else { + null + } + + decodedValue?.let { emit(ViewportAttributeSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(ViewportAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readSpeakerEnabledAttribute(): Boolean? { + val ATTRIBUTE_ID: UInt = 32u + + 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) { "Speakerenabled attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: Boolean? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getBoolean(AnonymousTag) + } else { + null + } + + return decodedValue + } + + suspend fun writeSpeakerEnabledAttribute(value: Boolean, timedWriteTimeout: Duration? = null) { + val ATTRIBUTE_ID: UInt = 32u + + val tlvWriter = TlvWriter() + tlvWriter.put(AnonymousTag, value) + + val writeRequests: WriteRequests = + WriteRequests( + requests = + listOf( + WriteRequest( + attributePath = + AttributePath(endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID), + tlvPayload = tlvWriter.getEncoded(), + ) + ), + timedRequest = timedWriteTimeout, + ) + + val response: WriteResponse = controller.write(writeRequests) + + when (response) { + is WriteResponse.Success -> { + logger.log(Level.FINE, "Write command succeeded") + } + is WriteResponse.PartialWriteFailure -> { + val aggregatedErrorMessage = + response.failures.joinToString("\n") { failure -> + "Error at ${failure.attributePath}: ${failure.ex.message}" + } + + response.failures.forEach { failure -> + logger.log(Level.WARNING, "Error at ${failure.attributePath}: ${failure.ex.message}") + } + + throw IllegalStateException("Write command failed with errors: \n$aggregatedErrorMessage") + } + } + } + + suspend fun subscribeSpeakerEnabledAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 32u + 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( + BooleanSubscriptionState.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) { + "Speakerenabled attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: Boolean? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getBoolean(AnonymousTag) + } else { + null + } + + decodedValue?.let { emit(BooleanSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(BooleanSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readSpeakerVolumeLevelAttribute(): UByte? { + val ATTRIBUTE_ID: UInt = 33u + + 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) { "Speakervolumelevel attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UByte? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getUByte(AnonymousTag) + } else { + null + } + + return decodedValue + } + + suspend fun writeSpeakerVolumeLevelAttribute(value: UByte, timedWriteTimeout: Duration? = null) { + val ATTRIBUTE_ID: UInt = 33u + + val tlvWriter = TlvWriter() + tlvWriter.put(AnonymousTag, value) + + val writeRequests: WriteRequests = + WriteRequests( + requests = + listOf( + WriteRequest( + attributePath = + AttributePath(endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID), + tlvPayload = tlvWriter.getEncoded(), + ) + ), + timedRequest = timedWriteTimeout, + ) + + val response: WriteResponse = controller.write(writeRequests) + + when (response) { + is WriteResponse.Success -> { + logger.log(Level.FINE, "Write command succeeded") + } + is WriteResponse.PartialWriteFailure -> { + val aggregatedErrorMessage = + response.failures.joinToString("\n") { failure -> + "Error at ${failure.attributePath}: ${failure.ex.message}" + } + + response.failures.forEach { failure -> + logger.log(Level.WARNING, "Error at ${failure.attributePath}: ${failure.ex.message}") + } + + throw IllegalStateException("Write command failed with errors: \n$aggregatedErrorMessage") + } + } + } + + suspend fun subscribeSpeakerVolumeLevelAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 33u + 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) { + "Speakervolumelevel attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UByte? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getUByte(AnonymousTag) + } else { + null + } + + decodedValue?.let { emit(UByteSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(UByteSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readSpeakerMaxLevelAttribute(): UByte? { + val ATTRIBUTE_ID: UInt = 34u + + 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) { "Speakermaxlevel attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UByte? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getUByte(AnonymousTag) + } else { + null + } + + return decodedValue + } + + suspend fun writeSpeakerMaxLevelAttribute(value: UByte, timedWriteTimeout: Duration? = null) { + val ATTRIBUTE_ID: UInt = 34u + + val tlvWriter = TlvWriter() + tlvWriter.put(AnonymousTag, value) + + val writeRequests: WriteRequests = + WriteRequests( + requests = + listOf( + WriteRequest( + attributePath = + AttributePath(endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID), + tlvPayload = tlvWriter.getEncoded(), + ) + ), + timedRequest = timedWriteTimeout, + ) + + val response: WriteResponse = controller.write(writeRequests) + + when (response) { + is WriteResponse.Success -> { + logger.log(Level.FINE, "Write command succeeded") + } + is WriteResponse.PartialWriteFailure -> { + val aggregatedErrorMessage = + response.failures.joinToString("\n") { failure -> + "Error at ${failure.attributePath}: ${failure.ex.message}" + } + + response.failures.forEach { failure -> + logger.log(Level.WARNING, "Error at ${failure.attributePath}: ${failure.ex.message}") + } + + throw IllegalStateException("Write command failed with errors: \n$aggregatedErrorMessage") + } + } + } + + suspend fun subscribeSpeakerMaxLevelAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 34u + 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) { + "Speakermaxlevel attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UByte? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getUByte(AnonymousTag) + } else { + null + } + + decodedValue?.let { emit(UByteSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(UByteSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readSpeakerMinLevelAttribute(): UByte? { + val ATTRIBUTE_ID: UInt = 35u + + 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) { "Speakerminlevel attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UByte? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getUByte(AnonymousTag) + } else { + null + } + + return decodedValue + } + + suspend fun writeSpeakerMinLevelAttribute(value: UByte, timedWriteTimeout: Duration? = null) { + val ATTRIBUTE_ID: UInt = 35u + + val tlvWriter = TlvWriter() + tlvWriter.put(AnonymousTag, value) + + val writeRequests: WriteRequests = + WriteRequests( + requests = + listOf( + WriteRequest( + attributePath = + AttributePath(endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID), + tlvPayload = tlvWriter.getEncoded(), + ) + ), + timedRequest = timedWriteTimeout, + ) + + val response: WriteResponse = controller.write(writeRequests) + + when (response) { + is WriteResponse.Success -> { + logger.log(Level.FINE, "Write command succeeded") + } + is WriteResponse.PartialWriteFailure -> { + val aggregatedErrorMessage = + response.failures.joinToString("\n") { failure -> + "Error at ${failure.attributePath}: ${failure.ex.message}" + } + + response.failures.forEach { failure -> + logger.log(Level.WARNING, "Error at ${failure.attributePath}: ${failure.ex.message}") + } + + throw IllegalStateException("Write command failed with errors: \n$aggregatedErrorMessage") + } + } + } + + suspend fun subscribeSpeakerMinLevelAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 35u + 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) { + "Speakerminlevel attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UByte? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getUByte(AnonymousTag) + } else { + null + } + + decodedValue?.let { emit(UByteSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(UByteSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readMicStatusAttribute(): Boolean? { + val ATTRIBUTE_ID: UInt = 36u + + 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) { "Micstatus attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: Boolean? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getBoolean(AnonymousTag) + } else { + null + } + + return decodedValue + } + + suspend fun writeMicStatusAttribute(value: Boolean, timedWriteTimeout: Duration? = null) { + val ATTRIBUTE_ID: UInt = 36u + + val tlvWriter = TlvWriter() + tlvWriter.put(AnonymousTag, value) + + val writeRequests: WriteRequests = + WriteRequests( + requests = + listOf( + WriteRequest( + attributePath = + AttributePath(endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID), + tlvPayload = tlvWriter.getEncoded(), + ) + ), + timedRequest = timedWriteTimeout, + ) + + val response: WriteResponse = controller.write(writeRequests) + + when (response) { + is WriteResponse.Success -> { + logger.log(Level.FINE, "Write command succeeded") + } + is WriteResponse.PartialWriteFailure -> { + val aggregatedErrorMessage = + response.failures.joinToString("\n") { failure -> + "Error at ${failure.attributePath}: ${failure.ex.message}" + } + + response.failures.forEach { failure -> + logger.log(Level.WARNING, "Error at ${failure.attributePath}: ${failure.ex.message}") + } + + throw IllegalStateException("Write command failed with errors: \n$aggregatedErrorMessage") + } + } + } + + suspend fun subscribeMicStatusAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 36u + 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( + BooleanSubscriptionState.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) { "Micstatus attribute not found in Node State update" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: Boolean? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getBoolean(AnonymousTag) + } else { + null + } + + decodedValue?.let { emit(BooleanSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(BooleanSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readMicVolumeLevelAttribute(): UByte? { + val ATTRIBUTE_ID: UInt = 37u + + 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) { "Micvolumelevel attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UByte? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getUByte(AnonymousTag) + } else { + null + } + + return decodedValue + } + + suspend fun writeMicVolumeLevelAttribute(value: UByte, timedWriteTimeout: Duration? = null) { + val ATTRIBUTE_ID: UInt = 37u + + val tlvWriter = TlvWriter() + tlvWriter.put(AnonymousTag, value) + + val writeRequests: WriteRequests = + WriteRequests( + requests = + listOf( + WriteRequest( + attributePath = + AttributePath(endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID), + tlvPayload = tlvWriter.getEncoded(), + ) + ), + timedRequest = timedWriteTimeout, + ) + + val response: WriteResponse = controller.write(writeRequests) + + when (response) { + is WriteResponse.Success -> { + logger.log(Level.FINE, "Write command succeeded") + } + is WriteResponse.PartialWriteFailure -> { + val aggregatedErrorMessage = + response.failures.joinToString("\n") { failure -> + "Error at ${failure.attributePath}: ${failure.ex.message}" + } + + response.failures.forEach { failure -> + logger.log(Level.WARNING, "Error at ${failure.attributePath}: ${failure.ex.message}") + } + + throw IllegalStateException("Write command failed with errors: \n$aggregatedErrorMessage") + } + } + } + + suspend fun subscribeMicVolumeLevelAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 37u + 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) { + "Micvolumelevel attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UByte? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getUByte(AnonymousTag) + } else { + null + } + + decodedValue?.let { emit(UByteSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(UByteSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readMicMaxLevelAttribute(): UByte? { + val ATTRIBUTE_ID: UInt = 38u + + 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) { "Micmaxlevel attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UByte? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getUByte(AnonymousTag) + } else { + null + } + + return decodedValue + } + + suspend fun writeMicMaxLevelAttribute(value: UByte, timedWriteTimeout: Duration? = null) { + val ATTRIBUTE_ID: UInt = 38u + + val tlvWriter = TlvWriter() + tlvWriter.put(AnonymousTag, value) + + val writeRequests: WriteRequests = + WriteRequests( + requests = + listOf( + WriteRequest( + attributePath = + AttributePath(endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID), + tlvPayload = tlvWriter.getEncoded(), + ) + ), + timedRequest = timedWriteTimeout, + ) + + val response: WriteResponse = controller.write(writeRequests) + + when (response) { + is WriteResponse.Success -> { + logger.log(Level.FINE, "Write command succeeded") + } + is WriteResponse.PartialWriteFailure -> { + val aggregatedErrorMessage = + response.failures.joinToString("\n") { failure -> + "Error at ${failure.attributePath}: ${failure.ex.message}" + } + + response.failures.forEach { failure -> + logger.log(Level.WARNING, "Error at ${failure.attributePath}: ${failure.ex.message}") + } + + throw IllegalStateException("Write command failed with errors: \n$aggregatedErrorMessage") + } + } + } + + suspend fun subscribeMicMaxLevelAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 38u + 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) { "Micmaxlevel attribute not found in Node State update" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UByte? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getUByte(AnonymousTag) + } else { + null + } + + decodedValue?.let { emit(UByteSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(UByteSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readMicMinLevelAttribute(): UByte? { + val ATTRIBUTE_ID: UInt = 39u + + 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) { "Micminlevel attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UByte? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getUByte(AnonymousTag) + } else { + null + } + + return decodedValue + } + + suspend fun writeMicMinLevelAttribute(value: UByte, timedWriteTimeout: Duration? = null) { + val ATTRIBUTE_ID: UInt = 39u + + val tlvWriter = TlvWriter() + tlvWriter.put(AnonymousTag, value) + + val writeRequests: WriteRequests = + WriteRequests( + requests = + listOf( + WriteRequest( + attributePath = + AttributePath(endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID), + tlvPayload = tlvWriter.getEncoded(), + ) + ), + timedRequest = timedWriteTimeout, + ) + + val response: WriteResponse = controller.write(writeRequests) + + when (response) { + is WriteResponse.Success -> { + logger.log(Level.FINE, "Write command succeeded") + } + is WriteResponse.PartialWriteFailure -> { + val aggregatedErrorMessage = + response.failures.joinToString("\n") { failure -> + "Error at ${failure.attributePath}: ${failure.ex.message}" + } + + response.failures.forEach { failure -> + logger.log(Level.WARNING, "Error at ${failure.attributePath}: ${failure.ex.message}") + } + + throw IllegalStateException("Write command failed with errors: \n$aggregatedErrorMessage") + } + } + } + + suspend fun subscribeMicMinLevelAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 39u + 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) { "Micminlevel attribute not found in Node State update" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UByte? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getUByte(AnonymousTag) + } else { + null + } + + decodedValue?.let { emit(UByteSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(UByteSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readMicAGCEnabledAttribute(): Boolean? { + val ATTRIBUTE_ID: UInt = 40u + + 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) { "Micagcenabled attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: Boolean? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getBoolean(AnonymousTag) + } else { + null + } + + return decodedValue + } + + suspend fun writeMicAGCEnabledAttribute(value: Boolean, timedWriteTimeout: Duration? = null) { + val ATTRIBUTE_ID: UInt = 40u + + val tlvWriter = TlvWriter() + tlvWriter.put(AnonymousTag, value) + + val writeRequests: WriteRequests = + WriteRequests( + requests = + listOf( + WriteRequest( + attributePath = + AttributePath(endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID), + tlvPayload = tlvWriter.getEncoded(), + ) + ), + timedRequest = timedWriteTimeout, + ) + + val response: WriteResponse = controller.write(writeRequests) + + when (response) { + is WriteResponse.Success -> { + logger.log(Level.FINE, "Write command succeeded") + } + is WriteResponse.PartialWriteFailure -> { + val aggregatedErrorMessage = + response.failures.joinToString("\n") { failure -> + "Error at ${failure.attributePath}: ${failure.ex.message}" + } + + response.failures.forEach { failure -> + logger.log(Level.WARNING, "Error at ${failure.attributePath}: ${failure.ex.message}") + } + + throw IllegalStateException("Write command failed with errors: \n$aggregatedErrorMessage") + } + } + } + + suspend fun subscribeMicAGCEnabledAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 40u + 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( + BooleanSubscriptionState.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) { "Micagcenabled attribute not found in Node State update" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: Boolean? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getBoolean(AnonymousTag) + } else { + null + } + + decodedValue?.let { emit(BooleanSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(BooleanSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readImageRotationAttribute(): UShort? { + val ATTRIBUTE_ID: UInt = 41u + + 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) { "Imagerotation attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UShort? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getUShort(AnonymousTag) + } else { + null + } + + return decodedValue + } + + suspend fun subscribeImageRotationAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 41u + 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) { "Imagerotation attribute not found in Node State update" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UShort? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getUShort(AnonymousTag) + } else { + null + } + + decodedValue?.let { emit(UShortSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(UShortSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readImageFlipHorizontalAttribute(): Boolean? { + val ATTRIBUTE_ID: UInt = 42u + + 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) { "Imagefliphorizontal attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: Boolean? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getBoolean(AnonymousTag) + } else { + null + } + + return decodedValue + } + + suspend fun subscribeImageFlipHorizontalAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 42u + 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( + BooleanSubscriptionState.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) { + "Imagefliphorizontal attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: Boolean? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getBoolean(AnonymousTag) + } else { + null + } + + decodedValue?.let { emit(BooleanSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(BooleanSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readImageFlipVerticalAttribute(): Boolean? { + val ATTRIBUTE_ID: UInt = 43u + + 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) { "Imageflipvertical attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: Boolean? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getBoolean(AnonymousTag) + } else { + null + } + + return decodedValue + } + + suspend fun subscribeImageFlipVerticalAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 43u + 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( + BooleanSubscriptionState.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) { + "Imageflipvertical attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: Boolean? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getBoolean(AnonymousTag) + } else { + null + } + + decodedValue?.let { emit(BooleanSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(BooleanSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readLocalVideoRecordingEnabledAttribute(): Boolean? { + val ATTRIBUTE_ID: UInt = 44u + + 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) { "Localvideorecordingenabled attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: Boolean? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getBoolean(AnonymousTag) + } else { + null + } + + return decodedValue + } + + suspend fun writeLocalVideoRecordingEnabledAttribute( + value: Boolean, + timedWriteTimeout: Duration? = null, + ) { + val ATTRIBUTE_ID: UInt = 44u + + val tlvWriter = TlvWriter() + tlvWriter.put(AnonymousTag, value) + + val writeRequests: WriteRequests = + WriteRequests( + requests = + listOf( + WriteRequest( + attributePath = + AttributePath(endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID), + tlvPayload = tlvWriter.getEncoded(), + ) + ), + timedRequest = timedWriteTimeout, + ) + + val response: WriteResponse = controller.write(writeRequests) + + when (response) { + is WriteResponse.Success -> { + logger.log(Level.FINE, "Write command succeeded") + } + is WriteResponse.PartialWriteFailure -> { + val aggregatedErrorMessage = + response.failures.joinToString("\n") { failure -> + "Error at ${failure.attributePath}: ${failure.ex.message}" + } + + response.failures.forEach { failure -> + logger.log(Level.WARNING, "Error at ${failure.attributePath}: ${failure.ex.message}") + } + + throw IllegalStateException("Write command failed with errors: \n$aggregatedErrorMessage") + } + } + } + + suspend fun subscribeLocalVideoRecordingEnabledAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 44u + 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( + BooleanSubscriptionState.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) { + "Localvideorecordingenabled attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: Boolean? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getBoolean(AnonymousTag) + } else { + null + } + + decodedValue?.let { emit(BooleanSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(BooleanSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readLocalSnapshotRecordingEnabledAttribute(): Boolean? { + val ATTRIBUTE_ID: UInt = 45u + + 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) { + "Localsnapshotrecordingenabled attribute not found in response" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: Boolean? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getBoolean(AnonymousTag) + } else { + null + } + + return decodedValue + } + + suspend fun writeLocalSnapshotRecordingEnabledAttribute( + value: Boolean, + timedWriteTimeout: Duration? = null, + ) { + val ATTRIBUTE_ID: UInt = 45u + + val tlvWriter = TlvWriter() + tlvWriter.put(AnonymousTag, value) + + val writeRequests: WriteRequests = + WriteRequests( + requests = + listOf( + WriteRequest( + attributePath = + AttributePath(endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID), + tlvPayload = tlvWriter.getEncoded(), + ) + ), + timedRequest = timedWriteTimeout, + ) + + val response: WriteResponse = controller.write(writeRequests) + + when (response) { + is WriteResponse.Success -> { + logger.log(Level.FINE, "Write command succeeded") + } + is WriteResponse.PartialWriteFailure -> { + val aggregatedErrorMessage = + response.failures.joinToString("\n") { failure -> + "Error at ${failure.attributePath}: ${failure.ex.message}" + } + + response.failures.forEach { failure -> + logger.log(Level.WARNING, "Error at ${failure.attributePath}: ${failure.ex.message}") + } + + throw IllegalStateException("Write command failed with errors: \n$aggregatedErrorMessage") + } + } + } + + suspend fun subscribeLocalSnapshotRecordingEnabledAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 45u + 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( + BooleanSubscriptionState.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) { + "Localsnapshotrecordingenabled attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: Boolean? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getBoolean(AnonymousTag) + } else { + null + } + + decodedValue?.let { emit(BooleanSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(BooleanSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readStatusLightAttribute(): Boolean? { + val ATTRIBUTE_ID: UInt = 46u + + 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) { "Statuslight attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: Boolean? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getBoolean(AnonymousTag) + } else { + null + } + + return decodedValue + } + + suspend fun writeStatusLightAttribute(value: Boolean, timedWriteTimeout: Duration? = null) { + val ATTRIBUTE_ID: UInt = 46u + + val tlvWriter = TlvWriter() + tlvWriter.put(AnonymousTag, value) + + val writeRequests: WriteRequests = + WriteRequests( + requests = + listOf( + WriteRequest( + attributePath = + AttributePath(endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID), + tlvPayload = tlvWriter.getEncoded(), + ) + ), + timedRequest = timedWriteTimeout, + ) + + val response: WriteResponse = controller.write(writeRequests) + + when (response) { + is WriteResponse.Success -> { + logger.log(Level.FINE, "Write command succeeded") + } + is WriteResponse.PartialWriteFailure -> { + val aggregatedErrorMessage = + response.failures.joinToString("\n") { failure -> + "Error at ${failure.attributePath}: ${failure.ex.message}" + } + + response.failures.forEach { failure -> + logger.log(Level.WARNING, "Error at ${failure.attributePath}: ${failure.ex.message}") + } + + throw IllegalStateException("Write command failed with errors: \n$aggregatedErrorMessage") + } + } + } + + suspend fun subscribeStatusLightAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 46u + 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( + BooleanSubscriptionState.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) { "Statuslight attribute not found in Node State update" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: Boolean? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getBoolean(AnonymousTag) + } else { + null + } + + decodedValue?.let { emit(BooleanSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(BooleanSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readStatusLightBrightnessAttribute(): UByte? { + val ATTRIBUTE_ID: UInt = 47u + + 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) { "Statuslightbrightness attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UByte? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getUByte(AnonymousTag) + } else { + null + } + + return decodedValue + } + + suspend fun writeStatusLightBrightnessAttribute( + value: UByte, + timedWriteTimeout: Duration? = null, + ) { + val ATTRIBUTE_ID: UInt = 47u + + val tlvWriter = TlvWriter() + tlvWriter.put(AnonymousTag, value) + + val writeRequests: WriteRequests = + WriteRequests( + requests = + listOf( + WriteRequest( + attributePath = + AttributePath(endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID), + tlvPayload = tlvWriter.getEncoded(), + ) + ), + timedRequest = timedWriteTimeout, + ) + + val response: WriteResponse = controller.write(writeRequests) + + when (response) { + is WriteResponse.Success -> { + logger.log(Level.FINE, "Write command succeeded") + } + is WriteResponse.PartialWriteFailure -> { + val aggregatedErrorMessage = + response.failures.joinToString("\n") { failure -> + "Error at ${failure.attributePath}: ${failure.ex.message}" + } + + response.failures.forEach { failure -> + logger.log(Level.WARNING, "Error at ${failure.attributePath}: ${failure.ex.message}") + } + + throw IllegalStateException("Write command failed with errors: \n$aggregatedErrorMessage") + } + } + } + + suspend fun subscribeStatusLightBrightnessAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 47u + 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) { + "Statuslightbrightness attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UByte? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getUByte(AnonymousTag) + } else { + null + } + + decodedValue?.let { emit(UByteSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(UByteSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readDepthSensorStatusAttribute(): UByte? { + val ATTRIBUTE_ID: UInt = 48u + + 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) { "Depthsensorstatus attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UByte? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getUByte(AnonymousTag) + } else { + null + } + + return decodedValue + } + + suspend fun writeDepthSensorStatusAttribute(value: UByte, timedWriteTimeout: Duration? = null) { + val ATTRIBUTE_ID: UInt = 48u + + val tlvWriter = TlvWriter() + tlvWriter.put(AnonymousTag, value) + + val writeRequests: WriteRequests = + WriteRequests( + requests = + listOf( + WriteRequest( + attributePath = + AttributePath(endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID), + tlvPayload = tlvWriter.getEncoded(), + ) + ), + timedRequest = timedWriteTimeout, + ) + + val response: WriteResponse = controller.write(writeRequests) + + when (response) { + is WriteResponse.Success -> { + logger.log(Level.FINE, "Write command succeeded") + } + is WriteResponse.PartialWriteFailure -> { + val aggregatedErrorMessage = + response.failures.joinToString("\n") { failure -> + "Error at ${failure.attributePath}: ${failure.ex.message}" + } + + response.failures.forEach { failure -> + logger.log(Level.WARNING, "Error at ${failure.attributePath}: ${failure.ex.message}") + } + + throw IllegalStateException("Write command failed with errors: \n$aggregatedErrorMessage") + } + } + } + + suspend fun subscribeDepthSensorStatusAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 48u + 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) { + "Depthsensorstatus attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UByte? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getUByte(AnonymousTag) + } else { + null + } + + decodedValue?.let { emit(UByteSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(UByteSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readWatermarkEnabledAttribute(): WatermarkEnabledAttribute { + val ATTRIBUTE_ID: UInt = 49u + + 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) { "Watermarkenabled attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List? = + if (tlvReader.isNextTag(AnonymousTag)) { + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(CameraAvStreamManagementClusterPerStreamStruct.fromTlv(AnonymousTag, tlvReader)) + } + tlvReader.exitContainer() + } + } else { + null + } + + return WatermarkEnabledAttribute(decodedValue) + } + + suspend fun subscribeWatermarkEnabledAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 49u + 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( + WatermarkEnabledAttributeSubscriptionState.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) { + "Watermarkenabled attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List? = + if (tlvReader.isNextTag(AnonymousTag)) { + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add( + CameraAvStreamManagementClusterPerStreamStruct.fromTlv(AnonymousTag, tlvReader) + ) + } + tlvReader.exitContainer() + } + } else { + null + } + + decodedValue?.let { emit(WatermarkEnabledAttributeSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(WatermarkEnabledAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readOSDEnabledAttribute(): OSDEnabledAttribute { + val ATTRIBUTE_ID: UInt = 50u + + 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) { "Osdenabled attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List? = + if (tlvReader.isNextTag(AnonymousTag)) { + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(CameraAvStreamManagementClusterPerStreamStruct.fromTlv(AnonymousTag, tlvReader)) + } + tlvReader.exitContainer() + } + } else { + null + } + + return OSDEnabledAttribute(decodedValue) + } + + suspend fun subscribeOSDEnabledAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 50u + 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( + OSDEnabledAttributeSubscriptionState.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) { "Osdenabled attribute not found in Node State update" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List? = + if (tlvReader.isNextTag(AnonymousTag)) { + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add( + CameraAvStreamManagementClusterPerStreamStruct.fromTlv(AnonymousTag, tlvReader) + ) + } + tlvReader.exitContainer() + } + } else { + null + } + + decodedValue?.let { emit(OSDEnabledAttributeSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(OSDEnabledAttributeSubscriptionState.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(CameraAvStreamManagementCluster::class.java.name) + const val CLUSTER_ID: UInt = 1361u + } +} diff --git a/src/controller/java/generated/java/matter/controller/cluster/eventstructs/CameraAvStreamManagementClusterAudioStreamChangedEvent.kt b/src/controller/java/generated/java/matter/controller/cluster/eventstructs/CameraAvStreamManagementClusterAudioStreamChangedEvent.kt new file mode 100644 index 00000000000000..c398f49796b595 --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/eventstructs/CameraAvStreamManagementClusterAudioStreamChangedEvent.kt @@ -0,0 +1,144 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package matter.controller.cluster.eventstructs + +import java.util.Optional +import matter.controller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class CameraAvStreamManagementClusterAudioStreamChangedEvent( + val audioStreamID: UShort, + val streamType: Optional, + val audioCodec: Optional, + val channelCount: Optional, + val sampleRate: Optional, + val bitRate: Optional, + val bitDepth: Optional, +) { + override fun toString(): String = buildString { + append("CameraAvStreamManagementClusterAudioStreamChangedEvent {\n") + append("\taudioStreamID : $audioStreamID\n") + append("\tstreamType : $streamType\n") + append("\taudioCodec : $audioCodec\n") + append("\tchannelCount : $channelCount\n") + append("\tsampleRate : $sampleRate\n") + append("\tbitRate : $bitRate\n") + append("\tbitDepth : $bitDepth\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_AUDIO_STREAM_ID), audioStreamID) + if (streamType.isPresent) { + val optstreamType = streamType.get() + put(ContextSpecificTag(TAG_STREAM_TYPE), optstreamType) + } + if (audioCodec.isPresent) { + val optaudioCodec = audioCodec.get() + put(ContextSpecificTag(TAG_AUDIO_CODEC), optaudioCodec) + } + if (channelCount.isPresent) { + val optchannelCount = channelCount.get() + put(ContextSpecificTag(TAG_CHANNEL_COUNT), optchannelCount) + } + if (sampleRate.isPresent) { + val optsampleRate = sampleRate.get() + put(ContextSpecificTag(TAG_SAMPLE_RATE), optsampleRate) + } + if (bitRate.isPresent) { + val optbitRate = bitRate.get() + put(ContextSpecificTag(TAG_BIT_RATE), optbitRate) + } + if (bitDepth.isPresent) { + val optbitDepth = bitDepth.get() + put(ContextSpecificTag(TAG_BIT_DEPTH), optbitDepth) + } + endStructure() + } + } + + companion object { + private const val TAG_AUDIO_STREAM_ID = 0 + private const val TAG_STREAM_TYPE = 1 + private const val TAG_AUDIO_CODEC = 2 + private const val TAG_CHANNEL_COUNT = 3 + private const val TAG_SAMPLE_RATE = 4 + private const val TAG_BIT_RATE = 5 + private const val TAG_BIT_DEPTH = 6 + + fun fromTlv( + tlvTag: Tag, + tlvReader: TlvReader, + ): CameraAvStreamManagementClusterAudioStreamChangedEvent { + tlvReader.enterStructure(tlvTag) + val audioStreamID = tlvReader.getUShort(ContextSpecificTag(TAG_AUDIO_STREAM_ID)) + val streamType = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_STREAM_TYPE))) { + Optional.of(tlvReader.getUByte(ContextSpecificTag(TAG_STREAM_TYPE))) + } else { + Optional.empty() + } + val audioCodec = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_AUDIO_CODEC))) { + Optional.of(tlvReader.getUByte(ContextSpecificTag(TAG_AUDIO_CODEC))) + } else { + Optional.empty() + } + val channelCount = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_CHANNEL_COUNT))) { + Optional.of(tlvReader.getUByte(ContextSpecificTag(TAG_CHANNEL_COUNT))) + } else { + Optional.empty() + } + val sampleRate = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_SAMPLE_RATE))) { + Optional.of(tlvReader.getUInt(ContextSpecificTag(TAG_SAMPLE_RATE))) + } else { + Optional.empty() + } + val bitRate = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_BIT_RATE))) { + Optional.of(tlvReader.getUInt(ContextSpecificTag(TAG_BIT_RATE))) + } else { + Optional.empty() + } + val bitDepth = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_BIT_DEPTH))) { + Optional.of(tlvReader.getUByte(ContextSpecificTag(TAG_BIT_DEPTH))) + } else { + Optional.empty() + } + + tlvReader.exitContainer() + + return CameraAvStreamManagementClusterAudioStreamChangedEvent( + audioStreamID, + streamType, + audioCodec, + channelCount, + sampleRate, + bitRate, + bitDepth, + ) + } + } +} diff --git a/src/controller/java/generated/java/matter/controller/cluster/eventstructs/CameraAvStreamManagementClusterSnapshotStreamChangedEvent.kt b/src/controller/java/generated/java/matter/controller/cluster/eventstructs/CameraAvStreamManagementClusterSnapshotStreamChangedEvent.kt new file mode 100644 index 00000000000000..074df191c914fd --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/eventstructs/CameraAvStreamManagementClusterSnapshotStreamChangedEvent.kt @@ -0,0 +1,156 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package matter.controller.cluster.eventstructs + +import java.util.Optional +import matter.controller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class CameraAvStreamManagementClusterSnapshotStreamChangedEvent( + val snapshotStreamID: UShort, + val imageCodec: Optional, + val frameRate: Optional, + val bitRate: Optional, + val minResolution: + Optional< + matter.controller.cluster.structs.CameraAvStreamManagementClusterVideoResolutionStruct + >, + val maxResolution: + Optional< + matter.controller.cluster.structs.CameraAvStreamManagementClusterVideoResolutionStruct + >, + val quality: Optional, +) { + override fun toString(): String = buildString { + append("CameraAvStreamManagementClusterSnapshotStreamChangedEvent {\n") + append("\tsnapshotStreamID : $snapshotStreamID\n") + append("\timageCodec : $imageCodec\n") + append("\tframeRate : $frameRate\n") + append("\tbitRate : $bitRate\n") + append("\tminResolution : $minResolution\n") + append("\tmaxResolution : $maxResolution\n") + append("\tquality : $quality\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_SNAPSHOT_STREAM_ID), snapshotStreamID) + if (imageCodec.isPresent) { + val optimageCodec = imageCodec.get() + put(ContextSpecificTag(TAG_IMAGE_CODEC), optimageCodec) + } + if (frameRate.isPresent) { + val optframeRate = frameRate.get() + put(ContextSpecificTag(TAG_FRAME_RATE), optframeRate) + } + if (bitRate.isPresent) { + val optbitRate = bitRate.get() + put(ContextSpecificTag(TAG_BIT_RATE), optbitRate) + } + if (minResolution.isPresent) { + val optminResolution = minResolution.get() + optminResolution.toTlv(ContextSpecificTag(TAG_MIN_RESOLUTION), this) + } + if (maxResolution.isPresent) { + val optmaxResolution = maxResolution.get() + optmaxResolution.toTlv(ContextSpecificTag(TAG_MAX_RESOLUTION), this) + } + if (quality.isPresent) { + val optquality = quality.get() + put(ContextSpecificTag(TAG_QUALITY), optquality) + } + endStructure() + } + } + + companion object { + private const val TAG_SNAPSHOT_STREAM_ID = 0 + private const val TAG_IMAGE_CODEC = 1 + private const val TAG_FRAME_RATE = 2 + private const val TAG_BIT_RATE = 3 + private const val TAG_MIN_RESOLUTION = 4 + private const val TAG_MAX_RESOLUTION = 5 + private const val TAG_QUALITY = 6 + + fun fromTlv( + tlvTag: Tag, + tlvReader: TlvReader, + ): CameraAvStreamManagementClusterSnapshotStreamChangedEvent { + tlvReader.enterStructure(tlvTag) + val snapshotStreamID = tlvReader.getUShort(ContextSpecificTag(TAG_SNAPSHOT_STREAM_ID)) + val imageCodec = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_IMAGE_CODEC))) { + Optional.of(tlvReader.getUByte(ContextSpecificTag(TAG_IMAGE_CODEC))) + } else { + Optional.empty() + } + val frameRate = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_FRAME_RATE))) { + Optional.of(tlvReader.getUShort(ContextSpecificTag(TAG_FRAME_RATE))) + } else { + Optional.empty() + } + val bitRate = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_BIT_RATE))) { + Optional.of(tlvReader.getUInt(ContextSpecificTag(TAG_BIT_RATE))) + } else { + Optional.empty() + } + val minResolution = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_MIN_RESOLUTION))) { + Optional.of( + matter.controller.cluster.structs.CameraAvStreamManagementClusterVideoResolutionStruct + .fromTlv(ContextSpecificTag(TAG_MIN_RESOLUTION), tlvReader) + ) + } else { + Optional.empty() + } + val maxResolution = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_MAX_RESOLUTION))) { + Optional.of( + matter.controller.cluster.structs.CameraAvStreamManagementClusterVideoResolutionStruct + .fromTlv(ContextSpecificTag(TAG_MAX_RESOLUTION), tlvReader) + ) + } else { + Optional.empty() + } + val quality = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_QUALITY))) { + Optional.of(tlvReader.getUByte(ContextSpecificTag(TAG_QUALITY))) + } else { + Optional.empty() + } + + tlvReader.exitContainer() + + return CameraAvStreamManagementClusterSnapshotStreamChangedEvent( + snapshotStreamID, + imageCodec, + frameRate, + bitRate, + minResolution, + maxResolution, + quality, + ) + } + } +} diff --git a/src/controller/java/generated/java/matter/controller/cluster/eventstructs/CameraAvStreamManagementClusterVideoStreamChangedEvent.kt b/src/controller/java/generated/java/matter/controller/cluster/eventstructs/CameraAvStreamManagementClusterVideoStreamChangedEvent.kt new file mode 100644 index 00000000000000..584a66713d3620 --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/eventstructs/CameraAvStreamManagementClusterVideoStreamChangedEvent.kt @@ -0,0 +1,212 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package matter.controller.cluster.eventstructs + +import java.util.Optional +import matter.controller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class CameraAvStreamManagementClusterVideoStreamChangedEvent( + val videoStreamID: UShort, + val streamType: Optional, + val videoCodec: Optional, + val minFrameRate: Optional, + val maxFrameRate: Optional, + val minResolution: + Optional< + matter.controller.cluster.structs.CameraAvStreamManagementClusterVideoResolutionStruct + >, + val maxResolution: + Optional< + matter.controller.cluster.structs.CameraAvStreamManagementClusterVideoResolutionStruct + >, + val minBitRate: Optional, + val maxBitRate: Optional, + val minFragmentLen: Optional, + val maxFragmentLen: Optional, +) { + override fun toString(): String = buildString { + append("CameraAvStreamManagementClusterVideoStreamChangedEvent {\n") + append("\tvideoStreamID : $videoStreamID\n") + append("\tstreamType : $streamType\n") + append("\tvideoCodec : $videoCodec\n") + append("\tminFrameRate : $minFrameRate\n") + append("\tmaxFrameRate : $maxFrameRate\n") + append("\tminResolution : $minResolution\n") + append("\tmaxResolution : $maxResolution\n") + append("\tminBitRate : $minBitRate\n") + append("\tmaxBitRate : $maxBitRate\n") + append("\tminFragmentLen : $minFragmentLen\n") + append("\tmaxFragmentLen : $maxFragmentLen\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_VIDEO_STREAM_ID), videoStreamID) + if (streamType.isPresent) { + val optstreamType = streamType.get() + put(ContextSpecificTag(TAG_STREAM_TYPE), optstreamType) + } + if (videoCodec.isPresent) { + val optvideoCodec = videoCodec.get() + put(ContextSpecificTag(TAG_VIDEO_CODEC), optvideoCodec) + } + if (minFrameRate.isPresent) { + val optminFrameRate = minFrameRate.get() + put(ContextSpecificTag(TAG_MIN_FRAME_RATE), optminFrameRate) + } + if (maxFrameRate.isPresent) { + val optmaxFrameRate = maxFrameRate.get() + put(ContextSpecificTag(TAG_MAX_FRAME_RATE), optmaxFrameRate) + } + if (minResolution.isPresent) { + val optminResolution = minResolution.get() + optminResolution.toTlv(ContextSpecificTag(TAG_MIN_RESOLUTION), this) + } + if (maxResolution.isPresent) { + val optmaxResolution = maxResolution.get() + optmaxResolution.toTlv(ContextSpecificTag(TAG_MAX_RESOLUTION), this) + } + if (minBitRate.isPresent) { + val optminBitRate = minBitRate.get() + put(ContextSpecificTag(TAG_MIN_BIT_RATE), optminBitRate) + } + if (maxBitRate.isPresent) { + val optmaxBitRate = maxBitRate.get() + put(ContextSpecificTag(TAG_MAX_BIT_RATE), optmaxBitRate) + } + if (minFragmentLen.isPresent) { + val optminFragmentLen = minFragmentLen.get() + put(ContextSpecificTag(TAG_MIN_FRAGMENT_LEN), optminFragmentLen) + } + if (maxFragmentLen.isPresent) { + val optmaxFragmentLen = maxFragmentLen.get() + put(ContextSpecificTag(TAG_MAX_FRAGMENT_LEN), optmaxFragmentLen) + } + endStructure() + } + } + + companion object { + private const val TAG_VIDEO_STREAM_ID = 0 + private const val TAG_STREAM_TYPE = 1 + private const val TAG_VIDEO_CODEC = 2 + private const val TAG_MIN_FRAME_RATE = 3 + private const val TAG_MAX_FRAME_RATE = 4 + private const val TAG_MIN_RESOLUTION = 5 + private const val TAG_MAX_RESOLUTION = 6 + private const val TAG_MIN_BIT_RATE = 7 + private const val TAG_MAX_BIT_RATE = 8 + private const val TAG_MIN_FRAGMENT_LEN = 9 + private const val TAG_MAX_FRAGMENT_LEN = 10 + + fun fromTlv( + tlvTag: Tag, + tlvReader: TlvReader, + ): CameraAvStreamManagementClusterVideoStreamChangedEvent { + tlvReader.enterStructure(tlvTag) + val videoStreamID = tlvReader.getUShort(ContextSpecificTag(TAG_VIDEO_STREAM_ID)) + val streamType = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_STREAM_TYPE))) { + Optional.of(tlvReader.getUByte(ContextSpecificTag(TAG_STREAM_TYPE))) + } else { + Optional.empty() + } + val videoCodec = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_VIDEO_CODEC))) { + Optional.of(tlvReader.getUByte(ContextSpecificTag(TAG_VIDEO_CODEC))) + } else { + Optional.empty() + } + val minFrameRate = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_MIN_FRAME_RATE))) { + Optional.of(tlvReader.getUShort(ContextSpecificTag(TAG_MIN_FRAME_RATE))) + } else { + Optional.empty() + } + val maxFrameRate = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_MAX_FRAME_RATE))) { + Optional.of(tlvReader.getUShort(ContextSpecificTag(TAG_MAX_FRAME_RATE))) + } else { + Optional.empty() + } + val minResolution = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_MIN_RESOLUTION))) { + Optional.of( + matter.controller.cluster.structs.CameraAvStreamManagementClusterVideoResolutionStruct + .fromTlv(ContextSpecificTag(TAG_MIN_RESOLUTION), tlvReader) + ) + } else { + Optional.empty() + } + val maxResolution = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_MAX_RESOLUTION))) { + Optional.of( + matter.controller.cluster.structs.CameraAvStreamManagementClusterVideoResolutionStruct + .fromTlv(ContextSpecificTag(TAG_MAX_RESOLUTION), tlvReader) + ) + } else { + Optional.empty() + } + val minBitRate = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_MIN_BIT_RATE))) { + Optional.of(tlvReader.getUShort(ContextSpecificTag(TAG_MIN_BIT_RATE))) + } else { + Optional.empty() + } + val maxBitRate = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_MAX_BIT_RATE))) { + Optional.of(tlvReader.getUShort(ContextSpecificTag(TAG_MAX_BIT_RATE))) + } else { + Optional.empty() + } + val minFragmentLen = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_MIN_FRAGMENT_LEN))) { + Optional.of(tlvReader.getUShort(ContextSpecificTag(TAG_MIN_FRAGMENT_LEN))) + } else { + Optional.empty() + } + val maxFragmentLen = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_MAX_FRAGMENT_LEN))) { + Optional.of(tlvReader.getUShort(ContextSpecificTag(TAG_MAX_FRAGMENT_LEN))) + } else { + Optional.empty() + } + + tlvReader.exitContainer() + + return CameraAvStreamManagementClusterVideoStreamChangedEvent( + videoStreamID, + streamType, + videoCodec, + minFrameRate, + maxFrameRate, + minResolution, + maxResolution, + minBitRate, + maxBitRate, + minFragmentLen, + maxFragmentLen, + ) + } + } +} 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 73e0a1190a0ac4..a83041b01de1d9 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/files.gni +++ b/src/controller/java/generated/java/matter/controller/cluster/files.gni @@ -19,6 +19,16 @@ matter_structs_sources = [ "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/BasicInformationClusterProductAppearanceStruct.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/BindingClusterTargetStruct.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/BridgedDeviceBasicInformationClusterProductAppearanceStruct.kt", + "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/CameraAvStreamManagementClusterAudioCapabilitiesStruct.kt", + "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/CameraAvStreamManagementClusterAudioStreamStruct.kt", + "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/CameraAvStreamManagementClusterPerStreamStruct.kt", + "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/CameraAvStreamManagementClusterRateDistortionTradeOffPointsStruct.kt", + "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/CameraAvStreamManagementClusterSnapshotParamsStruct.kt", + "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/CameraAvStreamManagementClusterSnapshotStreamStruct.kt", + "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/CameraAvStreamManagementClusterVideoResolutionStruct.kt", + "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/CameraAvStreamManagementClusterVideoSensorParamsStruct.kt", + "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/CameraAvStreamManagementClusterVideoStreamStruct.kt", + "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/CameraAvStreamManagementClusterViewportStruct.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/ChannelClusterAdditionalInfoStruct.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/ChannelClusterChannelInfoStruct.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/ChannelClusterChannelPagingStruct.kt", @@ -182,6 +192,9 @@ matter_eventstructs_sources = [ "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/eventstructs/BridgedDeviceBasicInformationClusterActiveChangedEvent.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/eventstructs/BridgedDeviceBasicInformationClusterReachableChangedEvent.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/eventstructs/BridgedDeviceBasicInformationClusterStartUpEvent.kt", + "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/eventstructs/CameraAvStreamManagementClusterAudioStreamChangedEvent.kt", + "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/eventstructs/CameraAvStreamManagementClusterSnapshotStreamChangedEvent.kt", + "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/eventstructs/CameraAvStreamManagementClusterVideoStreamChangedEvent.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/eventstructs/CommissionerControlClusterCommissioningRequestResultEvent.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/eventstructs/DemandResponseLoadControlClusterLoadControlEventStatusChangeEvent.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/eventstructs/DeviceEnergyManagementClusterPowerAdjustEndEvent.kt", @@ -269,6 +282,7 @@ matter_clusters_sources = [ "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/BooleanStateCluster.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/BooleanStateConfigurationCluster.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/BridgedDeviceBasicInformationCluster.kt", + "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/CameraAvStreamManagementCluster.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/CarbonDioxideConcentrationMeasurementCluster.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/CarbonMonoxideConcentrationMeasurementCluster.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/ChannelCluster.kt", diff --git a/src/controller/java/generated/java/matter/controller/cluster/structs/CameraAvStreamManagementClusterAudioCapabilitiesStruct.kt b/src/controller/java/generated/java/matter/controller/cluster/structs/CameraAvStreamManagementClusterAudioCapabilitiesStruct.kt new file mode 100644 index 00000000000000..a0b57945d0501f --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/structs/CameraAvStreamManagementClusterAudioCapabilitiesStruct.kt @@ -0,0 +1,111 @@ +/* + * + * 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.AnonymousTag +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class CameraAvStreamManagementClusterAudioCapabilitiesStruct( + val maxNumberOfChannels: UByte, + val supportedCodecs: List, + val supportedSampleRates: List, + val supportedBitDepths: List, +) { + override fun toString(): String = buildString { + append("CameraAvStreamManagementClusterAudioCapabilitiesStruct {\n") + append("\tmaxNumberOfChannels : $maxNumberOfChannels\n") + append("\tsupportedCodecs : $supportedCodecs\n") + append("\tsupportedSampleRates : $supportedSampleRates\n") + append("\tsupportedBitDepths : $supportedBitDepths\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_MAX_NUMBER_OF_CHANNELS), maxNumberOfChannels) + startArray(ContextSpecificTag(TAG_SUPPORTED_CODECS)) + for (item in supportedCodecs.iterator()) { + put(AnonymousTag, item) + } + endArray() + startArray(ContextSpecificTag(TAG_SUPPORTED_SAMPLE_RATES)) + for (item in supportedSampleRates.iterator()) { + put(AnonymousTag, item) + } + endArray() + startArray(ContextSpecificTag(TAG_SUPPORTED_BIT_DEPTHS)) + for (item in supportedBitDepths.iterator()) { + put(AnonymousTag, item) + } + endArray() + endStructure() + } + } + + companion object { + private const val TAG_MAX_NUMBER_OF_CHANNELS = 0 + private const val TAG_SUPPORTED_CODECS = 1 + private const val TAG_SUPPORTED_SAMPLE_RATES = 2 + private const val TAG_SUPPORTED_BIT_DEPTHS = 3 + + fun fromTlv( + tlvTag: Tag, + tlvReader: TlvReader, + ): CameraAvStreamManagementClusterAudioCapabilitiesStruct { + tlvReader.enterStructure(tlvTag) + val maxNumberOfChannels = tlvReader.getUByte(ContextSpecificTag(TAG_MAX_NUMBER_OF_CHANNELS)) + val supportedCodecs = + buildList { + tlvReader.enterArray(ContextSpecificTag(TAG_SUPPORTED_CODECS)) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUByte(AnonymousTag)) + } + tlvReader.exitContainer() + } + val supportedSampleRates = + buildList { + tlvReader.enterArray(ContextSpecificTag(TAG_SUPPORTED_SAMPLE_RATES)) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + val supportedBitDepths = + buildList { + tlvReader.enterArray(ContextSpecificTag(TAG_SUPPORTED_BIT_DEPTHS)) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + + tlvReader.exitContainer() + + return CameraAvStreamManagementClusterAudioCapabilitiesStruct( + maxNumberOfChannels, + supportedCodecs, + supportedSampleRates, + supportedBitDepths, + ) + } + } +} diff --git a/src/controller/java/generated/java/matter/controller/cluster/structs/CameraAvStreamManagementClusterAudioStreamStruct.kt b/src/controller/java/generated/java/matter/controller/cluster/structs/CameraAvStreamManagementClusterAudioStreamStruct.kt new file mode 100644 index 00000000000000..0ede21e0d34614 --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/structs/CameraAvStreamManagementClusterAudioStreamStruct.kt @@ -0,0 +1,101 @@ +/* + * + * 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 CameraAvStreamManagementClusterAudioStreamStruct( + val audioStreamID: UShort, + val streamType: UByte, + val audioCodec: UByte, + val channelCount: UByte, + val sampleRate: UInt, + val bitRate: UInt, + val bitDepth: UByte, + val referenceCount: UByte, +) { + override fun toString(): String = buildString { + append("CameraAvStreamManagementClusterAudioStreamStruct {\n") + append("\taudioStreamID : $audioStreamID\n") + append("\tstreamType : $streamType\n") + append("\taudioCodec : $audioCodec\n") + append("\tchannelCount : $channelCount\n") + append("\tsampleRate : $sampleRate\n") + append("\tbitRate : $bitRate\n") + append("\tbitDepth : $bitDepth\n") + append("\treferenceCount : $referenceCount\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_AUDIO_STREAM_ID), audioStreamID) + put(ContextSpecificTag(TAG_STREAM_TYPE), streamType) + put(ContextSpecificTag(TAG_AUDIO_CODEC), audioCodec) + put(ContextSpecificTag(TAG_CHANNEL_COUNT), channelCount) + put(ContextSpecificTag(TAG_SAMPLE_RATE), sampleRate) + put(ContextSpecificTag(TAG_BIT_RATE), bitRate) + put(ContextSpecificTag(TAG_BIT_DEPTH), bitDepth) + put(ContextSpecificTag(TAG_REFERENCE_COUNT), referenceCount) + endStructure() + } + } + + companion object { + private const val TAG_AUDIO_STREAM_ID = 0 + private const val TAG_STREAM_TYPE = 1 + private const val TAG_AUDIO_CODEC = 2 + private const val TAG_CHANNEL_COUNT = 3 + private const val TAG_SAMPLE_RATE = 4 + private const val TAG_BIT_RATE = 5 + private const val TAG_BIT_DEPTH = 6 + private const val TAG_REFERENCE_COUNT = 7 + + fun fromTlv( + tlvTag: Tag, + tlvReader: TlvReader, + ): CameraAvStreamManagementClusterAudioStreamStruct { + tlvReader.enterStructure(tlvTag) + val audioStreamID = tlvReader.getUShort(ContextSpecificTag(TAG_AUDIO_STREAM_ID)) + val streamType = tlvReader.getUByte(ContextSpecificTag(TAG_STREAM_TYPE)) + val audioCodec = tlvReader.getUByte(ContextSpecificTag(TAG_AUDIO_CODEC)) + val channelCount = tlvReader.getUByte(ContextSpecificTag(TAG_CHANNEL_COUNT)) + val sampleRate = tlvReader.getUInt(ContextSpecificTag(TAG_SAMPLE_RATE)) + val bitRate = tlvReader.getUInt(ContextSpecificTag(TAG_BIT_RATE)) + val bitDepth = tlvReader.getUByte(ContextSpecificTag(TAG_BIT_DEPTH)) + val referenceCount = tlvReader.getUByte(ContextSpecificTag(TAG_REFERENCE_COUNT)) + + tlvReader.exitContainer() + + return CameraAvStreamManagementClusterAudioStreamStruct( + audioStreamID, + streamType, + audioCodec, + channelCount, + sampleRate, + bitRate, + bitDepth, + referenceCount, + ) + } + } +} diff --git a/src/controller/java/generated/java/matter/controller/cluster/structs/CameraAvStreamManagementClusterPerStreamStruct.kt b/src/controller/java/generated/java/matter/controller/cluster/structs/CameraAvStreamManagementClusterPerStreamStruct.kt new file mode 100644 index 00000000000000..d2403918c3afd2 --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/structs/CameraAvStreamManagementClusterPerStreamStruct.kt @@ -0,0 +1,56 @@ +/* + * + * 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 CameraAvStreamManagementClusterPerStreamStruct(val streamID: UShort, val enabled: Boolean) { + override fun toString(): String = buildString { + append("CameraAvStreamManagementClusterPerStreamStruct {\n") + append("\tstreamID : $streamID\n") + append("\tenabled : $enabled\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_STREAM_ID), streamID) + put(ContextSpecificTag(TAG_ENABLED), enabled) + endStructure() + } + } + + companion object { + private const val TAG_STREAM_ID = 0 + private const val TAG_ENABLED = 1 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): CameraAvStreamManagementClusterPerStreamStruct { + tlvReader.enterStructure(tlvTag) + val streamID = tlvReader.getUShort(ContextSpecificTag(TAG_STREAM_ID)) + val enabled = tlvReader.getBoolean(ContextSpecificTag(TAG_ENABLED)) + + tlvReader.exitContainer() + + return CameraAvStreamManagementClusterPerStreamStruct(streamID, enabled) + } + } +} diff --git a/src/controller/java/generated/java/matter/controller/cluster/structs/CameraAvStreamManagementClusterRateDistortionTradeOffPointsStruct.kt b/src/controller/java/generated/java/matter/controller/cluster/structs/CameraAvStreamManagementClusterRateDistortionTradeOffPointsStruct.kt new file mode 100644 index 00000000000000..b6d493446b7b12 --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/structs/CameraAvStreamManagementClusterRateDistortionTradeOffPointsStruct.kt @@ -0,0 +1,75 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package matter.controller.cluster.structs + +import matter.controller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class CameraAvStreamManagementClusterRateDistortionTradeOffPointsStruct( + val codec: UByte, + val resolution: CameraAvStreamManagementClusterVideoResolutionStruct, + val minBitRate: UInt, +) { + override fun toString(): String = buildString { + append("CameraAvStreamManagementClusterRateDistortionTradeOffPointsStruct {\n") + append("\tcodec : $codec\n") + append("\tresolution : $resolution\n") + append("\tminBitRate : $minBitRate\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_CODEC), codec) + resolution.toTlv(ContextSpecificTag(TAG_RESOLUTION), this) + put(ContextSpecificTag(TAG_MIN_BIT_RATE), minBitRate) + endStructure() + } + } + + companion object { + private const val TAG_CODEC = 0 + private const val TAG_RESOLUTION = 1 + private const val TAG_MIN_BIT_RATE = 2 + + fun fromTlv( + tlvTag: Tag, + tlvReader: TlvReader, + ): CameraAvStreamManagementClusterRateDistortionTradeOffPointsStruct { + tlvReader.enterStructure(tlvTag) + val codec = tlvReader.getUByte(ContextSpecificTag(TAG_CODEC)) + val resolution = + CameraAvStreamManagementClusterVideoResolutionStruct.fromTlv( + ContextSpecificTag(TAG_RESOLUTION), + tlvReader, + ) + val minBitRate = tlvReader.getUInt(ContextSpecificTag(TAG_MIN_BIT_RATE)) + + tlvReader.exitContainer() + + return CameraAvStreamManagementClusterRateDistortionTradeOffPointsStruct( + codec, + resolution, + minBitRate, + ) + } + } +} diff --git a/src/controller/java/generated/java/matter/controller/cluster/structs/CameraAvStreamManagementClusterSnapshotParamsStruct.kt b/src/controller/java/generated/java/matter/controller/cluster/structs/CameraAvStreamManagementClusterSnapshotParamsStruct.kt new file mode 100644 index 00000000000000..5f639597bc5f4a --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/structs/CameraAvStreamManagementClusterSnapshotParamsStruct.kt @@ -0,0 +1,75 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package matter.controller.cluster.structs + +import matter.controller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class CameraAvStreamManagementClusterSnapshotParamsStruct( + val resolution: CameraAvStreamManagementClusterVideoResolutionStruct, + val maxFrameRate: UShort, + val imageCodec: UByte, +) { + override fun toString(): String = buildString { + append("CameraAvStreamManagementClusterSnapshotParamsStruct {\n") + append("\tresolution : $resolution\n") + append("\tmaxFrameRate : $maxFrameRate\n") + append("\timageCodec : $imageCodec\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + resolution.toTlv(ContextSpecificTag(TAG_RESOLUTION), this) + put(ContextSpecificTag(TAG_MAX_FRAME_RATE), maxFrameRate) + put(ContextSpecificTag(TAG_IMAGE_CODEC), imageCodec) + endStructure() + } + } + + companion object { + private const val TAG_RESOLUTION = 0 + private const val TAG_MAX_FRAME_RATE = 1 + private const val TAG_IMAGE_CODEC = 2 + + fun fromTlv( + tlvTag: Tag, + tlvReader: TlvReader, + ): CameraAvStreamManagementClusterSnapshotParamsStruct { + tlvReader.enterStructure(tlvTag) + val resolution = + CameraAvStreamManagementClusterVideoResolutionStruct.fromTlv( + ContextSpecificTag(TAG_RESOLUTION), + tlvReader, + ) + val maxFrameRate = tlvReader.getUShort(ContextSpecificTag(TAG_MAX_FRAME_RATE)) + val imageCodec = tlvReader.getUByte(ContextSpecificTag(TAG_IMAGE_CODEC)) + + tlvReader.exitContainer() + + return CameraAvStreamManagementClusterSnapshotParamsStruct( + resolution, + maxFrameRate, + imageCodec, + ) + } + } +} diff --git a/src/controller/java/generated/java/matter/controller/cluster/structs/CameraAvStreamManagementClusterSnapshotStreamStruct.kt b/src/controller/java/generated/java/matter/controller/cluster/structs/CameraAvStreamManagementClusterSnapshotStreamStruct.kt new file mode 100644 index 00000000000000..8e98459d04a908 --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/structs/CameraAvStreamManagementClusterSnapshotStreamStruct.kt @@ -0,0 +1,109 @@ +/* + * + * 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 CameraAvStreamManagementClusterSnapshotStreamStruct( + val snapshotStreamID: UShort, + val imageCodec: UByte, + val frameRate: UShort, + val bitRate: UInt, + val minResolution: CameraAvStreamManagementClusterVideoResolutionStruct, + val maxResolution: CameraAvStreamManagementClusterVideoResolutionStruct, + val quality: UByte, + val referenceCount: UByte, +) { + override fun toString(): String = buildString { + append("CameraAvStreamManagementClusterSnapshotStreamStruct {\n") + append("\tsnapshotStreamID : $snapshotStreamID\n") + append("\timageCodec : $imageCodec\n") + append("\tframeRate : $frameRate\n") + append("\tbitRate : $bitRate\n") + append("\tminResolution : $minResolution\n") + append("\tmaxResolution : $maxResolution\n") + append("\tquality : $quality\n") + append("\treferenceCount : $referenceCount\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_SNAPSHOT_STREAM_ID), snapshotStreamID) + put(ContextSpecificTag(TAG_IMAGE_CODEC), imageCodec) + put(ContextSpecificTag(TAG_FRAME_RATE), frameRate) + put(ContextSpecificTag(TAG_BIT_RATE), bitRate) + minResolution.toTlv(ContextSpecificTag(TAG_MIN_RESOLUTION), this) + maxResolution.toTlv(ContextSpecificTag(TAG_MAX_RESOLUTION), this) + put(ContextSpecificTag(TAG_QUALITY), quality) + put(ContextSpecificTag(TAG_REFERENCE_COUNT), referenceCount) + endStructure() + } + } + + companion object { + private const val TAG_SNAPSHOT_STREAM_ID = 0 + private const val TAG_IMAGE_CODEC = 1 + private const val TAG_FRAME_RATE = 2 + private const val TAG_BIT_RATE = 3 + private const val TAG_MIN_RESOLUTION = 4 + private const val TAG_MAX_RESOLUTION = 5 + private const val TAG_QUALITY = 6 + private const val TAG_REFERENCE_COUNT = 7 + + fun fromTlv( + tlvTag: Tag, + tlvReader: TlvReader, + ): CameraAvStreamManagementClusterSnapshotStreamStruct { + tlvReader.enterStructure(tlvTag) + val snapshotStreamID = tlvReader.getUShort(ContextSpecificTag(TAG_SNAPSHOT_STREAM_ID)) + val imageCodec = tlvReader.getUByte(ContextSpecificTag(TAG_IMAGE_CODEC)) + val frameRate = tlvReader.getUShort(ContextSpecificTag(TAG_FRAME_RATE)) + val bitRate = tlvReader.getUInt(ContextSpecificTag(TAG_BIT_RATE)) + val minResolution = + CameraAvStreamManagementClusterVideoResolutionStruct.fromTlv( + ContextSpecificTag(TAG_MIN_RESOLUTION), + tlvReader, + ) + val maxResolution = + CameraAvStreamManagementClusterVideoResolutionStruct.fromTlv( + ContextSpecificTag(TAG_MAX_RESOLUTION), + tlvReader, + ) + val quality = tlvReader.getUByte(ContextSpecificTag(TAG_QUALITY)) + val referenceCount = tlvReader.getUByte(ContextSpecificTag(TAG_REFERENCE_COUNT)) + + tlvReader.exitContainer() + + return CameraAvStreamManagementClusterSnapshotStreamStruct( + snapshotStreamID, + imageCodec, + frameRate, + bitRate, + minResolution, + maxResolution, + quality, + referenceCount, + ) + } + } +} diff --git a/src/controller/java/generated/java/matter/controller/cluster/structs/CameraAvStreamManagementClusterVideoResolutionStruct.kt b/src/controller/java/generated/java/matter/controller/cluster/structs/CameraAvStreamManagementClusterVideoResolutionStruct.kt new file mode 100644 index 00000000000000..4e153138371b59 --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/structs/CameraAvStreamManagementClusterVideoResolutionStruct.kt @@ -0,0 +1,59 @@ +/* + * + * 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 CameraAvStreamManagementClusterVideoResolutionStruct(val width: UShort, val height: UShort) { + override fun toString(): String = buildString { + append("CameraAvStreamManagementClusterVideoResolutionStruct {\n") + append("\twidth : $width\n") + append("\theight : $height\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_WIDTH), width) + put(ContextSpecificTag(TAG_HEIGHT), height) + endStructure() + } + } + + companion object { + private const val TAG_WIDTH = 0 + private const val TAG_HEIGHT = 1 + + fun fromTlv( + tlvTag: Tag, + tlvReader: TlvReader, + ): CameraAvStreamManagementClusterVideoResolutionStruct { + tlvReader.enterStructure(tlvTag) + val width = tlvReader.getUShort(ContextSpecificTag(TAG_WIDTH)) + val height = tlvReader.getUShort(ContextSpecificTag(TAG_HEIGHT)) + + tlvReader.exitContainer() + + return CameraAvStreamManagementClusterVideoResolutionStruct(width, height) + } + } +} diff --git a/src/controller/java/generated/java/matter/controller/cluster/structs/CameraAvStreamManagementClusterVideoSensorParamsStruct.kt b/src/controller/java/generated/java/matter/controller/cluster/structs/CameraAvStreamManagementClusterVideoSensorParamsStruct.kt new file mode 100644 index 00000000000000..5cf6052a753999 --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/structs/CameraAvStreamManagementClusterVideoSensorParamsStruct.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 matter.controller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class CameraAvStreamManagementClusterVideoSensorParamsStruct( + val sensorWidth: UShort, + val sensorHeight: UShort, + val HDRCapable: Boolean, + val maxFPS: UShort, + val maxHDRFPS: UShort, +) { + override fun toString(): String = buildString { + append("CameraAvStreamManagementClusterVideoSensorParamsStruct {\n") + append("\tsensorWidth : $sensorWidth\n") + append("\tsensorHeight : $sensorHeight\n") + append("\tHDRCapable : $HDRCapable\n") + append("\tmaxFPS : $maxFPS\n") + append("\tmaxHDRFPS : $maxHDRFPS\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_SENSOR_WIDTH), sensorWidth) + put(ContextSpecificTag(TAG_SENSOR_HEIGHT), sensorHeight) + put(ContextSpecificTag(TAG_HDR_CAPABLE), HDRCapable) + put(ContextSpecificTag(TAG_MAX_FPS), maxFPS) + put(ContextSpecificTag(TAG_MAX_HDRFPS), maxHDRFPS) + endStructure() + } + } + + companion object { + private const val TAG_SENSOR_WIDTH = 0 + private const val TAG_SENSOR_HEIGHT = 1 + private const val TAG_HDR_CAPABLE = 2 + private const val TAG_MAX_FPS = 3 + private const val TAG_MAX_HDRFPS = 4 + + fun fromTlv( + tlvTag: Tag, + tlvReader: TlvReader, + ): CameraAvStreamManagementClusterVideoSensorParamsStruct { + tlvReader.enterStructure(tlvTag) + val sensorWidth = tlvReader.getUShort(ContextSpecificTag(TAG_SENSOR_WIDTH)) + val sensorHeight = tlvReader.getUShort(ContextSpecificTag(TAG_SENSOR_HEIGHT)) + val HDRCapable = tlvReader.getBoolean(ContextSpecificTag(TAG_HDR_CAPABLE)) + val maxFPS = tlvReader.getUShort(ContextSpecificTag(TAG_MAX_FPS)) + val maxHDRFPS = tlvReader.getUShort(ContextSpecificTag(TAG_MAX_HDRFPS)) + + tlvReader.exitContainer() + + return CameraAvStreamManagementClusterVideoSensorParamsStruct( + sensorWidth, + sensorHeight, + HDRCapable, + maxFPS, + maxHDRFPS, + ) + } + } +} diff --git a/src/controller/java/generated/java/matter/controller/cluster/structs/CameraAvStreamManagementClusterVideoStreamStruct.kt b/src/controller/java/generated/java/matter/controller/cluster/structs/CameraAvStreamManagementClusterVideoStreamStruct.kt new file mode 100644 index 00000000000000..c23f9fa5ef9076 --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/structs/CameraAvStreamManagementClusterVideoStreamStruct.kt @@ -0,0 +1,133 @@ +/* + * + * 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 CameraAvStreamManagementClusterVideoStreamStruct( + val videoStreamID: UShort, + val streamType: UByte, + val videoCodec: UByte, + val minFrameRate: UShort, + val maxFrameRate: UShort, + val minResolution: CameraAvStreamManagementClusterVideoResolutionStruct, + val maxResolution: CameraAvStreamManagementClusterVideoResolutionStruct, + val minBitRate: UShort, + val maxBitRate: UShort, + val minFragmentLen: UShort, + val maxFragmentLen: UShort, + val referenceCount: UByte, +) { + override fun toString(): String = buildString { + append("CameraAvStreamManagementClusterVideoStreamStruct {\n") + append("\tvideoStreamID : $videoStreamID\n") + append("\tstreamType : $streamType\n") + append("\tvideoCodec : $videoCodec\n") + append("\tminFrameRate : $minFrameRate\n") + append("\tmaxFrameRate : $maxFrameRate\n") + append("\tminResolution : $minResolution\n") + append("\tmaxResolution : $maxResolution\n") + append("\tminBitRate : $minBitRate\n") + append("\tmaxBitRate : $maxBitRate\n") + append("\tminFragmentLen : $minFragmentLen\n") + append("\tmaxFragmentLen : $maxFragmentLen\n") + append("\treferenceCount : $referenceCount\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_VIDEO_STREAM_ID), videoStreamID) + put(ContextSpecificTag(TAG_STREAM_TYPE), streamType) + put(ContextSpecificTag(TAG_VIDEO_CODEC), videoCodec) + put(ContextSpecificTag(TAG_MIN_FRAME_RATE), minFrameRate) + put(ContextSpecificTag(TAG_MAX_FRAME_RATE), maxFrameRate) + minResolution.toTlv(ContextSpecificTag(TAG_MIN_RESOLUTION), this) + maxResolution.toTlv(ContextSpecificTag(TAG_MAX_RESOLUTION), this) + put(ContextSpecificTag(TAG_MIN_BIT_RATE), minBitRate) + put(ContextSpecificTag(TAG_MAX_BIT_RATE), maxBitRate) + put(ContextSpecificTag(TAG_MIN_FRAGMENT_LEN), minFragmentLen) + put(ContextSpecificTag(TAG_MAX_FRAGMENT_LEN), maxFragmentLen) + put(ContextSpecificTag(TAG_REFERENCE_COUNT), referenceCount) + endStructure() + } + } + + companion object { + private const val TAG_VIDEO_STREAM_ID = 0 + private const val TAG_STREAM_TYPE = 1 + private const val TAG_VIDEO_CODEC = 2 + private const val TAG_MIN_FRAME_RATE = 3 + private const val TAG_MAX_FRAME_RATE = 4 + private const val TAG_MIN_RESOLUTION = 5 + private const val TAG_MAX_RESOLUTION = 6 + private const val TAG_MIN_BIT_RATE = 7 + private const val TAG_MAX_BIT_RATE = 8 + private const val TAG_MIN_FRAGMENT_LEN = 9 + private const val TAG_MAX_FRAGMENT_LEN = 10 + private const val TAG_REFERENCE_COUNT = 11 + + fun fromTlv( + tlvTag: Tag, + tlvReader: TlvReader, + ): CameraAvStreamManagementClusterVideoStreamStruct { + tlvReader.enterStructure(tlvTag) + val videoStreamID = tlvReader.getUShort(ContextSpecificTag(TAG_VIDEO_STREAM_ID)) + val streamType = tlvReader.getUByte(ContextSpecificTag(TAG_STREAM_TYPE)) + val videoCodec = tlvReader.getUByte(ContextSpecificTag(TAG_VIDEO_CODEC)) + val minFrameRate = tlvReader.getUShort(ContextSpecificTag(TAG_MIN_FRAME_RATE)) + val maxFrameRate = tlvReader.getUShort(ContextSpecificTag(TAG_MAX_FRAME_RATE)) + val minResolution = + CameraAvStreamManagementClusterVideoResolutionStruct.fromTlv( + ContextSpecificTag(TAG_MIN_RESOLUTION), + tlvReader, + ) + val maxResolution = + CameraAvStreamManagementClusterVideoResolutionStruct.fromTlv( + ContextSpecificTag(TAG_MAX_RESOLUTION), + tlvReader, + ) + val minBitRate = tlvReader.getUShort(ContextSpecificTag(TAG_MIN_BIT_RATE)) + val maxBitRate = tlvReader.getUShort(ContextSpecificTag(TAG_MAX_BIT_RATE)) + val minFragmentLen = tlvReader.getUShort(ContextSpecificTag(TAG_MIN_FRAGMENT_LEN)) + val maxFragmentLen = tlvReader.getUShort(ContextSpecificTag(TAG_MAX_FRAGMENT_LEN)) + val referenceCount = tlvReader.getUByte(ContextSpecificTag(TAG_REFERENCE_COUNT)) + + tlvReader.exitContainer() + + return CameraAvStreamManagementClusterVideoStreamStruct( + videoStreamID, + streamType, + videoCodec, + minFrameRate, + maxFrameRate, + minResolution, + maxResolution, + minBitRate, + maxBitRate, + minFragmentLen, + maxFragmentLen, + referenceCount, + ) + } + } +} diff --git a/src/controller/java/generated/java/matter/controller/cluster/structs/CameraAvStreamManagementClusterViewportStruct.kt b/src/controller/java/generated/java/matter/controller/cluster/structs/CameraAvStreamManagementClusterViewportStruct.kt new file mode 100644 index 00000000000000..f89dac2b397770 --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/structs/CameraAvStreamManagementClusterViewportStruct.kt @@ -0,0 +1,69 @@ +/* + * + * 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 CameraAvStreamManagementClusterViewportStruct( + val x1: UShort, + val y1: UShort, + val x2: UShort, + val y2: UShort, +) { + override fun toString(): String = buildString { + append("CameraAvStreamManagementClusterViewportStruct {\n") + append("\tx1 : $x1\n") + append("\ty1 : $y1\n") + append("\tx2 : $x2\n") + append("\ty2 : $y2\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_X1), x1) + put(ContextSpecificTag(TAG_Y1), y1) + put(ContextSpecificTag(TAG_X2), x2) + put(ContextSpecificTag(TAG_Y2), y2) + endStructure() + } + } + + companion object { + private const val TAG_X1 = 0 + private const val TAG_Y1 = 1 + private const val TAG_X2 = 2 + private const val TAG_Y2 = 3 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): CameraAvStreamManagementClusterViewportStruct { + tlvReader.enterStructure(tlvTag) + val x1 = tlvReader.getUShort(ContextSpecificTag(TAG_X1)) + val y1 = tlvReader.getUShort(ContextSpecificTag(TAG_Y1)) + val x2 = tlvReader.getUShort(ContextSpecificTag(TAG_X2)) + val y2 = tlvReader.getUShort(ContextSpecificTag(TAG_Y2)) + + tlvReader.exitContainer() + + return CameraAvStreamManagementClusterViewportStruct(x1, y1, x2, y2) + } + } +} diff --git a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp index 19f3f8d3ed8efb..5c0363e83017ec 100644 --- a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp @@ -1183,27 +1183,29 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_0_revisionCtorSignature.c_str(), jninewElement_0_revision, newElement_0_revision); - jclass deviceTypeStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$DescriptorClusterDeviceTypeStruct", deviceTypeStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$DescriptorClusterDeviceTypeStruct"); - return nullptr; - } + jclass deviceTypeStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$DescriptorClusterDeviceTypeStruct", deviceTypeStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$DescriptorClusterDeviceTypeStruct"); + return nullptr; + } - jmethodID deviceTypeStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod(env, deviceTypeStructStructClass_1, "", - "(Ljava/lang/Long;Ljava/lang/Integer;)V", - &deviceTypeStructStructCtor_1); - if (err != CHIP_NO_ERROR || deviceTypeStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$DescriptorClusterDeviceTypeStruct constructor"); - return nullptr; - } + jmethodID deviceTypeStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod(env, deviceTypeStructStructClass_1, "", + "(Ljava/lang/Long;Ljava/lang/Integer;)V", + &deviceTypeStructStructCtor_1); + if (err != CHIP_NO_ERROR || deviceTypeStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$DescriptorClusterDeviceTypeStruct constructor"); + return nullptr; + } - newElement_0 = env->NewObject(deviceTypeStructStructClass_1, deviceTypeStructStructCtor_1, newElement_0_deviceType, - newElement_0_revision); + newElement_0 = env->NewObject(deviceTypeStructStructClass_1, deviceTypeStructStructCtor_1, + newElement_0_deviceType, newElement_0_revision); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -1347,28 +1349,32 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR chip::JniReferences::GetInstance().CreateOptional(newElement_0_labelInsideOptional, newElement_0_label); } - jclass semanticTagStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$DescriptorClusterSemanticTagStruct", semanticTagStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$DescriptorClusterSemanticTagStruct"); - return nullptr; - } + jclass semanticTagStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$DescriptorClusterSemanticTagStruct", + semanticTagStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$DescriptorClusterSemanticTagStruct"); + return nullptr; + } - jmethodID semanticTagStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod( - env, semanticTagStructStructClass_1, "", - "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/util/Optional;)V", - &semanticTagStructStructCtor_1); - if (err != CHIP_NO_ERROR || semanticTagStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$DescriptorClusterSemanticTagStruct constructor"); - return nullptr; - } + jmethodID semanticTagStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, semanticTagStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/util/Optional;)V", + &semanticTagStructStructCtor_1); + if (err != CHIP_NO_ERROR || semanticTagStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$DescriptorClusterSemanticTagStruct constructor"); + return nullptr; + } - newElement_0 = env->NewObject(semanticTagStructStructClass_1, semanticTagStructStructCtor_1, newElement_0_mfgCode, - newElement_0_namespaceID, newElement_0_tag, newElement_0_label); + newElement_0 = + env->NewObject(semanticTagStructStructClass_1, semanticTagStructStructCtor_1, newElement_0_mfgCode, + newElement_0_namespaceID, newElement_0_tag, newElement_0_label); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -1605,29 +1611,31 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_0_fabricIndexCtorSignature.c_str(), jninewElement_0_fabricIndex, newElement_0_fabricIndex); - jclass targetStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$BindingClusterTargetStruct", targetStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$BindingClusterTargetStruct"); - return nullptr; - } + jclass targetStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$BindingClusterTargetStruct", targetStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$BindingClusterTargetStruct"); + return nullptr; + } - jmethodID targetStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod( - env, targetStructStructClass_1, "", - "(Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/lang/Integer;)V", - &targetStructStructCtor_1); - if (err != CHIP_NO_ERROR || targetStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$BindingClusterTargetStruct constructor"); - return nullptr; - } + jmethodID targetStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, targetStructStructClass_1, "", + "(Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/lang/Integer;)V", + &targetStructStructCtor_1); + if (err != CHIP_NO_ERROR || targetStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$BindingClusterTargetStruct constructor"); + return nullptr; + } - newElement_0 = - env->NewObject(targetStructStructClass_1, targetStructStructCtor_1, newElement_0_node, newElement_0_group, - newElement_0_endpoint, newElement_0_cluster, newElement_0_fabricIndex); + newElement_0 = + env->NewObject(targetStructStructClass_1, targetStructStructCtor_1, newElement_0_node, newElement_0_group, + newElement_0_endpoint, newElement_0_cluster, newElement_0_fabricIndex); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -1883,29 +1891,32 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR jninewElement_3_deviceType, newElement_3_deviceType); } - jclass accessControlTargetStructStructClass_4; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$AccessControlClusterAccessControlTargetStruct", - accessControlTargetStructStructClass_4); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$AccessControlClusterAccessControlTargetStruct"); - return nullptr; - } + jclass accessControlTargetStructStructClass_4; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$AccessControlClusterAccessControlTargetStruct", + accessControlTargetStructStructClass_4); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$AccessControlClusterAccessControlTargetStruct"); + return nullptr; + } - jmethodID accessControlTargetStructStructCtor_4; - err = chip::JniReferences::GetInstance().FindMethod( - env, accessControlTargetStructStructClass_4, "", - "(Ljava/lang/Long;Ljava/lang/Integer;Ljava/lang/Long;)V", &accessControlTargetStructStructCtor_4); - if (err != CHIP_NO_ERROR || accessControlTargetStructStructCtor_4 == nullptr) - { - ChipLogError(Zcl, - "Could not find ChipStructs$AccessControlClusterAccessControlTargetStruct constructor"); - return nullptr; - } + jmethodID accessControlTargetStructStructCtor_4; + err = chip::JniReferences::GetInstance().FindMethod( + env, accessControlTargetStructStructClass_4, "", + "(Ljava/lang/Long;Ljava/lang/Integer;Ljava/lang/Long;)V", &accessControlTargetStructStructCtor_4); + if (err != CHIP_NO_ERROR || accessControlTargetStructStructCtor_4 == nullptr) + { + ChipLogError( + Zcl, "Could not find ChipStructs$AccessControlClusterAccessControlTargetStruct constructor"); + return nullptr; + } - newElement_3 = env->NewObject(accessControlTargetStructStructClass_4, accessControlTargetStructStructCtor_4, - newElement_3_cluster, newElement_3_endpoint, newElement_3_deviceType); + newElement_3 = + env->NewObject(accessControlTargetStructStructClass_4, accessControlTargetStructStructCtor_4, + newElement_3_cluster, newElement_3_endpoint, newElement_3_deviceType); + } chip::JniReferences::GetInstance().AddToList(newElement_0_targets, newElement_3); } } @@ -1917,30 +1928,32 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_0_fabricIndexCtorSignature.c_str(), jninewElement_0_fabricIndex, newElement_0_fabricIndex); - jclass accessControlEntryStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$AccessControlClusterAccessControlEntryStruct", - accessControlEntryStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$AccessControlClusterAccessControlEntryStruct"); - return nullptr; - } + jclass accessControlEntryStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$AccessControlClusterAccessControlEntryStruct", + accessControlEntryStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$AccessControlClusterAccessControlEntryStruct"); + return nullptr; + } - jmethodID accessControlEntryStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod( - env, accessControlEntryStructStructClass_1, "", - "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/util/ArrayList;Ljava/util/ArrayList;Ljava/lang/Integer;)V", - &accessControlEntryStructStructCtor_1); - if (err != CHIP_NO_ERROR || accessControlEntryStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$AccessControlClusterAccessControlEntryStruct constructor"); - return nullptr; - } + jmethodID accessControlEntryStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, accessControlEntryStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/util/ArrayList;Ljava/util/ArrayList;Ljava/lang/Integer;)V", + &accessControlEntryStructStructCtor_1); + if (err != CHIP_NO_ERROR || accessControlEntryStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$AccessControlClusterAccessControlEntryStruct constructor"); + return nullptr; + } - newElement_0 = env->NewObject(accessControlEntryStructStructClass_1, accessControlEntryStructStructCtor_1, - newElement_0_privilege, newElement_0_authMode, newElement_0_subjects, - newElement_0_targets, newElement_0_fabricIndex); + newElement_0 = env->NewObject(accessControlEntryStructStructClass_1, accessControlEntryStructStructCtor_1, + newElement_0_privilege, newElement_0_authMode, newElement_0_subjects, + newElement_0_targets, newElement_0_fabricIndex); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -1974,28 +1987,32 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_0_fabricIndexCtorSignature.c_str(), jninewElement_0_fabricIndex, newElement_0_fabricIndex); - jclass accessControlExtensionStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$AccessControlClusterAccessControlExtensionStruct", - accessControlExtensionStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$AccessControlClusterAccessControlExtensionStruct"); - return nullptr; - } + jclass accessControlExtensionStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$AccessControlClusterAccessControlExtensionStruct", + accessControlExtensionStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$AccessControlClusterAccessControlExtensionStruct"); + return nullptr; + } - jmethodID accessControlExtensionStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod(env, accessControlExtensionStructStructClass_1, "", - "([BLjava/lang/Integer;)V", - &accessControlExtensionStructStructCtor_1); - if (err != CHIP_NO_ERROR || accessControlExtensionStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$AccessControlClusterAccessControlExtensionStruct constructor"); - return nullptr; - } + jmethodID accessControlExtensionStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod(env, accessControlExtensionStructStructClass_1, "", + "([BLjava/lang/Integer;)V", + &accessControlExtensionStructStructCtor_1); + if (err != CHIP_NO_ERROR || accessControlExtensionStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$AccessControlClusterAccessControlExtensionStruct constructor"); + return nullptr; + } - newElement_0 = env->NewObject(accessControlExtensionStructStructClass_1, accessControlExtensionStructStructCtor_1, - newElement_0_data, newElement_0_fabricIndex); + newElement_0 = + env->NewObject(accessControlExtensionStructStructClass_1, accessControlExtensionStructStructCtor_1, + newElement_0_data, newElement_0_fabricIndex); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -2108,58 +2125,62 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR jninewElement_2_id, newElement_2_id); } - jclass accessRestrictionStructStructClass_3; + { + jclass accessRestrictionStructStructClass_3; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$AccessControlClusterAccessRestrictionStruct", + accessRestrictionStructStructClass_3); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$AccessControlClusterAccessRestrictionStruct"); + return nullptr; + } + + jmethodID accessRestrictionStructStructCtor_3; + err = chip::JniReferences::GetInstance().FindMethod(env, accessRestrictionStructStructClass_3, "", + "(Ljava/lang/Integer;Ljava/lang/Long;)V", + &accessRestrictionStructStructCtor_3); + if (err != CHIP_NO_ERROR || accessRestrictionStructStructCtor_3 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$AccessControlClusterAccessRestrictionStruct constructor"); + return nullptr; + } + + newElement_2 = env->NewObject(accessRestrictionStructStructClass_3, accessRestrictionStructStructCtor_3, + newElement_2_type, newElement_2_id); + } + chip::JniReferences::GetInstance().AddToList(newElement_0_restrictions, newElement_2); + } + + { + jclass commissioningAccessRestrictionEntryStructStructClass_1; err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$AccessControlClusterAccessRestrictionStruct", - accessRestrictionStructStructClass_3); + env, "chip/devicecontroller/ChipStructs$AccessControlClusterCommissioningAccessRestrictionEntryStruct", + commissioningAccessRestrictionEntryStructStructClass_1); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$AccessControlClusterAccessRestrictionStruct"); + ChipLogError( + Zcl, "Could not find class ChipStructs$AccessControlClusterCommissioningAccessRestrictionEntryStruct"); return nullptr; } - jmethodID accessRestrictionStructStructCtor_3; - err = chip::JniReferences::GetInstance().FindMethod(env, accessRestrictionStructStructClass_3, "", - "(Ljava/lang/Integer;Ljava/lang/Long;)V", - &accessRestrictionStructStructCtor_3); - if (err != CHIP_NO_ERROR || accessRestrictionStructStructCtor_3 == nullptr) + jmethodID commissioningAccessRestrictionEntryStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, commissioningAccessRestrictionEntryStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/lang/Long;Ljava/util/ArrayList;)V", + &commissioningAccessRestrictionEntryStructStructCtor_1); + if (err != CHIP_NO_ERROR || commissioningAccessRestrictionEntryStructStructCtor_1 == nullptr) { - ChipLogError(Zcl, "Could not find ChipStructs$AccessControlClusterAccessRestrictionStruct constructor"); + ChipLogError( + Zcl, + "Could not find ChipStructs$AccessControlClusterCommissioningAccessRestrictionEntryStruct constructor"); return nullptr; } - newElement_2 = env->NewObject(accessRestrictionStructStructClass_3, accessRestrictionStructStructCtor_3, - newElement_2_type, newElement_2_id); - chip::JniReferences::GetInstance().AddToList(newElement_0_restrictions, newElement_2); - } - - jclass commissioningAccessRestrictionEntryStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$AccessControlClusterCommissioningAccessRestrictionEntryStruct", - commissioningAccessRestrictionEntryStructStructClass_1); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, - "Could not find class ChipStructs$AccessControlClusterCommissioningAccessRestrictionEntryStruct"); - return nullptr; + newElement_0 = env->NewObject(commissioningAccessRestrictionEntryStructStructClass_1, + commissioningAccessRestrictionEntryStructStructCtor_1, newElement_0_endpoint, + newElement_0_cluster, newElement_0_restrictions); } - - jmethodID commissioningAccessRestrictionEntryStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod(env, commissioningAccessRestrictionEntryStructStructClass_1, - "", - "(Ljava/lang/Integer;Ljava/lang/Long;Ljava/util/ArrayList;)V", - &commissioningAccessRestrictionEntryStructStructCtor_1); - if (err != CHIP_NO_ERROR || commissioningAccessRestrictionEntryStructStructCtor_1 == nullptr) - { - ChipLogError( - Zcl, - "Could not find ChipStructs$AccessControlClusterCommissioningAccessRestrictionEntryStruct constructor"); - return nullptr; - } - - newElement_0 = env->NewObject(commissioningAccessRestrictionEntryStructStructClass_1, - commissioningAccessRestrictionEntryStructStructCtor_1, newElement_0_endpoint, - newElement_0_cluster, newElement_0_restrictions); chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -2224,28 +2245,30 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR jninewElement_2_id, newElement_2_id); } - jclass accessRestrictionStructStructClass_3; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$AccessControlClusterAccessRestrictionStruct", - accessRestrictionStructStructClass_3); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$AccessControlClusterAccessRestrictionStruct"); - return nullptr; - } + jclass accessRestrictionStructStructClass_3; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$AccessControlClusterAccessRestrictionStruct", + accessRestrictionStructStructClass_3); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$AccessControlClusterAccessRestrictionStruct"); + return nullptr; + } - jmethodID accessRestrictionStructStructCtor_3; - err = chip::JniReferences::GetInstance().FindMethod(env, accessRestrictionStructStructClass_3, "", - "(Ljava/lang/Integer;Ljava/lang/Long;)V", - &accessRestrictionStructStructCtor_3); - if (err != CHIP_NO_ERROR || accessRestrictionStructStructCtor_3 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$AccessControlClusterAccessRestrictionStruct constructor"); - return nullptr; - } + jmethodID accessRestrictionStructStructCtor_3; + err = chip::JniReferences::GetInstance().FindMethod(env, accessRestrictionStructStructClass_3, "", + "(Ljava/lang/Integer;Ljava/lang/Long;)V", + &accessRestrictionStructStructCtor_3); + if (err != CHIP_NO_ERROR || accessRestrictionStructStructCtor_3 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$AccessControlClusterAccessRestrictionStruct constructor"); + return nullptr; + } - newElement_2 = env->NewObject(accessRestrictionStructStructClass_3, accessRestrictionStructStructCtor_3, - newElement_2_type, newElement_2_id); + newElement_2 = env->NewObject(accessRestrictionStructStructClass_3, accessRestrictionStructStructCtor_3, + newElement_2_type, newElement_2_id); + } chip::JniReferences::GetInstance().AddToList(newElement_0_restrictions, newElement_2); } jobject newElement_0_fabricIndex; @@ -2256,30 +2279,33 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_0_fabricIndexCtorSignature.c_str(), jninewElement_0_fabricIndex, newElement_0_fabricIndex); - jclass accessRestrictionEntryStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$AccessControlClusterAccessRestrictionEntryStruct", - accessRestrictionEntryStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$AccessControlClusterAccessRestrictionEntryStruct"); - return nullptr; - } + jclass accessRestrictionEntryStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$AccessControlClusterAccessRestrictionEntryStruct", + accessRestrictionEntryStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$AccessControlClusterAccessRestrictionEntryStruct"); + return nullptr; + } - jmethodID accessRestrictionEntryStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod( - env, accessRestrictionEntryStructStructClass_1, "", - "(Ljava/lang/Integer;Ljava/lang/Long;Ljava/util/ArrayList;Ljava/lang/Integer;)V", - &accessRestrictionEntryStructStructCtor_1); - if (err != CHIP_NO_ERROR || accessRestrictionEntryStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$AccessControlClusterAccessRestrictionEntryStruct constructor"); - return nullptr; - } + jmethodID accessRestrictionEntryStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, accessRestrictionEntryStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/lang/Long;Ljava/util/ArrayList;Ljava/lang/Integer;)V", + &accessRestrictionEntryStructStructCtor_1); + if (err != CHIP_NO_ERROR || accessRestrictionEntryStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$AccessControlClusterAccessRestrictionEntryStruct constructor"); + return nullptr; + } - newElement_0 = env->NewObject(accessRestrictionEntryStructStructClass_1, accessRestrictionEntryStructStructCtor_1, - newElement_0_endpoint, newElement_0_cluster, newElement_0_restrictions, - newElement_0_fabricIndex); + newElement_0 = env->NewObject(accessRestrictionEntryStructStructClass_1, + accessRestrictionEntryStructStructCtor_1, newElement_0_endpoint, + newElement_0_cluster, newElement_0_restrictions, newElement_0_fabricIndex); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -2480,30 +2506,32 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_0_stateCtorSignature.c_str(), jninewElement_0_state, newElement_0_state); - jclass actionStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$ActionsClusterActionStruct", actionStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$ActionsClusterActionStruct"); - return nullptr; - } + jclass actionStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$ActionsClusterActionStruct", actionStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$ActionsClusterActionStruct"); + return nullptr; + } - jmethodID actionStructStructCtor_1; - err = - chip::JniReferences::GetInstance().FindMethod(env, actionStructStructClass_1, "", - "(Ljava/lang/Integer;Ljava/lang/String;Ljava/lang/Integer;Ljava/" - "lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;)V", - &actionStructStructCtor_1); - if (err != CHIP_NO_ERROR || actionStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$ActionsClusterActionStruct constructor"); - return nullptr; - } + jmethodID actionStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, actionStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/lang/String;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/" + "Integer;)V", + &actionStructStructCtor_1); + if (err != CHIP_NO_ERROR || actionStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$ActionsClusterActionStruct constructor"); + return nullptr; + } - newElement_0 = env->NewObject(actionStructStructClass_1, actionStructStructCtor_1, newElement_0_actionID, - newElement_0_name, newElement_0_type, newElement_0_endpointListID, - newElement_0_supportedCommands, newElement_0_state); + newElement_0 = env->NewObject(actionStructStructClass_1, actionStructStructCtor_1, newElement_0_actionID, + newElement_0_name, newElement_0_type, newElement_0_endpointListID, + newElement_0_supportedCommands, newElement_0_state); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -2556,29 +2584,31 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR chip::JniReferences::GetInstance().AddToList(newElement_0_endpoints, newElement_2); } - jclass endpointListStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$ActionsClusterEndpointListStruct", endpointListStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$ActionsClusterEndpointListStruct"); - return nullptr; - } + jclass endpointListStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$ActionsClusterEndpointListStruct", endpointListStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$ActionsClusterEndpointListStruct"); + return nullptr; + } - jmethodID endpointListStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod( - env, endpointListStructStructClass_1, "", - "(Ljava/lang/Integer;Ljava/lang/String;Ljava/lang/Integer;Ljava/util/ArrayList;)V", - &endpointListStructStructCtor_1); - if (err != CHIP_NO_ERROR || endpointListStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$ActionsClusterEndpointListStruct constructor"); - return nullptr; - } + jmethodID endpointListStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, endpointListStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/lang/String;Ljava/lang/Integer;Ljava/util/ArrayList;)V", + &endpointListStructStructCtor_1); + if (err != CHIP_NO_ERROR || endpointListStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$ActionsClusterEndpointListStruct constructor"); + return nullptr; + } - newElement_0 = - env->NewObject(endpointListStructStructClass_1, endpointListStructStructCtor_1, newElement_0_endpointListID, - newElement_0_name, newElement_0_type, newElement_0_endpoints); + newElement_0 = + env->NewObject(endpointListStructStructClass_1, endpointListStructStructCtor_1, newElement_0_endpointListID, + newElement_0_name, newElement_0_type, newElement_0_endpoints); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -3017,28 +3047,30 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR value_subscriptionsPerFabricClassName.c_str(), value_subscriptionsPerFabricCtorSignature.c_str(), jnivalue_subscriptionsPerFabric, value_subscriptionsPerFabric); - jclass capabilityMinimaStructStructClass_0; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$BasicInformationClusterCapabilityMinimaStruct", - capabilityMinimaStructStructClass_0); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$BasicInformationClusterCapabilityMinimaStruct"); - return nullptr; - } + jclass capabilityMinimaStructStructClass_0; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$BasicInformationClusterCapabilityMinimaStruct", + capabilityMinimaStructStructClass_0); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$BasicInformationClusterCapabilityMinimaStruct"); + return nullptr; + } - jmethodID capabilityMinimaStructStructCtor_0; - err = chip::JniReferences::GetInstance().FindMethod(env, capabilityMinimaStructStructClass_0, "", - "(Ljava/lang/Integer;Ljava/lang/Integer;)V", - &capabilityMinimaStructStructCtor_0); - if (err != CHIP_NO_ERROR || capabilityMinimaStructStructCtor_0 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$BasicInformationClusterCapabilityMinimaStruct constructor"); - return nullptr; - } + jmethodID capabilityMinimaStructStructCtor_0; + err = chip::JniReferences::GetInstance().FindMethod(env, capabilityMinimaStructStructClass_0, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;)V", + &capabilityMinimaStructStructCtor_0); + if (err != CHIP_NO_ERROR || capabilityMinimaStructStructCtor_0 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$BasicInformationClusterCapabilityMinimaStruct constructor"); + return nullptr; + } - value = env->NewObject(capabilityMinimaStructStructClass_0, capabilityMinimaStructStructCtor_0, - value_caseSessionsPerFabric, value_subscriptionsPerFabric); + value = env->NewObject(capabilityMinimaStructStructClass_0, capabilityMinimaStructStructCtor_0, + value_caseSessionsPerFabric, value_subscriptionsPerFabric); + } return value; } case Attributes::ProductAppearance::Id: { @@ -3071,28 +3103,30 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR jnivalue_primaryColor, value_primaryColor); } - jclass productAppearanceStructStructClass_0; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$BasicInformationClusterProductAppearanceStruct", - productAppearanceStructStructClass_0); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$BasicInformationClusterProductAppearanceStruct"); - return nullptr; - } + jclass productAppearanceStructStructClass_0; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$BasicInformationClusterProductAppearanceStruct", + productAppearanceStructStructClass_0); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$BasicInformationClusterProductAppearanceStruct"); + return nullptr; + } - jmethodID productAppearanceStructStructCtor_0; - err = chip::JniReferences::GetInstance().FindMethod(env, productAppearanceStructStructClass_0, "", - "(Ljava/lang/Integer;Ljava/lang/Integer;)V", - &productAppearanceStructStructCtor_0); - if (err != CHIP_NO_ERROR || productAppearanceStructStructCtor_0 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$BasicInformationClusterProductAppearanceStruct constructor"); - return nullptr; - } + jmethodID productAppearanceStructStructCtor_0; + err = chip::JniReferences::GetInstance().FindMethod(env, productAppearanceStructStructClass_0, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;)V", + &productAppearanceStructStructCtor_0); + if (err != CHIP_NO_ERROR || productAppearanceStructStructCtor_0 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$BasicInformationClusterProductAppearanceStruct constructor"); + return nullptr; + } - value = env->NewObject(productAppearanceStructStructClass_0, productAppearanceStructStructCtor_0, value_finish, - value_primaryColor); + value = env->NewObject(productAppearanceStructStructClass_0, productAppearanceStructStructCtor_0, value_finish, + value_primaryColor); + } return value; } case Attributes::SpecificationVersion::Id: { @@ -3449,28 +3483,31 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_0_fabricIndexCtorSignature.c_str(), jninewElement_0_fabricIndex, newElement_0_fabricIndex); - jclass providerLocationStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$OtaSoftwareUpdateRequestorClusterProviderLocation", - providerLocationStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$OtaSoftwareUpdateRequestorClusterProviderLocation"); - return nullptr; - } + jclass providerLocationStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$OtaSoftwareUpdateRequestorClusterProviderLocation", + providerLocationStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$OtaSoftwareUpdateRequestorClusterProviderLocation"); + return nullptr; + } - jmethodID providerLocationStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod(env, providerLocationStructClass_1, "", - "(Ljava/lang/Long;Ljava/lang/Integer;Ljava/lang/Integer;)V", - &providerLocationStructCtor_1); - if (err != CHIP_NO_ERROR || providerLocationStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$OtaSoftwareUpdateRequestorClusterProviderLocation constructor"); - return nullptr; - } + jmethodID providerLocationStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod(env, providerLocationStructClass_1, "", + "(Ljava/lang/Long;Ljava/lang/Integer;Ljava/lang/Integer;)V", + &providerLocationStructCtor_1); + if (err != CHIP_NO_ERROR || providerLocationStructCtor_1 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$OtaSoftwareUpdateRequestorClusterProviderLocation constructor"); + return nullptr; + } - newElement_0 = env->NewObject(providerLocationStructClass_1, providerLocationStructCtor_1, - newElement_0_providerNodeID, newElement_0_endpoint, newElement_0_fabricIndex); + newElement_0 = env->NewObject(providerLocationStructClass_1, providerLocationStructCtor_1, + newElement_0_providerNodeID, newElement_0_endpoint, newElement_0_fabricIndex); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -5141,28 +5178,30 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR value_maxCumulativeFailsafeSecondsClassName.c_str(), value_maxCumulativeFailsafeSecondsCtorSignature.c_str(), jnivalue_maxCumulativeFailsafeSeconds, value_maxCumulativeFailsafeSeconds); - jclass basicCommissioningInfoStructClass_0; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$GeneralCommissioningClusterBasicCommissioningInfo", - basicCommissioningInfoStructClass_0); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$GeneralCommissioningClusterBasicCommissioningInfo"); - return nullptr; - } + jclass basicCommissioningInfoStructClass_0; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$GeneralCommissioningClusterBasicCommissioningInfo", + basicCommissioningInfoStructClass_0); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$GeneralCommissioningClusterBasicCommissioningInfo"); + return nullptr; + } - jmethodID basicCommissioningInfoStructCtor_0; - err = chip::JniReferences::GetInstance().FindMethod(env, basicCommissioningInfoStructClass_0, "", - "(Ljava/lang/Integer;Ljava/lang/Integer;)V", - &basicCommissioningInfoStructCtor_0); - if (err != CHIP_NO_ERROR || basicCommissioningInfoStructCtor_0 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$GeneralCommissioningClusterBasicCommissioningInfo constructor"); - return nullptr; - } + jmethodID basicCommissioningInfoStructCtor_0; + err = chip::JniReferences::GetInstance().FindMethod(env, basicCommissioningInfoStructClass_0, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;)V", + &basicCommissioningInfoStructCtor_0); + if (err != CHIP_NO_ERROR || basicCommissioningInfoStructCtor_0 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$GeneralCommissioningClusterBasicCommissioningInfo constructor"); + return nullptr; + } - value = env->NewObject(basicCommissioningInfoStructClass_0, basicCommissioningInfoStructCtor_0, - value_failSafeExpiryLengthSeconds, value_maxCumulativeFailsafeSeconds); + value = env->NewObject(basicCommissioningInfoStructClass_0, basicCommissioningInfoStructCtor_0, + value_failSafeExpiryLengthSeconds, value_maxCumulativeFailsafeSeconds); + } return value; } case Attributes::RegulatoryConfig::Id: { @@ -5528,29 +5567,31 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_0_clientIdentifier); } - jclass networkInfoStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$NetworkCommissioningClusterNetworkInfoStruct", - networkInfoStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$NetworkCommissioningClusterNetworkInfoStruct"); - return nullptr; - } + jclass networkInfoStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$NetworkCommissioningClusterNetworkInfoStruct", + networkInfoStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$NetworkCommissioningClusterNetworkInfoStruct"); + return nullptr; + } - jmethodID networkInfoStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod( - env, networkInfoStructStructClass_1, "", - "([BLjava/lang/Boolean;Ljava/util/Optional;Ljava/util/Optional;)V", &networkInfoStructStructCtor_1); - if (err != CHIP_NO_ERROR || networkInfoStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$NetworkCommissioningClusterNetworkInfoStruct constructor"); - return nullptr; - } + jmethodID networkInfoStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, networkInfoStructStructClass_1, "", + "([BLjava/lang/Boolean;Ljava/util/Optional;Ljava/util/Optional;)V", &networkInfoStructStructCtor_1); + if (err != CHIP_NO_ERROR || networkInfoStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$NetworkCommissioningClusterNetworkInfoStruct constructor"); + return nullptr; + } - newElement_0 = - env->NewObject(networkInfoStructStructClass_1, networkInfoStructStructCtor_1, newElement_0_networkID, - newElement_0_connected, newElement_0_networkIdentifier, newElement_0_clientIdentifier); + newElement_0 = + env->NewObject(networkInfoStructStructClass_1, networkInfoStructStructCtor_1, newElement_0_networkID, + newElement_0_connected, newElement_0_networkIdentifier, newElement_0_clientIdentifier); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -6112,32 +6153,34 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_0_typeCtorSignature.c_str(), jninewElement_0_type, newElement_0_type); - jclass networkInterfaceStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$GeneralDiagnosticsClusterNetworkInterface", - networkInterfaceStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$GeneralDiagnosticsClusterNetworkInterface"); - return nullptr; - } + jclass networkInterfaceStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$GeneralDiagnosticsClusterNetworkInterface", + networkInterfaceStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$GeneralDiagnosticsClusterNetworkInterface"); + return nullptr; + } - jmethodID networkInterfaceStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod( - env, networkInterfaceStructClass_1, "", - "(Ljava/lang/String;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;[BLjava/util/ArrayList;Ljava/util/" - "ArrayList;Ljava/lang/Integer;)V", - &networkInterfaceStructCtor_1); - if (err != CHIP_NO_ERROR || networkInterfaceStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$GeneralDiagnosticsClusterNetworkInterface constructor"); - return nullptr; - } + jmethodID networkInterfaceStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, networkInterfaceStructClass_1, "", + "(Ljava/lang/String;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;[BLjava/util/ArrayList;Ljava/" + "util/ArrayList;Ljava/lang/Integer;)V", + &networkInterfaceStructCtor_1); + if (err != CHIP_NO_ERROR || networkInterfaceStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$GeneralDiagnosticsClusterNetworkInterface constructor"); + return nullptr; + } - newElement_0 = env->NewObject(networkInterfaceStructClass_1, networkInterfaceStructCtor_1, newElement_0_name, - newElement_0_isOperational, newElement_0_offPremiseServicesReachableIPv4, - newElement_0_offPremiseServicesReachableIPv6, newElement_0_hardwareAddress, - newElement_0_IPv4Addresses, newElement_0_IPv6Addresses, newElement_0_type); + newElement_0 = env->NewObject(networkInterfaceStructClass_1, networkInterfaceStructCtor_1, newElement_0_name, + newElement_0_isOperational, newElement_0_offPremiseServicesReachableIPv4, + newElement_0_offPremiseServicesReachableIPv6, newElement_0_hardwareAddress, + newElement_0_IPv4Addresses, newElement_0_IPv6Addresses, newElement_0_type); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -6527,30 +6570,32 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR chip::JniReferences::GetInstance().CreateOptional(newElement_0_stackSizeInsideOptional, newElement_0_stackSize); } - jclass threadMetricsStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$SoftwareDiagnosticsClusterThreadMetricsStruct", - threadMetricsStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$SoftwareDiagnosticsClusterThreadMetricsStruct"); - return nullptr; - } + jclass threadMetricsStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$SoftwareDiagnosticsClusterThreadMetricsStruct", + threadMetricsStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$SoftwareDiagnosticsClusterThreadMetricsStruct"); + return nullptr; + } - jmethodID threadMetricsStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod( - env, threadMetricsStructStructClass_1, "", - "(Ljava/lang/Long;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;)V", - &threadMetricsStructStructCtor_1); - if (err != CHIP_NO_ERROR || threadMetricsStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$SoftwareDiagnosticsClusterThreadMetricsStruct constructor"); - return nullptr; - } + jmethodID threadMetricsStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, threadMetricsStructStructClass_1, "", + "(Ljava/lang/Long;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;)V", + &threadMetricsStructStructCtor_1); + if (err != CHIP_NO_ERROR || threadMetricsStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$SoftwareDiagnosticsClusterThreadMetricsStruct constructor"); + return nullptr; + } - newElement_0 = env->NewObject(threadMetricsStructStructClass_1, threadMetricsStructStructCtor_1, newElement_0_id, - newElement_0_name, newElement_0_stackFreeCurrent, newElement_0_stackFreeMinimum, - newElement_0_stackSize); + newElement_0 = env->NewObject(threadMetricsStructStructClass_1, threadMetricsStructStructCtor_1, + newElement_0_id, newElement_0_name, newElement_0_stackFreeCurrent, + newElement_0_stackFreeMinimum, newElement_0_stackSize); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -7023,34 +7068,38 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_0_isChildCtorSignature.c_str(), jninewElement_0_isChild, newElement_0_isChild); - jclass neighborTableStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$ThreadNetworkDiagnosticsClusterNeighborTableStruct", - neighborTableStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$ThreadNetworkDiagnosticsClusterNeighborTableStruct"); - return nullptr; - } + jclass neighborTableStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$ThreadNetworkDiagnosticsClusterNeighborTableStruct", + neighborTableStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$ThreadNetworkDiagnosticsClusterNeighborTableStruct"); + return nullptr; + } - jmethodID neighborTableStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod( - env, neighborTableStructStructClass_1, "", - "(Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Integer;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Integer;Ljava/" - "lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Boolean;Ljava/lang/" - "Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;)V", - &neighborTableStructStructCtor_1); - if (err != CHIP_NO_ERROR || neighborTableStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$ThreadNetworkDiagnosticsClusterNeighborTableStruct constructor"); - return nullptr; - } + jmethodID neighborTableStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, neighborTableStructStructClass_1, "", + "(Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Integer;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/" + "Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/" + "Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;)V", + &neighborTableStructStructCtor_1); + if (err != CHIP_NO_ERROR || neighborTableStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$ThreadNetworkDiagnosticsClusterNeighborTableStruct constructor"); + return nullptr; + } - newElement_0 = env->NewObject( - neighborTableStructStructClass_1, neighborTableStructStructCtor_1, newElement_0_extAddress, newElement_0_age, - newElement_0_rloc16, newElement_0_linkFrameCounter, newElement_0_mleFrameCounter, newElement_0_lqi, - newElement_0_averageRssi, newElement_0_lastRssi, newElement_0_frameErrorRate, newElement_0_messageErrorRate, - newElement_0_rxOnWhenIdle, newElement_0_fullThreadDevice, newElement_0_fullNetworkData, newElement_0_isChild); + newElement_0 = env->NewObject( + neighborTableStructStructClass_1, neighborTableStructStructCtor_1, newElement_0_extAddress, + newElement_0_age, newElement_0_rloc16, newElement_0_linkFrameCounter, newElement_0_mleFrameCounter, + newElement_0_lqi, newElement_0_averageRssi, newElement_0_lastRssi, newElement_0_frameErrorRate, + newElement_0_messageErrorRate, newElement_0_rxOnWhenIdle, newElement_0_fullThreadDevice, + newElement_0_fullNetworkData, newElement_0_isChild); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -7142,32 +7191,34 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_0_linkEstablishedClassName.c_str(), newElement_0_linkEstablishedCtorSignature.c_str(), jninewElement_0_linkEstablished, newElement_0_linkEstablished); - jclass routeTableStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$ThreadNetworkDiagnosticsClusterRouteTableStruct", - routeTableStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$ThreadNetworkDiagnosticsClusterRouteTableStruct"); - return nullptr; - } + jclass routeTableStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$ThreadNetworkDiagnosticsClusterRouteTableStruct", + routeTableStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$ThreadNetworkDiagnosticsClusterRouteTableStruct"); + return nullptr; + } - jmethodID routeTableStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod( - env, routeTableStructStructClass_1, "", - "(Ljava/lang/Long;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/" - "Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Boolean;Ljava/lang/Boolean;)V", - &routeTableStructStructCtor_1); - if (err != CHIP_NO_ERROR || routeTableStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$ThreadNetworkDiagnosticsClusterRouteTableStruct constructor"); - return nullptr; - } + jmethodID routeTableStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, routeTableStructStructClass_1, "", + "(Ljava/lang/Long;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/" + "Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Boolean;Ljava/lang/Boolean;)V", + &routeTableStructStructCtor_1); + if (err != CHIP_NO_ERROR || routeTableStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$ThreadNetworkDiagnosticsClusterRouteTableStruct constructor"); + return nullptr; + } - newElement_0 = env->NewObject(routeTableStructStructClass_1, routeTableStructStructCtor_1, newElement_0_extAddress, - newElement_0_rloc16, newElement_0_routerId, newElement_0_nextHop, - newElement_0_pathCost, newElement_0_LQIIn, newElement_0_LQIOut, newElement_0_age, - newElement_0_allocated, newElement_0_linkEstablished); + newElement_0 = env->NewObject( + routeTableStructStructClass_1, routeTableStructStructCtor_1, newElement_0_extAddress, newElement_0_rloc16, + newElement_0_routerId, newElement_0_nextHop, newElement_0_pathCost, newElement_0_LQIIn, newElement_0_LQIOut, + newElement_0_age, newElement_0_allocated, newElement_0_linkEstablished); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -8057,27 +8108,30 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR chip::JniReferences::GetInstance().CreateBoxedObject( value_flagsClassName.c_str(), value_flagsCtorSignature.c_str(), jnivalue_flags, value_flags); - jclass securityPolicyStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$ThreadNetworkDiagnosticsClusterSecurityPolicy", - securityPolicyStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$ThreadNetworkDiagnosticsClusterSecurityPolicy"); - return nullptr; - } + jclass securityPolicyStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$ThreadNetworkDiagnosticsClusterSecurityPolicy", + securityPolicyStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$ThreadNetworkDiagnosticsClusterSecurityPolicy"); + return nullptr; + } - jmethodID securityPolicyStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod(env, securityPolicyStructClass_1, "", - "(Ljava/lang/Integer;Ljava/lang/Integer;)V", - &securityPolicyStructCtor_1); - if (err != CHIP_NO_ERROR || securityPolicyStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$ThreadNetworkDiagnosticsClusterSecurityPolicy constructor"); - return nullptr; - } + jmethodID securityPolicyStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod(env, securityPolicyStructClass_1, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;)V", + &securityPolicyStructCtor_1); + if (err != CHIP_NO_ERROR || securityPolicyStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$ThreadNetworkDiagnosticsClusterSecurityPolicy constructor"); + return nullptr; + } - value = env->NewObject(securityPolicyStructClass_1, securityPolicyStructCtor_1, value_rotationTime, value_flags); + value = + env->NewObject(securityPolicyStructClass_1, securityPolicyStructCtor_1, value_rotationTime, value_flags); + } } return value; } @@ -8203,36 +8257,39 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR value_channelMaskPresentClassName.c_str(), value_channelMaskPresentCtorSignature.c_str(), jnivalue_channelMaskPresent, value_channelMaskPresent); - jclass operationalDatasetComponentsStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$ThreadNetworkDiagnosticsClusterOperationalDatasetComponents", - operationalDatasetComponentsStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, - "Could not find class ChipStructs$ThreadNetworkDiagnosticsClusterOperationalDatasetComponents"); - return nullptr; - } + jclass operationalDatasetComponentsStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$ThreadNetworkDiagnosticsClusterOperationalDatasetComponents", + operationalDatasetComponentsStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError( + Zcl, "Could not find class ChipStructs$ThreadNetworkDiagnosticsClusterOperationalDatasetComponents"); + return nullptr; + } - jmethodID operationalDatasetComponentsStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod( - env, operationalDatasetComponentsStructClass_1, "", - "(Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/" - "Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/" - "lang/Boolean;)V", - &operationalDatasetComponentsStructCtor_1); - if (err != CHIP_NO_ERROR || operationalDatasetComponentsStructCtor_1 == nullptr) - { - ChipLogError( - Zcl, "Could not find ChipStructs$ThreadNetworkDiagnosticsClusterOperationalDatasetComponents constructor"); - return nullptr; - } + jmethodID operationalDatasetComponentsStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, operationalDatasetComponentsStructClass_1, "", + "(Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/" + "lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/" + "Boolean;Ljava/lang/Boolean;)V", + &operationalDatasetComponentsStructCtor_1); + if (err != CHIP_NO_ERROR || operationalDatasetComponentsStructCtor_1 == nullptr) + { + ChipLogError( + Zcl, + "Could not find ChipStructs$ThreadNetworkDiagnosticsClusterOperationalDatasetComponents constructor"); + return nullptr; + } - value = env->NewObject(operationalDatasetComponentsStructClass_1, operationalDatasetComponentsStructCtor_1, - value_activeTimestampPresent, value_pendingTimestampPresent, value_masterKeyPresent, - value_networkNamePresent, value_extendedPanIdPresent, value_meshLocalPrefixPresent, - value_delayPresent, value_panIdPresent, value_channelPresent, value_pskcPresent, - value_securityPolicyPresent, value_channelMaskPresent); + value = env->NewObject(operationalDatasetComponentsStructClass_1, operationalDatasetComponentsStructCtor_1, + value_activeTimestampPresent, value_pendingTimestampPresent, value_masterKeyPresent, + value_networkNamePresent, value_extendedPanIdPresent, value_meshLocalPrefixPresent, + value_delayPresent, value_panIdPresent, value_channelPresent, value_pskcPresent, + value_securityPolicyPresent, value_channelMaskPresent); + } } return value; } @@ -9240,28 +9297,31 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR chip::JniReferences::GetInstance().CreateBoxedObject( value_endpointClassName.c_str(), value_endpointCtorSignature.c_str(), jnivalue_endpoint, value_endpoint); - jclass trustedTimeSourceStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$TimeSynchronizationClusterTrustedTimeSourceStruct", - trustedTimeSourceStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$TimeSynchronizationClusterTrustedTimeSourceStruct"); - return nullptr; - } + jclass trustedTimeSourceStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$TimeSynchronizationClusterTrustedTimeSourceStruct", + trustedTimeSourceStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$TimeSynchronizationClusterTrustedTimeSourceStruct"); + return nullptr; + } - jmethodID trustedTimeSourceStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod(env, trustedTimeSourceStructStructClass_1, "", - "(Ljava/lang/Integer;Ljava/lang/Long;Ljava/lang/Integer;)V", - &trustedTimeSourceStructStructCtor_1); - if (err != CHIP_NO_ERROR || trustedTimeSourceStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$TimeSynchronizationClusterTrustedTimeSourceStruct constructor"); - return nullptr; - } + jmethodID trustedTimeSourceStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod(env, trustedTimeSourceStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/lang/Long;Ljava/lang/Integer;)V", + &trustedTimeSourceStructStructCtor_1); + if (err != CHIP_NO_ERROR || trustedTimeSourceStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$TimeSynchronizationClusterTrustedTimeSourceStruct constructor"); + return nullptr; + } - value = env->NewObject(trustedTimeSourceStructStructClass_1, trustedTimeSourceStructStructCtor_1, value_fabricIndex, - value_nodeID, value_endpoint); + value = env->NewObject(trustedTimeSourceStructStructClass_1, trustedTimeSourceStructStructCtor_1, + value_fabricIndex, value_nodeID, value_endpoint); + } } return value; } @@ -9327,27 +9387,30 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR chip::JniReferences::GetInstance().CreateOptional(newElement_0_nameInsideOptional, newElement_0_name); } - jclass timeZoneStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$TimeSynchronizationClusterTimeZoneStruct", timeZoneStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$TimeSynchronizationClusterTimeZoneStruct"); - return nullptr; - } + jclass timeZoneStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$TimeSynchronizationClusterTimeZoneStruct", + timeZoneStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$TimeSynchronizationClusterTimeZoneStruct"); + return nullptr; + } - jmethodID timeZoneStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod(env, timeZoneStructStructClass_1, "", - "(Ljava/lang/Long;Ljava/lang/Long;Ljava/util/Optional;)V", - &timeZoneStructStructCtor_1); - if (err != CHIP_NO_ERROR || timeZoneStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$TimeSynchronizationClusterTimeZoneStruct constructor"); - return nullptr; - } + jmethodID timeZoneStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod(env, timeZoneStructStructClass_1, "", + "(Ljava/lang/Long;Ljava/lang/Long;Ljava/util/Optional;)V", + &timeZoneStructStructCtor_1); + if (err != CHIP_NO_ERROR || timeZoneStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$TimeSynchronizationClusterTimeZoneStruct constructor"); + return nullptr; + } - newElement_0 = env->NewObject(timeZoneStructStructClass_1, timeZoneStructStructCtor_1, newElement_0_offset, - newElement_0_validAt, newElement_0_name); + newElement_0 = env->NewObject(timeZoneStructStructClass_1, timeZoneStructStructCtor_1, newElement_0_offset, + newElement_0_validAt, newElement_0_name); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -9397,28 +9460,30 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR jninewElement_0_validUntil, newElement_0_validUntil); } - jclass DSTOffsetStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$TimeSynchronizationClusterDSTOffsetStruct", - DSTOffsetStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$TimeSynchronizationClusterDSTOffsetStruct"); - return nullptr; - } + jclass DSTOffsetStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$TimeSynchronizationClusterDSTOffsetStruct", + DSTOffsetStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$TimeSynchronizationClusterDSTOffsetStruct"); + return nullptr; + } - jmethodID DSTOffsetStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod(env, DSTOffsetStructStructClass_1, "", - "(Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Long;)V", - &DSTOffsetStructStructCtor_1); - if (err != CHIP_NO_ERROR || DSTOffsetStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$TimeSynchronizationClusterDSTOffsetStruct constructor"); - return nullptr; - } + jmethodID DSTOffsetStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod(env, DSTOffsetStructStructClass_1, "", + "(Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Long;)V", + &DSTOffsetStructStructCtor_1); + if (err != CHIP_NO_ERROR || DSTOffsetStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$TimeSynchronizationClusterDSTOffsetStruct constructor"); + return nullptr; + } - newElement_0 = env->NewObject(DSTOffsetStructStructClass_1, DSTOffsetStructStructCtor_1, newElement_0_offset, - newElement_0_validStarting, newElement_0_validUntil); + newElement_0 = env->NewObject(DSTOffsetStructStructClass_1, DSTOffsetStructStructCtor_1, newElement_0_offset, + newElement_0_validStarting, newElement_0_validUntil); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -9910,33 +9975,86 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR jnivalue_primaryColor, value_primaryColor); } - jclass productAppearanceStructStructClass_0; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$BridgedDeviceBasicInformationClusterProductAppearanceStruct", - productAppearanceStructStructClass_0); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$BridgedDeviceBasicInformationClusterProductAppearanceStruct"); + jclass productAppearanceStructStructClass_0; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$BridgedDeviceBasicInformationClusterProductAppearanceStruct", + productAppearanceStructStructClass_0); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, + "Could not find class ChipStructs$BridgedDeviceBasicInformationClusterProductAppearanceStruct"); + return nullptr; + } + + jmethodID productAppearanceStructStructCtor_0; + err = chip::JniReferences::GetInstance().FindMethod(env, productAppearanceStructStructClass_0, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;)V", + &productAppearanceStructStructCtor_0); + if (err != CHIP_NO_ERROR || productAppearanceStructStructCtor_0 == nullptr) + { + ChipLogError( + Zcl, "Could not find ChipStructs$BridgedDeviceBasicInformationClusterProductAppearanceStruct constructor"); + return nullptr; + } + + value = env->NewObject(productAppearanceStructStructClass_0, productAppearanceStructStructCtor_0, value_finish, + value_primaryColor); + } + 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); - jmethodID productAppearanceStructStructCtor_0; - err = chip::JniReferences::GetInstance().FindMethod(env, productAppearanceStructStructClass_0, "", - "(Ljava/lang/Integer;Ljava/lang/Integer;)V", - &productAppearanceStructStructCtor_0); - if (err != CHIP_NO_ERROR || productAppearanceStructStructCtor_0 == nullptr) + 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) { - ChipLogError(Zcl, - "Could not find ChipStructs$BridgedDeviceBasicInformationClusterProductAppearanceStruct constructor"); return nullptr; } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); - value = env->NewObject(productAppearanceStructStructClass_0, productAppearanceStructStructCtor_0, value_finish, - value_primaryColor); + 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::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + case Attributes::EventList::Id: { + using TypeInfo = Attributes::EventList::TypeInfo; TypeInfo::DecodableType cppValue; *aError = app::DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) @@ -9960,58 +10078,8 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR } 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::EventList::Id: { - using TypeInfo = Attributes::EventList::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; + case Attributes::AttributeList::Id: { + using TypeInfo = Attributes::AttributeList::TypeInfo; TypeInfo::DecodableType cppValue; *aError = app::DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) @@ -10512,26 +10580,28 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_0_fabricIndexCtorSignature.c_str(), jninewElement_0_fabricIndex, newElement_0_fabricIndex); - jclass NOCStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$OperationalCredentialsClusterNOCStruct", NOCStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$OperationalCredentialsClusterNOCStruct"); - return nullptr; - } + jclass NOCStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$OperationalCredentialsClusterNOCStruct", NOCStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$OperationalCredentialsClusterNOCStruct"); + return nullptr; + } - jmethodID NOCStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod(env, NOCStructStructClass_1, "", - "([B[BLjava/lang/Integer;)V", &NOCStructStructCtor_1); - if (err != CHIP_NO_ERROR || NOCStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$OperationalCredentialsClusterNOCStruct constructor"); - return nullptr; - } + jmethodID NOCStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod(env, NOCStructStructClass_1, "", + "([B[BLjava/lang/Integer;)V", &NOCStructStructCtor_1); + if (err != CHIP_NO_ERROR || NOCStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$OperationalCredentialsClusterNOCStruct constructor"); + return nullptr; + } - newElement_0 = env->NewObject(NOCStructStructClass_1, NOCStructStructCtor_1, newElement_0_noc, newElement_0_icac, - newElement_0_fabricIndex); + newElement_0 = env->NewObject(NOCStructStructClass_1, NOCStructStructCtor_1, newElement_0_noc, + newElement_0_icac, newElement_0_fabricIndex); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -10589,30 +10659,33 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_0_fabricIndexCtorSignature.c_str(), jninewElement_0_fabricIndex, newElement_0_fabricIndex); - jclass fabricDescriptorStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$OperationalCredentialsClusterFabricDescriptorStruct", - fabricDescriptorStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$OperationalCredentialsClusterFabricDescriptorStruct"); - return nullptr; - } + jclass fabricDescriptorStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$OperationalCredentialsClusterFabricDescriptorStruct", + fabricDescriptorStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$OperationalCredentialsClusterFabricDescriptorStruct"); + return nullptr; + } - jmethodID fabricDescriptorStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod( - env, fabricDescriptorStructStructClass_1, "", - "([BLjava/lang/Integer;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/String;Ljava/lang/Integer;)V", - &fabricDescriptorStructStructCtor_1); - if (err != CHIP_NO_ERROR || fabricDescriptorStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$OperationalCredentialsClusterFabricDescriptorStruct constructor"); - return nullptr; - } + jmethodID fabricDescriptorStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, fabricDescriptorStructStructClass_1, "", + "([BLjava/lang/Integer;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/String;Ljava/lang/Integer;)V", + &fabricDescriptorStructStructCtor_1); + if (err != CHIP_NO_ERROR || fabricDescriptorStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$OperationalCredentialsClusterFabricDescriptorStruct constructor"); + return nullptr; + } - newElement_0 = env->NewObject(fabricDescriptorStructStructClass_1, fabricDescriptorStructStructCtor_1, - newElement_0_rootPublicKey, newElement_0_vendorID, newElement_0_fabricID, - newElement_0_nodeID, newElement_0_label, newElement_0_fabricIndex); + newElement_0 = env->NewObject(fabricDescriptorStructStructClass_1, fabricDescriptorStructStructCtor_1, + newElement_0_rootPublicKey, newElement_0_vendorID, newElement_0_fabricID, + newElement_0_nodeID, newElement_0_label, newElement_0_fabricIndex); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -10869,28 +10942,30 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_0_fabricIndexCtorSignature.c_str(), jninewElement_0_fabricIndex, newElement_0_fabricIndex); - jclass groupKeyMapStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$GroupKeyManagementClusterGroupKeyMapStruct", - groupKeyMapStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$GroupKeyManagementClusterGroupKeyMapStruct"); - return nullptr; - } + jclass groupKeyMapStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$GroupKeyManagementClusterGroupKeyMapStruct", + groupKeyMapStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$GroupKeyManagementClusterGroupKeyMapStruct"); + return nullptr; + } - jmethodID groupKeyMapStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod(env, groupKeyMapStructStructClass_1, "", - "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;)V", - &groupKeyMapStructStructCtor_1); - if (err != CHIP_NO_ERROR || groupKeyMapStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$GroupKeyManagementClusterGroupKeyMapStruct constructor"); - return nullptr; - } + jmethodID groupKeyMapStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, groupKeyMapStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;)V", &groupKeyMapStructStructCtor_1); + if (err != CHIP_NO_ERROR || groupKeyMapStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$GroupKeyManagementClusterGroupKeyMapStruct constructor"); + return nullptr; + } - newElement_0 = env->NewObject(groupKeyMapStructStructClass_1, groupKeyMapStructStructCtor_1, newElement_0_groupId, - newElement_0_groupKeySetID, newElement_0_fabricIndex); + newElement_0 = env->NewObject(groupKeyMapStructStructClass_1, groupKeyMapStructStructCtor_1, + newElement_0_groupId, newElement_0_groupKeySetID, newElement_0_fabricIndex); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -10953,29 +11028,32 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_0_fabricIndexCtorSignature.c_str(), jninewElement_0_fabricIndex, newElement_0_fabricIndex); - jclass groupInfoMapStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$GroupKeyManagementClusterGroupInfoMapStruct", - groupInfoMapStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$GroupKeyManagementClusterGroupInfoMapStruct"); - return nullptr; - } + jclass groupInfoMapStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$GroupKeyManagementClusterGroupInfoMapStruct", + groupInfoMapStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$GroupKeyManagementClusterGroupInfoMapStruct"); + return nullptr; + } - jmethodID groupInfoMapStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod( - env, groupInfoMapStructStructClass_1, "", - "(Ljava/lang/Integer;Ljava/util/ArrayList;Ljava/util/Optional;Ljava/lang/Integer;)V", - &groupInfoMapStructStructCtor_1); - if (err != CHIP_NO_ERROR || groupInfoMapStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$GroupKeyManagementClusterGroupInfoMapStruct constructor"); - return nullptr; - } + jmethodID groupInfoMapStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, groupInfoMapStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/util/ArrayList;Ljava/util/Optional;Ljava/lang/Integer;)V", + &groupInfoMapStructStructCtor_1); + if (err != CHIP_NO_ERROR || groupInfoMapStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$GroupKeyManagementClusterGroupInfoMapStruct constructor"); + return nullptr; + } - newElement_0 = env->NewObject(groupInfoMapStructStructClass_1, groupInfoMapStructStructCtor_1, newElement_0_groupId, - newElement_0_endpoints, newElement_0_groupName, newElement_0_fabricIndex); + newElement_0 = + env->NewObject(groupInfoMapStructStructClass_1, groupInfoMapStructStructCtor_1, newElement_0_groupId, + newElement_0_endpoints, newElement_0_groupName, newElement_0_fabricIndex); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -11175,26 +11253,29 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR jobject newElement_0_value; LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.value, newElement_0_value)); - jclass labelStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$FixedLabelClusterLabelStruct", labelStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$FixedLabelClusterLabelStruct"); - return nullptr; - } + jclass labelStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$FixedLabelClusterLabelStruct", labelStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$FixedLabelClusterLabelStruct"); + return nullptr; + } - jmethodID labelStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod( - env, labelStructStructClass_1, "", "(Ljava/lang/String;Ljava/lang/String;)V", &labelStructStructCtor_1); - if (err != CHIP_NO_ERROR || labelStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$FixedLabelClusterLabelStruct constructor"); - return nullptr; - } + jmethodID labelStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod(env, labelStructStructClass_1, "", + "(Ljava/lang/String;Ljava/lang/String;)V", + &labelStructStructCtor_1); + if (err != CHIP_NO_ERROR || labelStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$FixedLabelClusterLabelStruct constructor"); + return nullptr; + } - newElement_0 = - env->NewObject(labelStructStructClass_1, labelStructStructCtor_1, newElement_0_label, newElement_0_value); + newElement_0 = + env->NewObject(labelStructStructClass_1, labelStructStructCtor_1, newElement_0_label, newElement_0_value); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -11362,26 +11443,29 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR jobject newElement_0_value; LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.value, newElement_0_value)); - jclass labelStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$UserLabelClusterLabelStruct", labelStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$UserLabelClusterLabelStruct"); - return nullptr; - } + jclass labelStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$UserLabelClusterLabelStruct", labelStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$UserLabelClusterLabelStruct"); + return nullptr; + } - jmethodID labelStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod( - env, labelStructStructClass_1, "", "(Ljava/lang/String;Ljava/lang/String;)V", &labelStructStructCtor_1); - if (err != CHIP_NO_ERROR || labelStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$UserLabelClusterLabelStruct constructor"); - return nullptr; - } + jmethodID labelStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod(env, labelStructStructClass_1, "", + "(Ljava/lang/String;Ljava/lang/String;)V", + &labelStructStructCtor_1); + if (err != CHIP_NO_ERROR || labelStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$UserLabelClusterLabelStruct constructor"); + return nullptr; + } - newElement_0 = - env->NewObject(labelStructStructClass_1, labelStructStructCtor_1, newElement_0_label, newElement_0_value); + newElement_0 = + env->NewObject(labelStructStructClass_1, labelStructStructCtor_1, newElement_0_label, newElement_0_value); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -12205,30 +12289,33 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_0_fabricIndexCtorSignature.c_str(), jninewElement_0_fabricIndex, newElement_0_fabricIndex); - jclass monitoringRegistrationStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$IcdManagementClusterMonitoringRegistrationStruct", - monitoringRegistrationStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$IcdManagementClusterMonitoringRegistrationStruct"); - return nullptr; - } + jclass monitoringRegistrationStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$IcdManagementClusterMonitoringRegistrationStruct", + monitoringRegistrationStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$IcdManagementClusterMonitoringRegistrationStruct"); + return nullptr; + } - jmethodID monitoringRegistrationStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod( - env, monitoringRegistrationStructStructClass_1, "", - "(Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Integer;Ljava/lang/Integer;)V", - &monitoringRegistrationStructStructCtor_1); - if (err != CHIP_NO_ERROR || monitoringRegistrationStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$IcdManagementClusterMonitoringRegistrationStruct constructor"); - return nullptr; - } + jmethodID monitoringRegistrationStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, monitoringRegistrationStructStructClass_1, "", + "(Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Integer;Ljava/lang/Integer;)V", + &monitoringRegistrationStructStructCtor_1); + if (err != CHIP_NO_ERROR || monitoringRegistrationStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$IcdManagementClusterMonitoringRegistrationStruct constructor"); + return nullptr; + } - newElement_0 = env->NewObject(monitoringRegistrationStructStructClass_1, monitoringRegistrationStructStructCtor_1, - newElement_0_checkInNodeID, newElement_0_monitoredSubject, newElement_0_clientType, - newElement_0_fabricIndex); + newElement_0 = env->NewObject(monitoringRegistrationStructStructClass_1, + monitoringRegistrationStructStructCtor_1, newElement_0_checkInNodeID, + newElement_0_monitoredSubject, newElement_0_clientType, newElement_0_fabricIndex); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -12768,29 +12855,32 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_0_operationalStateLabel); } - jclass operationalStateStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$OvenCavityOperationalStateClusterOperationalStateStruct", - operationalStateStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$OvenCavityOperationalStateClusterOperationalStateStruct"); - return nullptr; - } + jclass operationalStateStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$OvenCavityOperationalStateClusterOperationalStateStruct", + operationalStateStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, + "Could not find class ChipStructs$OvenCavityOperationalStateClusterOperationalStateStruct"); + return nullptr; + } - jmethodID operationalStateStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod(env, operationalStateStructStructClass_1, "", - "(Ljava/lang/Integer;Ljava/util/Optional;)V", - &operationalStateStructStructCtor_1); - if (err != CHIP_NO_ERROR || operationalStateStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, - "Could not find ChipStructs$OvenCavityOperationalStateClusterOperationalStateStruct constructor"); - return nullptr; - } + jmethodID operationalStateStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod(env, operationalStateStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/util/Optional;)V", + &operationalStateStructStructCtor_1); + if (err != CHIP_NO_ERROR || operationalStateStructStructCtor_1 == nullptr) + { + ChipLogError( + Zcl, "Could not find ChipStructs$OvenCavityOperationalStateClusterOperationalStateStruct constructor"); + return nullptr; + } - newElement_0 = env->NewObject(operationalStateStructStructClass_1, operationalStateStructStructCtor_1, - newElement_0_operationalStateID, newElement_0_operationalStateLabel); + newElement_0 = env->NewObject(operationalStateStructStructClass_1, operationalStateStructStructCtor_1, + newElement_0_operationalStateID, newElement_0_operationalStateLabel); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -12852,28 +12942,30 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR chip::JniReferences::GetInstance().CreateOptional(value_errorStateDetailsInsideOptional, value_errorStateDetails); } - jclass errorStateStructStructClass_0; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$OvenCavityOperationalStateClusterErrorStateStruct", - errorStateStructStructClass_0); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$OvenCavityOperationalStateClusterErrorStateStruct"); - return nullptr; - } + jclass errorStateStructStructClass_0; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$OvenCavityOperationalStateClusterErrorStateStruct", + errorStateStructStructClass_0); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$OvenCavityOperationalStateClusterErrorStateStruct"); + return nullptr; + } - jmethodID errorStateStructStructCtor_0; - err = chip::JniReferences::GetInstance().FindMethod(env, errorStateStructStructClass_0, "", - "(Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;)V", - &errorStateStructStructCtor_0); - if (err != CHIP_NO_ERROR || errorStateStructStructCtor_0 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$OvenCavityOperationalStateClusterErrorStateStruct constructor"); - return nullptr; - } + jmethodID errorStateStructStructCtor_0; + err = chip::JniReferences::GetInstance().FindMethod( + env, errorStateStructStructClass_0, "", "(Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;)V", + &errorStateStructStructCtor_0); + if (err != CHIP_NO_ERROR || errorStateStructStructCtor_0 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$OvenCavityOperationalStateClusterErrorStateStruct constructor"); + return nullptr; + } - value = env->NewObject(errorStateStructStructClass_0, errorStateStructStructCtor_0, value_errorStateID, - value_errorStateLabel, value_errorStateDetails); + value = env->NewObject(errorStateStructStructClass_0, errorStateStructStructCtor_0, value_errorStateID, + value_errorStateLabel, value_errorStateDetails); + } return value; } case Attributes::GeneratedCommandList::Id: { @@ -13076,51 +13168,55 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_2_valueCtorSignature.c_str(), jninewElement_2_value, newElement_2_value); - jclass modeTagStructStructClass_3; + { + jclass modeTagStructStructClass_3; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$OvenModeClusterModeTagStruct", modeTagStructStructClass_3); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$OvenModeClusterModeTagStruct"); + return nullptr; + } + + jmethodID modeTagStructStructCtor_3; + err = chip::JniReferences::GetInstance().FindMethod(env, modeTagStructStructClass_3, "", + "(Ljava/util/Optional;Ljava/lang/Integer;)V", + &modeTagStructStructCtor_3); + if (err != CHIP_NO_ERROR || modeTagStructStructCtor_3 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$OvenModeClusterModeTagStruct constructor"); + return nullptr; + } + + newElement_2 = env->NewObject(modeTagStructStructClass_3, modeTagStructStructCtor_3, newElement_2_mfgCode, + newElement_2_value); + } + chip::JniReferences::GetInstance().AddToList(newElement_0_modeTags, newElement_2); + } + + { + jclass modeOptionStructStructClass_1; err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$OvenModeClusterModeTagStruct", modeTagStructStructClass_3); + env, "chip/devicecontroller/ChipStructs$OvenModeClusterModeOptionStruct", modeOptionStructStructClass_1); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$OvenModeClusterModeTagStruct"); + ChipLogError(Zcl, "Could not find class ChipStructs$OvenModeClusterModeOptionStruct"); return nullptr; } - jmethodID modeTagStructStructCtor_3; - err = chip::JniReferences::GetInstance().FindMethod(env, modeTagStructStructClass_3, "", - "(Ljava/util/Optional;Ljava/lang/Integer;)V", - &modeTagStructStructCtor_3); - if (err != CHIP_NO_ERROR || modeTagStructStructCtor_3 == nullptr) + jmethodID modeOptionStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, modeOptionStructStructClass_1, "", + "(Ljava/lang/String;Ljava/lang/Integer;Ljava/util/ArrayList;)V", &modeOptionStructStructCtor_1); + if (err != CHIP_NO_ERROR || modeOptionStructStructCtor_1 == nullptr) { - ChipLogError(Zcl, "Could not find ChipStructs$OvenModeClusterModeTagStruct constructor"); + ChipLogError(Zcl, "Could not find ChipStructs$OvenModeClusterModeOptionStruct constructor"); return nullptr; } - newElement_2 = env->NewObject(modeTagStructStructClass_3, modeTagStructStructCtor_3, newElement_2_mfgCode, - newElement_2_value); - chip::JniReferences::GetInstance().AddToList(newElement_0_modeTags, newElement_2); - } - - jclass modeOptionStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$OvenModeClusterModeOptionStruct", modeOptionStructStructClass_1); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Could not find class ChipStructs$OvenModeClusterModeOptionStruct"); - return nullptr; - } - - jmethodID modeOptionStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod(env, modeOptionStructStructClass_1, "", - "(Ljava/lang/String;Ljava/lang/Integer;Ljava/util/ArrayList;)V", - &modeOptionStructStructCtor_1); - if (err != CHIP_NO_ERROR || modeOptionStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$OvenModeClusterModeOptionStruct constructor"); - return nullptr; + newElement_0 = env->NewObject(modeOptionStructStructClass_1, modeOptionStructStructCtor_1, newElement_0_label, + newElement_0_mode, newElement_0_modeTags); } - - newElement_0 = env->NewObject(modeOptionStructStructClass_1, modeOptionStructStructCtor_1, newElement_0_label, - newElement_0_mode, newElement_0_modeTags); chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -13602,52 +13698,56 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_2_valueCtorSignature.c_str(), jninewElement_2_value, newElement_2_value); - jclass semanticTagStructStructClass_3; + { + jclass semanticTagStructStructClass_3; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$ModeSelectClusterSemanticTagStruct", + semanticTagStructStructClass_3); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$ModeSelectClusterSemanticTagStruct"); + return nullptr; + } + + jmethodID semanticTagStructStructCtor_3; + err = chip::JniReferences::GetInstance().FindMethod(env, semanticTagStructStructClass_3, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;)V", + &semanticTagStructStructCtor_3); + if (err != CHIP_NO_ERROR || semanticTagStructStructCtor_3 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$ModeSelectClusterSemanticTagStruct constructor"); + return nullptr; + } + + newElement_2 = env->NewObject(semanticTagStructStructClass_3, semanticTagStructStructCtor_3, + newElement_2_mfgCode, newElement_2_value); + } + chip::JniReferences::GetInstance().AddToList(newElement_0_semanticTags, newElement_2); + } + + { + jclass modeOptionStructStructClass_1; err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$ModeSelectClusterSemanticTagStruct", - semanticTagStructStructClass_3); + env, "chip/devicecontroller/ChipStructs$ModeSelectClusterModeOptionStruct", modeOptionStructStructClass_1); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$ModeSelectClusterSemanticTagStruct"); + ChipLogError(Zcl, "Could not find class ChipStructs$ModeSelectClusterModeOptionStruct"); return nullptr; } - jmethodID semanticTagStructStructCtor_3; - err = chip::JniReferences::GetInstance().FindMethod(env, semanticTagStructStructClass_3, "", - "(Ljava/lang/Integer;Ljava/lang/Integer;)V", - &semanticTagStructStructCtor_3); - if (err != CHIP_NO_ERROR || semanticTagStructStructCtor_3 == nullptr) + jmethodID modeOptionStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, modeOptionStructStructClass_1, "", + "(Ljava/lang/String;Ljava/lang/Integer;Ljava/util/ArrayList;)V", &modeOptionStructStructCtor_1); + if (err != CHIP_NO_ERROR || modeOptionStructStructCtor_1 == nullptr) { - ChipLogError(Zcl, "Could not find ChipStructs$ModeSelectClusterSemanticTagStruct constructor"); + ChipLogError(Zcl, "Could not find ChipStructs$ModeSelectClusterModeOptionStruct constructor"); return nullptr; } - newElement_2 = env->NewObject(semanticTagStructStructClass_3, semanticTagStructStructCtor_3, - newElement_2_mfgCode, newElement_2_value); - chip::JniReferences::GetInstance().AddToList(newElement_0_semanticTags, newElement_2); - } - - jclass modeOptionStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$ModeSelectClusterModeOptionStruct", modeOptionStructStructClass_1); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Could not find class ChipStructs$ModeSelectClusterModeOptionStruct"); - return nullptr; - } - - jmethodID modeOptionStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod(env, modeOptionStructStructClass_1, "", - "(Ljava/lang/String;Ljava/lang/Integer;Ljava/util/ArrayList;)V", - &modeOptionStructStructCtor_1); - if (err != CHIP_NO_ERROR || modeOptionStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$ModeSelectClusterModeOptionStruct constructor"); - return nullptr; + newElement_0 = env->NewObject(modeOptionStructStructClass_1, modeOptionStructStructCtor_1, newElement_0_label, + newElement_0_mode, newElement_0_semanticTags); } - - newElement_0 = env->NewObject(modeOptionStructStructClass_1, modeOptionStructStructCtor_1, newElement_0_label, - newElement_0_mode, newElement_0_semanticTags); chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -13914,52 +14014,57 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_2_valueCtorSignature.c_str(), jninewElement_2_value, newElement_2_value); - jclass modeTagStructStructClass_3; + { + jclass modeTagStructStructClass_3; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$LaundryWasherModeClusterModeTagStruct", + modeTagStructStructClass_3); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$LaundryWasherModeClusterModeTagStruct"); + return nullptr; + } + + jmethodID modeTagStructStructCtor_3; + err = chip::JniReferences::GetInstance().FindMethod(env, modeTagStructStructClass_3, "", + "(Ljava/util/Optional;Ljava/lang/Integer;)V", + &modeTagStructStructCtor_3); + if (err != CHIP_NO_ERROR || modeTagStructStructCtor_3 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$LaundryWasherModeClusterModeTagStruct constructor"); + return nullptr; + } + + newElement_2 = env->NewObject(modeTagStructStructClass_3, modeTagStructStructCtor_3, newElement_2_mfgCode, + newElement_2_value); + } + chip::JniReferences::GetInstance().AddToList(newElement_0_modeTags, newElement_2); + } + + { + jclass modeOptionStructStructClass_1; err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$LaundryWasherModeClusterModeTagStruct", modeTagStructStructClass_3); + env, "chip/devicecontroller/ChipStructs$LaundryWasherModeClusterModeOptionStruct", + modeOptionStructStructClass_1); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$LaundryWasherModeClusterModeTagStruct"); + ChipLogError(Zcl, "Could not find class ChipStructs$LaundryWasherModeClusterModeOptionStruct"); return nullptr; } - jmethodID modeTagStructStructCtor_3; - err = chip::JniReferences::GetInstance().FindMethod(env, modeTagStructStructClass_3, "", - "(Ljava/util/Optional;Ljava/lang/Integer;)V", - &modeTagStructStructCtor_3); - if (err != CHIP_NO_ERROR || modeTagStructStructCtor_3 == nullptr) + jmethodID modeOptionStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, modeOptionStructStructClass_1, "", + "(Ljava/lang/String;Ljava/lang/Integer;Ljava/util/ArrayList;)V", &modeOptionStructStructCtor_1); + if (err != CHIP_NO_ERROR || modeOptionStructStructCtor_1 == nullptr) { - ChipLogError(Zcl, "Could not find ChipStructs$LaundryWasherModeClusterModeTagStruct constructor"); + ChipLogError(Zcl, "Could not find ChipStructs$LaundryWasherModeClusterModeOptionStruct constructor"); return nullptr; } - newElement_2 = env->NewObject(modeTagStructStructClass_3, modeTagStructStructCtor_3, newElement_2_mfgCode, - newElement_2_value); - chip::JniReferences::GetInstance().AddToList(newElement_0_modeTags, newElement_2); - } - - jclass modeOptionStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$LaundryWasherModeClusterModeOptionStruct", - modeOptionStructStructClass_1); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Could not find class ChipStructs$LaundryWasherModeClusterModeOptionStruct"); - return nullptr; - } - - jmethodID modeOptionStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod(env, modeOptionStructStructClass_1, "", - "(Ljava/lang/String;Ljava/lang/Integer;Ljava/util/ArrayList;)V", - &modeOptionStructStructCtor_1); - if (err != CHIP_NO_ERROR || modeOptionStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$LaundryWasherModeClusterModeOptionStruct constructor"); - return nullptr; + newElement_0 = env->NewObject(modeOptionStructStructClass_1, modeOptionStructStructCtor_1, newElement_0_label, + newElement_0_mode, newElement_0_modeTags); } - - newElement_0 = env->NewObject(modeOptionStructStructClass_1, modeOptionStructStructCtor_1, newElement_0_label, - newElement_0_mode, newElement_0_modeTags); chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -14226,62 +14331,69 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_2_valueCtorSignature.c_str(), jninewElement_2_value, newElement_2_value); - jclass modeTagStructStructClass_3; + { + jclass modeTagStructStructClass_3; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, + "chip/devicecontroller/ChipStructs$RefrigeratorAndTemperatureControlledCabinetModeClusterModeTagStruct", + modeTagStructStructClass_3); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, + "Could not find class " + "ChipStructs$RefrigeratorAndTemperatureControlledCabinetModeClusterModeTagStruct"); + return nullptr; + } + + jmethodID modeTagStructStructCtor_3; + err = chip::JniReferences::GetInstance().FindMethod(env, modeTagStructStructClass_3, "", + "(Ljava/util/Optional;Ljava/lang/Integer;)V", + &modeTagStructStructCtor_3); + if (err != CHIP_NO_ERROR || modeTagStructStructCtor_3 == nullptr) + { + ChipLogError( + Zcl, + "Could not find ChipStructs$RefrigeratorAndTemperatureControlledCabinetModeClusterModeTagStruct " + "constructor"); + return nullptr; + } + + newElement_2 = env->NewObject(modeTagStructStructClass_3, modeTagStructStructCtor_3, newElement_2_mfgCode, + newElement_2_value); + } + chip::JniReferences::GetInstance().AddToList(newElement_0_modeTags, newElement_2); + } + + { + jclass modeOptionStructStructClass_1; err = chip::JniReferences::GetInstance().GetLocalClassRef( env, - "chip/devicecontroller/ChipStructs$RefrigeratorAndTemperatureControlledCabinetModeClusterModeTagStruct", - modeTagStructStructClass_3); + "chip/devicecontroller/ChipStructs$RefrigeratorAndTemperatureControlledCabinetModeClusterModeOptionStruct", + modeOptionStructStructClass_1); if (err != CHIP_NO_ERROR) { - ChipLogError( - Zcl, - "Could not find class ChipStructs$RefrigeratorAndTemperatureControlledCabinetModeClusterModeTagStruct"); + ChipLogError(Zcl, + "Could not find class " + "ChipStructs$RefrigeratorAndTemperatureControlledCabinetModeClusterModeOptionStruct"); return nullptr; } - jmethodID modeTagStructStructCtor_3; - err = chip::JniReferences::GetInstance().FindMethod(env, modeTagStructStructClass_3, "", - "(Ljava/util/Optional;Ljava/lang/Integer;)V", - &modeTagStructStructCtor_3); - if (err != CHIP_NO_ERROR || modeTagStructStructCtor_3 == nullptr) + jmethodID modeOptionStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, modeOptionStructStructClass_1, "", + "(Ljava/lang/String;Ljava/lang/Integer;Ljava/util/ArrayList;)V", &modeOptionStructStructCtor_1); + if (err != CHIP_NO_ERROR || modeOptionStructStructCtor_1 == nullptr) { - ChipLogError(Zcl, - "Could not find " - "ChipStructs$RefrigeratorAndTemperatureControlledCabinetModeClusterModeTagStruct constructor"); + ChipLogError( + Zcl, + "Could not find ChipStructs$RefrigeratorAndTemperatureControlledCabinetModeClusterModeOptionStruct " + "constructor"); return nullptr; } - newElement_2 = env->NewObject(modeTagStructStructClass_3, modeTagStructStructCtor_3, newElement_2_mfgCode, - newElement_2_value); - chip::JniReferences::GetInstance().AddToList(newElement_0_modeTags, newElement_2); - } - - jclass modeOptionStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$RefrigeratorAndTemperatureControlledCabinetModeClusterModeOptionStruct", - modeOptionStructStructClass_1); - if (err != CHIP_NO_ERROR) - { - ChipLogError( - Zcl, - "Could not find class ChipStructs$RefrigeratorAndTemperatureControlledCabinetModeClusterModeOptionStruct"); - return nullptr; - } - - jmethodID modeOptionStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod(env, modeOptionStructStructClass_1, "", - "(Ljava/lang/String;Ljava/lang/Integer;Ljava/util/ArrayList;)V", - &modeOptionStructStructCtor_1); - if (err != CHIP_NO_ERROR || modeOptionStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, - "Could not find " - "ChipStructs$RefrigeratorAndTemperatureControlledCabinetModeClusterModeOptionStruct constructor"); - return nullptr; + newElement_0 = env->NewObject(modeOptionStructStructClass_1, modeOptionStructStructCtor_1, newElement_0_label, + newElement_0_mode, newElement_0_modeTags); } - - newElement_0 = env->NewObject(modeOptionStructStructClass_1, modeOptionStructStructCtor_1, newElement_0_label, - newElement_0_mode, newElement_0_modeTags); chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -14775,51 +14887,55 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_2_valueCtorSignature.c_str(), jninewElement_2_value, newElement_2_value); - jclass modeTagStructStructClass_3; + { + jclass modeTagStructStructClass_3; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$RvcRunModeClusterModeTagStruct", modeTagStructStructClass_3); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$RvcRunModeClusterModeTagStruct"); + return nullptr; + } + + jmethodID modeTagStructStructCtor_3; + err = chip::JniReferences::GetInstance().FindMethod(env, modeTagStructStructClass_3, "", + "(Ljava/util/Optional;Ljava/lang/Integer;)V", + &modeTagStructStructCtor_3); + if (err != CHIP_NO_ERROR || modeTagStructStructCtor_3 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$RvcRunModeClusterModeTagStruct constructor"); + return nullptr; + } + + newElement_2 = env->NewObject(modeTagStructStructClass_3, modeTagStructStructCtor_3, newElement_2_mfgCode, + newElement_2_value); + } + chip::JniReferences::GetInstance().AddToList(newElement_0_modeTags, newElement_2); + } + + { + jclass modeOptionStructStructClass_1; err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$RvcRunModeClusterModeTagStruct", modeTagStructStructClass_3); + env, "chip/devicecontroller/ChipStructs$RvcRunModeClusterModeOptionStruct", modeOptionStructStructClass_1); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$RvcRunModeClusterModeTagStruct"); + ChipLogError(Zcl, "Could not find class ChipStructs$RvcRunModeClusterModeOptionStruct"); return nullptr; } - jmethodID modeTagStructStructCtor_3; - err = chip::JniReferences::GetInstance().FindMethod(env, modeTagStructStructClass_3, "", - "(Ljava/util/Optional;Ljava/lang/Integer;)V", - &modeTagStructStructCtor_3); - if (err != CHIP_NO_ERROR || modeTagStructStructCtor_3 == nullptr) + jmethodID modeOptionStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, modeOptionStructStructClass_1, "", + "(Ljava/lang/String;Ljava/lang/Integer;Ljava/util/ArrayList;)V", &modeOptionStructStructCtor_1); + if (err != CHIP_NO_ERROR || modeOptionStructStructCtor_1 == nullptr) { - ChipLogError(Zcl, "Could not find ChipStructs$RvcRunModeClusterModeTagStruct constructor"); + ChipLogError(Zcl, "Could not find ChipStructs$RvcRunModeClusterModeOptionStruct constructor"); return nullptr; } - newElement_2 = env->NewObject(modeTagStructStructClass_3, modeTagStructStructCtor_3, newElement_2_mfgCode, - newElement_2_value); - chip::JniReferences::GetInstance().AddToList(newElement_0_modeTags, newElement_2); - } - - jclass modeOptionStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$RvcRunModeClusterModeOptionStruct", modeOptionStructStructClass_1); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Could not find class ChipStructs$RvcRunModeClusterModeOptionStruct"); - return nullptr; - } - - jmethodID modeOptionStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod(env, modeOptionStructStructClass_1, "", - "(Ljava/lang/String;Ljava/lang/Integer;Ljava/util/ArrayList;)V", - &modeOptionStructStructCtor_1); - if (err != CHIP_NO_ERROR || modeOptionStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$RvcRunModeClusterModeOptionStruct constructor"); - return nullptr; + newElement_0 = env->NewObject(modeOptionStructStructClass_1, modeOptionStructStructCtor_1, newElement_0_label, + newElement_0_mode, newElement_0_modeTags); } - - newElement_0 = env->NewObject(modeOptionStructStructClass_1, modeOptionStructStructCtor_1, newElement_0_label, - newElement_0_mode, newElement_0_modeTags); chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -15040,51 +15156,56 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_2_valueCtorSignature.c_str(), jninewElement_2_value, newElement_2_value); - jclass modeTagStructStructClass_3; + { + jclass modeTagStructStructClass_3; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$RvcCleanModeClusterModeTagStruct", modeTagStructStructClass_3); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$RvcCleanModeClusterModeTagStruct"); + return nullptr; + } + + jmethodID modeTagStructStructCtor_3; + err = chip::JniReferences::GetInstance().FindMethod(env, modeTagStructStructClass_3, "", + "(Ljava/util/Optional;Ljava/lang/Integer;)V", + &modeTagStructStructCtor_3); + if (err != CHIP_NO_ERROR || modeTagStructStructCtor_3 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$RvcCleanModeClusterModeTagStruct constructor"); + return nullptr; + } + + newElement_2 = env->NewObject(modeTagStructStructClass_3, modeTagStructStructCtor_3, newElement_2_mfgCode, + newElement_2_value); + } + chip::JniReferences::GetInstance().AddToList(newElement_0_modeTags, newElement_2); + } + + { + jclass modeOptionStructStructClass_1; err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$RvcCleanModeClusterModeTagStruct", modeTagStructStructClass_3); + env, "chip/devicecontroller/ChipStructs$RvcCleanModeClusterModeOptionStruct", + modeOptionStructStructClass_1); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$RvcCleanModeClusterModeTagStruct"); + ChipLogError(Zcl, "Could not find class ChipStructs$RvcCleanModeClusterModeOptionStruct"); return nullptr; } - jmethodID modeTagStructStructCtor_3; - err = chip::JniReferences::GetInstance().FindMethod(env, modeTagStructStructClass_3, "", - "(Ljava/util/Optional;Ljava/lang/Integer;)V", - &modeTagStructStructCtor_3); - if (err != CHIP_NO_ERROR || modeTagStructStructCtor_3 == nullptr) + jmethodID modeOptionStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, modeOptionStructStructClass_1, "", + "(Ljava/lang/String;Ljava/lang/Integer;Ljava/util/ArrayList;)V", &modeOptionStructStructCtor_1); + if (err != CHIP_NO_ERROR || modeOptionStructStructCtor_1 == nullptr) { - ChipLogError(Zcl, "Could not find ChipStructs$RvcCleanModeClusterModeTagStruct constructor"); + ChipLogError(Zcl, "Could not find ChipStructs$RvcCleanModeClusterModeOptionStruct constructor"); return nullptr; } - newElement_2 = env->NewObject(modeTagStructStructClass_3, modeTagStructStructCtor_3, newElement_2_mfgCode, - newElement_2_value); - chip::JniReferences::GetInstance().AddToList(newElement_0_modeTags, newElement_2); - } - - jclass modeOptionStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$RvcCleanModeClusterModeOptionStruct", modeOptionStructStructClass_1); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Could not find class ChipStructs$RvcCleanModeClusterModeOptionStruct"); - return nullptr; - } - - jmethodID modeOptionStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod(env, modeOptionStructStructClass_1, "", - "(Ljava/lang/String;Ljava/lang/Integer;Ljava/util/ArrayList;)V", - &modeOptionStructStructCtor_1); - if (err != CHIP_NO_ERROR || modeOptionStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$RvcCleanModeClusterModeOptionStruct constructor"); - return nullptr; + newElement_0 = env->NewObject(modeOptionStructStructClass_1, modeOptionStructStructCtor_1, newElement_0_label, + newElement_0_mode, newElement_0_modeTags); } - - newElement_0 = env->NewObject(modeOptionStructStructClass_1, modeOptionStructStructCtor_1, newElement_0_label, - newElement_0_mode, newElement_0_modeTags); chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -15738,51 +15859,57 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_2_valueCtorSignature.c_str(), jninewElement_2_value, newElement_2_value); - jclass modeTagStructStructClass_3; + { + jclass modeTagStructStructClass_3; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$DishwasherModeClusterModeTagStruct", + modeTagStructStructClass_3); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$DishwasherModeClusterModeTagStruct"); + return nullptr; + } + + jmethodID modeTagStructStructCtor_3; + err = chip::JniReferences::GetInstance().FindMethod(env, modeTagStructStructClass_3, "", + "(Ljava/util/Optional;Ljava/lang/Integer;)V", + &modeTagStructStructCtor_3); + if (err != CHIP_NO_ERROR || modeTagStructStructCtor_3 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$DishwasherModeClusterModeTagStruct constructor"); + return nullptr; + } + + newElement_2 = env->NewObject(modeTagStructStructClass_3, modeTagStructStructCtor_3, newElement_2_mfgCode, + newElement_2_value); + } + chip::JniReferences::GetInstance().AddToList(newElement_0_modeTags, newElement_2); + } + + { + jclass modeOptionStructStructClass_1; err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$DishwasherModeClusterModeTagStruct", modeTagStructStructClass_3); + env, "chip/devicecontroller/ChipStructs$DishwasherModeClusterModeOptionStruct", + modeOptionStructStructClass_1); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$DishwasherModeClusterModeTagStruct"); + ChipLogError(Zcl, "Could not find class ChipStructs$DishwasherModeClusterModeOptionStruct"); return nullptr; } - jmethodID modeTagStructStructCtor_3; - err = chip::JniReferences::GetInstance().FindMethod(env, modeTagStructStructClass_3, "", - "(Ljava/util/Optional;Ljava/lang/Integer;)V", - &modeTagStructStructCtor_3); - if (err != CHIP_NO_ERROR || modeTagStructStructCtor_3 == nullptr) + jmethodID modeOptionStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, modeOptionStructStructClass_1, "", + "(Ljava/lang/String;Ljava/lang/Integer;Ljava/util/ArrayList;)V", &modeOptionStructStructCtor_1); + if (err != CHIP_NO_ERROR || modeOptionStructStructCtor_1 == nullptr) { - ChipLogError(Zcl, "Could not find ChipStructs$DishwasherModeClusterModeTagStruct constructor"); + ChipLogError(Zcl, "Could not find ChipStructs$DishwasherModeClusterModeOptionStruct constructor"); return nullptr; } - newElement_2 = env->NewObject(modeTagStructStructClass_3, modeTagStructStructCtor_3, newElement_2_mfgCode, - newElement_2_value); - chip::JniReferences::GetInstance().AddToList(newElement_0_modeTags, newElement_2); + newElement_0 = env->NewObject(modeOptionStructStructClass_1, modeOptionStructStructCtor_1, newElement_0_label, + newElement_0_mode, newElement_0_modeTags); } - - jclass modeOptionStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$DishwasherModeClusterModeOptionStruct", modeOptionStructStructClass_1); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Could not find class ChipStructs$DishwasherModeClusterModeOptionStruct"); - return nullptr; - } - - jmethodID modeOptionStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod(env, modeOptionStructStructClass_1, "", - "(Ljava/lang/String;Ljava/lang/Integer;Ljava/util/ArrayList;)V", - &modeOptionStructStructCtor_1); - if (err != CHIP_NO_ERROR || modeOptionStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$DishwasherModeClusterModeOptionStruct constructor"); - return nullptr; - } - - newElement_0 = env->NewObject(modeOptionStructStructClass_1, modeOptionStructStructCtor_1, newElement_0_label, - newElement_0_mode, newElement_0_modeTags); chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -16763,52 +16890,57 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_2_valueCtorSignature.c_str(), jninewElement_2_value, newElement_2_value); - jclass modeTagStructStructClass_3; + { + jclass modeTagStructStructClass_3; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$MicrowaveOvenModeClusterModeTagStruct", + modeTagStructStructClass_3); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$MicrowaveOvenModeClusterModeTagStruct"); + return nullptr; + } + + jmethodID modeTagStructStructCtor_3; + err = chip::JniReferences::GetInstance().FindMethod(env, modeTagStructStructClass_3, "", + "(Ljava/util/Optional;Ljava/lang/Integer;)V", + &modeTagStructStructCtor_3); + if (err != CHIP_NO_ERROR || modeTagStructStructCtor_3 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$MicrowaveOvenModeClusterModeTagStruct constructor"); + return nullptr; + } + + newElement_2 = env->NewObject(modeTagStructStructClass_3, modeTagStructStructCtor_3, newElement_2_mfgCode, + newElement_2_value); + } + chip::JniReferences::GetInstance().AddToList(newElement_0_modeTags, newElement_2); + } + + { + jclass modeOptionStructStructClass_1; err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$MicrowaveOvenModeClusterModeTagStruct", modeTagStructStructClass_3); + env, "chip/devicecontroller/ChipStructs$MicrowaveOvenModeClusterModeOptionStruct", + modeOptionStructStructClass_1); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$MicrowaveOvenModeClusterModeTagStruct"); + ChipLogError(Zcl, "Could not find class ChipStructs$MicrowaveOvenModeClusterModeOptionStruct"); return nullptr; } - jmethodID modeTagStructStructCtor_3; - err = chip::JniReferences::GetInstance().FindMethod(env, modeTagStructStructClass_3, "", - "(Ljava/util/Optional;Ljava/lang/Integer;)V", - &modeTagStructStructCtor_3); - if (err != CHIP_NO_ERROR || modeTagStructStructCtor_3 == nullptr) + jmethodID modeOptionStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, modeOptionStructStructClass_1, "", + "(Ljava/lang/String;Ljava/lang/Integer;Ljava/util/ArrayList;)V", &modeOptionStructStructCtor_1); + if (err != CHIP_NO_ERROR || modeOptionStructStructCtor_1 == nullptr) { - ChipLogError(Zcl, "Could not find ChipStructs$MicrowaveOvenModeClusterModeTagStruct constructor"); + ChipLogError(Zcl, "Could not find ChipStructs$MicrowaveOvenModeClusterModeOptionStruct constructor"); return nullptr; } - newElement_2 = env->NewObject(modeTagStructStructClass_3, modeTagStructStructCtor_3, newElement_2_mfgCode, - newElement_2_value); - chip::JniReferences::GetInstance().AddToList(newElement_0_modeTags, newElement_2); - } - - jclass modeOptionStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$MicrowaveOvenModeClusterModeOptionStruct", - modeOptionStructStructClass_1); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Could not find class ChipStructs$MicrowaveOvenModeClusterModeOptionStruct"); - return nullptr; - } - - jmethodID modeOptionStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod(env, modeOptionStructStructClass_1, "", - "(Ljava/lang/String;Ljava/lang/Integer;Ljava/util/ArrayList;)V", - &modeOptionStructStructCtor_1); - if (err != CHIP_NO_ERROR || modeOptionStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$MicrowaveOvenModeClusterModeOptionStruct constructor"); - return nullptr; + newElement_0 = env->NewObject(modeOptionStructStructClass_1, modeOptionStructStructCtor_1, newElement_0_label, + newElement_0_mode, newElement_0_modeTags); } - - newElement_0 = env->NewObject(modeOptionStructStructClass_1, modeOptionStructStructCtor_1, newElement_0_label, - newElement_0_mode, newElement_0_modeTags); chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -17377,28 +17509,30 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_0_operationalStateLabel); } - jclass operationalStateStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$OperationalStateClusterOperationalStateStruct", - operationalStateStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$OperationalStateClusterOperationalStateStruct"); - return nullptr; - } + jclass operationalStateStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$OperationalStateClusterOperationalStateStruct", + operationalStateStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$OperationalStateClusterOperationalStateStruct"); + return nullptr; + } - jmethodID operationalStateStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod(env, operationalStateStructStructClass_1, "", - "(Ljava/lang/Integer;Ljava/util/Optional;)V", - &operationalStateStructStructCtor_1); - if (err != CHIP_NO_ERROR || operationalStateStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$OperationalStateClusterOperationalStateStruct constructor"); - return nullptr; - } + jmethodID operationalStateStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod(env, operationalStateStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/util/Optional;)V", + &operationalStateStructStructCtor_1); + if (err != CHIP_NO_ERROR || operationalStateStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$OperationalStateClusterOperationalStateStruct constructor"); + return nullptr; + } - newElement_0 = env->NewObject(operationalStateStructStructClass_1, operationalStateStructStructCtor_1, - newElement_0_operationalStateID, newElement_0_operationalStateLabel); + newElement_0 = env->NewObject(operationalStateStructStructClass_1, operationalStateStructStructCtor_1, + newElement_0_operationalStateID, newElement_0_operationalStateLabel); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -17460,81 +17594,84 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR chip::JniReferences::GetInstance().CreateOptional(value_errorStateDetailsInsideOptional, value_errorStateDetails); } - jclass errorStateStructStructClass_0; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$OperationalStateClusterErrorStateStruct", errorStateStructStructClass_0); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$OperationalStateClusterErrorStateStruct"); + jclass errorStateStructStructClass_0; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$OperationalStateClusterErrorStateStruct", + errorStateStructStructClass_0); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$OperationalStateClusterErrorStateStruct"); + return nullptr; + } + + jmethodID errorStateStructStructCtor_0; + err = chip::JniReferences::GetInstance().FindMethod( + env, errorStateStructStructClass_0, "", "(Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;)V", + &errorStateStructStructCtor_0); + if (err != CHIP_NO_ERROR || errorStateStructStructCtor_0 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$OperationalStateClusterErrorStateStruct constructor"); + return nullptr; + } + + value = env->NewObject(errorStateStructStructClass_0, errorStateStructStructCtor_0, value_errorStateID, + value_errorStateLabel, value_errorStateDetails); + } + 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); - jmethodID errorStateStructStructCtor_0; - err = chip::JniReferences::GetInstance().FindMethod(env, errorStateStructStructClass_0, "", - "(Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;)V", - &errorStateStructStructCtor_0); - if (err != CHIP_NO_ERROR || errorStateStructStructCtor_0 == nullptr) + 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) { - ChipLogError(Zcl, "Could not find ChipStructs$OperationalStateClusterErrorStateStruct constructor"); return nullptr; } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); - value = env->NewObject(errorStateStructStructClass_0, errorStateStructStructCtor_0, value_errorStateID, - value_errorStateLabel, value_errorStateDetails); + 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::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::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; + case Attributes::EventList::Id: { + using TypeInfo = Attributes::EventList::TypeInfo; TypeInfo::DecodableType cppValue; *aError = app::DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) @@ -17736,28 +17873,31 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_0_operationalStateLabel); } - jclass operationalStateStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$RvcOperationalStateClusterOperationalStateStruct", - operationalStateStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$RvcOperationalStateClusterOperationalStateStruct"); - return nullptr; - } + jclass operationalStateStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$RvcOperationalStateClusterOperationalStateStruct", + operationalStateStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$RvcOperationalStateClusterOperationalStateStruct"); + return nullptr; + } - jmethodID operationalStateStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod(env, operationalStateStructStructClass_1, "", - "(Ljava/lang/Integer;Ljava/util/Optional;)V", - &operationalStateStructStructCtor_1); - if (err != CHIP_NO_ERROR || operationalStateStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$RvcOperationalStateClusterOperationalStateStruct constructor"); - return nullptr; - } + jmethodID operationalStateStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod(env, operationalStateStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/util/Optional;)V", + &operationalStateStructStructCtor_1); + if (err != CHIP_NO_ERROR || operationalStateStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$RvcOperationalStateClusterOperationalStateStruct constructor"); + return nullptr; + } - newElement_0 = env->NewObject(operationalStateStructStructClass_1, operationalStateStructStructCtor_1, - newElement_0_operationalStateID, newElement_0_operationalStateLabel); + newElement_0 = env->NewObject(operationalStateStructStructClass_1, operationalStateStructStructCtor_1, + newElement_0_operationalStateID, newElement_0_operationalStateLabel); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -17819,27 +17959,30 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR chip::JniReferences::GetInstance().CreateOptional(value_errorStateDetailsInsideOptional, value_errorStateDetails); } - jclass errorStateStructStructClass_0; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$RvcOperationalStateClusterErrorStateStruct", errorStateStructStructClass_0); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$RvcOperationalStateClusterErrorStateStruct"); - return nullptr; - } + jclass errorStateStructStructClass_0; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$RvcOperationalStateClusterErrorStateStruct", + errorStateStructStructClass_0); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$RvcOperationalStateClusterErrorStateStruct"); + return nullptr; + } - jmethodID errorStateStructStructCtor_0; - err = chip::JniReferences::GetInstance().FindMethod(env, errorStateStructStructClass_0, "", - "(Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;)V", - &errorStateStructStructCtor_0); - if (err != CHIP_NO_ERROR || errorStateStructStructCtor_0 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$RvcOperationalStateClusterErrorStateStruct constructor"); - return nullptr; - } + jmethodID errorStateStructStructCtor_0; + err = chip::JniReferences::GetInstance().FindMethod( + env, errorStateStructStructClass_0, "", "(Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;)V", + &errorStateStructStructCtor_0); + if (err != CHIP_NO_ERROR || errorStateStructStructCtor_0 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$RvcOperationalStateClusterErrorStateStruct constructor"); + return nullptr; + } - value = env->NewObject(errorStateStructStructClass_0, errorStateStructStructCtor_0, value_errorStateID, - value_errorStateLabel, value_errorStateDetails); + value = env->NewObject(errorStateStructStructClass_0, errorStateStructStructCtor_0, value_errorStateID, + value_errorStateLabel, value_errorStateDetails); + } return value; } case Attributes::GeneratedCommandList::Id: { @@ -18082,30 +18225,34 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_0_fabricIndexCtorSignature.c_str(), jninewElement_0_fabricIndex, newElement_0_fabricIndex); - jclass sceneInfoStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$ScenesManagementClusterSceneInfoStruct", sceneInfoStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$ScenesManagementClusterSceneInfoStruct"); - return nullptr; - } + jclass sceneInfoStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$ScenesManagementClusterSceneInfoStruct", + sceneInfoStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$ScenesManagementClusterSceneInfoStruct"); + return nullptr; + } - jmethodID sceneInfoStructStructCtor_1; - err = - chip::JniReferences::GetInstance().FindMethod(env, sceneInfoStructStructClass_1, "", - "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/" - "lang/Boolean;Ljava/lang/Integer;Ljava/lang/Integer;)V", - &sceneInfoStructStructCtor_1); - if (err != CHIP_NO_ERROR || sceneInfoStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$ScenesManagementClusterSceneInfoStruct constructor"); - return nullptr; - } + jmethodID sceneInfoStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, sceneInfoStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Boolean;Ljava/lang/Integer;Ljava/" + "lang/Integer;)V", + &sceneInfoStructStructCtor_1); + if (err != CHIP_NO_ERROR || sceneInfoStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$ScenesManagementClusterSceneInfoStruct constructor"); + return nullptr; + } - newElement_0 = env->NewObject(sceneInfoStructStructClass_1, sceneInfoStructStructCtor_1, newElement_0_sceneCount, - newElement_0_currentScene, newElement_0_currentGroup, newElement_0_sceneValid, - newElement_0_remainingCapacity, newElement_0_fabricIndex); + newElement_0 = + env->NewObject(sceneInfoStructStructClass_1, sceneInfoStructStructCtor_1, newElement_0_sceneCount, + newElement_0_currentScene, newElement_0_currentGroup, newElement_0_sceneValid, + newElement_0_remainingCapacity, newElement_0_fabricIndex); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -18366,28 +18513,31 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.productIdentifierValue, newElement_0_productIdentifierValue)); - jclass replacementProductStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$HepaFilterMonitoringClusterReplacementProductStruct", - replacementProductStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$HepaFilterMonitoringClusterReplacementProductStruct"); - return nullptr; - } + jclass replacementProductStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$HepaFilterMonitoringClusterReplacementProductStruct", + replacementProductStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$HepaFilterMonitoringClusterReplacementProductStruct"); + return nullptr; + } - jmethodID replacementProductStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod(env, replacementProductStructStructClass_1, "", - "(Ljava/lang/Integer;Ljava/lang/String;)V", - &replacementProductStructStructCtor_1); - if (err != CHIP_NO_ERROR || replacementProductStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$HepaFilterMonitoringClusterReplacementProductStruct constructor"); - return nullptr; - } + jmethodID replacementProductStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod(env, replacementProductStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/lang/String;)V", + &replacementProductStructStructCtor_1); + if (err != CHIP_NO_ERROR || replacementProductStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$HepaFilterMonitoringClusterReplacementProductStruct constructor"); + return nullptr; + } - newElement_0 = env->NewObject(replacementProductStructStructClass_1, replacementProductStructStructCtor_1, - newElement_0_productIdentifierType, newElement_0_productIdentifierValue); + newElement_0 = env->NewObject(replacementProductStructStructClass_1, replacementProductStructStructCtor_1, + newElement_0_productIdentifierType, newElement_0_productIdentifierValue); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -18648,31 +18798,33 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.productIdentifierValue, newElement_0_productIdentifierValue)); - jclass replacementProductStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$ActivatedCarbonFilterMonitoringClusterReplacementProductStruct", - replacementProductStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, - "Could not find class ChipStructs$ActivatedCarbonFilterMonitoringClusterReplacementProductStruct"); - return nullptr; - } + jclass replacementProductStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$ActivatedCarbonFilterMonitoringClusterReplacementProductStruct", + replacementProductStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError( + Zcl, "Could not find class ChipStructs$ActivatedCarbonFilterMonitoringClusterReplacementProductStruct"); + return nullptr; + } - jmethodID replacementProductStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod(env, replacementProductStructStructClass_1, "", - "(Ljava/lang/Integer;Ljava/lang/String;)V", - &replacementProductStructStructCtor_1); - if (err != CHIP_NO_ERROR || replacementProductStructStructCtor_1 == nullptr) - { - ChipLogError( - Zcl, - "Could not find ChipStructs$ActivatedCarbonFilterMonitoringClusterReplacementProductStruct constructor"); - return nullptr; - } + jmethodID replacementProductStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod(env, replacementProductStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/lang/String;)V", + &replacementProductStructStructCtor_1); + if (err != CHIP_NO_ERROR || replacementProductStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$ActivatedCarbonFilterMonitoringClusterReplacementProductStruct " + "constructor"); + return nullptr; + } - newElement_0 = env->NewObject(replacementProductStructStructClass_1, replacementProductStructStructCtor_1, - newElement_0_productIdentifierType, newElement_0_productIdentifierValue); + newElement_0 = env->NewObject(replacementProductStructStructClass_1, replacementProductStructStructCtor_1, + newElement_0_productIdentifierType, newElement_0_productIdentifierValue); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -19670,65 +19822,72 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_2_fixedTypical); } - jclass measurementAccuracyRangeStructStructClass_3; + { + jclass measurementAccuracyRangeStructStructClass_3; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, + "chip/devicecontroller/ChipStructs$ElectricalPowerMeasurementClusterMeasurementAccuracyRangeStruct", + measurementAccuracyRangeStructStructClass_3); + if (err != CHIP_NO_ERROR) + { + ChipLogError( + Zcl, + "Could not find class ChipStructs$ElectricalPowerMeasurementClusterMeasurementAccuracyRangeStruct"); + return nullptr; + } + + jmethodID measurementAccuracyRangeStructStructCtor_3; + err = chip::JniReferences::GetInstance().FindMethod( + env, measurementAccuracyRangeStructStructClass_3, "", + "(Ljava/lang/Long;Ljava/lang/Long;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/" + "util/Optional;Ljava/util/Optional;Ljava/util/Optional;)V", + &measurementAccuracyRangeStructStructCtor_3); + if (err != CHIP_NO_ERROR || measurementAccuracyRangeStructStructCtor_3 == nullptr) + { + ChipLogError(Zcl, + "Could not find " + "ChipStructs$ElectricalPowerMeasurementClusterMeasurementAccuracyRangeStruct constructor"); + return nullptr; + } + + newElement_2 = env->NewObject( + measurementAccuracyRangeStructStructClass_3, measurementAccuracyRangeStructStructCtor_3, + newElement_2_rangeMin, newElement_2_rangeMax, newElement_2_percentMax, newElement_2_percentMin, + newElement_2_percentTypical, newElement_2_fixedMax, newElement_2_fixedMin, newElement_2_fixedTypical); + } + chip::JniReferences::GetInstance().AddToList(newElement_0_accuracyRanges, newElement_2); + } + + { + jclass measurementAccuracyStructStructClass_1; err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$ElectricalPowerMeasurementClusterMeasurementAccuracyRangeStruct", - measurementAccuracyRangeStructStructClass_3); + env, "chip/devicecontroller/ChipStructs$ElectricalPowerMeasurementClusterMeasurementAccuracyStruct", + measurementAccuracyStructStructClass_1); if (err != CHIP_NO_ERROR) { - ChipLogError( - Zcl, - "Could not find class ChipStructs$ElectricalPowerMeasurementClusterMeasurementAccuracyRangeStruct"); + ChipLogError(Zcl, + "Could not find class ChipStructs$ElectricalPowerMeasurementClusterMeasurementAccuracyStruct"); return nullptr; } - jmethodID measurementAccuracyRangeStructStructCtor_3; + jmethodID measurementAccuracyStructStructCtor_1; err = chip::JniReferences::GetInstance().FindMethod( - env, measurementAccuracyRangeStructStructClass_3, "", - "(Ljava/lang/Long;Ljava/lang/Long;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/" - "Optional;Ljava/util/Optional;Ljava/util/Optional;)V", - &measurementAccuracyRangeStructStructCtor_3); - if (err != CHIP_NO_ERROR || measurementAccuracyRangeStructStructCtor_3 == nullptr) + env, measurementAccuracyStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/lang/Boolean;Ljava/lang/Long;Ljava/lang/Long;Ljava/util/ArrayList;)V", + &measurementAccuracyStructStructCtor_1); + if (err != CHIP_NO_ERROR || measurementAccuracyStructStructCtor_1 == nullptr) { - ChipLogError(Zcl, - "Could not find ChipStructs$ElectricalPowerMeasurementClusterMeasurementAccuracyRangeStruct " - "constructor"); + ChipLogError( + Zcl, + "Could not find ChipStructs$ElectricalPowerMeasurementClusterMeasurementAccuracyStruct constructor"); return nullptr; } - newElement_2 = env->NewObject( - measurementAccuracyRangeStructStructClass_3, measurementAccuracyRangeStructStructCtor_3, - newElement_2_rangeMin, newElement_2_rangeMax, newElement_2_percentMax, newElement_2_percentMin, - newElement_2_percentTypical, newElement_2_fixedMax, newElement_2_fixedMin, newElement_2_fixedTypical); - chip::JniReferences::GetInstance().AddToList(newElement_0_accuracyRanges, newElement_2); - } - - jclass measurementAccuracyStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$ElectricalPowerMeasurementClusterMeasurementAccuracyStruct", - measurementAccuracyStructStructClass_1); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, - "Could not find class ChipStructs$ElectricalPowerMeasurementClusterMeasurementAccuracyStruct"); - return nullptr; - } - - jmethodID measurementAccuracyStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod( - env, measurementAccuracyStructStructClass_1, "", - "(Ljava/lang/Integer;Ljava/lang/Boolean;Ljava/lang/Long;Ljava/lang/Long;Ljava/util/ArrayList;)V", - &measurementAccuracyStructStructCtor_1); - if (err != CHIP_NO_ERROR || measurementAccuracyStructStructCtor_1 == nullptr) - { - ChipLogError( - Zcl, "Could not find ChipStructs$ElectricalPowerMeasurementClusterMeasurementAccuracyStruct constructor"); - return nullptr; + newElement_0 = + env->NewObject(measurementAccuracyStructStructClass_1, measurementAccuracyStructStructCtor_1, + newElement_0_measurementType, newElement_0_measured, newElement_0_minMeasuredValue, + newElement_0_maxMeasuredValue, newElement_0_accuracyRanges); } - - newElement_0 = env->NewObject(measurementAccuracyStructStructClass_1, measurementAccuracyStructStructCtor_1, - newElement_0_measurementType, newElement_0_measured, newElement_0_minMeasuredValue, - newElement_0_maxMeasuredValue, newElement_0_accuracyRanges); chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -19915,35 +20074,38 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_0_maxSystime); } - jclass measurementRangeStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$ElectricalPowerMeasurementClusterMeasurementRangeStruct", - measurementRangeStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$ElectricalPowerMeasurementClusterMeasurementRangeStruct"); - return nullptr; - } + jclass measurementRangeStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$ElectricalPowerMeasurementClusterMeasurementRangeStruct", + measurementRangeStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, + "Could not find class ChipStructs$ElectricalPowerMeasurementClusterMeasurementRangeStruct"); + return nullptr; + } - jmethodID measurementRangeStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod( - env, measurementRangeStructStructClass_1, "", - "(Ljava/lang/Integer;Ljava/lang/Long;Ljava/lang/Long;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/" - "Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/" - "Optional;)V", - &measurementRangeStructStructCtor_1); - if (err != CHIP_NO_ERROR || measurementRangeStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, - "Could not find ChipStructs$ElectricalPowerMeasurementClusterMeasurementRangeStruct constructor"); - return nullptr; - } + jmethodID measurementRangeStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, measurementRangeStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/lang/Long;Ljava/lang/Long;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/" + "Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/" + "Optional;)V", + &measurementRangeStructStructCtor_1); + if (err != CHIP_NO_ERROR || measurementRangeStructStructCtor_1 == nullptr) + { + ChipLogError( + Zcl, "Could not find ChipStructs$ElectricalPowerMeasurementClusterMeasurementRangeStruct constructor"); + return nullptr; + } - newElement_0 = env->NewObject(measurementRangeStructStructClass_1, measurementRangeStructStructCtor_1, - newElement_0_measurementType, newElement_0_min, newElement_0_max, - newElement_0_startTimestamp, newElement_0_endTimestamp, newElement_0_minTimestamp, - newElement_0_maxTimestamp, newElement_0_startSystime, newElement_0_endSystime, - newElement_0_minSystime, newElement_0_maxSystime); + newElement_0 = env->NewObject(measurementRangeStructStructClass_1, measurementRangeStructStructCtor_1, + newElement_0_measurementType, newElement_0_min, newElement_0_max, + newElement_0_startTimestamp, newElement_0_endTimestamp, newElement_0_minTimestamp, + newElement_0_maxTimestamp, newElement_0_startSystime, newElement_0_endSystime, + newElement_0_minSystime, newElement_0_maxSystime); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -20245,31 +20407,33 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR jninewElement_1_measurement, newElement_1_measurement); } - jclass harmonicMeasurementStructStructClass_2; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$ElectricalPowerMeasurementClusterHarmonicMeasurementStruct", - harmonicMeasurementStructStructClass_2); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, - "Could not find class ChipStructs$ElectricalPowerMeasurementClusterHarmonicMeasurementStruct"); - return nullptr; - } + jclass harmonicMeasurementStructStructClass_2; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$ElectricalPowerMeasurementClusterHarmonicMeasurementStruct", + harmonicMeasurementStructStructClass_2); + if (err != CHIP_NO_ERROR) + { + ChipLogError( + Zcl, "Could not find class ChipStructs$ElectricalPowerMeasurementClusterHarmonicMeasurementStruct"); + return nullptr; + } - jmethodID harmonicMeasurementStructStructCtor_2; - err = chip::JniReferences::GetInstance().FindMethod(env, harmonicMeasurementStructStructClass_2, "", - "(Ljava/lang/Integer;Ljava/lang/Long;)V", - &harmonicMeasurementStructStructCtor_2); - if (err != CHIP_NO_ERROR || harmonicMeasurementStructStructCtor_2 == nullptr) - { - ChipLogError( - Zcl, - "Could not find ChipStructs$ElectricalPowerMeasurementClusterHarmonicMeasurementStruct constructor"); - return nullptr; - } + jmethodID harmonicMeasurementStructStructCtor_2; + err = chip::JniReferences::GetInstance().FindMethod(env, harmonicMeasurementStructStructClass_2, "", + "(Ljava/lang/Integer;Ljava/lang/Long;)V", + &harmonicMeasurementStructStructCtor_2); + if (err != CHIP_NO_ERROR || harmonicMeasurementStructStructCtor_2 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$ElectricalPowerMeasurementClusterHarmonicMeasurementStruct " + "constructor"); + return nullptr; + } - newElement_1 = env->NewObject(harmonicMeasurementStructStructClass_2, harmonicMeasurementStructStructCtor_2, - newElement_1_order, newElement_1_measurement); + newElement_1 = env->NewObject(harmonicMeasurementStructStructClass_2, harmonicMeasurementStructStructCtor_2, + newElement_1_order, newElement_1_measurement); + } chip::JniReferences::GetInstance().AddToList(value, newElement_1); } } @@ -20319,31 +20483,33 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR jninewElement_1_measurement, newElement_1_measurement); } - jclass harmonicMeasurementStructStructClass_2; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$ElectricalPowerMeasurementClusterHarmonicMeasurementStruct", - harmonicMeasurementStructStructClass_2); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, - "Could not find class ChipStructs$ElectricalPowerMeasurementClusterHarmonicMeasurementStruct"); - return nullptr; - } + jclass harmonicMeasurementStructStructClass_2; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$ElectricalPowerMeasurementClusterHarmonicMeasurementStruct", + harmonicMeasurementStructStructClass_2); + if (err != CHIP_NO_ERROR) + { + ChipLogError( + Zcl, "Could not find class ChipStructs$ElectricalPowerMeasurementClusterHarmonicMeasurementStruct"); + return nullptr; + } - jmethodID harmonicMeasurementStructStructCtor_2; - err = chip::JniReferences::GetInstance().FindMethod(env, harmonicMeasurementStructStructClass_2, "", - "(Ljava/lang/Integer;Ljava/lang/Long;)V", - &harmonicMeasurementStructStructCtor_2); - if (err != CHIP_NO_ERROR || harmonicMeasurementStructStructCtor_2 == nullptr) - { - ChipLogError( - Zcl, - "Could not find ChipStructs$ElectricalPowerMeasurementClusterHarmonicMeasurementStruct constructor"); - return nullptr; - } + jmethodID harmonicMeasurementStructStructCtor_2; + err = chip::JniReferences::GetInstance().FindMethod(env, harmonicMeasurementStructStructClass_2, "", + "(Ljava/lang/Integer;Ljava/lang/Long;)V", + &harmonicMeasurementStructStructCtor_2); + if (err != CHIP_NO_ERROR || harmonicMeasurementStructStructCtor_2 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$ElectricalPowerMeasurementClusterHarmonicMeasurementStruct " + "constructor"); + return nullptr; + } - newElement_1 = env->NewObject(harmonicMeasurementStructStructClass_2, harmonicMeasurementStructStructCtor_2, - newElement_1_order, newElement_1_measurement); + newElement_1 = env->NewObject(harmonicMeasurementStructStructClass_2, harmonicMeasurementStructStructCtor_2, + newElement_1_order, newElement_1_measurement); + } chip::JniReferences::GetInstance().AddToList(value, newElement_1); } } @@ -20702,63 +20868,69 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_1_fixedTypical); } - jclass measurementAccuracyRangeStructStructClass_2; + { + jclass measurementAccuracyRangeStructStructClass_2; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$ElectricalEnergyMeasurementClusterMeasurementAccuracyRangeStruct", + measurementAccuracyRangeStructStructClass_2); + if (err != CHIP_NO_ERROR) + { + ChipLogError( + Zcl, + "Could not find class ChipStructs$ElectricalEnergyMeasurementClusterMeasurementAccuracyRangeStruct"); + return nullptr; + } + + jmethodID measurementAccuracyRangeStructStructCtor_2; + err = chip::JniReferences::GetInstance().FindMethod( + env, measurementAccuracyRangeStructStructClass_2, "", + "(Ljava/lang/Long;Ljava/lang/Long;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/" + "Optional;Ljava/util/Optional;Ljava/util/Optional;)V", + &measurementAccuracyRangeStructStructCtor_2); + if (err != CHIP_NO_ERROR || measurementAccuracyRangeStructStructCtor_2 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$ElectricalEnergyMeasurementClusterMeasurementAccuracyRangeStruct " + "constructor"); + return nullptr; + } + + newElement_1 = env->NewObject( + measurementAccuracyRangeStructStructClass_2, measurementAccuracyRangeStructStructCtor_2, + newElement_1_rangeMin, newElement_1_rangeMax, newElement_1_percentMax, newElement_1_percentMin, + newElement_1_percentTypical, newElement_1_fixedMax, newElement_1_fixedMin, newElement_1_fixedTypical); + } + chip::JniReferences::GetInstance().AddToList(value_accuracyRanges, newElement_1); + } + + { + jclass measurementAccuracyStructStructClass_0; err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$ElectricalEnergyMeasurementClusterMeasurementAccuracyRangeStruct", - measurementAccuracyRangeStructStructClass_2); + env, "chip/devicecontroller/ChipStructs$ElectricalEnergyMeasurementClusterMeasurementAccuracyStruct", + measurementAccuracyStructStructClass_0); if (err != CHIP_NO_ERROR) { - ChipLogError( - Zcl, "Could not find class ChipStructs$ElectricalEnergyMeasurementClusterMeasurementAccuracyRangeStruct"); + ChipLogError(Zcl, + "Could not find class ChipStructs$ElectricalEnergyMeasurementClusterMeasurementAccuracyStruct"); return nullptr; } - jmethodID measurementAccuracyRangeStructStructCtor_2; + jmethodID measurementAccuracyStructStructCtor_0; err = chip::JniReferences::GetInstance().FindMethod( - env, measurementAccuracyRangeStructStructClass_2, "", - "(Ljava/lang/Long;Ljava/lang/Long;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/" - "Optional;Ljava/util/Optional;Ljava/util/Optional;)V", - &measurementAccuracyRangeStructStructCtor_2); - if (err != CHIP_NO_ERROR || measurementAccuracyRangeStructStructCtor_2 == nullptr) + env, measurementAccuracyStructStructClass_0, "", + "(Ljava/lang/Integer;Ljava/lang/Boolean;Ljava/lang/Long;Ljava/lang/Long;Ljava/util/ArrayList;)V", + &measurementAccuracyStructStructCtor_0); + if (err != CHIP_NO_ERROR || measurementAccuracyStructStructCtor_0 == nullptr) { ChipLogError( - Zcl, - "Could not find ChipStructs$ElectricalEnergyMeasurementClusterMeasurementAccuracyRangeStruct constructor"); + Zcl, "Could not find ChipStructs$ElectricalEnergyMeasurementClusterMeasurementAccuracyStruct constructor"); return nullptr; } - newElement_1 = env->NewObject( - measurementAccuracyRangeStructStructClass_2, measurementAccuracyRangeStructStructCtor_2, newElement_1_rangeMin, - newElement_1_rangeMax, newElement_1_percentMax, newElement_1_percentMin, newElement_1_percentTypical, - newElement_1_fixedMax, newElement_1_fixedMin, newElement_1_fixedTypical); - chip::JniReferences::GetInstance().AddToList(value_accuracyRanges, newElement_1); + value = env->NewObject(measurementAccuracyStructStructClass_0, measurementAccuracyStructStructCtor_0, + value_measurementType, value_measured, value_minMeasuredValue, value_maxMeasuredValue, + value_accuracyRanges); } - - jclass measurementAccuracyStructStructClass_0; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$ElectricalEnergyMeasurementClusterMeasurementAccuracyStruct", - measurementAccuracyStructStructClass_0); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Could not find class ChipStructs$ElectricalEnergyMeasurementClusterMeasurementAccuracyStruct"); - return nullptr; - } - - jmethodID measurementAccuracyStructStructCtor_0; - err = chip::JniReferences::GetInstance().FindMethod( - env, measurementAccuracyStructStructClass_0, "", - "(Ljava/lang/Integer;Ljava/lang/Boolean;Ljava/lang/Long;Ljava/lang/Long;Ljava/util/ArrayList;)V", - &measurementAccuracyStructStructCtor_0); - if (err != CHIP_NO_ERROR || measurementAccuracyStructStructCtor_0 == nullptr) - { - ChipLogError(Zcl, - "Could not find ChipStructs$ElectricalEnergyMeasurementClusterMeasurementAccuracyStruct constructor"); - return nullptr; - } - - value = - env->NewObject(measurementAccuracyStructStructClass_0, measurementAccuracyStructStructCtor_0, value_measurementType, - value_measured, value_minMeasuredValue, value_maxMeasuredValue, value_accuracyRanges); return value; } case Attributes::CumulativeEnergyImported::Id: { @@ -20848,30 +21020,34 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR chip::JniReferences::GetInstance().CreateOptional(value_endSystimeInsideOptional, value_endSystime); } - jclass energyMeasurementStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$ElectricalEnergyMeasurementClusterEnergyMeasurementStruct", - energyMeasurementStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$ElectricalEnergyMeasurementClusterEnergyMeasurementStruct"); - return nullptr; - } + jclass energyMeasurementStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$ElectricalEnergyMeasurementClusterEnergyMeasurementStruct", + energyMeasurementStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, + "Could not find class ChipStructs$ElectricalEnergyMeasurementClusterEnergyMeasurementStruct"); + return nullptr; + } - jmethodID energyMeasurementStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod( - env, energyMeasurementStructStructClass_1, "", - "(Ljava/lang/Long;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;)V", - &energyMeasurementStructStructCtor_1); - if (err != CHIP_NO_ERROR || energyMeasurementStructStructCtor_1 == nullptr) - { - ChipLogError( - Zcl, "Could not find ChipStructs$ElectricalEnergyMeasurementClusterEnergyMeasurementStruct constructor"); - return nullptr; - } + jmethodID energyMeasurementStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, energyMeasurementStructStructClass_1, "", + "(Ljava/lang/Long;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;)V", + &energyMeasurementStructStructCtor_1); + if (err != CHIP_NO_ERROR || energyMeasurementStructStructCtor_1 == nullptr) + { + ChipLogError( + Zcl, + "Could not find ChipStructs$ElectricalEnergyMeasurementClusterEnergyMeasurementStruct constructor"); + return nullptr; + } - value = env->NewObject(energyMeasurementStructStructClass_1, energyMeasurementStructStructCtor_1, value_energy, - value_startTimestamp, value_endTimestamp, value_startSystime, value_endSystime); + value = env->NewObject(energyMeasurementStructStructClass_1, energyMeasurementStructStructCtor_1, value_energy, + value_startTimestamp, value_endTimestamp, value_startSystime, value_endSystime); + } } return value; } @@ -20962,30 +21138,34 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR chip::JniReferences::GetInstance().CreateOptional(value_endSystimeInsideOptional, value_endSystime); } - jclass energyMeasurementStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$ElectricalEnergyMeasurementClusterEnergyMeasurementStruct", - energyMeasurementStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$ElectricalEnergyMeasurementClusterEnergyMeasurementStruct"); - return nullptr; - } + jclass energyMeasurementStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$ElectricalEnergyMeasurementClusterEnergyMeasurementStruct", + energyMeasurementStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, + "Could not find class ChipStructs$ElectricalEnergyMeasurementClusterEnergyMeasurementStruct"); + return nullptr; + } - jmethodID energyMeasurementStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod( - env, energyMeasurementStructStructClass_1, "", - "(Ljava/lang/Long;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;)V", - &energyMeasurementStructStructCtor_1); - if (err != CHIP_NO_ERROR || energyMeasurementStructStructCtor_1 == nullptr) - { - ChipLogError( - Zcl, "Could not find ChipStructs$ElectricalEnergyMeasurementClusterEnergyMeasurementStruct constructor"); - return nullptr; - } + jmethodID energyMeasurementStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, energyMeasurementStructStructClass_1, "", + "(Ljava/lang/Long;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;)V", + &energyMeasurementStructStructCtor_1); + if (err != CHIP_NO_ERROR || energyMeasurementStructStructCtor_1 == nullptr) + { + ChipLogError( + Zcl, + "Could not find ChipStructs$ElectricalEnergyMeasurementClusterEnergyMeasurementStruct constructor"); + return nullptr; + } - value = env->NewObject(energyMeasurementStructStructClass_1, energyMeasurementStructStructCtor_1, value_energy, - value_startTimestamp, value_endTimestamp, value_startSystime, value_endSystime); + value = env->NewObject(energyMeasurementStructStructClass_1, energyMeasurementStructStructCtor_1, value_energy, + value_startTimestamp, value_endTimestamp, value_startSystime, value_endSystime); + } } return value; } @@ -21076,30 +21256,34 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR chip::JniReferences::GetInstance().CreateOptional(value_endSystimeInsideOptional, value_endSystime); } - jclass energyMeasurementStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$ElectricalEnergyMeasurementClusterEnergyMeasurementStruct", - energyMeasurementStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$ElectricalEnergyMeasurementClusterEnergyMeasurementStruct"); - return nullptr; - } + jclass energyMeasurementStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$ElectricalEnergyMeasurementClusterEnergyMeasurementStruct", + energyMeasurementStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, + "Could not find class ChipStructs$ElectricalEnergyMeasurementClusterEnergyMeasurementStruct"); + return nullptr; + } - jmethodID energyMeasurementStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod( - env, energyMeasurementStructStructClass_1, "", - "(Ljava/lang/Long;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;)V", - &energyMeasurementStructStructCtor_1); - if (err != CHIP_NO_ERROR || energyMeasurementStructStructCtor_1 == nullptr) - { - ChipLogError( - Zcl, "Could not find ChipStructs$ElectricalEnergyMeasurementClusterEnergyMeasurementStruct constructor"); - return nullptr; - } + jmethodID energyMeasurementStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, energyMeasurementStructStructClass_1, "", + "(Ljava/lang/Long;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;)V", + &energyMeasurementStructStructCtor_1); + if (err != CHIP_NO_ERROR || energyMeasurementStructStructCtor_1 == nullptr) + { + ChipLogError( + Zcl, + "Could not find ChipStructs$ElectricalEnergyMeasurementClusterEnergyMeasurementStruct constructor"); + return nullptr; + } - value = env->NewObject(energyMeasurementStructStructClass_1, energyMeasurementStructStructCtor_1, value_energy, - value_startTimestamp, value_endTimestamp, value_startSystime, value_endSystime); + value = env->NewObject(energyMeasurementStructStructClass_1, energyMeasurementStructStructCtor_1, value_energy, + value_startTimestamp, value_endTimestamp, value_startSystime, value_endSystime); + } } return value; } @@ -21190,30 +21374,34 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR chip::JniReferences::GetInstance().CreateOptional(value_endSystimeInsideOptional, value_endSystime); } - jclass energyMeasurementStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$ElectricalEnergyMeasurementClusterEnergyMeasurementStruct", - energyMeasurementStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$ElectricalEnergyMeasurementClusterEnergyMeasurementStruct"); - return nullptr; - } + jclass energyMeasurementStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$ElectricalEnergyMeasurementClusterEnergyMeasurementStruct", + energyMeasurementStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, + "Could not find class ChipStructs$ElectricalEnergyMeasurementClusterEnergyMeasurementStruct"); + return nullptr; + } - jmethodID energyMeasurementStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod( - env, energyMeasurementStructStructClass_1, "", - "(Ljava/lang/Long;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;)V", - &energyMeasurementStructStructCtor_1); - if (err != CHIP_NO_ERROR || energyMeasurementStructStructCtor_1 == nullptr) - { - ChipLogError( - Zcl, "Could not find ChipStructs$ElectricalEnergyMeasurementClusterEnergyMeasurementStruct constructor"); - return nullptr; - } + jmethodID energyMeasurementStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, energyMeasurementStructStructClass_1, "", + "(Ljava/lang/Long;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;)V", + &energyMeasurementStructStructCtor_1); + if (err != CHIP_NO_ERROR || energyMeasurementStructStructCtor_1 == nullptr) + { + ChipLogError( + Zcl, + "Could not find ChipStructs$ElectricalEnergyMeasurementClusterEnergyMeasurementStruct constructor"); + return nullptr; + } - value = env->NewObject(energyMeasurementStructStructClass_1, energyMeasurementStructStructCtor_1, value_energy, - value_startTimestamp, value_endTimestamp, value_startSystime, value_endSystime); + value = env->NewObject(energyMeasurementStructStructClass_1, energyMeasurementStructStructCtor_1, value_energy, + value_startTimestamp, value_endTimestamp, value_startSystime, value_endSystime); + } } return value; } @@ -21337,33 +21525,35 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR value_exportedResetSystime); } - jclass cumulativeEnergyResetStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$ElectricalEnergyMeasurementClusterCumulativeEnergyResetStruct", - cumulativeEnergyResetStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, - "Could not find class ChipStructs$ElectricalEnergyMeasurementClusterCumulativeEnergyResetStruct"); - return nullptr; - } + jclass cumulativeEnergyResetStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$ElectricalEnergyMeasurementClusterCumulativeEnergyResetStruct", + cumulativeEnergyResetStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError( + Zcl, "Could not find class ChipStructs$ElectricalEnergyMeasurementClusterCumulativeEnergyResetStruct"); + return nullptr; + } - jmethodID cumulativeEnergyResetStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod( - env, cumulativeEnergyResetStructStructClass_1, "", - "(Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;)V", - &cumulativeEnergyResetStructStructCtor_1); - if (err != CHIP_NO_ERROR || cumulativeEnergyResetStructStructCtor_1 == nullptr) - { - ChipLogError( - Zcl, - "Could not find ChipStructs$ElectricalEnergyMeasurementClusterCumulativeEnergyResetStruct constructor"); - return nullptr; - } + jmethodID cumulativeEnergyResetStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, cumulativeEnergyResetStructStructClass_1, "", + "(Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;)V", + &cumulativeEnergyResetStructStructCtor_1); + if (err != CHIP_NO_ERROR || cumulativeEnergyResetStructStructCtor_1 == nullptr) + { + ChipLogError( + Zcl, + "Could not find ChipStructs$ElectricalEnergyMeasurementClusterCumulativeEnergyResetStruct constructor"); + return nullptr; + } - value = env->NewObject(cumulativeEnergyResetStructStructClass_1, cumulativeEnergyResetStructStructCtor_1, - value_importedResetTimestamp, value_exportedResetTimestamp, value_importedResetSystime, - value_exportedResetSystime); + value = env->NewObject(cumulativeEnergyResetStructStructClass_1, cumulativeEnergyResetStructStructCtor_1, + value_importedResetTimestamp, value_exportedResetTimestamp, value_importedResetSystime, + value_exportedResetSystime); + } } return value; } @@ -21814,31 +22004,34 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_0_randomDurationMinutes); } - jclass loadControlProgramStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterLoadControlProgramStruct", - loadControlProgramStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$DemandResponseLoadControlClusterLoadControlProgramStruct"); - return nullptr; - } + jclass loadControlProgramStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterLoadControlProgramStruct", + loadControlProgramStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, + "Could not find class ChipStructs$DemandResponseLoadControlClusterLoadControlProgramStruct"); + return nullptr; + } - jmethodID loadControlProgramStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod( - env, loadControlProgramStructStructClass_1, "", - "([BLjava/lang/String;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;)V", - &loadControlProgramStructStructCtor_1); - if (err != CHIP_NO_ERROR || loadControlProgramStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, - "Could not find ChipStructs$DemandResponseLoadControlClusterLoadControlProgramStruct constructor"); - return nullptr; - } + jmethodID loadControlProgramStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, loadControlProgramStructStructClass_1, "", + "([BLjava/lang/String;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;)V", + &loadControlProgramStructStructCtor_1); + if (err != CHIP_NO_ERROR || loadControlProgramStructStructCtor_1 == nullptr) + { + ChipLogError( + Zcl, "Could not find ChipStructs$DemandResponseLoadControlClusterLoadControlProgramStruct constructor"); + return nullptr; + } - newElement_0 = env->NewObject(loadControlProgramStructStructClass_1, loadControlProgramStructStructCtor_1, - newElement_0_programID, newElement_0_name, newElement_0_enrollmentGroup, - newElement_0_randomStartMinutes, newElement_0_randomDurationMinutes); + newElement_0 = env->NewObject(loadControlProgramStructStructClass_1, loadControlProgramStructStructCtor_1, + newElement_0_programID, newElement_0_name, newElement_0_enrollmentGroup, + newElement_0_randomStartMinutes, newElement_0_randomDurationMinutes); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -22115,36 +22308,39 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_2_temperatureControlInsideOptional_heatingTempSetpoint); } - jclass temperatureControlStructStructClass_5; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterTemperatureControlStruct", - temperatureControlStructStructClass_5); - if (err != CHIP_NO_ERROR) { - ChipLogError( - Zcl, "Could not find class ChipStructs$DemandResponseLoadControlClusterTemperatureControlStruct"); - return nullptr; - } + jclass temperatureControlStructStructClass_5; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterTemperatureControlStruct", + temperatureControlStructStructClass_5); + if (err != CHIP_NO_ERROR) + { + ChipLogError( + Zcl, + "Could not find class ChipStructs$DemandResponseLoadControlClusterTemperatureControlStruct"); + return nullptr; + } - jmethodID temperatureControlStructStructCtor_5; - err = chip::JniReferences::GetInstance().FindMethod( - env, temperatureControlStructStructClass_5, "", - "(Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;)V", - &temperatureControlStructStructCtor_5); - if (err != CHIP_NO_ERROR || temperatureControlStructStructCtor_5 == nullptr) - { - ChipLogError( - Zcl, - "Could not find ChipStructs$DemandResponseLoadControlClusterTemperatureControlStruct constructor"); - return nullptr; - } + jmethodID temperatureControlStructStructCtor_5; + err = chip::JniReferences::GetInstance().FindMethod( + env, temperatureControlStructStructClass_5, "", + "(Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;)V", + &temperatureControlStructStructCtor_5); + if (err != CHIP_NO_ERROR || temperatureControlStructStructCtor_5 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$DemandResponseLoadControlClusterTemperatureControlStruct " + "constructor"); + return nullptr; + } - newElement_2_temperatureControlInsideOptional = - env->NewObject(temperatureControlStructStructClass_5, temperatureControlStructStructCtor_5, - newElement_2_temperatureControlInsideOptional_coolingTempOffset, - newElement_2_temperatureControlInsideOptional_heatingtTempOffset, - newElement_2_temperatureControlInsideOptional_coolingTempSetpoint, - newElement_2_temperatureControlInsideOptional_heatingTempSetpoint); + newElement_2_temperatureControlInsideOptional = + env->NewObject(temperatureControlStructStructClass_5, temperatureControlStructStructCtor_5, + newElement_2_temperatureControlInsideOptional_coolingTempOffset, + newElement_2_temperatureControlInsideOptional_heatingtTempOffset, + newElement_2_temperatureControlInsideOptional_coolingTempSetpoint, + newElement_2_temperatureControlInsideOptional_heatingTempSetpoint); + } chip::JniReferences::GetInstance().CreateOptional(newElement_2_temperatureControlInsideOptional, newElement_2_temperatureControl); } @@ -22167,32 +22363,35 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR jninewElement_2_averageLoadControlInsideOptional_loadAdjustment, newElement_2_averageLoadControlInsideOptional_loadAdjustment); - jclass averageLoadControlStructStructClass_5; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterAverageLoadControlStruct", - averageLoadControlStructStructClass_5); - if (err != CHIP_NO_ERROR) { - ChipLogError( - Zcl, "Could not find class ChipStructs$DemandResponseLoadControlClusterAverageLoadControlStruct"); - return nullptr; - } + jclass averageLoadControlStructStructClass_5; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterAverageLoadControlStruct", + averageLoadControlStructStructClass_5); + if (err != CHIP_NO_ERROR) + { + ChipLogError( + Zcl, + "Could not find class ChipStructs$DemandResponseLoadControlClusterAverageLoadControlStruct"); + return nullptr; + } - jmethodID averageLoadControlStructStructCtor_5; - err = chip::JniReferences::GetInstance().FindMethod(env, averageLoadControlStructStructClass_5, "", - "(Ljava/lang/Integer;)V", - &averageLoadControlStructStructCtor_5); - if (err != CHIP_NO_ERROR || averageLoadControlStructStructCtor_5 == nullptr) - { - ChipLogError( - Zcl, - "Could not find ChipStructs$DemandResponseLoadControlClusterAverageLoadControlStruct constructor"); - return nullptr; - } + jmethodID averageLoadControlStructStructCtor_5; + err = chip::JniReferences::GetInstance().FindMethod(env, averageLoadControlStructStructClass_5, + "", "(Ljava/lang/Integer;)V", + &averageLoadControlStructStructCtor_5); + if (err != CHIP_NO_ERROR || averageLoadControlStructStructCtor_5 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$DemandResponseLoadControlClusterAverageLoadControlStruct " + "constructor"); + return nullptr; + } - newElement_2_averageLoadControlInsideOptional = - env->NewObject(averageLoadControlStructStructClass_5, averageLoadControlStructStructCtor_5, - newElement_2_averageLoadControlInsideOptional_loadAdjustment); + newElement_2_averageLoadControlInsideOptional = + env->NewObject(averageLoadControlStructStructClass_5, averageLoadControlStructStructCtor_5, + newElement_2_averageLoadControlInsideOptional_loadAdjustment); + } chip::JniReferences::GetInstance().CreateOptional(newElement_2_averageLoadControlInsideOptional, newElement_2_averageLoadControl); } @@ -22215,32 +22414,34 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR jninewElement_2_dutyCycleControlInsideOptional_dutyCycle, newElement_2_dutyCycleControlInsideOptional_dutyCycle); - jclass dutyCycleControlStructStructClass_5; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterDutyCycleControlStruct", - dutyCycleControlStructStructClass_5); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, - "Could not find class ChipStructs$DemandResponseLoadControlClusterDutyCycleControlStruct"); - return nullptr; - } + jclass dutyCycleControlStructStructClass_5; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterDutyCycleControlStruct", + dutyCycleControlStructStructClass_5); + if (err != CHIP_NO_ERROR) + { + ChipLogError( + Zcl, "Could not find class ChipStructs$DemandResponseLoadControlClusterDutyCycleControlStruct"); + return nullptr; + } - jmethodID dutyCycleControlStructStructCtor_5; - err = chip::JniReferences::GetInstance().FindMethod(env, dutyCycleControlStructStructClass_5, "", - "(Ljava/lang/Integer;)V", - &dutyCycleControlStructStructCtor_5); - if (err != CHIP_NO_ERROR || dutyCycleControlStructStructCtor_5 == nullptr) - { - ChipLogError( - Zcl, - "Could not find ChipStructs$DemandResponseLoadControlClusterDutyCycleControlStruct constructor"); - return nullptr; - } + jmethodID dutyCycleControlStructStructCtor_5; + err = chip::JniReferences::GetInstance().FindMethod(env, dutyCycleControlStructStructClass_5, "", + "(Ljava/lang/Integer;)V", + &dutyCycleControlStructStructCtor_5); + if (err != CHIP_NO_ERROR || dutyCycleControlStructStructCtor_5 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$DemandResponseLoadControlClusterDutyCycleControlStruct " + "constructor"); + return nullptr; + } - newElement_2_dutyCycleControlInsideOptional = - env->NewObject(dutyCycleControlStructStructClass_5, dutyCycleControlStructStructCtor_5, - newElement_2_dutyCycleControlInsideOptional_dutyCycle); + newElement_2_dutyCycleControlInsideOptional = + env->NewObject(dutyCycleControlStructStructClass_5, dutyCycleControlStructStructCtor_5, + newElement_2_dutyCycleControlInsideOptional_dutyCycle); + } chip::JniReferences::GetInstance().CreateOptional(newElement_2_dutyCycleControlInsideOptional, newElement_2_dutyCycleControl); } @@ -22263,32 +22464,35 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR jninewElement_2_powerSavingsControlInsideOptional_powerSavings, newElement_2_powerSavingsControlInsideOptional_powerSavings); - jclass powerSavingsControlStructStructClass_5; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterPowerSavingsControlStruct", - powerSavingsControlStructStructClass_5); - if (err != CHIP_NO_ERROR) { - ChipLogError( - Zcl, "Could not find class ChipStructs$DemandResponseLoadControlClusterPowerSavingsControlStruct"); - return nullptr; - } + jclass powerSavingsControlStructStructClass_5; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterPowerSavingsControlStruct", + powerSavingsControlStructStructClass_5); + if (err != CHIP_NO_ERROR) + { + ChipLogError( + Zcl, + "Could not find class ChipStructs$DemandResponseLoadControlClusterPowerSavingsControlStruct"); + return nullptr; + } - jmethodID powerSavingsControlStructStructCtor_5; - err = chip::JniReferences::GetInstance().FindMethod(env, powerSavingsControlStructStructClass_5, "", - "(Ljava/lang/Integer;)V", - &powerSavingsControlStructStructCtor_5); - if (err != CHIP_NO_ERROR || powerSavingsControlStructStructCtor_5 == nullptr) - { - ChipLogError( - Zcl, - "Could not find ChipStructs$DemandResponseLoadControlClusterPowerSavingsControlStruct constructor"); - return nullptr; - } + jmethodID powerSavingsControlStructStructCtor_5; + err = chip::JniReferences::GetInstance().FindMethod(env, powerSavingsControlStructStructClass_5, + "", "(Ljava/lang/Integer;)V", + &powerSavingsControlStructStructCtor_5); + if (err != CHIP_NO_ERROR || powerSavingsControlStructStructCtor_5 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$DemandResponseLoadControlClusterPowerSavingsControlStruct " + "constructor"); + return nullptr; + } - newElement_2_powerSavingsControlInsideOptional = - env->NewObject(powerSavingsControlStructStructClass_5, powerSavingsControlStructStructCtor_5, - newElement_2_powerSavingsControlInsideOptional_powerSavings); + newElement_2_powerSavingsControlInsideOptional = + env->NewObject(powerSavingsControlStructStructClass_5, powerSavingsControlStructStructCtor_5, + newElement_2_powerSavingsControlInsideOptional_powerSavings); + } chip::JniReferences::GetInstance().CreateOptional(newElement_2_powerSavingsControlInsideOptional, newElement_2_powerSavingsControl); } @@ -22311,97 +22515,107 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR jninewElement_2_heatingSourceControlInsideOptional_heatingSource, newElement_2_heatingSourceControlInsideOptional_heatingSource); - jclass heatingSourceControlStructStructClass_5; + { + jclass heatingSourceControlStructStructClass_5; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterHeatingSourceControlStruct", + heatingSourceControlStructStructClass_5); + if (err != CHIP_NO_ERROR) + { + ChipLogError( + Zcl, + "Could not find class ChipStructs$DemandResponseLoadControlClusterHeatingSourceControlStruct"); + return nullptr; + } + + jmethodID heatingSourceControlStructStructCtor_5; + err = chip::JniReferences::GetInstance().FindMethod(env, heatingSourceControlStructStructClass_5, + "", "(Ljava/lang/Integer;)V", + &heatingSourceControlStructStructCtor_5); + if (err != CHIP_NO_ERROR || heatingSourceControlStructStructCtor_5 == nullptr) + { + ChipLogError(Zcl, + "Could not find " + "ChipStructs$DemandResponseLoadControlClusterHeatingSourceControlStruct constructor"); + return nullptr; + } + + newElement_2_heatingSourceControlInsideOptional = + env->NewObject(heatingSourceControlStructStructClass_5, heatingSourceControlStructStructCtor_5, + newElement_2_heatingSourceControlInsideOptional_heatingSource); + } + chip::JniReferences::GetInstance().CreateOptional(newElement_2_heatingSourceControlInsideOptional, + newElement_2_heatingSourceControl); + } + + { + jclass loadControlEventTransitionStructStructClass_3; err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterHeatingSourceControlStruct", - heatingSourceControlStructStructClass_5); + env, + "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterLoadControlEventTransitionStruct", + loadControlEventTransitionStructStructClass_3); if (err != CHIP_NO_ERROR) { - ChipLogError( - Zcl, "Could not find class ChipStructs$DemandResponseLoadControlClusterHeatingSourceControlStruct"); + ChipLogError(Zcl, + "Could not find class " + "ChipStructs$DemandResponseLoadControlClusterLoadControlEventTransitionStruct"); return nullptr; } - jmethodID heatingSourceControlStructStructCtor_5; - err = chip::JniReferences::GetInstance().FindMethod(env, heatingSourceControlStructStructClass_5, "", - "(Ljava/lang/Integer;)V", - &heatingSourceControlStructStructCtor_5); - if (err != CHIP_NO_ERROR || heatingSourceControlStructStructCtor_5 == nullptr) + jmethodID loadControlEventTransitionStructStructCtor_3; + err = chip::JniReferences::GetInstance().FindMethod( + env, loadControlEventTransitionStructStructClass_3, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/" + "Optional;Ljava/util/Optional;Ljava/util/Optional;)V", + &loadControlEventTransitionStructStructCtor_3); + if (err != CHIP_NO_ERROR || loadControlEventTransitionStructStructCtor_3 == nullptr) { - ChipLogError(Zcl, - "Could not find ChipStructs$DemandResponseLoadControlClusterHeatingSourceControlStruct " - "constructor"); + ChipLogError( + Zcl, + "Could not find ChipStructs$DemandResponseLoadControlClusterLoadControlEventTransitionStruct " + "constructor"); return nullptr; } - newElement_2_heatingSourceControlInsideOptional = - env->NewObject(heatingSourceControlStructStructClass_5, heatingSourceControlStructStructCtor_5, - newElement_2_heatingSourceControlInsideOptional_heatingSource); - chip::JniReferences::GetInstance().CreateOptional(newElement_2_heatingSourceControlInsideOptional, - newElement_2_heatingSourceControl); + newElement_2 = env->NewObject(loadControlEventTransitionStructStructClass_3, + loadControlEventTransitionStructStructCtor_3, newElement_2_duration, + newElement_2_control, newElement_2_temperatureControl, + newElement_2_averageLoadControl, newElement_2_dutyCycleControl, + newElement_2_powerSavingsControl, newElement_2_heatingSourceControl); } + chip::JniReferences::GetInstance().AddToList(newElement_0_transitions, newElement_2); + } - jclass loadControlEventTransitionStructStructClass_3; + { + jclass loadControlEventStructStructClass_1; err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterLoadControlEventTransitionStruct", - loadControlEventTransitionStructStructClass_3); + env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterLoadControlEventStruct", + loadControlEventStructStructClass_1); if (err != CHIP_NO_ERROR) { - ChipLogError( - Zcl, - "Could not find class ChipStructs$DemandResponseLoadControlClusterLoadControlEventTransitionStruct"); + ChipLogError(Zcl, + "Could not find class ChipStructs$DemandResponseLoadControlClusterLoadControlEventStruct"); return nullptr; } - jmethodID loadControlEventTransitionStructStructCtor_3; + jmethodID loadControlEventStructStructCtor_1; err = chip::JniReferences::GetInstance().FindMethod( - env, loadControlEventTransitionStructStructClass_3, "", - "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/" - "util/Optional;Ljava/util/Optional;)V", - &loadControlEventTransitionStructStructCtor_3); - if (err != CHIP_NO_ERROR || loadControlEventTransitionStructStructCtor_3 == nullptr) + env, loadControlEventStructStructClass_1, "", + "([B[BLjava/lang/Integer;Ljava/lang/Long;Ljava/util/Optional;Ljava/lang/Integer;Ljava/lang/Long;Ljava/util/" + "ArrayList;)V", + &loadControlEventStructStructCtor_1); + if (err != CHIP_NO_ERROR || loadControlEventStructStructCtor_1 == nullptr) { - ChipLogError(Zcl, - "Could not find ChipStructs$DemandResponseLoadControlClusterLoadControlEventTransitionStruct " - "constructor"); + ChipLogError( + Zcl, "Could not find ChipStructs$DemandResponseLoadControlClusterLoadControlEventStruct constructor"); return nullptr; } - newElement_2 = - env->NewObject(loadControlEventTransitionStructStructClass_3, loadControlEventTransitionStructStructCtor_3, - newElement_2_duration, newElement_2_control, newElement_2_temperatureControl, - newElement_2_averageLoadControl, newElement_2_dutyCycleControl, - newElement_2_powerSavingsControl, newElement_2_heatingSourceControl); - chip::JniReferences::GetInstance().AddToList(newElement_0_transitions, newElement_2); - } - - jclass loadControlEventStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterLoadControlEventStruct", - loadControlEventStructStructClass_1); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Could not find class ChipStructs$DemandResponseLoadControlClusterLoadControlEventStruct"); - return nullptr; - } - - jmethodID loadControlEventStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod( - env, loadControlEventStructStructClass_1, "", - "([B[BLjava/lang/Integer;Ljava/lang/Long;Ljava/util/Optional;Ljava/lang/Integer;Ljava/lang/Long;Ljava/util/" - "ArrayList;)V", - &loadControlEventStructStructCtor_1); - if (err != CHIP_NO_ERROR || loadControlEventStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, - "Could not find ChipStructs$DemandResponseLoadControlClusterLoadControlEventStruct constructor"); - return nullptr; + newElement_0 = env->NewObject(loadControlEventStructStructClass_1, loadControlEventStructStructCtor_1, + newElement_0_eventID, newElement_0_programID, newElement_0_control, + newElement_0_deviceClass, newElement_0_enrollmentGroup, newElement_0_criticality, + newElement_0_startTime, newElement_0_transitions); } - - newElement_0 = env->NewObject(loadControlEventStructStructClass_1, loadControlEventStructStructCtor_1, - newElement_0_eventID, newElement_0_programID, newElement_0_control, - newElement_0_deviceClass, newElement_0_enrollmentGroup, newElement_0_criticality, - newElement_0_startTime, newElement_0_transitions); chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -22662,36 +22876,39 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_2_temperatureControlInsideOptional_heatingTempSetpoint); } - jclass temperatureControlStructStructClass_5; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterTemperatureControlStruct", - temperatureControlStructStructClass_5); - if (err != CHIP_NO_ERROR) { - ChipLogError( - Zcl, "Could not find class ChipStructs$DemandResponseLoadControlClusterTemperatureControlStruct"); - return nullptr; - } + jclass temperatureControlStructStructClass_5; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterTemperatureControlStruct", + temperatureControlStructStructClass_5); + if (err != CHIP_NO_ERROR) + { + ChipLogError( + Zcl, + "Could not find class ChipStructs$DemandResponseLoadControlClusterTemperatureControlStruct"); + return nullptr; + } - jmethodID temperatureControlStructStructCtor_5; - err = chip::JniReferences::GetInstance().FindMethod( - env, temperatureControlStructStructClass_5, "", - "(Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;)V", - &temperatureControlStructStructCtor_5); - if (err != CHIP_NO_ERROR || temperatureControlStructStructCtor_5 == nullptr) - { - ChipLogError( - Zcl, - "Could not find ChipStructs$DemandResponseLoadControlClusterTemperatureControlStruct constructor"); - return nullptr; - } + jmethodID temperatureControlStructStructCtor_5; + err = chip::JniReferences::GetInstance().FindMethod( + env, temperatureControlStructStructClass_5, "", + "(Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;)V", + &temperatureControlStructStructCtor_5); + if (err != CHIP_NO_ERROR || temperatureControlStructStructCtor_5 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$DemandResponseLoadControlClusterTemperatureControlStruct " + "constructor"); + return nullptr; + } - newElement_2_temperatureControlInsideOptional = - env->NewObject(temperatureControlStructStructClass_5, temperatureControlStructStructCtor_5, - newElement_2_temperatureControlInsideOptional_coolingTempOffset, - newElement_2_temperatureControlInsideOptional_heatingtTempOffset, - newElement_2_temperatureControlInsideOptional_coolingTempSetpoint, - newElement_2_temperatureControlInsideOptional_heatingTempSetpoint); + newElement_2_temperatureControlInsideOptional = + env->NewObject(temperatureControlStructStructClass_5, temperatureControlStructStructCtor_5, + newElement_2_temperatureControlInsideOptional_coolingTempOffset, + newElement_2_temperatureControlInsideOptional_heatingtTempOffset, + newElement_2_temperatureControlInsideOptional_coolingTempSetpoint, + newElement_2_temperatureControlInsideOptional_heatingTempSetpoint); + } chip::JniReferences::GetInstance().CreateOptional(newElement_2_temperatureControlInsideOptional, newElement_2_temperatureControl); } @@ -22714,32 +22931,35 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR jninewElement_2_averageLoadControlInsideOptional_loadAdjustment, newElement_2_averageLoadControlInsideOptional_loadAdjustment); - jclass averageLoadControlStructStructClass_5; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterAverageLoadControlStruct", - averageLoadControlStructStructClass_5); - if (err != CHIP_NO_ERROR) { - ChipLogError( - Zcl, "Could not find class ChipStructs$DemandResponseLoadControlClusterAverageLoadControlStruct"); - return nullptr; - } + jclass averageLoadControlStructStructClass_5; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterAverageLoadControlStruct", + averageLoadControlStructStructClass_5); + if (err != CHIP_NO_ERROR) + { + ChipLogError( + Zcl, + "Could not find class ChipStructs$DemandResponseLoadControlClusterAverageLoadControlStruct"); + return nullptr; + } - jmethodID averageLoadControlStructStructCtor_5; - err = chip::JniReferences::GetInstance().FindMethod(env, averageLoadControlStructStructClass_5, "", - "(Ljava/lang/Integer;)V", - &averageLoadControlStructStructCtor_5); - if (err != CHIP_NO_ERROR || averageLoadControlStructStructCtor_5 == nullptr) - { - ChipLogError( - Zcl, - "Could not find ChipStructs$DemandResponseLoadControlClusterAverageLoadControlStruct constructor"); - return nullptr; - } + jmethodID averageLoadControlStructStructCtor_5; + err = chip::JniReferences::GetInstance().FindMethod(env, averageLoadControlStructStructClass_5, + "", "(Ljava/lang/Integer;)V", + &averageLoadControlStructStructCtor_5); + if (err != CHIP_NO_ERROR || averageLoadControlStructStructCtor_5 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$DemandResponseLoadControlClusterAverageLoadControlStruct " + "constructor"); + return nullptr; + } - newElement_2_averageLoadControlInsideOptional = - env->NewObject(averageLoadControlStructStructClass_5, averageLoadControlStructStructCtor_5, - newElement_2_averageLoadControlInsideOptional_loadAdjustment); + newElement_2_averageLoadControlInsideOptional = + env->NewObject(averageLoadControlStructStructClass_5, averageLoadControlStructStructCtor_5, + newElement_2_averageLoadControlInsideOptional_loadAdjustment); + } chip::JniReferences::GetInstance().CreateOptional(newElement_2_averageLoadControlInsideOptional, newElement_2_averageLoadControl); } @@ -22762,32 +22982,34 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR jninewElement_2_dutyCycleControlInsideOptional_dutyCycle, newElement_2_dutyCycleControlInsideOptional_dutyCycle); - jclass dutyCycleControlStructStructClass_5; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterDutyCycleControlStruct", - dutyCycleControlStructStructClass_5); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, - "Could not find class ChipStructs$DemandResponseLoadControlClusterDutyCycleControlStruct"); - return nullptr; - } + jclass dutyCycleControlStructStructClass_5; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterDutyCycleControlStruct", + dutyCycleControlStructStructClass_5); + if (err != CHIP_NO_ERROR) + { + ChipLogError( + Zcl, "Could not find class ChipStructs$DemandResponseLoadControlClusterDutyCycleControlStruct"); + return nullptr; + } - jmethodID dutyCycleControlStructStructCtor_5; - err = chip::JniReferences::GetInstance().FindMethod(env, dutyCycleControlStructStructClass_5, "", - "(Ljava/lang/Integer;)V", - &dutyCycleControlStructStructCtor_5); - if (err != CHIP_NO_ERROR || dutyCycleControlStructStructCtor_5 == nullptr) - { - ChipLogError( - Zcl, - "Could not find ChipStructs$DemandResponseLoadControlClusterDutyCycleControlStruct constructor"); - return nullptr; - } + jmethodID dutyCycleControlStructStructCtor_5; + err = chip::JniReferences::GetInstance().FindMethod(env, dutyCycleControlStructStructClass_5, "", + "(Ljava/lang/Integer;)V", + &dutyCycleControlStructStructCtor_5); + if (err != CHIP_NO_ERROR || dutyCycleControlStructStructCtor_5 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$DemandResponseLoadControlClusterDutyCycleControlStruct " + "constructor"); + return nullptr; + } - newElement_2_dutyCycleControlInsideOptional = - env->NewObject(dutyCycleControlStructStructClass_5, dutyCycleControlStructStructCtor_5, - newElement_2_dutyCycleControlInsideOptional_dutyCycle); + newElement_2_dutyCycleControlInsideOptional = + env->NewObject(dutyCycleControlStructStructClass_5, dutyCycleControlStructStructCtor_5, + newElement_2_dutyCycleControlInsideOptional_dutyCycle); + } chip::JniReferences::GetInstance().CreateOptional(newElement_2_dutyCycleControlInsideOptional, newElement_2_dutyCycleControl); } @@ -22810,32 +23032,35 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR jninewElement_2_powerSavingsControlInsideOptional_powerSavings, newElement_2_powerSavingsControlInsideOptional_powerSavings); - jclass powerSavingsControlStructStructClass_5; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterPowerSavingsControlStruct", - powerSavingsControlStructStructClass_5); - if (err != CHIP_NO_ERROR) { - ChipLogError( - Zcl, "Could not find class ChipStructs$DemandResponseLoadControlClusterPowerSavingsControlStruct"); - return nullptr; - } + jclass powerSavingsControlStructStructClass_5; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterPowerSavingsControlStruct", + powerSavingsControlStructStructClass_5); + if (err != CHIP_NO_ERROR) + { + ChipLogError( + Zcl, + "Could not find class ChipStructs$DemandResponseLoadControlClusterPowerSavingsControlStruct"); + return nullptr; + } - jmethodID powerSavingsControlStructStructCtor_5; - err = chip::JniReferences::GetInstance().FindMethod(env, powerSavingsControlStructStructClass_5, "", - "(Ljava/lang/Integer;)V", - &powerSavingsControlStructStructCtor_5); - if (err != CHIP_NO_ERROR || powerSavingsControlStructStructCtor_5 == nullptr) - { - ChipLogError( - Zcl, - "Could not find ChipStructs$DemandResponseLoadControlClusterPowerSavingsControlStruct constructor"); - return nullptr; - } + jmethodID powerSavingsControlStructStructCtor_5; + err = chip::JniReferences::GetInstance().FindMethod(env, powerSavingsControlStructStructClass_5, + "", "(Ljava/lang/Integer;)V", + &powerSavingsControlStructStructCtor_5); + if (err != CHIP_NO_ERROR || powerSavingsControlStructStructCtor_5 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$DemandResponseLoadControlClusterPowerSavingsControlStruct " + "constructor"); + return nullptr; + } - newElement_2_powerSavingsControlInsideOptional = - env->NewObject(powerSavingsControlStructStructClass_5, powerSavingsControlStructStructCtor_5, - newElement_2_powerSavingsControlInsideOptional_powerSavings); + newElement_2_powerSavingsControlInsideOptional = + env->NewObject(powerSavingsControlStructStructClass_5, powerSavingsControlStructStructCtor_5, + newElement_2_powerSavingsControlInsideOptional_powerSavings); + } chip::JniReferences::GetInstance().CreateOptional(newElement_2_powerSavingsControlInsideOptional, newElement_2_powerSavingsControl); } @@ -22858,97 +23083,107 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR jninewElement_2_heatingSourceControlInsideOptional_heatingSource, newElement_2_heatingSourceControlInsideOptional_heatingSource); - jclass heatingSourceControlStructStructClass_5; + { + jclass heatingSourceControlStructStructClass_5; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterHeatingSourceControlStruct", + heatingSourceControlStructStructClass_5); + if (err != CHIP_NO_ERROR) + { + ChipLogError( + Zcl, + "Could not find class ChipStructs$DemandResponseLoadControlClusterHeatingSourceControlStruct"); + return nullptr; + } + + jmethodID heatingSourceControlStructStructCtor_5; + err = chip::JniReferences::GetInstance().FindMethod(env, heatingSourceControlStructStructClass_5, + "", "(Ljava/lang/Integer;)V", + &heatingSourceControlStructStructCtor_5); + if (err != CHIP_NO_ERROR || heatingSourceControlStructStructCtor_5 == nullptr) + { + ChipLogError(Zcl, + "Could not find " + "ChipStructs$DemandResponseLoadControlClusterHeatingSourceControlStruct constructor"); + return nullptr; + } + + newElement_2_heatingSourceControlInsideOptional = + env->NewObject(heatingSourceControlStructStructClass_5, heatingSourceControlStructStructCtor_5, + newElement_2_heatingSourceControlInsideOptional_heatingSource); + } + chip::JniReferences::GetInstance().CreateOptional(newElement_2_heatingSourceControlInsideOptional, + newElement_2_heatingSourceControl); + } + + { + jclass loadControlEventTransitionStructStructClass_3; err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterHeatingSourceControlStruct", - heatingSourceControlStructStructClass_5); + env, + "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterLoadControlEventTransitionStruct", + loadControlEventTransitionStructStructClass_3); if (err != CHIP_NO_ERROR) { - ChipLogError( - Zcl, "Could not find class ChipStructs$DemandResponseLoadControlClusterHeatingSourceControlStruct"); + ChipLogError(Zcl, + "Could not find class " + "ChipStructs$DemandResponseLoadControlClusterLoadControlEventTransitionStruct"); return nullptr; } - jmethodID heatingSourceControlStructStructCtor_5; - err = chip::JniReferences::GetInstance().FindMethod(env, heatingSourceControlStructStructClass_5, "", - "(Ljava/lang/Integer;)V", - &heatingSourceControlStructStructCtor_5); - if (err != CHIP_NO_ERROR || heatingSourceControlStructStructCtor_5 == nullptr) + jmethodID loadControlEventTransitionStructStructCtor_3; + err = chip::JniReferences::GetInstance().FindMethod( + env, loadControlEventTransitionStructStructClass_3, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/" + "Optional;Ljava/util/Optional;Ljava/util/Optional;)V", + &loadControlEventTransitionStructStructCtor_3); + if (err != CHIP_NO_ERROR || loadControlEventTransitionStructStructCtor_3 == nullptr) { - ChipLogError(Zcl, - "Could not find ChipStructs$DemandResponseLoadControlClusterHeatingSourceControlStruct " - "constructor"); + ChipLogError( + Zcl, + "Could not find ChipStructs$DemandResponseLoadControlClusterLoadControlEventTransitionStruct " + "constructor"); return nullptr; } - newElement_2_heatingSourceControlInsideOptional = - env->NewObject(heatingSourceControlStructStructClass_5, heatingSourceControlStructStructCtor_5, - newElement_2_heatingSourceControlInsideOptional_heatingSource); - chip::JniReferences::GetInstance().CreateOptional(newElement_2_heatingSourceControlInsideOptional, - newElement_2_heatingSourceControl); + newElement_2 = env->NewObject(loadControlEventTransitionStructStructClass_3, + loadControlEventTransitionStructStructCtor_3, newElement_2_duration, + newElement_2_control, newElement_2_temperatureControl, + newElement_2_averageLoadControl, newElement_2_dutyCycleControl, + newElement_2_powerSavingsControl, newElement_2_heatingSourceControl); } + chip::JniReferences::GetInstance().AddToList(newElement_0_transitions, newElement_2); + } - jclass loadControlEventTransitionStructStructClass_3; + { + jclass loadControlEventStructStructClass_1; err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterLoadControlEventTransitionStruct", - loadControlEventTransitionStructStructClass_3); + env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterLoadControlEventStruct", + loadControlEventStructStructClass_1); if (err != CHIP_NO_ERROR) { - ChipLogError( - Zcl, - "Could not find class ChipStructs$DemandResponseLoadControlClusterLoadControlEventTransitionStruct"); + ChipLogError(Zcl, + "Could not find class ChipStructs$DemandResponseLoadControlClusterLoadControlEventStruct"); return nullptr; } - jmethodID loadControlEventTransitionStructStructCtor_3; + jmethodID loadControlEventStructStructCtor_1; err = chip::JniReferences::GetInstance().FindMethod( - env, loadControlEventTransitionStructStructClass_3, "", - "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/" - "util/Optional;Ljava/util/Optional;)V", - &loadControlEventTransitionStructStructCtor_3); - if (err != CHIP_NO_ERROR || loadControlEventTransitionStructStructCtor_3 == nullptr) + env, loadControlEventStructStructClass_1, "", + "([B[BLjava/lang/Integer;Ljava/lang/Long;Ljava/util/Optional;Ljava/lang/Integer;Ljava/lang/Long;Ljava/util/" + "ArrayList;)V", + &loadControlEventStructStructCtor_1); + if (err != CHIP_NO_ERROR || loadControlEventStructStructCtor_1 == nullptr) { - ChipLogError(Zcl, - "Could not find ChipStructs$DemandResponseLoadControlClusterLoadControlEventTransitionStruct " - "constructor"); + ChipLogError( + Zcl, "Could not find ChipStructs$DemandResponseLoadControlClusterLoadControlEventStruct constructor"); return nullptr; } - newElement_2 = - env->NewObject(loadControlEventTransitionStructStructClass_3, loadControlEventTransitionStructStructCtor_3, - newElement_2_duration, newElement_2_control, newElement_2_temperatureControl, - newElement_2_averageLoadControl, newElement_2_dutyCycleControl, - newElement_2_powerSavingsControl, newElement_2_heatingSourceControl); - chip::JniReferences::GetInstance().AddToList(newElement_0_transitions, newElement_2); + newElement_0 = env->NewObject(loadControlEventStructStructClass_1, loadControlEventStructStructCtor_1, + newElement_0_eventID, newElement_0_programID, newElement_0_control, + newElement_0_deviceClass, newElement_0_enrollmentGroup, newElement_0_criticality, + newElement_0_startTime, newElement_0_transitions); } - - jclass loadControlEventStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterLoadControlEventStruct", - loadControlEventStructStructClass_1); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Could not find class ChipStructs$DemandResponseLoadControlClusterLoadControlEventStruct"); - return nullptr; - } - - jmethodID loadControlEventStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod( - env, loadControlEventStructStructClass_1, "", - "([B[BLjava/lang/Integer;Ljava/lang/Long;Ljava/util/Optional;Ljava/lang/Integer;Ljava/lang/Long;Ljava/util/" - "ArrayList;)V", - &loadControlEventStructStructCtor_1); - if (err != CHIP_NO_ERROR || loadControlEventStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, - "Could not find ChipStructs$DemandResponseLoadControlClusterLoadControlEventStruct constructor"); - return nullptr; - } - - newElement_0 = env->NewObject(loadControlEventStructStructClass_1, loadControlEventStructStructCtor_1, - newElement_0_eventID, newElement_0_programID, newElement_0_control, - newElement_0_deviceClass, newElement_0_enrollmentGroup, newElement_0_criticality, - newElement_0_startTime, newElement_0_transitions); chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -23272,57 +23507,63 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR chip::JniReferences::GetInstance().CreateOptional(newElement_3_labelInsideOptional, newElement_3_label); } - jclass messageResponseOptionStructStructClass_4; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$MessagesClusterMessageResponseOptionStruct", - messageResponseOptionStructStructClass_4); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$MessagesClusterMessageResponseOptionStruct"); - return nullptr; - } + jclass messageResponseOptionStructStructClass_4; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$MessagesClusterMessageResponseOptionStruct", + messageResponseOptionStructStructClass_4); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$MessagesClusterMessageResponseOptionStruct"); + return nullptr; + } - jmethodID messageResponseOptionStructStructCtor_4; - err = chip::JniReferences::GetInstance().FindMethod(env, messageResponseOptionStructStructClass_4, "", - "(Ljava/util/Optional;Ljava/util/Optional;)V", - &messageResponseOptionStructStructCtor_4); - if (err != CHIP_NO_ERROR || messageResponseOptionStructStructCtor_4 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$MessagesClusterMessageResponseOptionStruct constructor"); - return nullptr; - } + jmethodID messageResponseOptionStructStructCtor_4; + err = chip::JniReferences::GetInstance().FindMethod( + env, messageResponseOptionStructStructClass_4, "", + "(Ljava/util/Optional;Ljava/util/Optional;)V", &messageResponseOptionStructStructCtor_4); + if (err != CHIP_NO_ERROR || messageResponseOptionStructStructCtor_4 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$MessagesClusterMessageResponseOptionStruct constructor"); + return nullptr; + } - newElement_3 = - env->NewObject(messageResponseOptionStructStructClass_4, messageResponseOptionStructStructCtor_4, - newElement_3_messageResponseID, newElement_3_label); + newElement_3 = + env->NewObject(messageResponseOptionStructStructClass_4, messageResponseOptionStructStructCtor_4, + newElement_3_messageResponseID, newElement_3_label); + } chip::JniReferences::GetInstance().AddToList(newElement_0_responsesInsideOptional, newElement_3); } chip::JniReferences::GetInstance().CreateOptional(newElement_0_responsesInsideOptional, newElement_0_responses); } - jclass messageStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$MessagesClusterMessageStruct", messageStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$MessagesClusterMessageStruct"); - return nullptr; - } + jclass messageStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$MessagesClusterMessageStruct", messageStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$MessagesClusterMessageStruct"); + return nullptr; + } - jmethodID messageStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod(env, messageStructStructClass_1, "", - "([BLjava/lang/Integer;Ljava/lang/Integer;Ljava/lang/" - "Long;Ljava/lang/Long;Ljava/lang/String;Ljava/util/Optional;)V", - &messageStructStructCtor_1); - if (err != CHIP_NO_ERROR || messageStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$MessagesClusterMessageStruct constructor"); - return nullptr; - } + jmethodID messageStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, messageStructStructClass_1, "", + "([BLjava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/String;Ljava/util/" + "Optional;)V", + &messageStructStructCtor_1); + if (err != CHIP_NO_ERROR || messageStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$MessagesClusterMessageStruct constructor"); + return nullptr; + } - newElement_0 = env->NewObject(messageStructStructClass_1, messageStructStructCtor_1, newElement_0_messageID, - newElement_0_priority, newElement_0_messageControl, newElement_0_startTime, - newElement_0_duration, newElement_0_messageText, newElement_0_responses); + newElement_0 = env->NewObject(messageStructStructClass_1, messageStructStructCtor_1, newElement_0_messageID, + newElement_0_priority, newElement_0_messageControl, newElement_0_startTime, + newElement_0_duration, newElement_0_messageText, newElement_0_responses); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -23631,30 +23872,34 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_3_maxDurationClassName.c_str(), newElement_3_maxDurationCtorSignature.c_str(), jninewElement_3_maxDuration, newElement_3_maxDuration); - jclass powerAdjustStructStructClass_4; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$DeviceEnergyManagementClusterPowerAdjustStruct", - powerAdjustStructStructClass_4); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$DeviceEnergyManagementClusterPowerAdjustStruct"); - return nullptr; - } + jclass powerAdjustStructStructClass_4; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$DeviceEnergyManagementClusterPowerAdjustStruct", + powerAdjustStructStructClass_4); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, + "Could not find class ChipStructs$DeviceEnergyManagementClusterPowerAdjustStruct"); + return nullptr; + } - jmethodID powerAdjustStructStructCtor_4; - err = chip::JniReferences::GetInstance().FindMethod( - env, powerAdjustStructStructClass_4, "", - "(Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Long;)V", &powerAdjustStructStructCtor_4); - if (err != CHIP_NO_ERROR || powerAdjustStructStructCtor_4 == nullptr) - { - ChipLogError(Zcl, - "Could not find ChipStructs$DeviceEnergyManagementClusterPowerAdjustStruct constructor"); - return nullptr; - } + jmethodID powerAdjustStructStructCtor_4; + err = chip::JniReferences::GetInstance().FindMethod( + env, powerAdjustStructStructClass_4, "", + "(Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Long;)V", + &powerAdjustStructStructCtor_4); + if (err != CHIP_NO_ERROR || powerAdjustStructStructCtor_4 == nullptr) + { + ChipLogError( + Zcl, "Could not find ChipStructs$DeviceEnergyManagementClusterPowerAdjustStruct constructor"); + return nullptr; + } - newElement_3 = - env->NewObject(powerAdjustStructStructClass_4, powerAdjustStructStructCtor_4, newElement_3_minPower, - newElement_3_maxPower, newElement_3_minDuration, newElement_3_maxDuration); + newElement_3 = + env->NewObject(powerAdjustStructStructClass_4, powerAdjustStructStructCtor_4, newElement_3_minPower, + newElement_3_maxPower, newElement_3_minDuration, newElement_3_maxDuration); + } chip::JniReferences::GetInstance().AddToList(value_powerAdjustCapability, newElement_3); } } @@ -23665,29 +23910,32 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR chip::JniReferences::GetInstance().CreateBoxedObject( value_causeClassName.c_str(), value_causeCtorSignature.c_str(), jnivalue_cause, value_cause); - jclass powerAdjustCapabilityStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$DeviceEnergyManagementClusterPowerAdjustCapabilityStruct", - powerAdjustCapabilityStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$DeviceEnergyManagementClusterPowerAdjustCapabilityStruct"); - return nullptr; - } + jclass powerAdjustCapabilityStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$DeviceEnergyManagementClusterPowerAdjustCapabilityStruct", + powerAdjustCapabilityStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, + "Could not find class ChipStructs$DeviceEnergyManagementClusterPowerAdjustCapabilityStruct"); + return nullptr; + } - jmethodID powerAdjustCapabilityStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod(env, powerAdjustCapabilityStructStructClass_1, "", - "(Ljava/util/ArrayList;Ljava/lang/Integer;)V", - &powerAdjustCapabilityStructStructCtor_1); - if (err != CHIP_NO_ERROR || powerAdjustCapabilityStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, - "Could not find ChipStructs$DeviceEnergyManagementClusterPowerAdjustCapabilityStruct constructor"); - return nullptr; - } + jmethodID powerAdjustCapabilityStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod(env, powerAdjustCapabilityStructStructClass_1, "", + "(Ljava/util/ArrayList;Ljava/lang/Integer;)V", + &powerAdjustCapabilityStructStructCtor_1); + if (err != CHIP_NO_ERROR || powerAdjustCapabilityStructStructCtor_1 == nullptr) + { + ChipLogError( + Zcl, "Could not find ChipStructs$DeviceEnergyManagementClusterPowerAdjustCapabilityStruct constructor"); + return nullptr; + } - value = env->NewObject(powerAdjustCapabilityStructStructClass_1, powerAdjustCapabilityStructStructCtor_1, - value_powerAdjustCapability, value_cause); + value = env->NewObject(powerAdjustCapabilityStructStructClass_1, powerAdjustCapabilityStructStructCtor_1, + value_powerAdjustCapability, value_cause); + } } return value; } @@ -24032,29 +24280,33 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_5_currency); } - jclass costStructStructClass_6; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$DeviceEnergyManagementClusterCostStruct", - costStructStructClass_6); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$DeviceEnergyManagementClusterCostStruct"); - return nullptr; + jclass costStructStructClass_6; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$DeviceEnergyManagementClusterCostStruct", + costStructStructClass_6); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$DeviceEnergyManagementClusterCostStruct"); + return nullptr; + } + + jmethodID costStructStructCtor_6; + err = chip::JniReferences::GetInstance().FindMethod( + env, costStructStructClass_6, "", + "(Ljava/lang/Integer;Ljava/lang/Long;Ljava/lang/Integer;Ljava/util/Optional;)V", + &costStructStructCtor_6); + if (err != CHIP_NO_ERROR || costStructStructCtor_6 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$DeviceEnergyManagementClusterCostStruct constructor"); + return nullptr; + } + + newElement_5 = + env->NewObject(costStructStructClass_6, costStructStructCtor_6, newElement_5_costType, + newElement_5_value, newElement_5_decimalPoints, newElement_5_currency); } - - jmethodID costStructStructCtor_6; - err = chip::JniReferences::GetInstance().FindMethod( - env, costStructStructClass_6, "", - "(Ljava/lang/Integer;Ljava/lang/Long;Ljava/lang/Integer;Ljava/util/Optional;)V", - &costStructStructCtor_6); - if (err != CHIP_NO_ERROR || costStructStructCtor_6 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$DeviceEnergyManagementClusterCostStruct constructor"); - return nullptr; - } - - newElement_5 = env->NewObject(costStructStructClass_6, costStructStructCtor_6, newElement_5_costType, - newElement_5_value, newElement_5_decimalPoints, newElement_5_currency); chip::JniReferences::GetInstance().AddToList(newElement_2_costsInsideOptional, newElement_5); } chip::JniReferences::GetInstance().CreateOptional(newElement_2_costsInsideOptional, newElement_2_costs); @@ -24136,36 +24388,40 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_2_maxDurationAdjustment); } - jclass slotStructStructClass_3; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$DeviceEnergyManagementClusterSlotStruct", slotStructStructClass_3); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$DeviceEnergyManagementClusterSlotStruct"); - return nullptr; - } + jclass slotStructStructClass_3; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$DeviceEnergyManagementClusterSlotStruct", + slotStructStructClass_3); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$DeviceEnergyManagementClusterSlotStruct"); + return nullptr; + } - jmethodID slotStructStructCtor_3; - err = chip::JniReferences::GetInstance().FindMethod( - env, slotStructStructClass_3, "", - "(Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Long;Ljava/util/" - "Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/" - "Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/" - "Optional;Ljava/util/Optional;Ljava/util/Optional;)V", - &slotStructStructCtor_3); - if (err != CHIP_NO_ERROR || slotStructStructCtor_3 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$DeviceEnergyManagementClusterSlotStruct constructor"); - return nullptr; - } + jmethodID slotStructStructCtor_3; + err = chip::JniReferences::GetInstance().FindMethod( + env, slotStructStructClass_3, "", + "(Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Long;Ljava/util/" + "Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/" + "Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/" + "Optional;Ljava/util/Optional;Ljava/util/Optional;)V", + &slotStructStructCtor_3); + if (err != CHIP_NO_ERROR || slotStructStructCtor_3 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$DeviceEnergyManagementClusterSlotStruct constructor"); + return nullptr; + } - newElement_2 = env->NewObject( - slotStructStructClass_3, slotStructStructCtor_3, newElement_2_minDuration, newElement_2_maxDuration, - newElement_2_defaultDuration, newElement_2_elapsedSlotTime, newElement_2_remainingSlotTime, - newElement_2_slotIsPausable, newElement_2_minPauseDuration, newElement_2_maxPauseDuration, - newElement_2_manufacturerESAState, newElement_2_nominalPower, newElement_2_minPower, newElement_2_maxPower, - newElement_2_nominalEnergy, newElement_2_costs, newElement_2_minPowerAdjustment, - newElement_2_maxPowerAdjustment, newElement_2_minDurationAdjustment, newElement_2_maxDurationAdjustment); + newElement_2 = env->NewObject( + slotStructStructClass_3, slotStructStructCtor_3, newElement_2_minDuration, newElement_2_maxDuration, + newElement_2_defaultDuration, newElement_2_elapsedSlotTime, newElement_2_remainingSlotTime, + newElement_2_slotIsPausable, newElement_2_minPauseDuration, newElement_2_maxPauseDuration, + newElement_2_manufacturerESAState, newElement_2_nominalPower, newElement_2_minPower, + newElement_2_maxPower, newElement_2_nominalEnergy, newElement_2_costs, newElement_2_minPowerAdjustment, + newElement_2_maxPowerAdjustment, newElement_2_minDurationAdjustment, + newElement_2_maxDurationAdjustment); + } chip::JniReferences::GetInstance().AddToList(value_slots, newElement_2); } jobject value_forecastUpdateReason; @@ -24176,31 +24432,33 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR value_forecastUpdateReasonClassName.c_str(), value_forecastUpdateReasonCtorSignature.c_str(), jnivalue_forecastUpdateReason, value_forecastUpdateReason); - jclass forecastStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$DeviceEnergyManagementClusterForecastStruct", - forecastStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$DeviceEnergyManagementClusterForecastStruct"); - return nullptr; - } + jclass forecastStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$DeviceEnergyManagementClusterForecastStruct", + forecastStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$DeviceEnergyManagementClusterForecastStruct"); + return nullptr; + } - jmethodID forecastStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod( - env, forecastStructStructClass_1, "", - "(Ljava/lang/Long;Ljava/lang/Integer;Ljava/lang/Long;Ljava/lang/Long;Ljava/util/Optional;Ljava/util/" - "Optional;Ljava/lang/Boolean;Ljava/util/ArrayList;Ljava/lang/Integer;)V", - &forecastStructStructCtor_1); - if (err != CHIP_NO_ERROR || forecastStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$DeviceEnergyManagementClusterForecastStruct constructor"); - return nullptr; - } + jmethodID forecastStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, forecastStructStructClass_1, "", + "(Ljava/lang/Long;Ljava/lang/Integer;Ljava/lang/Long;Ljava/lang/Long;Ljava/util/Optional;Ljava/util/" + "Optional;Ljava/lang/Boolean;Ljava/util/ArrayList;Ljava/lang/Integer;)V", + &forecastStructStructCtor_1); + if (err != CHIP_NO_ERROR || forecastStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$DeviceEnergyManagementClusterForecastStruct constructor"); + return nullptr; + } - value = env->NewObject(forecastStructStructClass_1, forecastStructStructCtor_1, value_forecastID, - value_activeSlotNumber, value_startTime, value_endTime, value_earliestStartTime, - value_latestEndTime, value_isPausable, value_slots, value_forecastUpdateReason); + value = env->NewObject(forecastStructStructClass_1, forecastStructStructCtor_1, value_forecastID, + value_activeSlotNumber, value_startTime, value_endTime, value_earliestStartTime, + value_latestEndTime, value_isPausable, value_slots, value_forecastUpdateReason); + } } return value; } @@ -25009,27 +25267,29 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR chip::JniReferences::GetInstance().CreateOptional(newElement_0_labelInsideOptional, newElement_0_label); } - jclass balanceStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$EnergyPreferenceClusterBalanceStruct", balanceStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$EnergyPreferenceClusterBalanceStruct"); - return nullptr; - } + jclass balanceStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$EnergyPreferenceClusterBalanceStruct", balanceStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$EnergyPreferenceClusterBalanceStruct"); + return nullptr; + } - jmethodID balanceStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod(env, balanceStructStructClass_1, "", - "(Ljava/lang/Integer;Ljava/util/Optional;)V", - &balanceStructStructCtor_1); - if (err != CHIP_NO_ERROR || balanceStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$EnergyPreferenceClusterBalanceStruct constructor"); - return nullptr; - } + jmethodID balanceStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod(env, balanceStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/util/Optional;)V", + &balanceStructStructCtor_1); + if (err != CHIP_NO_ERROR || balanceStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$EnergyPreferenceClusterBalanceStruct constructor"); + return nullptr; + } - newElement_0 = - env->NewObject(balanceStructStructClass_1, balanceStructStructCtor_1, newElement_0_step, newElement_0_label); + newElement_0 = env->NewObject(balanceStructStructClass_1, balanceStructStructCtor_1, newElement_0_step, + newElement_0_label); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -25111,27 +25371,29 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR chip::JniReferences::GetInstance().CreateOptional(newElement_0_labelInsideOptional, newElement_0_label); } - jclass balanceStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$EnergyPreferenceClusterBalanceStruct", balanceStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$EnergyPreferenceClusterBalanceStruct"); - return nullptr; - } + jclass balanceStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$EnergyPreferenceClusterBalanceStruct", balanceStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$EnergyPreferenceClusterBalanceStruct"); + return nullptr; + } - jmethodID balanceStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod(env, balanceStructStructClass_1, "", - "(Ljava/lang/Integer;Ljava/util/Optional;)V", - &balanceStructStructCtor_1); - if (err != CHIP_NO_ERROR || balanceStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$EnergyPreferenceClusterBalanceStruct constructor"); - return nullptr; - } + jmethodID balanceStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod(env, balanceStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/util/Optional;)V", + &balanceStructStructCtor_1); + if (err != CHIP_NO_ERROR || balanceStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$EnergyPreferenceClusterBalanceStruct constructor"); + return nullptr; + } - newElement_0 = - env->NewObject(balanceStructStructClass_1, balanceStructStructCtor_1, newElement_0_step, newElement_0_label); + newElement_0 = env->NewObject(balanceStructStructClass_1, balanceStructStructCtor_1, newElement_0_step, + newElement_0_label); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -25544,51 +25806,57 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_2_valueCtorSignature.c_str(), jninewElement_2_value, newElement_2_value); - jclass modeTagStructStructClass_3; + { + jclass modeTagStructStructClass_3; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$EnergyEvseModeClusterModeTagStruct", + modeTagStructStructClass_3); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$EnergyEvseModeClusterModeTagStruct"); + return nullptr; + } + + jmethodID modeTagStructStructCtor_3; + err = chip::JniReferences::GetInstance().FindMethod(env, modeTagStructStructClass_3, "", + "(Ljava/util/Optional;Ljava/lang/Integer;)V", + &modeTagStructStructCtor_3); + if (err != CHIP_NO_ERROR || modeTagStructStructCtor_3 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$EnergyEvseModeClusterModeTagStruct constructor"); + return nullptr; + } + + newElement_2 = env->NewObject(modeTagStructStructClass_3, modeTagStructStructCtor_3, newElement_2_mfgCode, + newElement_2_value); + } + chip::JniReferences::GetInstance().AddToList(newElement_0_modeTags, newElement_2); + } + + { + jclass modeOptionStructStructClass_1; err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$EnergyEvseModeClusterModeTagStruct", modeTagStructStructClass_3); + env, "chip/devicecontroller/ChipStructs$EnergyEvseModeClusterModeOptionStruct", + modeOptionStructStructClass_1); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$EnergyEvseModeClusterModeTagStruct"); + ChipLogError(Zcl, "Could not find class ChipStructs$EnergyEvseModeClusterModeOptionStruct"); return nullptr; } - jmethodID modeTagStructStructCtor_3; - err = chip::JniReferences::GetInstance().FindMethod(env, modeTagStructStructClass_3, "", - "(Ljava/util/Optional;Ljava/lang/Integer;)V", - &modeTagStructStructCtor_3); - if (err != CHIP_NO_ERROR || modeTagStructStructCtor_3 == nullptr) + jmethodID modeOptionStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, modeOptionStructStructClass_1, "", + "(Ljava/lang/String;Ljava/lang/Integer;Ljava/util/ArrayList;)V", &modeOptionStructStructCtor_1); + if (err != CHIP_NO_ERROR || modeOptionStructStructCtor_1 == nullptr) { - ChipLogError(Zcl, "Could not find ChipStructs$EnergyEvseModeClusterModeTagStruct constructor"); + ChipLogError(Zcl, "Could not find ChipStructs$EnergyEvseModeClusterModeOptionStruct constructor"); return nullptr; } - newElement_2 = env->NewObject(modeTagStructStructClass_3, modeTagStructStructCtor_3, newElement_2_mfgCode, - newElement_2_value); - chip::JniReferences::GetInstance().AddToList(newElement_0_modeTags, newElement_2); - } - - jclass modeOptionStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$EnergyEvseModeClusterModeOptionStruct", modeOptionStructStructClass_1); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Could not find class ChipStructs$EnergyEvseModeClusterModeOptionStruct"); - return nullptr; - } - - jmethodID modeOptionStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod(env, modeOptionStructStructClass_1, "", - "(Ljava/lang/String;Ljava/lang/Integer;Ljava/util/ArrayList;)V", - &modeOptionStructStructCtor_1); - if (err != CHIP_NO_ERROR || modeOptionStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$EnergyEvseModeClusterModeOptionStruct constructor"); - return nullptr; + newElement_0 = env->NewObject(modeOptionStructStructClass_1, modeOptionStructStructCtor_1, newElement_0_label, + newElement_0_mode, newElement_0_modeTags); } - - newElement_0 = env->NewObject(modeOptionStructStructClass_1, modeOptionStructStructCtor_1, newElement_0_label, - newElement_0_mode, newElement_0_modeTags); chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -25855,51 +26123,57 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_2_valueCtorSignature.c_str(), jninewElement_2_value, newElement_2_value); - jclass modeTagStructStructClass_3; + { + jclass modeTagStructStructClass_3; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$WaterHeaterModeClusterModeTagStruct", + modeTagStructStructClass_3); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$WaterHeaterModeClusterModeTagStruct"); + return nullptr; + } + + jmethodID modeTagStructStructCtor_3; + err = chip::JniReferences::GetInstance().FindMethod(env, modeTagStructStructClass_3, "", + "(Ljava/util/Optional;Ljava/lang/Integer;)V", + &modeTagStructStructCtor_3); + if (err != CHIP_NO_ERROR || modeTagStructStructCtor_3 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$WaterHeaterModeClusterModeTagStruct constructor"); + return nullptr; + } + + newElement_2 = env->NewObject(modeTagStructStructClass_3, modeTagStructStructCtor_3, newElement_2_mfgCode, + newElement_2_value); + } + chip::JniReferences::GetInstance().AddToList(newElement_0_modeTags, newElement_2); + } + + { + jclass modeOptionStructStructClass_1; err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$WaterHeaterModeClusterModeTagStruct", modeTagStructStructClass_3); + env, "chip/devicecontroller/ChipStructs$WaterHeaterModeClusterModeOptionStruct", + modeOptionStructStructClass_1); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$WaterHeaterModeClusterModeTagStruct"); + ChipLogError(Zcl, "Could not find class ChipStructs$WaterHeaterModeClusterModeOptionStruct"); return nullptr; } - jmethodID modeTagStructStructCtor_3; - err = chip::JniReferences::GetInstance().FindMethod(env, modeTagStructStructClass_3, "", - "(Ljava/util/Optional;Ljava/lang/Integer;)V", - &modeTagStructStructCtor_3); - if (err != CHIP_NO_ERROR || modeTagStructStructCtor_3 == nullptr) + jmethodID modeOptionStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, modeOptionStructStructClass_1, "", + "(Ljava/lang/String;Ljava/lang/Integer;Ljava/util/ArrayList;)V", &modeOptionStructStructCtor_1); + if (err != CHIP_NO_ERROR || modeOptionStructStructCtor_1 == nullptr) { - ChipLogError(Zcl, "Could not find ChipStructs$WaterHeaterModeClusterModeTagStruct constructor"); + ChipLogError(Zcl, "Could not find ChipStructs$WaterHeaterModeClusterModeOptionStruct constructor"); return nullptr; } - newElement_2 = env->NewObject(modeTagStructStructClass_3, modeTagStructStructCtor_3, newElement_2_mfgCode, - newElement_2_value); - chip::JniReferences::GetInstance().AddToList(newElement_0_modeTags, newElement_2); + newElement_0 = env->NewObject(modeOptionStructStructClass_1, modeOptionStructStructCtor_1, newElement_0_label, + newElement_0_mode, newElement_0_modeTags); } - - jclass modeOptionStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$WaterHeaterModeClusterModeOptionStruct", modeOptionStructStructClass_1); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Could not find class ChipStructs$WaterHeaterModeClusterModeOptionStruct"); - return nullptr; - } - - jmethodID modeOptionStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod(env, modeOptionStructStructClass_1, "", - "(Ljava/lang/String;Ljava/lang/Integer;Ljava/util/ArrayList;)V", - &modeOptionStructStructCtor_1); - if (err != CHIP_NO_ERROR || modeOptionStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$WaterHeaterModeClusterModeOptionStruct constructor"); - return nullptr; - } - - newElement_0 = env->NewObject(modeOptionStructStructClass_1, modeOptionStructStructCtor_1, newElement_0_label, - newElement_0_mode, newElement_0_modeTags); chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -26166,53 +26440,59 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_2_valueCtorSignature.c_str(), jninewElement_2_value, newElement_2_value); - jclass modeTagStructStructClass_3; + { + jclass modeTagStructStructClass_3; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$DeviceEnergyManagementModeClusterModeTagStruct", + modeTagStructStructClass_3); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$DeviceEnergyManagementModeClusterModeTagStruct"); + return nullptr; + } + + jmethodID modeTagStructStructCtor_3; + err = chip::JniReferences::GetInstance().FindMethod(env, modeTagStructStructClass_3, "", + "(Ljava/util/Optional;Ljava/lang/Integer;)V", + &modeTagStructStructCtor_3); + if (err != CHIP_NO_ERROR || modeTagStructStructCtor_3 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$DeviceEnergyManagementModeClusterModeTagStruct constructor"); + return nullptr; + } + + newElement_2 = env->NewObject(modeTagStructStructClass_3, modeTagStructStructCtor_3, newElement_2_mfgCode, + newElement_2_value); + } + chip::JniReferences::GetInstance().AddToList(newElement_0_modeTags, newElement_2); + } + + { + jclass modeOptionStructStructClass_1; err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$DeviceEnergyManagementModeClusterModeTagStruct", - modeTagStructStructClass_3); + env, "chip/devicecontroller/ChipStructs$DeviceEnergyManagementModeClusterModeOptionStruct", + modeOptionStructStructClass_1); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$DeviceEnergyManagementModeClusterModeTagStruct"); + ChipLogError(Zcl, "Could not find class ChipStructs$DeviceEnergyManagementModeClusterModeOptionStruct"); return nullptr; } - jmethodID modeTagStructStructCtor_3; - err = chip::JniReferences::GetInstance().FindMethod(env, modeTagStructStructClass_3, "", - "(Ljava/util/Optional;Ljava/lang/Integer;)V", - &modeTagStructStructCtor_3); - if (err != CHIP_NO_ERROR || modeTagStructStructCtor_3 == nullptr) + jmethodID modeOptionStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, modeOptionStructStructClass_1, "", + "(Ljava/lang/String;Ljava/lang/Integer;Ljava/util/ArrayList;)V", &modeOptionStructStructCtor_1); + if (err != CHIP_NO_ERROR || modeOptionStructStructCtor_1 == nullptr) { - ChipLogError(Zcl, "Could not find ChipStructs$DeviceEnergyManagementModeClusterModeTagStruct constructor"); + ChipLogError(Zcl, + "Could not find ChipStructs$DeviceEnergyManagementModeClusterModeOptionStruct constructor"); return nullptr; } - newElement_2 = env->NewObject(modeTagStructStructClass_3, modeTagStructStructCtor_3, newElement_2_mfgCode, - newElement_2_value); - chip::JniReferences::GetInstance().AddToList(newElement_0_modeTags, newElement_2); - } - - jclass modeOptionStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$DeviceEnergyManagementModeClusterModeOptionStruct", - modeOptionStructStructClass_1); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Could not find class ChipStructs$DeviceEnergyManagementModeClusterModeOptionStruct"); - return nullptr; - } - - jmethodID modeOptionStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod(env, modeOptionStructStructClass_1, "", - "(Ljava/lang/String;Ljava/lang/Integer;Ljava/util/ArrayList;)V", - &modeOptionStructStructCtor_1); - if (err != CHIP_NO_ERROR || modeOptionStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$DeviceEnergyManagementModeClusterModeOptionStruct constructor"); - return nullptr; + newElement_0 = env->NewObject(modeOptionStructStructClass_1, modeOptionStructStructCtor_1, newElement_0_label, + newElement_0_mode, newElement_0_modeTags); } - - newElement_0 = env->NewObject(modeOptionStructStructClass_1, modeOptionStructStructCtor_1, newElement_0_label, - newElement_0_mode, newElement_0_modeTags); chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -27957,30 +28237,32 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR jninewElement_0_areaInfo_locationInfo_areaType, newElement_0_areaInfo_locationInfo_areaType); } - jclass locationDescriptorStructStructClass_4; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$ServiceAreaClusterLocationDescriptorStruct", - locationDescriptorStructStructClass_4); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$ServiceAreaClusterLocationDescriptorStruct"); - return nullptr; - } + jclass locationDescriptorStructStructClass_4; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$ServiceAreaClusterLocationDescriptorStruct", + locationDescriptorStructStructClass_4); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$ServiceAreaClusterLocationDescriptorStruct"); + return nullptr; + } - jmethodID locationDescriptorStructStructCtor_4; - err = chip::JniReferences::GetInstance().FindMethod( - env, locationDescriptorStructStructClass_4, "", - "(Ljava/lang/String;Ljava/lang/Integer;Ljava/lang/Integer;)V", &locationDescriptorStructStructCtor_4); - if (err != CHIP_NO_ERROR || locationDescriptorStructStructCtor_4 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$ServiceAreaClusterLocationDescriptorStruct constructor"); - return nullptr; - } + jmethodID locationDescriptorStructStructCtor_4; + err = chip::JniReferences::GetInstance().FindMethod( + env, locationDescriptorStructStructClass_4, "", + "(Ljava/lang/String;Ljava/lang/Integer;Ljava/lang/Integer;)V", &locationDescriptorStructStructCtor_4); + if (err != CHIP_NO_ERROR || locationDescriptorStructStructCtor_4 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$ServiceAreaClusterLocationDescriptorStruct constructor"); + return nullptr; + } - newElement_0_areaInfo_locationInfo = - env->NewObject(locationDescriptorStructStructClass_4, locationDescriptorStructStructCtor_4, - newElement_0_areaInfo_locationInfo_locationName, - newElement_0_areaInfo_locationInfo_floorNumber, newElement_0_areaInfo_locationInfo_areaType); + newElement_0_areaInfo_locationInfo = env->NewObject( + locationDescriptorStructStructClass_4, locationDescriptorStructStructCtor_4, + newElement_0_areaInfo_locationInfo_locationName, newElement_0_areaInfo_locationInfo_floorNumber, + newElement_0_areaInfo_locationInfo_areaType); + } } jobject newElement_0_areaInfo_landmarkInfo; if (entry_0.areaInfo.landmarkInfo.IsNull()) @@ -28016,77 +28298,83 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_0_areaInfo_landmarkInfo_relativePositionTag); } - jclass landmarkInfoStructStructClass_4; + { + jclass landmarkInfoStructStructClass_4; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$ServiceAreaClusterLandmarkInfoStruct", + landmarkInfoStructStructClass_4); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$ServiceAreaClusterLandmarkInfoStruct"); + return nullptr; + } + + jmethodID landmarkInfoStructStructCtor_4; + err = chip::JniReferences::GetInstance().FindMethod(env, landmarkInfoStructStructClass_4, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;)V", + &landmarkInfoStructStructCtor_4); + if (err != CHIP_NO_ERROR || landmarkInfoStructStructCtor_4 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$ServiceAreaClusterLandmarkInfoStruct constructor"); + return nullptr; + } + + newElement_0_areaInfo_landmarkInfo = env->NewObject( + landmarkInfoStructStructClass_4, landmarkInfoStructStructCtor_4, + newElement_0_areaInfo_landmarkInfo_landmarkTag, newElement_0_areaInfo_landmarkInfo_relativePositionTag); + } + } + + { + jclass areaInfoStructStructClass_2; err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$ServiceAreaClusterLandmarkInfoStruct", - landmarkInfoStructStructClass_4); + env, "chip/devicecontroller/ChipStructs$ServiceAreaClusterAreaInfoStruct", areaInfoStructStructClass_2); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$ServiceAreaClusterLandmarkInfoStruct"); + ChipLogError(Zcl, "Could not find class ChipStructs$ServiceAreaClusterAreaInfoStruct"); return nullptr; } - jmethodID landmarkInfoStructStructCtor_4; - err = chip::JniReferences::GetInstance().FindMethod(env, landmarkInfoStructStructClass_4, "", - "(Ljava/lang/Integer;Ljava/lang/Integer;)V", - &landmarkInfoStructStructCtor_4); - if (err != CHIP_NO_ERROR || landmarkInfoStructStructCtor_4 == nullptr) + jmethodID areaInfoStructStructCtor_2; + err = chip::JniReferences::GetInstance().FindMethod( + env, areaInfoStructStructClass_2, "", + "(Lchip/devicecontroller/ChipStructs$ServiceAreaClusterLocationDescriptorStruct;Lchip/devicecontroller/" + "ChipStructs$ServiceAreaClusterLandmarkInfoStruct;)V", + &areaInfoStructStructCtor_2); + if (err != CHIP_NO_ERROR || areaInfoStructStructCtor_2 == nullptr) { - ChipLogError(Zcl, "Could not find ChipStructs$ServiceAreaClusterLandmarkInfoStruct constructor"); + ChipLogError(Zcl, "Could not find ChipStructs$ServiceAreaClusterAreaInfoStruct constructor"); return nullptr; } - newElement_0_areaInfo_landmarkInfo = env->NewObject( - landmarkInfoStructStructClass_4, landmarkInfoStructStructCtor_4, - newElement_0_areaInfo_landmarkInfo_landmarkTag, newElement_0_areaInfo_landmarkInfo_relativePositionTag); + newElement_0_areaInfo = env->NewObject(areaInfoStructStructClass_2, areaInfoStructStructCtor_2, + newElement_0_areaInfo_locationInfo, newElement_0_areaInfo_landmarkInfo); } - jclass areaInfoStructStructClass_2; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$ServiceAreaClusterAreaInfoStruct", areaInfoStructStructClass_2); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$ServiceAreaClusterAreaInfoStruct"); - return nullptr; - } - - jmethodID areaInfoStructStructCtor_2; - err = chip::JniReferences::GetInstance().FindMethod( - env, areaInfoStructStructClass_2, "", - "(Lchip/devicecontroller/ChipStructs$ServiceAreaClusterLocationDescriptorStruct;Lchip/devicecontroller/" - "ChipStructs$ServiceAreaClusterLandmarkInfoStruct;)V", - &areaInfoStructStructCtor_2); - if (err != CHIP_NO_ERROR || areaInfoStructStructCtor_2 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$ServiceAreaClusterAreaInfoStruct constructor"); - return nullptr; - } - - newElement_0_areaInfo = env->NewObject(areaInfoStructStructClass_2, areaInfoStructStructCtor_2, - newElement_0_areaInfo_locationInfo, newElement_0_areaInfo_landmarkInfo); + jclass areaStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$ServiceAreaClusterAreaStruct", areaStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$ServiceAreaClusterAreaStruct"); + return nullptr; + } - jclass areaStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$ServiceAreaClusterAreaStruct", areaStructStructClass_1); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Could not find class ChipStructs$ServiceAreaClusterAreaStruct"); - return nullptr; - } + jmethodID areaStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, areaStructStructClass_1, "", + "(Ljava/lang/Long;Ljava/lang/Long;Lchip/devicecontroller/ChipStructs$ServiceAreaClusterAreaInfoStruct;)V", + &areaStructStructCtor_1); + if (err != CHIP_NO_ERROR || areaStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$ServiceAreaClusterAreaStruct constructor"); + return nullptr; + } - jmethodID areaStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod( - env, areaStructStructClass_1, "", - "(Ljava/lang/Long;Ljava/lang/Long;Lchip/devicecontroller/ChipStructs$ServiceAreaClusterAreaInfoStruct;)V", - &areaStructStructCtor_1); - if (err != CHIP_NO_ERROR || areaStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$ServiceAreaClusterAreaStruct constructor"); - return nullptr; + newElement_0 = env->NewObject(areaStructStructClass_1, areaStructStructCtor_1, newElement_0_areaID, + newElement_0_mapID, newElement_0_areaInfo); } - - newElement_0 = env->NewObject(areaStructStructClass_1, areaStructStructCtor_1, newElement_0_areaID, - newElement_0_mapID, newElement_0_areaInfo); chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -28117,25 +28405,28 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR jobject newElement_0_name; LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.name, newElement_0_name)); - jclass mapStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$ServiceAreaClusterMapStruct", mapStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$ServiceAreaClusterMapStruct"); - return nullptr; - } + jclass mapStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$ServiceAreaClusterMapStruct", mapStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$ServiceAreaClusterMapStruct"); + return nullptr; + } - jmethodID mapStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod( - env, mapStructStructClass_1, "", "(Ljava/lang/Long;Ljava/lang/String;)V", &mapStructStructCtor_1); - if (err != CHIP_NO_ERROR || mapStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$ServiceAreaClusterMapStruct constructor"); - return nullptr; - } + jmethodID mapStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, mapStructStructClass_1, "", "(Ljava/lang/Long;Ljava/lang/String;)V", &mapStructStructCtor_1); + if (err != CHIP_NO_ERROR || mapStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$ServiceAreaClusterMapStruct constructor"); + return nullptr; + } - newElement_0 = env->NewObject(mapStructStructClass_1, mapStructStructCtor_1, newElement_0_mapID, newElement_0_name); + newElement_0 = + env->NewObject(mapStructStructClass_1, mapStructStructCtor_1, newElement_0_mapID, newElement_0_name); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -28294,27 +28585,31 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_0_estimatedTime); } - jclass progressStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$ServiceAreaClusterProgressStruct", progressStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$ServiceAreaClusterProgressStruct"); - return nullptr; - } + jclass progressStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$ServiceAreaClusterProgressStruct", progressStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$ServiceAreaClusterProgressStruct"); + return nullptr; + } - jmethodID progressStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod( - env, progressStructStructClass_1, "", - "(Ljava/lang/Long;Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;)V", &progressStructStructCtor_1); - if (err != CHIP_NO_ERROR || progressStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$ServiceAreaClusterProgressStruct constructor"); - return nullptr; - } + jmethodID progressStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, progressStructStructClass_1, "", + "(Ljava/lang/Long;Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;)V", + &progressStructStructCtor_1); + if (err != CHIP_NO_ERROR || progressStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$ServiceAreaClusterProgressStruct constructor"); + return nullptr; + } - newElement_0 = env->NewObject(progressStructStructClass_1, progressStructStructCtor_1, newElement_0_areaID, - newElement_0_status, newElement_0_totalOperationalTime, newElement_0_estimatedTime); + newElement_0 = + env->NewObject(progressStructStructClass_1, progressStructStructCtor_1, newElement_0_areaID, + newElement_0_status, newElement_0_totalOperationalTime, newElement_0_estimatedTime); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -29996,28 +30291,30 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_0_presetTypeFeaturesClassName.c_str(), newElement_0_presetTypeFeaturesCtorSignature.c_str(), jninewElement_0_presetTypeFeatures, newElement_0_presetTypeFeatures); - jclass presetTypeStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$ThermostatClusterPresetTypeStruct", presetTypeStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$ThermostatClusterPresetTypeStruct"); - return nullptr; - } + jclass presetTypeStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$ThermostatClusterPresetTypeStruct", presetTypeStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$ThermostatClusterPresetTypeStruct"); + return nullptr; + } - jmethodID presetTypeStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod(env, presetTypeStructStructClass_1, "", - "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;)V", - &presetTypeStructStructCtor_1); - if (err != CHIP_NO_ERROR || presetTypeStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$ThermostatClusterPresetTypeStruct constructor"); - return nullptr; - } + jmethodID presetTypeStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, presetTypeStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;)V", &presetTypeStructStructCtor_1); + if (err != CHIP_NO_ERROR || presetTypeStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$ThermostatClusterPresetTypeStruct constructor"); + return nullptr; + } - newElement_0 = - env->NewObject(presetTypeStructStructClass_1, presetTypeStructStructCtor_1, newElement_0_presetScenario, - newElement_0_numberOfPresets, newElement_0_presetTypeFeatures); + newElement_0 = + env->NewObject(presetTypeStructStructClass_1, presetTypeStructStructCtor_1, newElement_0_presetScenario, + newElement_0_numberOfPresets, newElement_0_presetTypeFeatures); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -30060,28 +30357,31 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_0_scheduleTypeFeaturesClassName.c_str(), newElement_0_scheduleTypeFeaturesCtorSignature.c_str(), jninewElement_0_scheduleTypeFeatures, newElement_0_scheduleTypeFeatures); - jclass scheduleTypeStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$ThermostatClusterScheduleTypeStruct", scheduleTypeStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$ThermostatClusterScheduleTypeStruct"); - return nullptr; - } + jclass scheduleTypeStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$ThermostatClusterScheduleTypeStruct", + scheduleTypeStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$ThermostatClusterScheduleTypeStruct"); + return nullptr; + } - jmethodID scheduleTypeStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod(env, scheduleTypeStructStructClass_1, "", - "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;)V", - &scheduleTypeStructStructCtor_1); - if (err != CHIP_NO_ERROR || scheduleTypeStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$ThermostatClusterScheduleTypeStruct constructor"); - return nullptr; - } + jmethodID scheduleTypeStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, scheduleTypeStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;)V", &scheduleTypeStructStructCtor_1); + if (err != CHIP_NO_ERROR || scheduleTypeStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$ThermostatClusterScheduleTypeStruct constructor"); + return nullptr; + } - newElement_0 = - env->NewObject(scheduleTypeStructStructClass_1, scheduleTypeStructStructCtor_1, newElement_0_systemMode, - newElement_0_numberOfSchedules, newElement_0_scheduleTypeFeatures); + newElement_0 = + env->NewObject(scheduleTypeStructStructClass_1, scheduleTypeStructStructCtor_1, newElement_0_systemMode, + newElement_0_numberOfSchedules, newElement_0_scheduleTypeFeatures); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -30308,29 +30608,31 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR jninewElement_0_builtIn, newElement_0_builtIn); } - jclass presetStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$ThermostatClusterPresetStruct", presetStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$ThermostatClusterPresetStruct"); - return nullptr; - } + jclass presetStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$ThermostatClusterPresetStruct", presetStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$ThermostatClusterPresetStruct"); + return nullptr; + } - jmethodID presetStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod( - env, presetStructStructClass_1, "", - "([BLjava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/lang/Boolean;)V", - &presetStructStructCtor_1); - if (err != CHIP_NO_ERROR || presetStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$ThermostatClusterPresetStruct constructor"); - return nullptr; - } + jmethodID presetStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, presetStructStructClass_1, "", + "([BLjava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/lang/Boolean;)V", + &presetStructStructCtor_1); + if (err != CHIP_NO_ERROR || presetStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$ThermostatClusterPresetStruct constructor"); + return nullptr; + } - newElement_0 = env->NewObject(presetStructStructClass_1, presetStructStructCtor_1, newElement_0_presetHandle, - newElement_0_presetScenario, newElement_0_name, newElement_0_coolingSetpoint, - newElement_0_heatingSetpoint, newElement_0_builtIn); + newElement_0 = env->NewObject(presetStructStructClass_1, presetStructStructCtor_1, newElement_0_presetHandle, + newElement_0_presetScenario, newElement_0_name, newElement_0_coolingSetpoint, + newElement_0_heatingSetpoint, newElement_0_builtIn); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -30495,32 +30797,34 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_2_heatingSetpoint); } - jclass scheduleTransitionStructStructClass_3; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$ThermostatClusterScheduleTransitionStruct", - scheduleTransitionStructStructClass_3); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$ThermostatClusterScheduleTransitionStruct"); - return nullptr; - } + jclass scheduleTransitionStructStructClass_3; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$ThermostatClusterScheduleTransitionStruct", + scheduleTransitionStructStructClass_3); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$ThermostatClusterScheduleTransitionStruct"); + return nullptr; + } - jmethodID scheduleTransitionStructStructCtor_3; - err = chip::JniReferences::GetInstance().FindMethod( - env, scheduleTransitionStructStructClass_3, "", - "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/" - "util/Optional;)V", - &scheduleTransitionStructStructCtor_3); - if (err != CHIP_NO_ERROR || scheduleTransitionStructStructCtor_3 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$ThermostatClusterScheduleTransitionStruct constructor"); - return nullptr; - } + jmethodID scheduleTransitionStructStructCtor_3; + err = chip::JniReferences::GetInstance().FindMethod( + env, scheduleTransitionStructStructClass_3, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/" + "Optional;Ljava/util/Optional;)V", + &scheduleTransitionStructStructCtor_3); + if (err != CHIP_NO_ERROR || scheduleTransitionStructStructCtor_3 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$ThermostatClusterScheduleTransitionStruct constructor"); + return nullptr; + } - newElement_2 = - env->NewObject(scheduleTransitionStructStructClass_3, scheduleTransitionStructStructCtor_3, - newElement_2_dayOfWeek, newElement_2_transitionTime, newElement_2_presetHandle, - newElement_2_systemMode, newElement_2_coolingSetpoint, newElement_2_heatingSetpoint); + newElement_2 = + env->NewObject(scheduleTransitionStructStructClass_3, scheduleTransitionStructStructCtor_3, + newElement_2_dayOfWeek, newElement_2_transitionTime, newElement_2_presetHandle, + newElement_2_systemMode, newElement_2_coolingSetpoint, newElement_2_heatingSetpoint); + } chip::JniReferences::GetInstance().AddToList(newElement_0_transitions, newElement_2); } jobject newElement_0_builtIn; @@ -30538,29 +30842,31 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR jninewElement_0_builtIn, newElement_0_builtIn); } - jclass scheduleStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$ThermostatClusterScheduleStruct", scheduleStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$ThermostatClusterScheduleStruct"); - return nullptr; - } + jclass scheduleStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$ThermostatClusterScheduleStruct", scheduleStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$ThermostatClusterScheduleStruct"); + return nullptr; + } - jmethodID scheduleStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod( - env, scheduleStructStructClass_1, "", - "([BLjava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/ArrayList;Ljava/lang/Boolean;)V", - &scheduleStructStructCtor_1); - if (err != CHIP_NO_ERROR || scheduleStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$ThermostatClusterScheduleStruct constructor"); - return nullptr; - } + jmethodID scheduleStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, scheduleStructStructClass_1, "", + "([BLjava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/ArrayList;Ljava/lang/Boolean;)V", + &scheduleStructStructCtor_1); + if (err != CHIP_NO_ERROR || scheduleStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$ThermostatClusterScheduleStruct constructor"); + return nullptr; + } - newElement_0 = env->NewObject(scheduleStructStructClass_1, scheduleStructStructCtor_1, newElement_0_scheduleHandle, - newElement_0_systemMode, newElement_0_name, newElement_0_presetHandle, - newElement_0_transitions, newElement_0_builtIn); + newElement_0 = env->NewObject(scheduleStructStructClass_1, scheduleStructStructCtor_1, + newElement_0_scheduleHandle, newElement_0_systemMode, newElement_0_name, + newElement_0_presetHandle, newElement_0_transitions, newElement_0_builtIn); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -34062,28 +34368,30 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR value_holdTimeDefaultCtorSignature.c_str(), jnivalue_holdTimeDefault, value_holdTimeDefault); - jclass holdTimeLimitsStructStructClass_0; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$OccupancySensingClusterHoldTimeLimitsStruct", - holdTimeLimitsStructStructClass_0); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$OccupancySensingClusterHoldTimeLimitsStruct"); - return nullptr; - } + jclass holdTimeLimitsStructStructClass_0; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$OccupancySensingClusterHoldTimeLimitsStruct", + holdTimeLimitsStructStructClass_0); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$OccupancySensingClusterHoldTimeLimitsStruct"); + return nullptr; + } - jmethodID holdTimeLimitsStructStructCtor_0; - err = chip::JniReferences::GetInstance().FindMethod(env, holdTimeLimitsStructStructClass_0, "", - "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;)V", - &holdTimeLimitsStructStructCtor_0); - if (err != CHIP_NO_ERROR || holdTimeLimitsStructStructCtor_0 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$OccupancySensingClusterHoldTimeLimitsStruct constructor"); - return nullptr; - } + jmethodID holdTimeLimitsStructStructCtor_0; + err = chip::JniReferences::GetInstance().FindMethod(env, holdTimeLimitsStructStructClass_0, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;)V", + &holdTimeLimitsStructStructCtor_0); + if (err != CHIP_NO_ERROR || holdTimeLimitsStructStructCtor_0 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$OccupancySensingClusterHoldTimeLimitsStruct constructor"); + return nullptr; + } - value = env->NewObject(holdTimeLimitsStructStructClass_0, holdTimeLimitsStructStructCtor_0, value_holdTimeMin, - value_holdTimeMax, value_holdTimeDefault); + value = env->NewObject(holdTimeLimitsStructStructClass_0, holdTimeLimitsStructStructCtor_0, value_holdTimeMin, + value_holdTimeMax, value_holdTimeDefault); + } return value; } case Attributes::PIROccupiedToUnoccupiedDelay::Id: { @@ -38398,29 +38706,32 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_0_activeTimestampClassName.c_str(), newElement_0_activeTimestampCtorSignature.c_str(), jninewElement_0_activeTimestamp, newElement_0_activeTimestamp); - jclass threadNetworkStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$ThreadNetworkDirectoryClusterThreadNetworkStruct", - threadNetworkStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$ThreadNetworkDirectoryClusterThreadNetworkStruct"); - return nullptr; - } + jclass threadNetworkStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$ThreadNetworkDirectoryClusterThreadNetworkStruct", + threadNetworkStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$ThreadNetworkDirectoryClusterThreadNetworkStruct"); + return nullptr; + } - jmethodID threadNetworkStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod(env, threadNetworkStructStructClass_1, "", - "([BLjava/lang/String;Ljava/lang/Integer;Ljava/lang/Long;)V", - &threadNetworkStructStructCtor_1); - if (err != CHIP_NO_ERROR || threadNetworkStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$ThreadNetworkDirectoryClusterThreadNetworkStruct constructor"); - return nullptr; - } + jmethodID threadNetworkStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, threadNetworkStructStructClass_1, "", + "([BLjava/lang/String;Ljava/lang/Integer;Ljava/lang/Long;)V", &threadNetworkStructStructCtor_1); + if (err != CHIP_NO_ERROR || threadNetworkStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$ThreadNetworkDirectoryClusterThreadNetworkStruct constructor"); + return nullptr; + } - newElement_0 = - env->NewObject(threadNetworkStructStructClass_1, threadNetworkStructStructCtor_1, newElement_0_extendedPanID, - newElement_0_networkName, newElement_0_channel, newElement_0_activeTimestamp); + newElement_0 = env->NewObject(threadNetworkStructStructClass_1, threadNetworkStructStructCtor_1, + newElement_0_extendedPanID, newElement_0_networkName, newElement_0_channel, + newElement_0_activeTimestamp); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -38849,31 +39160,33 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR chip::JniReferences::GetInstance().CreateOptional(newElement_0_typeInsideOptional, newElement_0_type); } - jclass channelInfoStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$ChannelClusterChannelInfoStruct", channelInfoStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$ChannelClusterChannelInfoStruct"); - return nullptr; - } + jclass channelInfoStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$ChannelClusterChannelInfoStruct", channelInfoStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$ChannelClusterChannelInfoStruct"); + return nullptr; + } - jmethodID channelInfoStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod( - env, channelInfoStructStructClass_1, "", - "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/" - "Optional;Ljava/util/Optional;)V", - &channelInfoStructStructCtor_1); - if (err != CHIP_NO_ERROR || channelInfoStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$ChannelClusterChannelInfoStruct constructor"); - return nullptr; - } + jmethodID channelInfoStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, channelInfoStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/" + "util/Optional;Ljava/util/Optional;)V", + &channelInfoStructStructCtor_1); + if (err != CHIP_NO_ERROR || channelInfoStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$ChannelClusterChannelInfoStruct constructor"); + return nullptr; + } - newElement_0 = - env->NewObject(channelInfoStructStructClass_1, channelInfoStructStructCtor_1, newElement_0_majorNumber, - newElement_0_minorNumber, newElement_0_name, newElement_0_callSign, - newElement_0_affiliateCallSign, newElement_0_identifier, newElement_0_type); + newElement_0 = + env->NewObject(channelInfoStructStructClass_1, channelInfoStructStructCtor_1, newElement_0_majorNumber, + newElement_0_minorNumber, newElement_0_name, newElement_0_callSign, + newElement_0_affiliateCallSign, newElement_0_identifier, newElement_0_type); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -38928,28 +39241,30 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR value_lineupInfoTypeCtorSignature.c_str(), jnivalue_lineupInfoType, value_lineupInfoType); - jclass lineupInfoStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$ChannelClusterLineupInfoStruct", lineupInfoStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$ChannelClusterLineupInfoStruct"); - return nullptr; - } + jclass lineupInfoStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$ChannelClusterLineupInfoStruct", lineupInfoStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$ChannelClusterLineupInfoStruct"); + return nullptr; + } - jmethodID lineupInfoStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod( - env, lineupInfoStructStructClass_1, "", - "(Ljava/lang/String;Ljava/util/Optional;Ljava/util/Optional;Ljava/lang/Integer;)V", - &lineupInfoStructStructCtor_1); - if (err != CHIP_NO_ERROR || lineupInfoStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$ChannelClusterLineupInfoStruct constructor"); - return nullptr; - } + jmethodID lineupInfoStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, lineupInfoStructStructClass_1, "", + "(Ljava/lang/String;Ljava/util/Optional;Ljava/util/Optional;Ljava/lang/Integer;)V", + &lineupInfoStructStructCtor_1); + if (err != CHIP_NO_ERROR || lineupInfoStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$ChannelClusterLineupInfoStruct constructor"); + return nullptr; + } - value = env->NewObject(lineupInfoStructStructClass_1, lineupInfoStructStructCtor_1, value_operatorName, - value_lineupName, value_postalCode, value_lineupInfoType); + value = env->NewObject(lineupInfoStructStructClass_1, lineupInfoStructStructCtor_1, value_operatorName, + value_lineupName, value_postalCode, value_lineupInfoType); + } } return value; } @@ -39048,30 +39363,32 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR chip::JniReferences::GetInstance().CreateOptional(value_typeInsideOptional, value_type); } - jclass channelInfoStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$ChannelClusterChannelInfoStruct", channelInfoStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$ChannelClusterChannelInfoStruct"); - return nullptr; - } + jclass channelInfoStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$ChannelClusterChannelInfoStruct", channelInfoStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$ChannelClusterChannelInfoStruct"); + return nullptr; + } - jmethodID channelInfoStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod( - env, channelInfoStructStructClass_1, "", - "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/" - "Optional;Ljava/util/Optional;)V", - &channelInfoStructStructCtor_1); - if (err != CHIP_NO_ERROR || channelInfoStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$ChannelClusterChannelInfoStruct constructor"); - return nullptr; - } + jmethodID channelInfoStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, channelInfoStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/" + "util/Optional;Ljava/util/Optional;)V", + &channelInfoStructStructCtor_1); + if (err != CHIP_NO_ERROR || channelInfoStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$ChannelClusterChannelInfoStruct constructor"); + return nullptr; + } - value = env->NewObject(channelInfoStructStructClass_1, channelInfoStructStructCtor_1, value_majorNumber, - value_minorNumber, value_name, value_callSign, value_affiliateCallSign, value_identifier, - value_type); + value = env->NewObject(channelInfoStructStructClass_1, channelInfoStructStructCtor_1, value_majorNumber, + value_minorNumber, value_name, value_callSign, value_affiliateCallSign, value_identifier, + value_type); + } } return value; } @@ -39243,27 +39560,30 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR jobject newElement_0_name; LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.name, newElement_0_name)); - jclass targetInfoStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$TargetNavigatorClusterTargetInfoStruct", targetInfoStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$TargetNavigatorClusterTargetInfoStruct"); - return nullptr; - } + jclass targetInfoStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$TargetNavigatorClusterTargetInfoStruct", + targetInfoStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$TargetNavigatorClusterTargetInfoStruct"); + return nullptr; + } - jmethodID targetInfoStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod(env, targetInfoStructStructClass_1, "", - "(Ljava/lang/Integer;Ljava/lang/String;)V", - &targetInfoStructStructCtor_1); - if (err != CHIP_NO_ERROR || targetInfoStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$TargetNavigatorClusterTargetInfoStruct constructor"); - return nullptr; - } + jmethodID targetInfoStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod(env, targetInfoStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/lang/String;)V", + &targetInfoStructStructCtor_1); + if (err != CHIP_NO_ERROR || targetInfoStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$TargetNavigatorClusterTargetInfoStruct constructor"); + return nullptr; + } - newElement_0 = env->NewObject(targetInfoStructStructClass_1, targetInfoStructStructCtor_1, newElement_0_identifier, - newElement_0_name); + newElement_0 = env->NewObject(targetInfoStructStructClass_1, targetInfoStructStructCtor_1, + newElement_0_identifier, newElement_0_name); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -39523,28 +39843,30 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR value_positionClassName.c_str(), value_positionCtorSignature.c_str(), jnivalue_position, value_position); } - jclass playbackPositionStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$MediaPlaybackClusterPlaybackPositionStruct", - playbackPositionStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$MediaPlaybackClusterPlaybackPositionStruct"); - return nullptr; - } + jclass playbackPositionStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$MediaPlaybackClusterPlaybackPositionStruct", + playbackPositionStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$MediaPlaybackClusterPlaybackPositionStruct"); + return nullptr; + } - jmethodID playbackPositionStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod(env, playbackPositionStructStructClass_1, "", - "(Ljava/lang/Long;Ljava/lang/Long;)V", - &playbackPositionStructStructCtor_1); - if (err != CHIP_NO_ERROR || playbackPositionStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$MediaPlaybackClusterPlaybackPositionStruct constructor"); - return nullptr; - } + jmethodID playbackPositionStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod(env, playbackPositionStructStructClass_1, "", + "(Ljava/lang/Long;Ljava/lang/Long;)V", + &playbackPositionStructStructCtor_1); + if (err != CHIP_NO_ERROR || playbackPositionStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$MediaPlaybackClusterPlaybackPositionStruct constructor"); + return nullptr; + } - value = env->NewObject(playbackPositionStructStructClass_1, playbackPositionStructStructCtor_1, value_updatedAt, - value_position); + value = env->NewObject(playbackPositionStructStructClass_1, playbackPositionStructStructCtor_1, value_updatedAt, + value_position); + } } return value; } @@ -39659,51 +39981,56 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR value_trackAttributes_displayName); } - jclass trackAttributesStructStructClass_3; + { + jclass trackAttributesStructStructClass_3; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$MediaPlaybackClusterTrackAttributesStruct", + trackAttributesStructStructClass_3); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$MediaPlaybackClusterTrackAttributesStruct"); + return nullptr; + } + + jmethodID trackAttributesStructStructCtor_3; + err = chip::JniReferences::GetInstance().FindMethod(env, trackAttributesStructStructClass_3, "", + "(Ljava/lang/String;Ljava/util/Optional;)V", + &trackAttributesStructStructCtor_3); + if (err != CHIP_NO_ERROR || trackAttributesStructStructCtor_3 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$MediaPlaybackClusterTrackAttributesStruct constructor"); + return nullptr; + } + + value_trackAttributes = + env->NewObject(trackAttributesStructStructClass_3, trackAttributesStructStructCtor_3, + value_trackAttributes_languageCode, value_trackAttributes_displayName); + } + } + + { + jclass trackStructStructClass_1; err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$MediaPlaybackClusterTrackAttributesStruct", - trackAttributesStructStructClass_3); + env, "chip/devicecontroller/ChipStructs$MediaPlaybackClusterTrackStruct", trackStructStructClass_1); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$MediaPlaybackClusterTrackAttributesStruct"); + ChipLogError(Zcl, "Could not find class ChipStructs$MediaPlaybackClusterTrackStruct"); return nullptr; } - jmethodID trackAttributesStructStructCtor_3; - err = chip::JniReferences::GetInstance().FindMethod(env, trackAttributesStructStructClass_3, "", - "(Ljava/lang/String;Ljava/util/Optional;)V", - &trackAttributesStructStructCtor_3); - if (err != CHIP_NO_ERROR || trackAttributesStructStructCtor_3 == nullptr) + jmethodID trackStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, trackStructStructClass_1, "", + "(Ljava/lang/String;Lchip/devicecontroller/ChipStructs$MediaPlaybackClusterTrackAttributesStruct;)V", + &trackStructStructCtor_1); + if (err != CHIP_NO_ERROR || trackStructStructCtor_1 == nullptr) { - ChipLogError(Zcl, "Could not find ChipStructs$MediaPlaybackClusterTrackAttributesStruct constructor"); + ChipLogError(Zcl, "Could not find ChipStructs$MediaPlaybackClusterTrackStruct constructor"); return nullptr; } - value_trackAttributes = env->NewObject(trackAttributesStructStructClass_3, trackAttributesStructStructCtor_3, - value_trackAttributes_languageCode, value_trackAttributes_displayName); + value = env->NewObject(trackStructStructClass_1, trackStructStructCtor_1, value_id, value_trackAttributes); } - - jclass trackStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$MediaPlaybackClusterTrackStruct", trackStructStructClass_1); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Could not find class ChipStructs$MediaPlaybackClusterTrackStruct"); - return nullptr; - } - - jmethodID trackStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod( - env, trackStructStructClass_1, "", - "(Ljava/lang/String;Lchip/devicecontroller/ChipStructs$MediaPlaybackClusterTrackAttributesStruct;)V", - &trackStructStructCtor_1); - if (err != CHIP_NO_ERROR || trackStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$MediaPlaybackClusterTrackStruct constructor"); - return nullptr; - } - - value = env->NewObject(trackStructStructClass_1, trackStructStructCtor_1, value_id, value_trackAttributes); } return value; } @@ -39763,53 +40090,58 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_1_trackAttributes_displayNameInsideOptional, newElement_1_trackAttributes_displayName); } - jclass trackAttributesStructStructClass_4; + { + jclass trackAttributesStructStructClass_4; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$MediaPlaybackClusterTrackAttributesStruct", + trackAttributesStructStructClass_4); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$MediaPlaybackClusterTrackAttributesStruct"); + return nullptr; + } + + jmethodID trackAttributesStructStructCtor_4; + err = chip::JniReferences::GetInstance().FindMethod(env, trackAttributesStructStructClass_4, "", + "(Ljava/lang/String;Ljava/util/Optional;)V", + &trackAttributesStructStructCtor_4); + if (err != CHIP_NO_ERROR || trackAttributesStructStructCtor_4 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$MediaPlaybackClusterTrackAttributesStruct constructor"); + return nullptr; + } + + newElement_1_trackAttributes = + env->NewObject(trackAttributesStructStructClass_4, trackAttributesStructStructCtor_4, + newElement_1_trackAttributes_languageCode, newElement_1_trackAttributes_displayName); + } + } + + { + jclass trackStructStructClass_2; err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$MediaPlaybackClusterTrackAttributesStruct", - trackAttributesStructStructClass_4); + env, "chip/devicecontroller/ChipStructs$MediaPlaybackClusterTrackStruct", trackStructStructClass_2); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$MediaPlaybackClusterTrackAttributesStruct"); + ChipLogError(Zcl, "Could not find class ChipStructs$MediaPlaybackClusterTrackStruct"); return nullptr; } - jmethodID trackAttributesStructStructCtor_4; - err = chip::JniReferences::GetInstance().FindMethod(env, trackAttributesStructStructClass_4, "", - "(Ljava/lang/String;Ljava/util/Optional;)V", - &trackAttributesStructStructCtor_4); - if (err != CHIP_NO_ERROR || trackAttributesStructStructCtor_4 == nullptr) + jmethodID trackStructStructCtor_2; + err = chip::JniReferences::GetInstance().FindMethod( + env, trackStructStructClass_2, "", + "(Ljava/lang/String;Lchip/devicecontroller/ChipStructs$MediaPlaybackClusterTrackAttributesStruct;)V", + &trackStructStructCtor_2); + if (err != CHIP_NO_ERROR || trackStructStructCtor_2 == nullptr) { - ChipLogError(Zcl, "Could not find ChipStructs$MediaPlaybackClusterTrackAttributesStruct constructor"); + ChipLogError(Zcl, "Could not find ChipStructs$MediaPlaybackClusterTrackStruct constructor"); return nullptr; } - newElement_1_trackAttributes = - env->NewObject(trackAttributesStructStructClass_4, trackAttributesStructStructCtor_4, - newElement_1_trackAttributes_languageCode, newElement_1_trackAttributes_displayName); - } - - jclass trackStructStructClass_2; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$MediaPlaybackClusterTrackStruct", trackStructStructClass_2); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Could not find class ChipStructs$MediaPlaybackClusterTrackStruct"); - return nullptr; + newElement_1 = env->NewObject(trackStructStructClass_2, trackStructStructCtor_2, newElement_1_id, + newElement_1_trackAttributes); } - - jmethodID trackStructStructCtor_2; - err = chip::JniReferences::GetInstance().FindMethod( - env, trackStructStructClass_2, "", - "(Ljava/lang/String;Lchip/devicecontroller/ChipStructs$MediaPlaybackClusterTrackAttributesStruct;)V", - &trackStructStructCtor_2); - if (err != CHIP_NO_ERROR || trackStructStructCtor_2 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$MediaPlaybackClusterTrackStruct constructor"); - return nullptr; - } - - newElement_1 = env->NewObject(trackStructStructClass_2, trackStructStructCtor_2, newElement_1_id, - newElement_1_trackAttributes); chip::JniReferences::GetInstance().AddToList(value, newElement_1); } } @@ -39864,51 +40196,56 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR value_trackAttributes_displayName); } - jclass trackAttributesStructStructClass_3; + { + jclass trackAttributesStructStructClass_3; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$MediaPlaybackClusterTrackAttributesStruct", + trackAttributesStructStructClass_3); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$MediaPlaybackClusterTrackAttributesStruct"); + return nullptr; + } + + jmethodID trackAttributesStructStructCtor_3; + err = chip::JniReferences::GetInstance().FindMethod(env, trackAttributesStructStructClass_3, "", + "(Ljava/lang/String;Ljava/util/Optional;)V", + &trackAttributesStructStructCtor_3); + if (err != CHIP_NO_ERROR || trackAttributesStructStructCtor_3 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$MediaPlaybackClusterTrackAttributesStruct constructor"); + return nullptr; + } + + value_trackAttributes = + env->NewObject(trackAttributesStructStructClass_3, trackAttributesStructStructCtor_3, + value_trackAttributes_languageCode, value_trackAttributes_displayName); + } + } + + { + jclass trackStructStructClass_1; err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$MediaPlaybackClusterTrackAttributesStruct", - trackAttributesStructStructClass_3); + env, "chip/devicecontroller/ChipStructs$MediaPlaybackClusterTrackStruct", trackStructStructClass_1); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$MediaPlaybackClusterTrackAttributesStruct"); + ChipLogError(Zcl, "Could not find class ChipStructs$MediaPlaybackClusterTrackStruct"); return nullptr; } - jmethodID trackAttributesStructStructCtor_3; - err = chip::JniReferences::GetInstance().FindMethod(env, trackAttributesStructStructClass_3, "", - "(Ljava/lang/String;Ljava/util/Optional;)V", - &trackAttributesStructStructCtor_3); - if (err != CHIP_NO_ERROR || trackAttributesStructStructCtor_3 == nullptr) + jmethodID trackStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, trackStructStructClass_1, "", + "(Ljava/lang/String;Lchip/devicecontroller/ChipStructs$MediaPlaybackClusterTrackAttributesStruct;)V", + &trackStructStructCtor_1); + if (err != CHIP_NO_ERROR || trackStructStructCtor_1 == nullptr) { - ChipLogError(Zcl, "Could not find ChipStructs$MediaPlaybackClusterTrackAttributesStruct constructor"); + ChipLogError(Zcl, "Could not find ChipStructs$MediaPlaybackClusterTrackStruct constructor"); return nullptr; } - value_trackAttributes = env->NewObject(trackAttributesStructStructClass_3, trackAttributesStructStructCtor_3, - value_trackAttributes_languageCode, value_trackAttributes_displayName); - } - - jclass trackStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$MediaPlaybackClusterTrackStruct", trackStructStructClass_1); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Could not find class ChipStructs$MediaPlaybackClusterTrackStruct"); - return nullptr; - } - - jmethodID trackStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod( - env, trackStructStructClass_1, "", - "(Ljava/lang/String;Lchip/devicecontroller/ChipStructs$MediaPlaybackClusterTrackAttributesStruct;)V", - &trackStructStructCtor_1); - if (err != CHIP_NO_ERROR || trackStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$MediaPlaybackClusterTrackStruct constructor"); - return nullptr; + value = env->NewObject(trackStructStructClass_1, trackStructStructCtor_1, value_id, value_trackAttributes); } - - value = env->NewObject(trackStructStructClass_1, trackStructStructCtor_1, value_id, value_trackAttributes); } return value; } @@ -39968,53 +40305,58 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_1_trackAttributes_displayNameInsideOptional, newElement_1_trackAttributes_displayName); } - jclass trackAttributesStructStructClass_4; + { + jclass trackAttributesStructStructClass_4; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$MediaPlaybackClusterTrackAttributesStruct", + trackAttributesStructStructClass_4); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$MediaPlaybackClusterTrackAttributesStruct"); + return nullptr; + } + + jmethodID trackAttributesStructStructCtor_4; + err = chip::JniReferences::GetInstance().FindMethod(env, trackAttributesStructStructClass_4, "", + "(Ljava/lang/String;Ljava/util/Optional;)V", + &trackAttributesStructStructCtor_4); + if (err != CHIP_NO_ERROR || trackAttributesStructStructCtor_4 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$MediaPlaybackClusterTrackAttributesStruct constructor"); + return nullptr; + } + + newElement_1_trackAttributes = + env->NewObject(trackAttributesStructStructClass_4, trackAttributesStructStructCtor_4, + newElement_1_trackAttributes_languageCode, newElement_1_trackAttributes_displayName); + } + } + + { + jclass trackStructStructClass_2; err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$MediaPlaybackClusterTrackAttributesStruct", - trackAttributesStructStructClass_4); + env, "chip/devicecontroller/ChipStructs$MediaPlaybackClusterTrackStruct", trackStructStructClass_2); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$MediaPlaybackClusterTrackAttributesStruct"); + ChipLogError(Zcl, "Could not find class ChipStructs$MediaPlaybackClusterTrackStruct"); return nullptr; } - jmethodID trackAttributesStructStructCtor_4; - err = chip::JniReferences::GetInstance().FindMethod(env, trackAttributesStructStructClass_4, "", - "(Ljava/lang/String;Ljava/util/Optional;)V", - &trackAttributesStructStructCtor_4); - if (err != CHIP_NO_ERROR || trackAttributesStructStructCtor_4 == nullptr) + jmethodID trackStructStructCtor_2; + err = chip::JniReferences::GetInstance().FindMethod( + env, trackStructStructClass_2, "", + "(Ljava/lang/String;Lchip/devicecontroller/ChipStructs$MediaPlaybackClusterTrackAttributesStruct;)V", + &trackStructStructCtor_2); + if (err != CHIP_NO_ERROR || trackStructStructCtor_2 == nullptr) { - ChipLogError(Zcl, "Could not find ChipStructs$MediaPlaybackClusterTrackAttributesStruct constructor"); + ChipLogError(Zcl, "Could not find ChipStructs$MediaPlaybackClusterTrackStruct constructor"); return nullptr; } - newElement_1_trackAttributes = - env->NewObject(trackAttributesStructStructClass_4, trackAttributesStructStructCtor_4, - newElement_1_trackAttributes_languageCode, newElement_1_trackAttributes_displayName); + newElement_1 = env->NewObject(trackStructStructClass_2, trackStructStructCtor_2, newElement_1_id, + newElement_1_trackAttributes); } - - jclass trackStructStructClass_2; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$MediaPlaybackClusterTrackStruct", trackStructStructClass_2); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Could not find class ChipStructs$MediaPlaybackClusterTrackStruct"); - return nullptr; - } - - jmethodID trackStructStructCtor_2; - err = chip::JniReferences::GetInstance().FindMethod( - env, trackStructStructClass_2, "", - "(Ljava/lang/String;Lchip/devicecontroller/ChipStructs$MediaPlaybackClusterTrackAttributesStruct;)V", - &trackStructStructCtor_2); - if (err != CHIP_NO_ERROR || trackStructStructCtor_2 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$MediaPlaybackClusterTrackStruct constructor"); - return nullptr; - } - - newElement_1 = env->NewObject(trackStructStructClass_2, trackStructStructCtor_2, newElement_1_id, - newElement_1_trackAttributes); chip::JniReferences::GetInstance().AddToList(value, newElement_1); } } @@ -40198,27 +40540,30 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR LogErrorOnFailure( chip::JniReferences::GetInstance().CharToStringUTF(entry_0.description, newElement_0_description)); - jclass inputInfoStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$MediaInputClusterInputInfoStruct", inputInfoStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$MediaInputClusterInputInfoStruct"); - return nullptr; - } + jclass inputInfoStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$MediaInputClusterInputInfoStruct", inputInfoStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$MediaInputClusterInputInfoStruct"); + return nullptr; + } - jmethodID inputInfoStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod( - env, inputInfoStructStructClass_1, "", - "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/String;Ljava/lang/String;)V", &inputInfoStructStructCtor_1); - if (err != CHIP_NO_ERROR || inputInfoStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$MediaInputClusterInputInfoStruct constructor"); - return nullptr; - } + jmethodID inputInfoStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, inputInfoStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/String;Ljava/lang/String;)V", + &inputInfoStructStructCtor_1); + if (err != CHIP_NO_ERROR || inputInfoStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$MediaInputClusterInputInfoStruct constructor"); + return nullptr; + } - newElement_0 = env->NewObject(inputInfoStructStructClass_1, inputInfoStructStructCtor_1, newElement_0_index, - newElement_0_inputType, newElement_0_name, newElement_0_description); + newElement_0 = env->NewObject(inputInfoStructStructClass_1, inputInfoStructStructCtor_1, newElement_0_index, + newElement_0_inputType, newElement_0_name, newElement_0_description); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -40877,27 +41222,29 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR jobject newElement_0_name; LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.name, newElement_0_name)); - jclass outputInfoStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$AudioOutputClusterOutputInfoStruct", outputInfoStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$AudioOutputClusterOutputInfoStruct"); - return nullptr; - } + jclass outputInfoStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$AudioOutputClusterOutputInfoStruct", outputInfoStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$AudioOutputClusterOutputInfoStruct"); + return nullptr; + } - jmethodID outputInfoStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod(env, outputInfoStructStructClass_1, "", - "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/String;)V", - &outputInfoStructStructCtor_1); - if (err != CHIP_NO_ERROR || outputInfoStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$AudioOutputClusterOutputInfoStruct constructor"); - return nullptr; - } + jmethodID outputInfoStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, outputInfoStructStructClass_1, "", "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/String;)V", + &outputInfoStructStructCtor_1); + if (err != CHIP_NO_ERROR || outputInfoStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$AudioOutputClusterOutputInfoStruct constructor"); + return nullptr; + } - newElement_0 = env->NewObject(outputInfoStructStructClass_1, outputInfoStructStructCtor_1, newElement_0_index, - newElement_0_outputType, newElement_0_name); + newElement_0 = env->NewObject(outputInfoStructStructClass_1, outputInfoStructStructCtor_1, newElement_0_index, + newElement_0_outputType, newElement_0_name); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -41112,28 +41459,30 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue.Value().application.applicationID, value_application_applicationID)); - jclass applicationStructStructClass_2; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$ApplicationLauncherClusterApplicationStruct", - applicationStructStructClass_2); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$ApplicationLauncherClusterApplicationStruct"); - return nullptr; - } + jclass applicationStructStructClass_2; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$ApplicationLauncherClusterApplicationStruct", + applicationStructStructClass_2); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$ApplicationLauncherClusterApplicationStruct"); + return nullptr; + } - jmethodID applicationStructStructCtor_2; - err = chip::JniReferences::GetInstance().FindMethod(env, applicationStructStructClass_2, "", - "(Ljava/lang/Integer;Ljava/lang/String;)V", - &applicationStructStructCtor_2); - if (err != CHIP_NO_ERROR || applicationStructStructCtor_2 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$ApplicationLauncherClusterApplicationStruct constructor"); - return nullptr; - } + jmethodID applicationStructStructCtor_2; + err = chip::JniReferences::GetInstance().FindMethod(env, applicationStructStructClass_2, "", + "(Ljava/lang/Integer;Ljava/lang/String;)V", + &applicationStructStructCtor_2); + if (err != CHIP_NO_ERROR || applicationStructStructCtor_2 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$ApplicationLauncherClusterApplicationStruct constructor"); + return nullptr; + } - value_application = env->NewObject(applicationStructStructClass_2, applicationStructStructCtor_2, - value_application_catalogVendorID, value_application_applicationID); + value_application = env->NewObject(applicationStructStructClass_2, applicationStructStructCtor_2, + value_application_catalogVendorID, value_application_applicationID); + } jobject value_endpoint; if (!cppValue.Value().endpoint.HasValue()) { @@ -41151,322 +41500,327 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR chip::JniReferences::GetInstance().CreateOptional(value_endpointInsideOptional, value_endpoint); } - jclass applicationEPStructStructClass_1; + { + jclass applicationEPStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$ApplicationLauncherClusterApplicationEPStruct", + applicationEPStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$ApplicationLauncherClusterApplicationEPStruct"); + return nullptr; + } + + jmethodID applicationEPStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, applicationEPStructStructClass_1, "", + "(Lchip/devicecontroller/ChipStructs$ApplicationLauncherClusterApplicationStruct;Ljava/util/Optional;)V", + &applicationEPStructStructCtor_1); + if (err != CHIP_NO_ERROR || applicationEPStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$ApplicationLauncherClusterApplicationEPStruct constructor"); + return nullptr; + } + + value = env->NewObject(applicationEPStructStructClass_1, applicationEPStructStructCtor_1, value_application, + value_endpoint); + } + } + 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::EventList::Id: { + using TypeInfo = Attributes::EventList::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::ApplicationBasic::Id: { + using namespace app::Clusters::ApplicationBasic; + switch (aPath.mAttributeId) + { + case Attributes::VendorName::Id: { + using TypeInfo = Attributes::VendorName::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); + return value; + } + case Attributes::VendorID::Id: { + using TypeInfo = Attributes::VendorID::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; + } + case Attributes::ApplicationName::Id: { + using TypeInfo = Attributes::ApplicationName::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); + return value; + } + case Attributes::ProductID::Id: { + using TypeInfo = Attributes::ProductID::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; + } + case Attributes::Application::Id: { + using TypeInfo = Attributes::Application::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + jobject value_catalogVendorID; + std::string value_catalogVendorIDClassName = "java/lang/Integer"; + std::string value_catalogVendorIDCtorSignature = "(I)V"; + jint jnivalue_catalogVendorID = static_cast(cppValue.catalogVendorID); + chip::JniReferences::GetInstance().CreateBoxedObject(value_catalogVendorIDClassName.c_str(), + value_catalogVendorIDCtorSignature.c_str(), + jnivalue_catalogVendorID, value_catalogVendorID); + jobject value_applicationID; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue.applicationID, value_applicationID)); + + { + jclass applicationStructStructClass_0; err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$ApplicationLauncherClusterApplicationEPStruct", - applicationEPStructStructClass_1); + env, "chip/devicecontroller/ChipStructs$ApplicationBasicClusterApplicationStruct", + applicationStructStructClass_0); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$ApplicationLauncherClusterApplicationEPStruct"); + ChipLogError(Zcl, "Could not find class ChipStructs$ApplicationBasicClusterApplicationStruct"); return nullptr; } - jmethodID applicationEPStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod( - env, applicationEPStructStructClass_1, "", - "(Lchip/devicecontroller/ChipStructs$ApplicationLauncherClusterApplicationStruct;Ljava/util/Optional;)V", - &applicationEPStructStructCtor_1); - if (err != CHIP_NO_ERROR || applicationEPStructStructCtor_1 == nullptr) + jmethodID applicationStructStructCtor_0; + err = chip::JniReferences::GetInstance().FindMethod(env, applicationStructStructClass_0, "", + "(Ljava/lang/Integer;Ljava/lang/String;)V", + &applicationStructStructCtor_0); + if (err != CHIP_NO_ERROR || applicationStructStructCtor_0 == nullptr) { - ChipLogError(Zcl, "Could not find ChipStructs$ApplicationLauncherClusterApplicationEPStruct constructor"); + ChipLogError(Zcl, "Could not find ChipStructs$ApplicationBasicClusterApplicationStruct constructor"); return nullptr; } - value = env->NewObject(applicationEPStructStructClass_1, applicationEPStructStructCtor_1, value_application, - value_endpoint); - } - 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::EventList::Id: { - using TypeInfo = Attributes::EventList::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::ApplicationBasic::Id: { - using namespace app::Clusters::ApplicationBasic; - switch (aPath.mAttributeId) - { - case Attributes::VendorName::Id: { - using TypeInfo = Attributes::VendorName::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); - return value; - } - case Attributes::VendorID::Id: { - using TypeInfo = Attributes::VendorID::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; - } - case Attributes::ApplicationName::Id: { - using TypeInfo = Attributes::ApplicationName::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); - return value; - } - case Attributes::ProductID::Id: { - using TypeInfo = Attributes::ProductID::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; - } - case Attributes::Application::Id: { - using TypeInfo = Attributes::Application::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - jobject value_catalogVendorID; - std::string value_catalogVendorIDClassName = "java/lang/Integer"; - std::string value_catalogVendorIDCtorSignature = "(I)V"; - jint jnivalue_catalogVendorID = static_cast(cppValue.catalogVendorID); - chip::JniReferences::GetInstance().CreateBoxedObject(value_catalogVendorIDClassName.c_str(), - value_catalogVendorIDCtorSignature.c_str(), - jnivalue_catalogVendorID, value_catalogVendorID); - jobject value_applicationID; - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue.applicationID, value_applicationID)); - - jclass applicationStructStructClass_0; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$ApplicationBasicClusterApplicationStruct", applicationStructStructClass_0); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Could not find class ChipStructs$ApplicationBasicClusterApplicationStruct"); - return nullptr; - } - - jmethodID applicationStructStructCtor_0; - err = chip::JniReferences::GetInstance().FindMethod(env, applicationStructStructClass_0, "", - "(Ljava/lang/Integer;Ljava/lang/String;)V", - &applicationStructStructCtor_0); - if (err != CHIP_NO_ERROR || applicationStructStructCtor_0 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$ApplicationBasicClusterApplicationStruct constructor"); - return nullptr; - } - - value = env->NewObject(applicationStructStructClass_0, applicationStructStructCtor_0, value_catalogVendorID, - value_applicationID); - return value; - } - case Attributes::Status::Id: { - using TypeInfo = Attributes::Status::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; - } - case Attributes::ApplicationVersion::Id: { - using TypeInfo = Attributes::ApplicationVersion::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); - return value; - } - case Attributes::AllowedVendorList::Id: { - using TypeInfo = Attributes::AllowedVendorList::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); + value = env->NewObject(applicationStructStructClass_0, applicationStructStructCtor_0, value_catalogVendorID, + value_applicationID); + } + return value; + } + case Attributes::Status::Id: { + using TypeInfo = Attributes::Status::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; + } + case Attributes::ApplicationVersion::Id: { + using TypeInfo = Attributes::ApplicationVersion::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); + return value; + } + case Attributes::AllowedVendorList::Id: { + using TypeInfo = Attributes::AllowedVendorList::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; } @@ -41802,27 +42156,30 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_0_ratingNameDesc); } - jclass ratingNameStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$ContentControlClusterRatingNameStruct", ratingNameStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$ContentControlClusterRatingNameStruct"); - return nullptr; - } + jclass ratingNameStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$ContentControlClusterRatingNameStruct", + ratingNameStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$ContentControlClusterRatingNameStruct"); + return nullptr; + } - jmethodID ratingNameStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod(env, ratingNameStructStructClass_1, "", - "(Ljava/lang/String;Ljava/util/Optional;)V", - &ratingNameStructStructCtor_1); - if (err != CHIP_NO_ERROR || ratingNameStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$ContentControlClusterRatingNameStruct constructor"); - return nullptr; - } + jmethodID ratingNameStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod(env, ratingNameStructStructClass_1, "", + "(Ljava/lang/String;Ljava/util/Optional;)V", + &ratingNameStructStructCtor_1); + if (err != CHIP_NO_ERROR || ratingNameStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$ContentControlClusterRatingNameStruct constructor"); + return nullptr; + } - newElement_0 = env->NewObject(ratingNameStructStructClass_1, ratingNameStructStructCtor_1, newElement_0_ratingName, - newElement_0_ratingNameDesc); + newElement_0 = env->NewObject(ratingNameStructStructClass_1, ratingNameStructStructCtor_1, + newElement_0_ratingName, newElement_0_ratingNameDesc); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -41871,27 +42228,30 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_0_ratingNameDesc); } - jclass ratingNameStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$ContentControlClusterRatingNameStruct", ratingNameStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$ContentControlClusterRatingNameStruct"); - return nullptr; - } + jclass ratingNameStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$ContentControlClusterRatingNameStruct", + ratingNameStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$ContentControlClusterRatingNameStruct"); + return nullptr; + } - jmethodID ratingNameStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod(env, ratingNameStructStructClass_1, "", - "(Ljava/lang/String;Ljava/util/Optional;)V", - &ratingNameStructStructCtor_1); - if (err != CHIP_NO_ERROR || ratingNameStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$ContentControlClusterRatingNameStruct constructor"); - return nullptr; - } + jmethodID ratingNameStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod(env, ratingNameStructStructClass_1, "", + "(Ljava/lang/String;Ljava/util/Optional;)V", + &ratingNameStructStructCtor_1); + if (err != CHIP_NO_ERROR || ratingNameStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$ContentControlClusterRatingNameStruct constructor"); + return nullptr; + } - newElement_0 = env->NewObject(ratingNameStructStructClass_1, ratingNameStructStructCtor_1, newElement_0_ratingName, - newElement_0_ratingNameDesc); + newElement_0 = env->NewObject(ratingNameStructStructClass_1, ratingNameStructStructCtor_1, + newElement_0_ratingName, newElement_0_ratingNameDesc); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -42236,12 +42596,12 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR } break; } - case app::Clusters::WebRTCTransportProvider::Id: { - using namespace app::Clusters::WebRTCTransportProvider; + case app::Clusters::CameraAvStreamManagement::Id: { + using namespace app::Clusters::CameraAvStreamManagement; switch (aPath.mAttributeId) { - case Attributes::CurrentSessions::Id: { - using TypeInfo = Attributes::CurrentSessions::TypeInfo; + case Attributes::MaxConcurrentVideoEncoders::Id: { + using TypeInfo = Attributes::MaxConcurrentVideoEncoders::TypeInfo; TypeInfo::DecodableType cppValue; *aError = app::DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) @@ -42249,101 +42609,1940 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - chip::JniReferences::GetInstance().CreateArrayList(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; + } + case Attributes::MaxEncodedPixelRate::Id: { + using TypeInfo = Attributes::MaxEncodedPixelRate::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::VideoSensorParams::Id: { + using TypeInfo = Attributes::VideoSensorParams::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + jobject value_sensorWidth; + std::string value_sensorWidthClassName = "java/lang/Integer"; + std::string value_sensorWidthCtorSignature = "(I)V"; + jint jnivalue_sensorWidth = static_cast(cppValue.sensorWidth); + chip::JniReferences::GetInstance().CreateBoxedObject(value_sensorWidthClassName.c_str(), + value_sensorWidthCtorSignature.c_str(), jnivalue_sensorWidth, + value_sensorWidth); + jobject value_sensorHeight; + std::string value_sensorHeightClassName = "java/lang/Integer"; + std::string value_sensorHeightCtorSignature = "(I)V"; + jint jnivalue_sensorHeight = static_cast(cppValue.sensorHeight); + chip::JniReferences::GetInstance().CreateBoxedObject(value_sensorHeightClassName.c_str(), + value_sensorHeightCtorSignature.c_str(), + jnivalue_sensorHeight, value_sensorHeight); + jobject value_HDRCapable; + std::string value_HDRCapableClassName = "java/lang/Boolean"; + std::string value_HDRCapableCtorSignature = "(Z)V"; + jboolean jnivalue_HDRCapable = static_cast(cppValue.HDRCapable); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_HDRCapableClassName.c_str(), value_HDRCapableCtorSignature.c_str(), jnivalue_HDRCapable, value_HDRCapable); + jobject value_maxFPS; + std::string value_maxFPSClassName = "java/lang/Integer"; + std::string value_maxFPSCtorSignature = "(I)V"; + jint jnivalue_maxFPS = static_cast(cppValue.maxFPS); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_maxFPSClassName.c_str(), value_maxFPSCtorSignature.c_str(), jnivalue_maxFPS, value_maxFPS); + jobject value_maxHDRFPS; + std::string value_maxHDRFPSClassName = "java/lang/Integer"; + std::string value_maxHDRFPSCtorSignature = "(I)V"; + jint jnivalue_maxHDRFPS = static_cast(cppValue.maxHDRFPS); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_maxHDRFPSClassName.c_str(), value_maxHDRFPSCtorSignature.c_str(), jnivalue_maxHDRFPS, value_maxHDRFPS); - auto iter_value_0 = cppValue.begin(); - while (iter_value_0.Next()) { - auto & entry_0 = iter_value_0.GetValue(); - jobject newElement_0; - jobject newElement_0_id; - std::string newElement_0_idClassName = "java/lang/Integer"; - std::string newElement_0_idCtorSignature = "(I)V"; - jint jninewElement_0_id = static_cast(entry_0.id); - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_0_idClassName.c_str(), newElement_0_idCtorSignature.c_str(), jninewElement_0_id, newElement_0_id); - jobject newElement_0_peerNodeID; - std::string newElement_0_peerNodeIDClassName = "java/lang/Long"; - std::string newElement_0_peerNodeIDCtorSignature = "(J)V"; - jlong jninewElement_0_peerNodeID = static_cast(entry_0.peerNodeID); - chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_peerNodeIDClassName.c_str(), - newElement_0_peerNodeIDCtorSignature.c_str(), - jninewElement_0_peerNodeID, newElement_0_peerNodeID); - jobject newElement_0_peerFabricIndex; - std::string newElement_0_peerFabricIndexClassName = "java/lang/Integer"; - std::string newElement_0_peerFabricIndexCtorSignature = "(I)V"; - jint jninewElement_0_peerFabricIndex = static_cast(entry_0.peerFabricIndex); - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_0_peerFabricIndexClassName.c_str(), newElement_0_peerFabricIndexCtorSignature.c_str(), - jninewElement_0_peerFabricIndex, newElement_0_peerFabricIndex); - jobject newElement_0_streamType; - std::string newElement_0_streamTypeClassName = "java/lang/Integer"; - std::string newElement_0_streamTypeCtorSignature = "(I)V"; - jint jninewElement_0_streamType = static_cast(entry_0.streamType); - chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_streamTypeClassName.c_str(), - newElement_0_streamTypeCtorSignature.c_str(), - jninewElement_0_streamType, newElement_0_streamType); - jobject newElement_0_videoStreamID; - if (entry_0.videoStreamID.IsNull()) + jclass videoSensorParamsStructStructClass_0; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$CameraAvStreamManagementClusterVideoSensorParamsStruct", + videoSensorParamsStructStructClass_0); + if (err != CHIP_NO_ERROR) { - newElement_0_videoStreamID = nullptr; + ChipLogError(Zcl, "Could not find class ChipStructs$CameraAvStreamManagementClusterVideoSensorParamsStruct"); + return nullptr; } - else + + jmethodID videoSensorParamsStructStructCtor_0; + err = chip::JniReferences::GetInstance().FindMethod( + env, videoSensorParamsStructStructClass_0, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Boolean;Ljava/lang/Integer;Ljava/lang/Integer;)V", + &videoSensorParamsStructStructCtor_0); + if (err != CHIP_NO_ERROR || videoSensorParamsStructStructCtor_0 == nullptr) { - std::string newElement_0_videoStreamIDClassName = "java/lang/Integer"; - std::string newElement_0_videoStreamIDCtorSignature = "(I)V"; - jint jninewElement_0_videoStreamID = static_cast(entry_0.videoStreamID.Value()); - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_0_videoStreamIDClassName.c_str(), newElement_0_videoStreamIDCtorSignature.c_str(), - jninewElement_0_videoStreamID, newElement_0_videoStreamID); + ChipLogError(Zcl, + "Could not find ChipStructs$CameraAvStreamManagementClusterVideoSensorParamsStruct constructor"); + return nullptr; } - jobject newElement_0_audioStreamID; - if (entry_0.audioStreamID.IsNull()) + + value = env->NewObject(videoSensorParamsStructStructClass_0, videoSensorParamsStructStructCtor_0, value_sensorWidth, + value_sensorHeight, value_HDRCapable, value_maxFPS, value_maxHDRFPS); + } + return value; + } + case Attributes::NightVisionCapable::Id: { + using TypeInfo = Attributes::NightVisionCapable::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Boolean"; + std::string valueCtorSignature = "(Z)V"; + jboolean jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + jnivalue, value); + return value; + } + case Attributes::MinViewPortWidth::Id: { + using TypeInfo = Attributes::MinViewPortWidth::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + jobject value_width; + std::string value_widthClassName = "java/lang/Integer"; + std::string value_widthCtorSignature = "(I)V"; + jint jnivalue_width = static_cast(cppValue.width); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_widthClassName.c_str(), value_widthCtorSignature.c_str(), jnivalue_width, value_width); + jobject value_height; + std::string value_heightClassName = "java/lang/Integer"; + std::string value_heightCtorSignature = "(I)V"; + jint jnivalue_height = static_cast(cppValue.height); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_heightClassName.c_str(), value_heightCtorSignature.c_str(), jnivalue_height, value_height); + + { + jclass videoResolutionStructStructClass_0; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$CameraAvStreamManagementClusterVideoResolutionStruct", + videoResolutionStructStructClass_0); + if (err != CHIP_NO_ERROR) { - newElement_0_audioStreamID = nullptr; + ChipLogError(Zcl, "Could not find class ChipStructs$CameraAvStreamManagementClusterVideoResolutionStruct"); + return nullptr; } - else + + jmethodID videoResolutionStructStructCtor_0; + err = chip::JniReferences::GetInstance().FindMethod(env, videoResolutionStructStructClass_0, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;)V", + &videoResolutionStructStructCtor_0); + if (err != CHIP_NO_ERROR || videoResolutionStructStructCtor_0 == nullptr) { - std::string newElement_0_audioStreamIDClassName = "java/lang/Integer"; - std::string newElement_0_audioStreamIDCtorSignature = "(I)V"; - jint jninewElement_0_audioStreamID = static_cast(entry_0.audioStreamID.Value()); - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_0_audioStreamIDClassName.c_str(), newElement_0_audioStreamIDCtorSignature.c_str(), - jninewElement_0_audioStreamID, newElement_0_audioStreamID); + ChipLogError(Zcl, + "Could not find ChipStructs$CameraAvStreamManagementClusterVideoResolutionStruct constructor"); + return nullptr; } - jobject newElement_0_metadataOptions; - std::string newElement_0_metadataOptionsClassName = "java/lang/Integer"; - std::string newElement_0_metadataOptionsCtorSignature = "(I)V"; - jint jninewElement_0_metadataOptions = static_cast(entry_0.metadataOptions.Raw()); - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_0_metadataOptionsClassName.c_str(), newElement_0_metadataOptionsCtorSignature.c_str(), - jninewElement_0_metadataOptions, newElement_0_metadataOptions); - jclass webRTCSessionStructStructClass_1; + value = env->NewObject(videoResolutionStructStructClass_0, videoResolutionStructStructCtor_0, value_width, + value_height); + } + return value; + } + case Attributes::MinViewPortHeight::Id: { + using TypeInfo = Attributes::MinViewPortHeight::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + jobject value_width; + std::string value_widthClassName = "java/lang/Integer"; + std::string value_widthCtorSignature = "(I)V"; + jint jnivalue_width = static_cast(cppValue.width); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_widthClassName.c_str(), value_widthCtorSignature.c_str(), jnivalue_width, value_width); + jobject value_height; + std::string value_heightClassName = "java/lang/Integer"; + std::string value_heightCtorSignature = "(I)V"; + jint jnivalue_height = static_cast(cppValue.height); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_heightClassName.c_str(), value_heightCtorSignature.c_str(), jnivalue_height, value_height); + + { + jclass videoResolutionStructStructClass_0; err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$WebRTCTransportProviderClusterWebRTCSessionStruct", - webRTCSessionStructStructClass_1); + env, "chip/devicecontroller/ChipStructs$CameraAvStreamManagementClusterVideoResolutionStruct", + videoResolutionStructStructClass_0); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$WebRTCTransportProviderClusterWebRTCSessionStruct"); + ChipLogError(Zcl, "Could not find class ChipStructs$CameraAvStreamManagementClusterVideoResolutionStruct"); return nullptr; } - jmethodID webRTCSessionStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod( - env, webRTCSessionStructStructClass_1, "", - "(Ljava/lang/Integer;Ljava/lang/Long;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/" - "Integer;Ljava/lang/Integer;)V", - &webRTCSessionStructStructCtor_1); - if (err != CHIP_NO_ERROR || webRTCSessionStructStructCtor_1 == nullptr) + jmethodID videoResolutionStructStructCtor_0; + err = chip::JniReferences::GetInstance().FindMethod(env, videoResolutionStructStructClass_0, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;)V", + &videoResolutionStructStructCtor_0); + if (err != CHIP_NO_ERROR || videoResolutionStructStructCtor_0 == nullptr) { - ChipLogError(Zcl, "Could not find ChipStructs$WebRTCTransportProviderClusterWebRTCSessionStruct constructor"); + ChipLogError(Zcl, + "Could not find ChipStructs$CameraAvStreamManagementClusterVideoResolutionStruct constructor"); return nullptr; } - newElement_0 = env->NewObject(webRTCSessionStructStructClass_1, webRTCSessionStructStructCtor_1, newElement_0_id, - newElement_0_peerNodeID, newElement_0_peerFabricIndex, newElement_0_streamType, - newElement_0_videoStreamID, newElement_0_audioStreamID, newElement_0_metadataOptions); + value = env->NewObject(videoResolutionStructStructClass_0, videoResolutionStructStructCtor_0, value_width, + value_height); + } + return value; + } + case Attributes::RateDistortionTradeOffPoints::Id: { + using TypeInfo = Attributes::RateDistortionTradeOffPoints::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; + jobject newElement_0_codec; + std::string newElement_0_codecClassName = "java/lang/Integer"; + std::string newElement_0_codecCtorSignature = "(I)V"; + jint jninewElement_0_codec = static_cast(entry_0.codec); + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_codecClassName.c_str(), + newElement_0_codecCtorSignature.c_str(), + jninewElement_0_codec, newElement_0_codec); + jobject newElement_0_resolution; + jobject newElement_0_resolution_width; + std::string newElement_0_resolution_widthClassName = "java/lang/Integer"; + std::string newElement_0_resolution_widthCtorSignature = "(I)V"; + jint jninewElement_0_resolution_width = static_cast(entry_0.resolution.width); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_resolution_widthClassName.c_str(), newElement_0_resolution_widthCtorSignature.c_str(), + jninewElement_0_resolution_width, newElement_0_resolution_width); + jobject newElement_0_resolution_height; + std::string newElement_0_resolution_heightClassName = "java/lang/Integer"; + std::string newElement_0_resolution_heightCtorSignature = "(I)V"; + jint jninewElement_0_resolution_height = static_cast(entry_0.resolution.height); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_resolution_heightClassName.c_str(), newElement_0_resolution_heightCtorSignature.c_str(), + jninewElement_0_resolution_height, newElement_0_resolution_height); + + { + jclass videoResolutionStructStructClass_2; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$CameraAvStreamManagementClusterVideoResolutionStruct", + videoResolutionStructStructClass_2); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$CameraAvStreamManagementClusterVideoResolutionStruct"); + return nullptr; + } + + jmethodID videoResolutionStructStructCtor_2; + err = chip::JniReferences::GetInstance().FindMethod(env, videoResolutionStructStructClass_2, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;)V", + &videoResolutionStructStructCtor_2); + if (err != CHIP_NO_ERROR || videoResolutionStructStructCtor_2 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$CameraAvStreamManagementClusterVideoResolutionStruct constructor"); + return nullptr; + } + + newElement_0_resolution = env->NewObject(videoResolutionStructStructClass_2, videoResolutionStructStructCtor_2, + newElement_0_resolution_width, newElement_0_resolution_height); + } + jobject newElement_0_minBitRate; + std::string newElement_0_minBitRateClassName = "java/lang/Long"; + std::string newElement_0_minBitRateCtorSignature = "(J)V"; + jlong jninewElement_0_minBitRate = static_cast(entry_0.minBitRate); + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_minBitRateClassName.c_str(), + newElement_0_minBitRateCtorSignature.c_str(), + jninewElement_0_minBitRate, newElement_0_minBitRate); + + { + jclass rateDistortionTradeOffPointsStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$CameraAvStreamManagementClusterRateDistortionTradeOffPointsStruct", + rateDistortionTradeOffPointsStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError( + Zcl, + "Could not find class ChipStructs$CameraAvStreamManagementClusterRateDistortionTradeOffPointsStruct"); + return nullptr; + } + + jmethodID rateDistortionTradeOffPointsStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, rateDistortionTradeOffPointsStructStructClass_1, "", + "(Ljava/lang/Integer;Lchip/devicecontroller/" + "ChipStructs$CameraAvStreamManagementClusterVideoResolutionStruct;Ljava/lang/Long;)V", + &rateDistortionTradeOffPointsStructStructCtor_1); + if (err != CHIP_NO_ERROR || rateDistortionTradeOffPointsStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$CameraAvStreamManagementClusterRateDistortionTradeOffPointsStruct " + "constructor"); + return nullptr; + } + + newElement_0 = env->NewObject(rateDistortionTradeOffPointsStructStructClass_1, + rateDistortionTradeOffPointsStructStructCtor_1, newElement_0_codec, + newElement_0_resolution, newElement_0_minBitRate); + } + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::MaxPreRollBufferSize::Id: { + using TypeInfo = Attributes::MaxPreRollBufferSize::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::MicrophoneCapabilities::Id: { + using TypeInfo = Attributes::MicrophoneCapabilities::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + jobject value_maxNumberOfChannels; + std::string value_maxNumberOfChannelsClassName = "java/lang/Integer"; + std::string value_maxNumberOfChannelsCtorSignature = "(I)V"; + jint jnivalue_maxNumberOfChannels = static_cast(cppValue.maxNumberOfChannels); + chip::JniReferences::GetInstance().CreateBoxedObject(value_maxNumberOfChannelsClassName.c_str(), + value_maxNumberOfChannelsCtorSignature.c_str(), + jnivalue_maxNumberOfChannels, value_maxNumberOfChannels); + jobject value_supportedCodecs; + chip::JniReferences::GetInstance().CreateArrayList(value_supportedCodecs); + + auto iter_value_supportedCodecs_1 = cppValue.supportedCodecs.begin(); + while (iter_value_supportedCodecs_1.Next()) + { + auto & entry_1 = iter_value_supportedCodecs_1.GetValue(); + jobject newElement_1; + std::string newElement_1ClassName = "java/lang/Integer"; + std::string newElement_1CtorSignature = "(I)V"; + jint jninewElement_1 = static_cast(entry_1); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_1ClassName.c_str(), newElement_1CtorSignature.c_str(), jninewElement_1, newElement_1); + chip::JniReferences::GetInstance().AddToList(value_supportedCodecs, newElement_1); + } + jobject value_supportedSampleRates; + chip::JniReferences::GetInstance().CreateArrayList(value_supportedSampleRates); + + auto iter_value_supportedSampleRates_1 = cppValue.supportedSampleRates.begin(); + while (iter_value_supportedSampleRates_1.Next()) + { + auto & entry_1 = iter_value_supportedSampleRates_1.GetValue(); + jobject newElement_1; + std::string newElement_1ClassName = "java/lang/Long"; + std::string newElement_1CtorSignature = "(J)V"; + jlong jninewElement_1 = static_cast(entry_1); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_1ClassName.c_str(), newElement_1CtorSignature.c_str(), jninewElement_1, newElement_1); + chip::JniReferences::GetInstance().AddToList(value_supportedSampleRates, newElement_1); + } + jobject value_supportedBitDepths; + chip::JniReferences::GetInstance().CreateArrayList(value_supportedBitDepths); + + auto iter_value_supportedBitDepths_1 = cppValue.supportedBitDepths.begin(); + while (iter_value_supportedBitDepths_1.Next()) + { + auto & entry_1 = iter_value_supportedBitDepths_1.GetValue(); + jobject newElement_1; + std::string newElement_1ClassName = "java/lang/Long"; + std::string newElement_1CtorSignature = "(J)V"; + jlong jninewElement_1 = static_cast(entry_1); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_1ClassName.c_str(), newElement_1CtorSignature.c_str(), jninewElement_1, newElement_1); + chip::JniReferences::GetInstance().AddToList(value_supportedBitDepths, newElement_1); + } + + { + jclass audioCapabilitiesStructStructClass_0; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$CameraAvStreamManagementClusterAudioCapabilitiesStruct", + audioCapabilitiesStructStructClass_0); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$CameraAvStreamManagementClusterAudioCapabilitiesStruct"); + return nullptr; + } + + jmethodID audioCapabilitiesStructStructCtor_0; + err = chip::JniReferences::GetInstance().FindMethod( + env, audioCapabilitiesStructStructClass_0, "", + "(Ljava/lang/Integer;Ljava/util/ArrayList;Ljava/util/ArrayList;Ljava/util/ArrayList;)V", + &audioCapabilitiesStructStructCtor_0); + if (err != CHIP_NO_ERROR || audioCapabilitiesStructStructCtor_0 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$CameraAvStreamManagementClusterAudioCapabilitiesStruct constructor"); + return nullptr; + } + + value = env->NewObject(audioCapabilitiesStructStructClass_0, audioCapabilitiesStructStructCtor_0, + value_maxNumberOfChannels, value_supportedCodecs, value_supportedSampleRates, + value_supportedBitDepths); + } + return value; + } + case Attributes::SpeakerCapabilities::Id: { + using TypeInfo = Attributes::SpeakerCapabilities::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + if (cppValue.IsNull()) + { + value = nullptr; + } + else + { + jobject value_maxNumberOfChannels; + std::string value_maxNumberOfChannelsClassName = "java/lang/Integer"; + std::string value_maxNumberOfChannelsCtorSignature = "(I)V"; + jint jnivalue_maxNumberOfChannels = static_cast(cppValue.Value().maxNumberOfChannels); + chip::JniReferences::GetInstance().CreateBoxedObject(value_maxNumberOfChannelsClassName.c_str(), + value_maxNumberOfChannelsCtorSignature.c_str(), + jnivalue_maxNumberOfChannels, value_maxNumberOfChannels); + jobject value_supportedCodecs; + chip::JniReferences::GetInstance().CreateArrayList(value_supportedCodecs); + + auto iter_value_supportedCodecs_2 = cppValue.Value().supportedCodecs.begin(); + while (iter_value_supportedCodecs_2.Next()) + { + auto & entry_2 = iter_value_supportedCodecs_2.GetValue(); + jobject newElement_2; + std::string newElement_2ClassName = "java/lang/Integer"; + std::string newElement_2CtorSignature = "(I)V"; + jint jninewElement_2 = static_cast(entry_2); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_2ClassName.c_str(), newElement_2CtorSignature.c_str(), jninewElement_2, newElement_2); + chip::JniReferences::GetInstance().AddToList(value_supportedCodecs, newElement_2); + } + jobject value_supportedSampleRates; + chip::JniReferences::GetInstance().CreateArrayList(value_supportedSampleRates); + + auto iter_value_supportedSampleRates_2 = cppValue.Value().supportedSampleRates.begin(); + while (iter_value_supportedSampleRates_2.Next()) + { + auto & entry_2 = iter_value_supportedSampleRates_2.GetValue(); + jobject newElement_2; + std::string newElement_2ClassName = "java/lang/Long"; + std::string newElement_2CtorSignature = "(J)V"; + jlong jninewElement_2 = static_cast(entry_2); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_2ClassName.c_str(), newElement_2CtorSignature.c_str(), jninewElement_2, newElement_2); + chip::JniReferences::GetInstance().AddToList(value_supportedSampleRates, newElement_2); + } + jobject value_supportedBitDepths; + chip::JniReferences::GetInstance().CreateArrayList(value_supportedBitDepths); + + auto iter_value_supportedBitDepths_2 = cppValue.Value().supportedBitDepths.begin(); + while (iter_value_supportedBitDepths_2.Next()) + { + auto & entry_2 = iter_value_supportedBitDepths_2.GetValue(); + jobject newElement_2; + std::string newElement_2ClassName = "java/lang/Long"; + std::string newElement_2CtorSignature = "(J)V"; + jlong jninewElement_2 = static_cast(entry_2); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_2ClassName.c_str(), newElement_2CtorSignature.c_str(), jninewElement_2, newElement_2); + chip::JniReferences::GetInstance().AddToList(value_supportedBitDepths, newElement_2); + } + + { + jclass audioCapabilitiesStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$CameraAvStreamManagementClusterAudioCapabilitiesStruct", + audioCapabilitiesStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, + "Could not find class ChipStructs$CameraAvStreamManagementClusterAudioCapabilitiesStruct"); + return nullptr; + } + + jmethodID audioCapabilitiesStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, audioCapabilitiesStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/util/ArrayList;Ljava/util/ArrayList;Ljava/util/ArrayList;)V", + &audioCapabilitiesStructStructCtor_1); + if (err != CHIP_NO_ERROR || audioCapabilitiesStructStructCtor_1 == nullptr) + { + ChipLogError( + Zcl, "Could not find ChipStructs$CameraAvStreamManagementClusterAudioCapabilitiesStruct constructor"); + return nullptr; + } + + value = env->NewObject(audioCapabilitiesStructStructClass_1, audioCapabilitiesStructStructCtor_1, + value_maxNumberOfChannels, value_supportedCodecs, value_supportedSampleRates, + value_supportedBitDepths); + } + } + return value; + } + case Attributes::TwoWayTalkSupport::Id: { + using TypeInfo = Attributes::TwoWayTalkSupport::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; + } + case Attributes::SupportedSnapshotParams::Id: { + using TypeInfo = Attributes::SupportedSnapshotParams::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; + jobject newElement_0_resolution; + jobject newElement_0_resolution_width; + std::string newElement_0_resolution_widthClassName = "java/lang/Integer"; + std::string newElement_0_resolution_widthCtorSignature = "(I)V"; + jint jninewElement_0_resolution_width = static_cast(entry_0.resolution.width); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_resolution_widthClassName.c_str(), newElement_0_resolution_widthCtorSignature.c_str(), + jninewElement_0_resolution_width, newElement_0_resolution_width); + jobject newElement_0_resolution_height; + std::string newElement_0_resolution_heightClassName = "java/lang/Integer"; + std::string newElement_0_resolution_heightCtorSignature = "(I)V"; + jint jninewElement_0_resolution_height = static_cast(entry_0.resolution.height); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_resolution_heightClassName.c_str(), newElement_0_resolution_heightCtorSignature.c_str(), + jninewElement_0_resolution_height, newElement_0_resolution_height); + + { + jclass videoResolutionStructStructClass_2; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$CameraAvStreamManagementClusterVideoResolutionStruct", + videoResolutionStructStructClass_2); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$CameraAvStreamManagementClusterVideoResolutionStruct"); + return nullptr; + } + + jmethodID videoResolutionStructStructCtor_2; + err = chip::JniReferences::GetInstance().FindMethod(env, videoResolutionStructStructClass_2, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;)V", + &videoResolutionStructStructCtor_2); + if (err != CHIP_NO_ERROR || videoResolutionStructStructCtor_2 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$CameraAvStreamManagementClusterVideoResolutionStruct constructor"); + return nullptr; + } + + newElement_0_resolution = env->NewObject(videoResolutionStructStructClass_2, videoResolutionStructStructCtor_2, + newElement_0_resolution_width, newElement_0_resolution_height); + } + jobject newElement_0_maxFrameRate; + std::string newElement_0_maxFrameRateClassName = "java/lang/Integer"; + std::string newElement_0_maxFrameRateCtorSignature = "(I)V"; + jint jninewElement_0_maxFrameRate = static_cast(entry_0.maxFrameRate); + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_maxFrameRateClassName.c_str(), + newElement_0_maxFrameRateCtorSignature.c_str(), + jninewElement_0_maxFrameRate, newElement_0_maxFrameRate); + jobject newElement_0_imageCodec; + std::string newElement_0_imageCodecClassName = "java/lang/Integer"; + std::string newElement_0_imageCodecCtorSignature = "(I)V"; + jint jninewElement_0_imageCodec = static_cast(entry_0.imageCodec); + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_imageCodecClassName.c_str(), + newElement_0_imageCodecCtorSignature.c_str(), + jninewElement_0_imageCodec, newElement_0_imageCodec); + + { + jclass snapshotParamsStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$CameraAvStreamManagementClusterSnapshotParamsStruct", + snapshotParamsStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$CameraAvStreamManagementClusterSnapshotParamsStruct"); + return nullptr; + } + + jmethodID snapshotParamsStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, snapshotParamsStructStructClass_1, "", + "(Lchip/devicecontroller/ChipStructs$CameraAvStreamManagementClusterVideoResolutionStruct;Ljava/lang/" + "Integer;Ljava/lang/Integer;)V", + &snapshotParamsStructStructCtor_1); + if (err != CHIP_NO_ERROR || snapshotParamsStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$CameraAvStreamManagementClusterSnapshotParamsStruct constructor"); + return nullptr; + } + + newElement_0 = env->NewObject(snapshotParamsStructStructClass_1, snapshotParamsStructStructCtor_1, + newElement_0_resolution, newElement_0_maxFrameRate, newElement_0_imageCodec); + } + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::HDRCapable::Id: { + using TypeInfo = Attributes::HDRCapable::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Boolean"; + std::string valueCtorSignature = "(Z)V"; + jboolean jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + jnivalue, value); + return value; + } + case Attributes::MaxNetworkBandwidth::Id: { + using TypeInfo = Attributes::MaxNetworkBandwidth::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::CurrentFrameRate::Id: { + using TypeInfo = Attributes::CurrentFrameRate::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; + } + case Attributes::HDRMode::Id: { + using TypeInfo = Attributes::HDRMode::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Boolean"; + std::string valueCtorSignature = "(Z)V"; + jboolean jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + jnivalue, value); + return value; + } + case Attributes::CurrentVideoCodecs::Id: { + using TypeInfo = Attributes::CurrentVideoCodecs::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::CurrentSnapshotConfig::Id: { + using TypeInfo = Attributes::CurrentSnapshotConfig::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + jobject value_resolution; + jobject value_resolution_width; + std::string value_resolution_widthClassName = "java/lang/Integer"; + std::string value_resolution_widthCtorSignature = "(I)V"; + jint jnivalue_resolution_width = static_cast(cppValue.resolution.width); + chip::JniReferences::GetInstance().CreateBoxedObject(value_resolution_widthClassName.c_str(), + value_resolution_widthCtorSignature.c_str(), + jnivalue_resolution_width, value_resolution_width); + jobject value_resolution_height; + std::string value_resolution_heightClassName = "java/lang/Integer"; + std::string value_resolution_heightCtorSignature = "(I)V"; + jint jnivalue_resolution_height = static_cast(cppValue.resolution.height); + chip::JniReferences::GetInstance().CreateBoxedObject(value_resolution_heightClassName.c_str(), + value_resolution_heightCtorSignature.c_str(), + jnivalue_resolution_height, value_resolution_height); + + { + jclass videoResolutionStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$CameraAvStreamManagementClusterVideoResolutionStruct", + videoResolutionStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$CameraAvStreamManagementClusterVideoResolutionStruct"); + return nullptr; + } + + jmethodID videoResolutionStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod(env, videoResolutionStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;)V", + &videoResolutionStructStructCtor_1); + if (err != CHIP_NO_ERROR || videoResolutionStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$CameraAvStreamManagementClusterVideoResolutionStruct constructor"); + return nullptr; + } + + value_resolution = env->NewObject(videoResolutionStructStructClass_1, videoResolutionStructStructCtor_1, + value_resolution_width, value_resolution_height); + } + jobject value_maxFrameRate; + std::string value_maxFrameRateClassName = "java/lang/Integer"; + std::string value_maxFrameRateCtorSignature = "(I)V"; + jint jnivalue_maxFrameRate = static_cast(cppValue.maxFrameRate); + chip::JniReferences::GetInstance().CreateBoxedObject(value_maxFrameRateClassName.c_str(), + value_maxFrameRateCtorSignature.c_str(), + jnivalue_maxFrameRate, value_maxFrameRate); + jobject value_imageCodec; + std::string value_imageCodecClassName = "java/lang/Integer"; + std::string value_imageCodecCtorSignature = "(I)V"; + jint jnivalue_imageCodec = static_cast(cppValue.imageCodec); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_imageCodecClassName.c_str(), value_imageCodecCtorSignature.c_str(), jnivalue_imageCodec, value_imageCodec); + + { + jclass snapshotParamsStructStructClass_0; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$CameraAvStreamManagementClusterSnapshotParamsStruct", + snapshotParamsStructStructClass_0); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$CameraAvStreamManagementClusterSnapshotParamsStruct"); + return nullptr; + } + + jmethodID snapshotParamsStructStructCtor_0; + err = chip::JniReferences::GetInstance().FindMethod( + env, snapshotParamsStructStructClass_0, "", + "(Lchip/devicecontroller/ChipStructs$CameraAvStreamManagementClusterVideoResolutionStruct;Ljava/lang/" + "Integer;Ljava/lang/Integer;)V", + &snapshotParamsStructStructCtor_0); + if (err != CHIP_NO_ERROR || snapshotParamsStructStructCtor_0 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$CameraAvStreamManagementClusterSnapshotParamsStruct constructor"); + return nullptr; + } + + value = env->NewObject(snapshotParamsStructStructClass_0, snapshotParamsStructStructCtor_0, value_resolution, + value_maxFrameRate, value_imageCodec); + } + return value; + } + case Attributes::FabricsUsingCamera::Id: { + using TypeInfo = Attributes::FabricsUsingCamera::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::AllocatedVideoStreams::Id: { + using TypeInfo = Attributes::AllocatedVideoStreams::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; + jobject newElement_0_videoStreamID; + std::string newElement_0_videoStreamIDClassName = "java/lang/Integer"; + std::string newElement_0_videoStreamIDCtorSignature = "(I)V"; + jint jninewElement_0_videoStreamID = static_cast(entry_0.videoStreamID); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_videoStreamIDClassName.c_str(), newElement_0_videoStreamIDCtorSignature.c_str(), + jninewElement_0_videoStreamID, newElement_0_videoStreamID); + jobject newElement_0_streamType; + std::string newElement_0_streamTypeClassName = "java/lang/Integer"; + std::string newElement_0_streamTypeCtorSignature = "(I)V"; + jint jninewElement_0_streamType = static_cast(entry_0.streamType); + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_streamTypeClassName.c_str(), + newElement_0_streamTypeCtorSignature.c_str(), + jninewElement_0_streamType, newElement_0_streamType); + jobject newElement_0_videoCodec; + std::string newElement_0_videoCodecClassName = "java/lang/Integer"; + std::string newElement_0_videoCodecCtorSignature = "(I)V"; + jint jninewElement_0_videoCodec = static_cast(entry_0.videoCodec); + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_videoCodecClassName.c_str(), + newElement_0_videoCodecCtorSignature.c_str(), + jninewElement_0_videoCodec, newElement_0_videoCodec); + jobject newElement_0_minFrameRate; + std::string newElement_0_minFrameRateClassName = "java/lang/Integer"; + std::string newElement_0_minFrameRateCtorSignature = "(I)V"; + jint jninewElement_0_minFrameRate = static_cast(entry_0.minFrameRate); + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_minFrameRateClassName.c_str(), + newElement_0_minFrameRateCtorSignature.c_str(), + jninewElement_0_minFrameRate, newElement_0_minFrameRate); + jobject newElement_0_maxFrameRate; + std::string newElement_0_maxFrameRateClassName = "java/lang/Integer"; + std::string newElement_0_maxFrameRateCtorSignature = "(I)V"; + jint jninewElement_0_maxFrameRate = static_cast(entry_0.maxFrameRate); + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_maxFrameRateClassName.c_str(), + newElement_0_maxFrameRateCtorSignature.c_str(), + jninewElement_0_maxFrameRate, newElement_0_maxFrameRate); + jobject newElement_0_minResolution; + jobject newElement_0_minResolution_width; + std::string newElement_0_minResolution_widthClassName = "java/lang/Integer"; + std::string newElement_0_minResolution_widthCtorSignature = "(I)V"; + jint jninewElement_0_minResolution_width = static_cast(entry_0.minResolution.width); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_minResolution_widthClassName.c_str(), newElement_0_minResolution_widthCtorSignature.c_str(), + jninewElement_0_minResolution_width, newElement_0_minResolution_width); + jobject newElement_0_minResolution_height; + std::string newElement_0_minResolution_heightClassName = "java/lang/Integer"; + std::string newElement_0_minResolution_heightCtorSignature = "(I)V"; + jint jninewElement_0_minResolution_height = static_cast(entry_0.minResolution.height); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_minResolution_heightClassName.c_str(), newElement_0_minResolution_heightCtorSignature.c_str(), + jninewElement_0_minResolution_height, newElement_0_minResolution_height); + + { + jclass videoResolutionStructStructClass_2; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$CameraAvStreamManagementClusterVideoResolutionStruct", + videoResolutionStructStructClass_2); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$CameraAvStreamManagementClusterVideoResolutionStruct"); + return nullptr; + } + + jmethodID videoResolutionStructStructCtor_2; + err = chip::JniReferences::GetInstance().FindMethod(env, videoResolutionStructStructClass_2, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;)V", + &videoResolutionStructStructCtor_2); + if (err != CHIP_NO_ERROR || videoResolutionStructStructCtor_2 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$CameraAvStreamManagementClusterVideoResolutionStruct constructor"); + return nullptr; + } + + newElement_0_minResolution = + env->NewObject(videoResolutionStructStructClass_2, videoResolutionStructStructCtor_2, + newElement_0_minResolution_width, newElement_0_minResolution_height); + } + jobject newElement_0_maxResolution; + jobject newElement_0_maxResolution_width; + std::string newElement_0_maxResolution_widthClassName = "java/lang/Integer"; + std::string newElement_0_maxResolution_widthCtorSignature = "(I)V"; + jint jninewElement_0_maxResolution_width = static_cast(entry_0.maxResolution.width); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_maxResolution_widthClassName.c_str(), newElement_0_maxResolution_widthCtorSignature.c_str(), + jninewElement_0_maxResolution_width, newElement_0_maxResolution_width); + jobject newElement_0_maxResolution_height; + std::string newElement_0_maxResolution_heightClassName = "java/lang/Integer"; + std::string newElement_0_maxResolution_heightCtorSignature = "(I)V"; + jint jninewElement_0_maxResolution_height = static_cast(entry_0.maxResolution.height); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_maxResolution_heightClassName.c_str(), newElement_0_maxResolution_heightCtorSignature.c_str(), + jninewElement_0_maxResolution_height, newElement_0_maxResolution_height); + + { + jclass videoResolutionStructStructClass_2; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$CameraAvStreamManagementClusterVideoResolutionStruct", + videoResolutionStructStructClass_2); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$CameraAvStreamManagementClusterVideoResolutionStruct"); + return nullptr; + } + + jmethodID videoResolutionStructStructCtor_2; + err = chip::JniReferences::GetInstance().FindMethod(env, videoResolutionStructStructClass_2, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;)V", + &videoResolutionStructStructCtor_2); + if (err != CHIP_NO_ERROR || videoResolutionStructStructCtor_2 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$CameraAvStreamManagementClusterVideoResolutionStruct constructor"); + return nullptr; + } + + newElement_0_maxResolution = + env->NewObject(videoResolutionStructStructClass_2, videoResolutionStructStructCtor_2, + newElement_0_maxResolution_width, newElement_0_maxResolution_height); + } + jobject newElement_0_minBitRate; + std::string newElement_0_minBitRateClassName = "java/lang/Integer"; + std::string newElement_0_minBitRateCtorSignature = "(I)V"; + jint jninewElement_0_minBitRate = static_cast(entry_0.minBitRate); + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_minBitRateClassName.c_str(), + newElement_0_minBitRateCtorSignature.c_str(), + jninewElement_0_minBitRate, newElement_0_minBitRate); + jobject newElement_0_maxBitRate; + std::string newElement_0_maxBitRateClassName = "java/lang/Integer"; + std::string newElement_0_maxBitRateCtorSignature = "(I)V"; + jint jninewElement_0_maxBitRate = static_cast(entry_0.maxBitRate); + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_maxBitRateClassName.c_str(), + newElement_0_maxBitRateCtorSignature.c_str(), + jninewElement_0_maxBitRate, newElement_0_maxBitRate); + jobject newElement_0_minFragmentLen; + std::string newElement_0_minFragmentLenClassName = "java/lang/Integer"; + std::string newElement_0_minFragmentLenCtorSignature = "(I)V"; + jint jninewElement_0_minFragmentLen = static_cast(entry_0.minFragmentLen); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_minFragmentLenClassName.c_str(), newElement_0_minFragmentLenCtorSignature.c_str(), + jninewElement_0_minFragmentLen, newElement_0_minFragmentLen); + jobject newElement_0_maxFragmentLen; + std::string newElement_0_maxFragmentLenClassName = "java/lang/Integer"; + std::string newElement_0_maxFragmentLenCtorSignature = "(I)V"; + jint jninewElement_0_maxFragmentLen = static_cast(entry_0.maxFragmentLen); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_maxFragmentLenClassName.c_str(), newElement_0_maxFragmentLenCtorSignature.c_str(), + jninewElement_0_maxFragmentLen, newElement_0_maxFragmentLen); + jobject newElement_0_referenceCount; + std::string newElement_0_referenceCountClassName = "java/lang/Integer"; + std::string newElement_0_referenceCountCtorSignature = "(I)V"; + jint jninewElement_0_referenceCount = static_cast(entry_0.referenceCount); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_referenceCountClassName.c_str(), newElement_0_referenceCountCtorSignature.c_str(), + jninewElement_0_referenceCount, newElement_0_referenceCount); + + { + jclass videoStreamStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$CameraAvStreamManagementClusterVideoStreamStruct", + videoStreamStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$CameraAvStreamManagementClusterVideoStreamStruct"); + return nullptr; + } + + jmethodID videoStreamStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, videoStreamStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;Lchip/" + "devicecontroller/ChipStructs$CameraAvStreamManagementClusterVideoResolutionStruct;Lchip/devicecontroller/" + "ChipStructs$CameraAvStreamManagementClusterVideoResolutionStruct;Ljava/lang/Integer;Ljava/lang/" + "Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;)V", + &videoStreamStructStructCtor_1); + if (err != CHIP_NO_ERROR || videoStreamStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$CameraAvStreamManagementClusterVideoStreamStruct constructor"); + return nullptr; + } + + newElement_0 = env->NewObject( + videoStreamStructStructClass_1, videoStreamStructStructCtor_1, newElement_0_videoStreamID, + newElement_0_streamType, newElement_0_videoCodec, newElement_0_minFrameRate, newElement_0_maxFrameRate, + newElement_0_minResolution, newElement_0_maxResolution, newElement_0_minBitRate, newElement_0_maxBitRate, + newElement_0_minFragmentLen, newElement_0_maxFragmentLen, newElement_0_referenceCount); + } + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::AllocatedAudioStreams::Id: { + using TypeInfo = Attributes::AllocatedAudioStreams::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; + jobject newElement_0_audioStreamID; + std::string newElement_0_audioStreamIDClassName = "java/lang/Integer"; + std::string newElement_0_audioStreamIDCtorSignature = "(I)V"; + jint jninewElement_0_audioStreamID = static_cast(entry_0.audioStreamID); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_audioStreamIDClassName.c_str(), newElement_0_audioStreamIDCtorSignature.c_str(), + jninewElement_0_audioStreamID, newElement_0_audioStreamID); + jobject newElement_0_streamType; + std::string newElement_0_streamTypeClassName = "java/lang/Integer"; + std::string newElement_0_streamTypeCtorSignature = "(I)V"; + jint jninewElement_0_streamType = static_cast(entry_0.streamType); + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_streamTypeClassName.c_str(), + newElement_0_streamTypeCtorSignature.c_str(), + jninewElement_0_streamType, newElement_0_streamType); + jobject newElement_0_audioCodec; + std::string newElement_0_audioCodecClassName = "java/lang/Integer"; + std::string newElement_0_audioCodecCtorSignature = "(I)V"; + jint jninewElement_0_audioCodec = static_cast(entry_0.audioCodec); + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_audioCodecClassName.c_str(), + newElement_0_audioCodecCtorSignature.c_str(), + jninewElement_0_audioCodec, newElement_0_audioCodec); + jobject newElement_0_channelCount; + std::string newElement_0_channelCountClassName = "java/lang/Integer"; + std::string newElement_0_channelCountCtorSignature = "(I)V"; + jint jninewElement_0_channelCount = static_cast(entry_0.channelCount); + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_channelCountClassName.c_str(), + newElement_0_channelCountCtorSignature.c_str(), + jninewElement_0_channelCount, newElement_0_channelCount); + jobject newElement_0_sampleRate; + std::string newElement_0_sampleRateClassName = "java/lang/Long"; + std::string newElement_0_sampleRateCtorSignature = "(J)V"; + jlong jninewElement_0_sampleRate = static_cast(entry_0.sampleRate); + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_sampleRateClassName.c_str(), + newElement_0_sampleRateCtorSignature.c_str(), + jninewElement_0_sampleRate, newElement_0_sampleRate); + jobject newElement_0_bitRate; + std::string newElement_0_bitRateClassName = "java/lang/Long"; + std::string newElement_0_bitRateCtorSignature = "(J)V"; + jlong jninewElement_0_bitRate = static_cast(entry_0.bitRate); + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_bitRateClassName.c_str(), + newElement_0_bitRateCtorSignature.c_str(), + jninewElement_0_bitRate, newElement_0_bitRate); + jobject newElement_0_bitDepth; + std::string newElement_0_bitDepthClassName = "java/lang/Integer"; + std::string newElement_0_bitDepthCtorSignature = "(I)V"; + jint jninewElement_0_bitDepth = static_cast(entry_0.bitDepth); + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_bitDepthClassName.c_str(), + newElement_0_bitDepthCtorSignature.c_str(), + jninewElement_0_bitDepth, newElement_0_bitDepth); + jobject newElement_0_referenceCount; + std::string newElement_0_referenceCountClassName = "java/lang/Integer"; + std::string newElement_0_referenceCountCtorSignature = "(I)V"; + jint jninewElement_0_referenceCount = static_cast(entry_0.referenceCount); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_referenceCountClassName.c_str(), newElement_0_referenceCountCtorSignature.c_str(), + jninewElement_0_referenceCount, newElement_0_referenceCount); + + { + jclass audioStreamStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$CameraAvStreamManagementClusterAudioStreamStruct", + audioStreamStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$CameraAvStreamManagementClusterAudioStreamStruct"); + return nullptr; + } + + jmethodID audioStreamStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, audioStreamStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Long;Ljava/lang/" + "Long;Ljava/lang/Integer;Ljava/lang/Integer;)V", + &audioStreamStructStructCtor_1); + if (err != CHIP_NO_ERROR || audioStreamStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$CameraAvStreamManagementClusterAudioStreamStruct constructor"); + return nullptr; + } + + newElement_0 = env->NewObject(audioStreamStructStructClass_1, audioStreamStructStructCtor_1, + newElement_0_audioStreamID, newElement_0_streamType, newElement_0_audioCodec, + newElement_0_channelCount, newElement_0_sampleRate, newElement_0_bitRate, + newElement_0_bitDepth, newElement_0_referenceCount); + } + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::AllocatedSnapshotStreams::Id: { + using TypeInfo = Attributes::AllocatedSnapshotStreams::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; + jobject newElement_0_snapshotStreamID; + std::string newElement_0_snapshotStreamIDClassName = "java/lang/Integer"; + std::string newElement_0_snapshotStreamIDCtorSignature = "(I)V"; + jint jninewElement_0_snapshotStreamID = static_cast(entry_0.snapshotStreamID); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_snapshotStreamIDClassName.c_str(), newElement_0_snapshotStreamIDCtorSignature.c_str(), + jninewElement_0_snapshotStreamID, newElement_0_snapshotStreamID); + jobject newElement_0_imageCodec; + std::string newElement_0_imageCodecClassName = "java/lang/Integer"; + std::string newElement_0_imageCodecCtorSignature = "(I)V"; + jint jninewElement_0_imageCodec = static_cast(entry_0.imageCodec); + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_imageCodecClassName.c_str(), + newElement_0_imageCodecCtorSignature.c_str(), + jninewElement_0_imageCodec, newElement_0_imageCodec); + jobject newElement_0_frameRate; + std::string newElement_0_frameRateClassName = "java/lang/Integer"; + std::string newElement_0_frameRateCtorSignature = "(I)V"; + jint jninewElement_0_frameRate = static_cast(entry_0.frameRate); + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_frameRateClassName.c_str(), + newElement_0_frameRateCtorSignature.c_str(), + jninewElement_0_frameRate, newElement_0_frameRate); + jobject newElement_0_bitRate; + std::string newElement_0_bitRateClassName = "java/lang/Long"; + std::string newElement_0_bitRateCtorSignature = "(J)V"; + jlong jninewElement_0_bitRate = static_cast(entry_0.bitRate); + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_bitRateClassName.c_str(), + newElement_0_bitRateCtorSignature.c_str(), + jninewElement_0_bitRate, newElement_0_bitRate); + jobject newElement_0_minResolution; + jobject newElement_0_minResolution_width; + std::string newElement_0_minResolution_widthClassName = "java/lang/Integer"; + std::string newElement_0_minResolution_widthCtorSignature = "(I)V"; + jint jninewElement_0_minResolution_width = static_cast(entry_0.minResolution.width); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_minResolution_widthClassName.c_str(), newElement_0_minResolution_widthCtorSignature.c_str(), + jninewElement_0_minResolution_width, newElement_0_minResolution_width); + jobject newElement_0_minResolution_height; + std::string newElement_0_minResolution_heightClassName = "java/lang/Integer"; + std::string newElement_0_minResolution_heightCtorSignature = "(I)V"; + jint jninewElement_0_minResolution_height = static_cast(entry_0.minResolution.height); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_minResolution_heightClassName.c_str(), newElement_0_minResolution_heightCtorSignature.c_str(), + jninewElement_0_minResolution_height, newElement_0_minResolution_height); + + { + jclass videoResolutionStructStructClass_2; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$CameraAvStreamManagementClusterVideoResolutionStruct", + videoResolutionStructStructClass_2); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$CameraAvStreamManagementClusterVideoResolutionStruct"); + return nullptr; + } + + jmethodID videoResolutionStructStructCtor_2; + err = chip::JniReferences::GetInstance().FindMethod(env, videoResolutionStructStructClass_2, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;)V", + &videoResolutionStructStructCtor_2); + if (err != CHIP_NO_ERROR || videoResolutionStructStructCtor_2 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$CameraAvStreamManagementClusterVideoResolutionStruct constructor"); + return nullptr; + } + + newElement_0_minResolution = + env->NewObject(videoResolutionStructStructClass_2, videoResolutionStructStructCtor_2, + newElement_0_minResolution_width, newElement_0_minResolution_height); + } + jobject newElement_0_maxResolution; + jobject newElement_0_maxResolution_width; + std::string newElement_0_maxResolution_widthClassName = "java/lang/Integer"; + std::string newElement_0_maxResolution_widthCtorSignature = "(I)V"; + jint jninewElement_0_maxResolution_width = static_cast(entry_0.maxResolution.width); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_maxResolution_widthClassName.c_str(), newElement_0_maxResolution_widthCtorSignature.c_str(), + jninewElement_0_maxResolution_width, newElement_0_maxResolution_width); + jobject newElement_0_maxResolution_height; + std::string newElement_0_maxResolution_heightClassName = "java/lang/Integer"; + std::string newElement_0_maxResolution_heightCtorSignature = "(I)V"; + jint jninewElement_0_maxResolution_height = static_cast(entry_0.maxResolution.height); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_maxResolution_heightClassName.c_str(), newElement_0_maxResolution_heightCtorSignature.c_str(), + jninewElement_0_maxResolution_height, newElement_0_maxResolution_height); + + { + jclass videoResolutionStructStructClass_2; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$CameraAvStreamManagementClusterVideoResolutionStruct", + videoResolutionStructStructClass_2); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$CameraAvStreamManagementClusterVideoResolutionStruct"); + return nullptr; + } + + jmethodID videoResolutionStructStructCtor_2; + err = chip::JniReferences::GetInstance().FindMethod(env, videoResolutionStructStructClass_2, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;)V", + &videoResolutionStructStructCtor_2); + if (err != CHIP_NO_ERROR || videoResolutionStructStructCtor_2 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$CameraAvStreamManagementClusterVideoResolutionStruct constructor"); + return nullptr; + } + + newElement_0_maxResolution = + env->NewObject(videoResolutionStructStructClass_2, videoResolutionStructStructCtor_2, + newElement_0_maxResolution_width, newElement_0_maxResolution_height); + } + jobject newElement_0_quality; + std::string newElement_0_qualityClassName = "java/lang/Integer"; + std::string newElement_0_qualityCtorSignature = "(I)V"; + jint jninewElement_0_quality = static_cast(entry_0.quality); + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_qualityClassName.c_str(), + newElement_0_qualityCtorSignature.c_str(), + jninewElement_0_quality, newElement_0_quality); + jobject newElement_0_referenceCount; + std::string newElement_0_referenceCountClassName = "java/lang/Integer"; + std::string newElement_0_referenceCountCtorSignature = "(I)V"; + jint jninewElement_0_referenceCount = static_cast(entry_0.referenceCount); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_referenceCountClassName.c_str(), newElement_0_referenceCountCtorSignature.c_str(), + jninewElement_0_referenceCount, newElement_0_referenceCount); + + { + jclass snapshotStreamStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$CameraAvStreamManagementClusterSnapshotStreamStruct", + snapshotStreamStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$CameraAvStreamManagementClusterSnapshotStreamStruct"); + return nullptr; + } + + jmethodID snapshotStreamStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, snapshotStreamStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Long;Lchip/devicecontroller/" + "ChipStructs$CameraAvStreamManagementClusterVideoResolutionStruct;Lchip/devicecontroller/" + "ChipStructs$CameraAvStreamManagementClusterVideoResolutionStruct;Ljava/lang/Integer;Ljava/lang/Integer;)V", + &snapshotStreamStructStructCtor_1); + if (err != CHIP_NO_ERROR || snapshotStreamStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$CameraAvStreamManagementClusterSnapshotStreamStruct constructor"); + return nullptr; + } + + newElement_0 = env->NewObject(snapshotStreamStructStructClass_1, snapshotStreamStructStructCtor_1, + newElement_0_snapshotStreamID, newElement_0_imageCodec, newElement_0_frameRate, + newElement_0_bitRate, newElement_0_minResolution, newElement_0_maxResolution, + newElement_0_quality, newElement_0_referenceCount); + } + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::RankedVideoStreamPrioritiesList::Id: { + using TypeInfo = Attributes::RankedVideoStreamPrioritiesList::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::SoftRecordingPrivacyModeSetting::Id: { + using TypeInfo = Attributes::SoftRecordingPrivacyModeSetting::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Boolean"; + std::string valueCtorSignature = "(Z)V"; + jboolean jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + jnivalue, value); + return value; + } + case Attributes::SoftLivestreamPrivacyModeSetting::Id: { + using TypeInfo = Attributes::SoftLivestreamPrivacyModeSetting::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Boolean"; + std::string valueCtorSignature = "(Z)V"; + jboolean jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + jnivalue, value); + return value; + } + case Attributes::HardPrivacyMode::Id: { + using TypeInfo = Attributes::HardPrivacyMode::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Boolean"; + std::string valueCtorSignature = "(Z)V"; + jboolean jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + jnivalue, value); + return value; + } + case Attributes::NightVision::Id: { + using TypeInfo = Attributes::NightVision::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; + } + case Attributes::NightVisionIllum::Id: { + using TypeInfo = Attributes::NightVisionIllum::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; + } + case Attributes::Awb::Id: { + using TypeInfo = Attributes::Awb::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Boolean"; + std::string valueCtorSignature = "(Z)V"; + jboolean jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + jnivalue, value); + return value; + } + case Attributes::ShutterSpeed::Id: { + using TypeInfo = Attributes::ShutterSpeed::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Boolean"; + std::string valueCtorSignature = "(Z)V"; + jboolean jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + jnivalue, value); + return value; + } + case Attributes::Iso::Id: { + using TypeInfo = Attributes::Iso::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Boolean"; + std::string valueCtorSignature = "(Z)V"; + jboolean jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + jnivalue, value); + return value; + } + case Attributes::Viewport::Id: { + using TypeInfo = Attributes::Viewport::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + jobject value_x1; + std::string value_x1ClassName = "java/lang/Integer"; + std::string value_x1CtorSignature = "(I)V"; + jint jnivalue_x1 = static_cast(cppValue.x1); + chip::JniReferences::GetInstance().CreateBoxedObject(value_x1ClassName.c_str(), value_x1CtorSignature.c_str(), + jnivalue_x1, value_x1); + jobject value_y1; + std::string value_y1ClassName = "java/lang/Integer"; + std::string value_y1CtorSignature = "(I)V"; + jint jnivalue_y1 = static_cast(cppValue.y1); + chip::JniReferences::GetInstance().CreateBoxedObject(value_y1ClassName.c_str(), value_y1CtorSignature.c_str(), + jnivalue_y1, value_y1); + jobject value_x2; + std::string value_x2ClassName = "java/lang/Integer"; + std::string value_x2CtorSignature = "(I)V"; + jint jnivalue_x2 = static_cast(cppValue.x2); + chip::JniReferences::GetInstance().CreateBoxedObject(value_x2ClassName.c_str(), value_x2CtorSignature.c_str(), + jnivalue_x2, value_x2); + jobject value_y2; + std::string value_y2ClassName = "java/lang/Integer"; + std::string value_y2CtorSignature = "(I)V"; + jint jnivalue_y2 = static_cast(cppValue.y2); + chip::JniReferences::GetInstance().CreateBoxedObject(value_y2ClassName.c_str(), value_y2CtorSignature.c_str(), + jnivalue_y2, value_y2); + + { + jclass viewportStructStructClass_0; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$CameraAvStreamManagementClusterViewportStruct", + viewportStructStructClass_0); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$CameraAvStreamManagementClusterViewportStruct"); + return nullptr; + } + + jmethodID viewportStructStructCtor_0; + err = chip::JniReferences::GetInstance().FindMethod( + env, viewportStructStructClass_0, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;)V", &viewportStructStructCtor_0); + if (err != CHIP_NO_ERROR || viewportStructStructCtor_0 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$CameraAvStreamManagementClusterViewportStruct constructor"); + return nullptr; + } + + value = + env->NewObject(viewportStructStructClass_0, viewportStructStructCtor_0, value_x1, value_y1, value_x2, value_y2); + } + return value; + } + case Attributes::SpeakerEnabled::Id: { + using TypeInfo = Attributes::SpeakerEnabled::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Boolean"; + std::string valueCtorSignature = "(Z)V"; + jboolean jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + jnivalue, value); + return value; + } + case Attributes::SpeakerVolumeLevel::Id: { + using TypeInfo = Attributes::SpeakerVolumeLevel::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; + } + case Attributes::SpeakerMaxLevel::Id: { + using TypeInfo = Attributes::SpeakerMaxLevel::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; + } + case Attributes::SpeakerMinLevel::Id: { + using TypeInfo = Attributes::SpeakerMinLevel::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; + } + case Attributes::MicStatus::Id: { + using TypeInfo = Attributes::MicStatus::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Boolean"; + std::string valueCtorSignature = "(Z)V"; + jboolean jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + jnivalue, value); + return value; + } + case Attributes::MicVolumeLevel::Id: { + using TypeInfo = Attributes::MicVolumeLevel::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; + } + case Attributes::MicMaxLevel::Id: { + using TypeInfo = Attributes::MicMaxLevel::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; + } + case Attributes::MicMinLevel::Id: { + using TypeInfo = Attributes::MicMinLevel::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; + } + case Attributes::MicAGCEnabled::Id: { + using TypeInfo = Attributes::MicAGCEnabled::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Boolean"; + std::string valueCtorSignature = "(Z)V"; + jboolean jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + jnivalue, value); + return value; + } + case Attributes::ImageRotation::Id: { + using TypeInfo = Attributes::ImageRotation::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; + } + case Attributes::ImageFlipHorizontal::Id: { + using TypeInfo = Attributes::ImageFlipHorizontal::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Boolean"; + std::string valueCtorSignature = "(Z)V"; + jboolean jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + jnivalue, value); + return value; + } + case Attributes::ImageFlipVertical::Id: { + using TypeInfo = Attributes::ImageFlipVertical::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Boolean"; + std::string valueCtorSignature = "(Z)V"; + jboolean jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + jnivalue, value); + return value; + } + case Attributes::LocalVideoRecordingEnabled::Id: { + using TypeInfo = Attributes::LocalVideoRecordingEnabled::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Boolean"; + std::string valueCtorSignature = "(Z)V"; + jboolean jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + jnivalue, value); + return value; + } + case Attributes::LocalSnapshotRecordingEnabled::Id: { + using TypeInfo = Attributes::LocalSnapshotRecordingEnabled::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Boolean"; + std::string valueCtorSignature = "(Z)V"; + jboolean jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + jnivalue, value); + return value; + } + case Attributes::StatusLight::Id: { + using TypeInfo = Attributes::StatusLight::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Boolean"; + std::string valueCtorSignature = "(Z)V"; + jboolean jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + jnivalue, value); + return value; + } + case Attributes::StatusLightBrightness::Id: { + using TypeInfo = Attributes::StatusLightBrightness::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; + } + case Attributes::DepthSensorStatus::Id: { + using TypeInfo = Attributes::DepthSensorStatus::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; + } + case Attributes::WatermarkEnabled::Id: { + using TypeInfo = Attributes::WatermarkEnabled::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; + jobject newElement_0_streamID; + std::string newElement_0_streamIDClassName = "java/lang/Integer"; + std::string newElement_0_streamIDCtorSignature = "(I)V"; + jint jninewElement_0_streamID = static_cast(entry_0.streamID); + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_streamIDClassName.c_str(), + newElement_0_streamIDCtorSignature.c_str(), + jninewElement_0_streamID, newElement_0_streamID); + jobject newElement_0_enabled; + std::string newElement_0_enabledClassName = "java/lang/Boolean"; + std::string newElement_0_enabledCtorSignature = "(Z)V"; + jboolean jninewElement_0_enabled = static_cast(entry_0.enabled); + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_enabledClassName.c_str(), + newElement_0_enabledCtorSignature.c_str(), + jninewElement_0_enabled, newElement_0_enabled); + + { + jclass perStreamStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$CameraAvStreamManagementClusterPerStreamStruct", + perStreamStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$CameraAvStreamManagementClusterPerStreamStruct"); + return nullptr; + } + + jmethodID perStreamStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod(env, perStreamStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/lang/Boolean;)V", + &perStreamStructStructCtor_1); + if (err != CHIP_NO_ERROR || perStreamStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$CameraAvStreamManagementClusterPerStreamStruct constructor"); + return nullptr; + } + + newElement_0 = env->NewObject(perStreamStructStructClass_1, perStreamStructStructCtor_1, newElement_0_streamID, + newElement_0_enabled); + } + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::OSDEnabled::Id: { + using TypeInfo = Attributes::OSDEnabled::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; + jobject newElement_0_streamID; + std::string newElement_0_streamIDClassName = "java/lang/Integer"; + std::string newElement_0_streamIDCtorSignature = "(I)V"; + jint jninewElement_0_streamID = static_cast(entry_0.streamID); + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_streamIDClassName.c_str(), + newElement_0_streamIDCtorSignature.c_str(), + jninewElement_0_streamID, newElement_0_streamID); + jobject newElement_0_enabled; + std::string newElement_0_enabledClassName = "java/lang/Boolean"; + std::string newElement_0_enabledCtorSignature = "(Z)V"; + jboolean jninewElement_0_enabled = static_cast(entry_0.enabled); + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_enabledClassName.c_str(), + newElement_0_enabledCtorSignature.c_str(), + jninewElement_0_enabled, newElement_0_enabled); + + { + jclass perStreamStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$CameraAvStreamManagementClusterPerStreamStruct", + perStreamStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$CameraAvStreamManagementClusterPerStreamStruct"); + return nullptr; + } + + jmethodID perStreamStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod(env, perStreamStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/lang/Boolean;)V", + &perStreamStructStructCtor_1); + if (err != CHIP_NO_ERROR || perStreamStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$CameraAvStreamManagementClusterPerStreamStruct constructor"); + return nullptr; + } + + newElement_0 = env->NewObject(perStreamStructStructClass_1, perStreamStructStructCtor_1, newElement_0_streamID, + newElement_0_enabled); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -42486,8 +44685,8 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR } break; } - case app::Clusters::WebRTCTransportRequestor::Id: { - using namespace app::Clusters::WebRTCTransportRequestor; + case app::Clusters::WebRTCTransportProvider::Id: { + using namespace app::Clusters::WebRTCTransportProvider; switch (aPath.mAttributeId) { case Attributes::CurrentSessions::Id: { @@ -42569,31 +44768,289 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_0_metadataOptionsClassName.c_str(), newElement_0_metadataOptionsCtorSignature.c_str(), jninewElement_0_metadataOptions, newElement_0_metadataOptions); - jclass webRTCSessionStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$WebRTCTransportRequestorClusterWebRTCSessionStruct", - webRTCSessionStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$WebRTCTransportRequestorClusterWebRTCSessionStruct"); - return nullptr; + jclass webRTCSessionStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$WebRTCTransportProviderClusterWebRTCSessionStruct", + webRTCSessionStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$WebRTCTransportProviderClusterWebRTCSessionStruct"); + return nullptr; + } + + jmethodID webRTCSessionStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, webRTCSessionStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/lang/Long;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/" + "Integer;Ljava/lang/Integer;)V", + &webRTCSessionStructStructCtor_1); + if (err != CHIP_NO_ERROR || webRTCSessionStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$WebRTCTransportProviderClusterWebRTCSessionStruct constructor"); + return nullptr; + } + + newElement_0 = + env->NewObject(webRTCSessionStructStructClass_1, webRTCSessionStructStructCtor_1, newElement_0_id, + newElement_0_peerNodeID, newElement_0_peerFabricIndex, newElement_0_streamType, + newElement_0_videoStreamID, newElement_0_audioStreamID, newElement_0_metadataOptions); } + 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); - jmethodID webRTCSessionStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod( - env, webRTCSessionStructStructClass_1, "", - "(Ljava/lang/Integer;Ljava/lang/Long;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/" - "Integer;Ljava/lang/Integer;)V", - &webRTCSessionStructStructCtor_1); - if (err != CHIP_NO_ERROR || webRTCSessionStructStructCtor_1 == nullptr) + 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::EventList::Id: { + using TypeInfo = Attributes::EventList::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::WebRTCTransportRequestor::Id: { + using namespace app::Clusters::WebRTCTransportRequestor; + switch (aPath.mAttributeId) + { + case Attributes::CurrentSessions::Id: { + using TypeInfo = Attributes::CurrentSessions::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; + jobject newElement_0_id; + std::string newElement_0_idClassName = "java/lang/Integer"; + std::string newElement_0_idCtorSignature = "(I)V"; + jint jninewElement_0_id = static_cast(entry_0.id); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_idClassName.c_str(), newElement_0_idCtorSignature.c_str(), jninewElement_0_id, newElement_0_id); + jobject newElement_0_peerNodeID; + std::string newElement_0_peerNodeIDClassName = "java/lang/Long"; + std::string newElement_0_peerNodeIDCtorSignature = "(J)V"; + jlong jninewElement_0_peerNodeID = static_cast(entry_0.peerNodeID); + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_peerNodeIDClassName.c_str(), + newElement_0_peerNodeIDCtorSignature.c_str(), + jninewElement_0_peerNodeID, newElement_0_peerNodeID); + jobject newElement_0_peerFabricIndex; + std::string newElement_0_peerFabricIndexClassName = "java/lang/Integer"; + std::string newElement_0_peerFabricIndexCtorSignature = "(I)V"; + jint jninewElement_0_peerFabricIndex = static_cast(entry_0.peerFabricIndex); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_peerFabricIndexClassName.c_str(), newElement_0_peerFabricIndexCtorSignature.c_str(), + jninewElement_0_peerFabricIndex, newElement_0_peerFabricIndex); + jobject newElement_0_streamType; + std::string newElement_0_streamTypeClassName = "java/lang/Integer"; + std::string newElement_0_streamTypeCtorSignature = "(I)V"; + jint jninewElement_0_streamType = static_cast(entry_0.streamType); + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_streamTypeClassName.c_str(), + newElement_0_streamTypeCtorSignature.c_str(), + jninewElement_0_streamType, newElement_0_streamType); + jobject newElement_0_videoStreamID; + if (entry_0.videoStreamID.IsNull()) { - ChipLogError(Zcl, "Could not find ChipStructs$WebRTCTransportRequestorClusterWebRTCSessionStruct constructor"); - return nullptr; + newElement_0_videoStreamID = nullptr; } + else + { + std::string newElement_0_videoStreamIDClassName = "java/lang/Integer"; + std::string newElement_0_videoStreamIDCtorSignature = "(I)V"; + jint jninewElement_0_videoStreamID = static_cast(entry_0.videoStreamID.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_videoStreamIDClassName.c_str(), newElement_0_videoStreamIDCtorSignature.c_str(), + jninewElement_0_videoStreamID, newElement_0_videoStreamID); + } + jobject newElement_0_audioStreamID; + if (entry_0.audioStreamID.IsNull()) + { + newElement_0_audioStreamID = nullptr; + } + else + { + std::string newElement_0_audioStreamIDClassName = "java/lang/Integer"; + std::string newElement_0_audioStreamIDCtorSignature = "(I)V"; + jint jninewElement_0_audioStreamID = static_cast(entry_0.audioStreamID.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_audioStreamIDClassName.c_str(), newElement_0_audioStreamIDCtorSignature.c_str(), + jninewElement_0_audioStreamID, newElement_0_audioStreamID); + } + jobject newElement_0_metadataOptions; + std::string newElement_0_metadataOptionsClassName = "java/lang/Integer"; + std::string newElement_0_metadataOptionsCtorSignature = "(I)V"; + jint jninewElement_0_metadataOptions = static_cast(entry_0.metadataOptions.Raw()); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_metadataOptionsClassName.c_str(), newElement_0_metadataOptionsCtorSignature.c_str(), + jninewElement_0_metadataOptions, newElement_0_metadataOptions); - newElement_0 = env->NewObject(webRTCSessionStructStructClass_1, webRTCSessionStructStructCtor_1, newElement_0_id, - newElement_0_peerNodeID, newElement_0_peerFabricIndex, newElement_0_streamType, - newElement_0_videoStreamID, newElement_0_audioStreamID, newElement_0_metadataOptions); + { + jclass webRTCSessionStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$WebRTCTransportRequestorClusterWebRTCSessionStruct", + webRTCSessionStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$WebRTCTransportRequestorClusterWebRTCSessionStruct"); + return nullptr; + } + + jmethodID webRTCSessionStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, webRTCSessionStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/lang/Long;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/" + "Integer;Ljava/lang/Integer;)V", + &webRTCSessionStructStructCtor_1); + if (err != CHIP_NO_ERROR || webRTCSessionStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$WebRTCTransportRequestorClusterWebRTCSessionStruct constructor"); + return nullptr; + } + + newElement_0 = + env->NewObject(webRTCSessionStructStructClass_1, webRTCSessionStructStructCtor_1, newElement_0_id, + newElement_0_peerNodeID, newElement_0_peerFabricIndex, newElement_0_streamType, + newElement_0_videoStreamID, newElement_0_audioStreamID, newElement_0_metadataOptions); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -42766,27 +45223,29 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR jobject newElement_0_name; LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.name, newElement_0_name)); - jclass chimeSoundStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$ChimeClusterChimeSoundStruct", chimeSoundStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$ChimeClusterChimeSoundStruct"); - return nullptr; - } + jclass chimeSoundStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$ChimeClusterChimeSoundStruct", chimeSoundStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$ChimeClusterChimeSoundStruct"); + return nullptr; + } - jmethodID chimeSoundStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod(env, chimeSoundStructStructClass_1, "", - "(Ljava/lang/Integer;Ljava/lang/String;)V", - &chimeSoundStructStructCtor_1); - if (err != CHIP_NO_ERROR || chimeSoundStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$ChimeClusterChimeSoundStruct constructor"); - return nullptr; - } + jmethodID chimeSoundStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod(env, chimeSoundStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/lang/String;)V", + &chimeSoundStructStructCtor_1); + if (err != CHIP_NO_ERROR || chimeSoundStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$ChimeClusterChimeSoundStruct constructor"); + return nullptr; + } - newElement_0 = env->NewObject(chimeSoundStructStructClass_1, chimeSoundStructStructCtor_1, newElement_0_chimeID, - newElement_0_name); + newElement_0 = env->NewObject(chimeSoundStructStructClass_1, chimeSoundStructStructCtor_1, newElement_0_chimeID, + newElement_0_name); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -43049,28 +45508,30 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_2_revisionCtorSignature.c_str(), jninewElement_2_revision, newElement_2_revision); - jclass deviceTypeStructStructClass_3; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$EcosystemInformationClusterDeviceTypeStruct", - deviceTypeStructStructClass_3); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$EcosystemInformationClusterDeviceTypeStruct"); - return nullptr; - } + jclass deviceTypeStructStructClass_3; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$EcosystemInformationClusterDeviceTypeStruct", + deviceTypeStructStructClass_3); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$EcosystemInformationClusterDeviceTypeStruct"); + return nullptr; + } - jmethodID deviceTypeStructStructCtor_3; - err = chip::JniReferences::GetInstance().FindMethod(env, deviceTypeStructStructClass_3, "", - "(Ljava/lang/Long;Ljava/lang/Integer;)V", - &deviceTypeStructStructCtor_3); - if (err != CHIP_NO_ERROR || deviceTypeStructStructCtor_3 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$EcosystemInformationClusterDeviceTypeStruct constructor"); - return nullptr; - } + jmethodID deviceTypeStructStructCtor_3; + err = chip::JniReferences::GetInstance().FindMethod(env, deviceTypeStructStructClass_3, "", + "(Ljava/lang/Long;Ljava/lang/Integer;)V", + &deviceTypeStructStructCtor_3); + if (err != CHIP_NO_ERROR || deviceTypeStructStructCtor_3 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$EcosystemInformationClusterDeviceTypeStruct constructor"); + return nullptr; + } - newElement_2 = env->NewObject(deviceTypeStructStructClass_3, deviceTypeStructStructCtor_3, - newElement_2_deviceType, newElement_2_revision); + newElement_2 = env->NewObject(deviceTypeStructStructClass_3, deviceTypeStructStructCtor_3, + newElement_2_deviceType, newElement_2_revision); + } chip::JniReferences::GetInstance().AddToList(newElement_0_deviceTypes, newElement_2); } jobject newElement_0_uniqueLocationIDs; @@ -43100,33 +45561,36 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_0_fabricIndexCtorSignature.c_str(), jninewElement_0_fabricIndex, newElement_0_fabricIndex); - jclass ecosystemDeviceStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$EcosystemInformationClusterEcosystemDeviceStruct", - ecosystemDeviceStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$EcosystemInformationClusterEcosystemDeviceStruct"); - return nullptr; - } + jclass ecosystemDeviceStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$EcosystemInformationClusterEcosystemDeviceStruct", + ecosystemDeviceStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$EcosystemInformationClusterEcosystemDeviceStruct"); + return nullptr; + } - jmethodID ecosystemDeviceStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod( - env, ecosystemDeviceStructStructClass_1, "", - "(Ljava/util/Optional;Ljava/util/Optional;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/util/ArrayList;Ljava/" - "util/ArrayList;Ljava/lang/Long;Ljava/lang/Integer;)V", - &ecosystemDeviceStructStructCtor_1); - if (err != CHIP_NO_ERROR || ecosystemDeviceStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$EcosystemInformationClusterEcosystemDeviceStruct constructor"); - return nullptr; - } + jmethodID ecosystemDeviceStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, ecosystemDeviceStructStructClass_1, "", + "(Ljava/util/Optional;Ljava/util/Optional;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/util/ArrayList;Ljava/" + "util/ArrayList;Ljava/lang/Long;Ljava/lang/Integer;)V", + &ecosystemDeviceStructStructCtor_1); + if (err != CHIP_NO_ERROR || ecosystemDeviceStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$EcosystemInformationClusterEcosystemDeviceStruct constructor"); + return nullptr; + } - newElement_0 = - env->NewObject(ecosystemDeviceStructStructClass_1, ecosystemDeviceStructStructCtor_1, newElement_0_deviceName, - newElement_0_deviceNameLastEdit, newElement_0_bridgedEndpoint, newElement_0_originalEndpoint, - newElement_0_deviceTypes, newElement_0_uniqueLocationIDs, newElement_0_uniqueLocationIDsLastEdit, - newElement_0_fabricIndex); + newElement_0 = + env->NewObject(ecosystemDeviceStructStructClass_1, ecosystemDeviceStructStructCtor_1, + newElement_0_deviceName, newElement_0_deviceNameLastEdit, newElement_0_bridgedEndpoint, + newElement_0_originalEndpoint, newElement_0_deviceTypes, newElement_0_uniqueLocationIDs, + newElement_0_uniqueLocationIDsLastEdit, newElement_0_fabricIndex); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -43187,30 +45651,33 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_0_locationDescriptor_areaType); } - jclass locationDescriptorStructStructClass_2; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$EcosystemInformationClusterLocationDescriptorStruct", - locationDescriptorStructStructClass_2); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$EcosystemInformationClusterLocationDescriptorStruct"); - return nullptr; - } + jclass locationDescriptorStructStructClass_2; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$EcosystemInformationClusterLocationDescriptorStruct", + locationDescriptorStructStructClass_2); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$EcosystemInformationClusterLocationDescriptorStruct"); + return nullptr; + } - jmethodID locationDescriptorStructStructCtor_2; - err = chip::JniReferences::GetInstance().FindMethod(env, locationDescriptorStructStructClass_2, "", - "(Ljava/lang/String;Ljava/lang/Integer;Ljava/lang/Integer;)V", - &locationDescriptorStructStructCtor_2); - if (err != CHIP_NO_ERROR || locationDescriptorStructStructCtor_2 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$EcosystemInformationClusterLocationDescriptorStruct constructor"); - return nullptr; - } + jmethodID locationDescriptorStructStructCtor_2; + err = chip::JniReferences::GetInstance().FindMethod( + env, locationDescriptorStructStructClass_2, "", + "(Ljava/lang/String;Ljava/lang/Integer;Ljava/lang/Integer;)V", &locationDescriptorStructStructCtor_2); + if (err != CHIP_NO_ERROR || locationDescriptorStructStructCtor_2 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$EcosystemInformationClusterLocationDescriptorStruct constructor"); + return nullptr; + } - newElement_0_locationDescriptor = - env->NewObject(locationDescriptorStructStructClass_2, locationDescriptorStructStructCtor_2, - newElement_0_locationDescriptor_locationName, newElement_0_locationDescriptor_floorNumber, - newElement_0_locationDescriptor_areaType); + newElement_0_locationDescriptor = + env->NewObject(locationDescriptorStructStructClass_2, locationDescriptorStructStructCtor_2, + newElement_0_locationDescriptor_locationName, newElement_0_locationDescriptor_floorNumber, + newElement_0_locationDescriptor_areaType); + } jobject newElement_0_locationDescriptorLastEdit; std::string newElement_0_locationDescriptorLastEditClassName = "java/lang/Long"; std::string newElement_0_locationDescriptorLastEditCtorSignature = "(J)V"; @@ -43227,31 +45694,34 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_0_fabricIndexCtorSignature.c_str(), jninewElement_0_fabricIndex, newElement_0_fabricIndex); - jclass ecosystemLocationStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$EcosystemInformationClusterEcosystemLocationStruct", - ecosystemLocationStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$EcosystemInformationClusterEcosystemLocationStruct"); - return nullptr; - } + jclass ecosystemLocationStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$EcosystemInformationClusterEcosystemLocationStruct", + ecosystemLocationStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$EcosystemInformationClusterEcosystemLocationStruct"); + return nullptr; + } - jmethodID ecosystemLocationStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod( - env, ecosystemLocationStructStructClass_1, "", - "(Ljava/lang/String;Lchip/devicecontroller/" - "ChipStructs$EcosystemInformationClusterLocationDescriptorStruct;Ljava/lang/Long;Ljava/lang/Integer;)V", - &ecosystemLocationStructStructCtor_1); - if (err != CHIP_NO_ERROR || ecosystemLocationStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$EcosystemInformationClusterEcosystemLocationStruct constructor"); - return nullptr; - } + jmethodID ecosystemLocationStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, ecosystemLocationStructStructClass_1, "", + "(Ljava/lang/String;Lchip/devicecontroller/" + "ChipStructs$EcosystemInformationClusterLocationDescriptorStruct;Ljava/lang/Long;Ljava/lang/Integer;)V", + &ecosystemLocationStructStructCtor_1); + if (err != CHIP_NO_ERROR || ecosystemLocationStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$EcosystemInformationClusterEcosystemLocationStruct constructor"); + return nullptr; + } - newElement_0 = env->NewObject(ecosystemLocationStructStructClass_1, ecosystemLocationStructStructCtor_1, - newElement_0_uniqueLocationID, newElement_0_locationDescriptor, - newElement_0_locationDescriptorLastEdit, newElement_0_fabricIndex); + newElement_0 = env->NewObject(ecosystemLocationStructStructClass_1, ecosystemLocationStructStructCtor_1, + newElement_0_uniqueLocationID, newElement_0_locationDescriptor, + newElement_0_locationDescriptorLastEdit, newElement_0_fabricIndex); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -44049,27 +46519,29 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR reinterpret_cast(entry_0.member2.data())); newElement_0_member2 = newElement_0_member2ByteArray; - jclass testListStructOctetStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$UnitTestingClusterTestListStructOctet", - testListStructOctetStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$UnitTestingClusterTestListStructOctet"); - return nullptr; - } + jclass testListStructOctetStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$UnitTestingClusterTestListStructOctet", + testListStructOctetStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$UnitTestingClusterTestListStructOctet"); + return nullptr; + } - jmethodID testListStructOctetStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod(env, testListStructOctetStructClass_1, "", - "(Ljava/lang/Long;[B)V", &testListStructOctetStructCtor_1); - if (err != CHIP_NO_ERROR || testListStructOctetStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$UnitTestingClusterTestListStructOctet constructor"); - return nullptr; - } + jmethodID testListStructOctetStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod(env, testListStructOctetStructClass_1, "", + "(Ljava/lang/Long;[B)V", &testListStructOctetStructCtor_1); + if (err != CHIP_NO_ERROR || testListStructOctetStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$UnitTestingClusterTestListStructOctet constructor"); + return nullptr; + } - newElement_0 = env->NewObject(testListStructOctetStructClass_1, testListStructOctetStructCtor_1, - newElement_0_member1, newElement_0_member2); + newElement_0 = env->NewObject(testListStructOctetStructClass_1, testListStructOctetStructCtor_1, + newElement_0_member1, newElement_0_member2); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -44357,32 +46829,34 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_0_nullableStruct_i); } - jclass simpleStructStructClass_3; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$UnitTestingClusterSimpleStruct", simpleStructStructClass_3); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$UnitTestingClusterSimpleStruct"); - return nullptr; - } + jclass simpleStructStructClass_3; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$UnitTestingClusterSimpleStruct", simpleStructStructClass_3); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$UnitTestingClusterSimpleStruct"); + return nullptr; + } - jmethodID simpleStructStructCtor_3; - err = chip::JniReferences::GetInstance().FindMethod( - env, simpleStructStructClass_3, "", - "(Ljava/lang/Integer;Ljava/lang/Boolean;Ljava/lang/Integer;[BLjava/lang/String;Ljava/lang/Integer;Ljava/" - "lang/Float;Ljava/lang/Double;Ljava/util/Optional;)V", - &simpleStructStructCtor_3); - if (err != CHIP_NO_ERROR || simpleStructStructCtor_3 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$UnitTestingClusterSimpleStruct constructor"); - return nullptr; - } + jmethodID simpleStructStructCtor_3; + err = chip::JniReferences::GetInstance().FindMethod( + env, simpleStructStructClass_3, "", + "(Ljava/lang/Integer;Ljava/lang/Boolean;Ljava/lang/Integer;[BLjava/lang/String;Ljava/lang/" + "Integer;Ljava/lang/Float;Ljava/lang/Double;Ljava/util/Optional;)V", + &simpleStructStructCtor_3); + if (err != CHIP_NO_ERROR || simpleStructStructCtor_3 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$UnitTestingClusterSimpleStruct constructor"); + return nullptr; + } - newElement_0_nullableStruct = - env->NewObject(simpleStructStructClass_3, simpleStructStructCtor_3, newElement_0_nullableStruct_a, - newElement_0_nullableStruct_b, newElement_0_nullableStruct_c, newElement_0_nullableStruct_d, - newElement_0_nullableStruct_e, newElement_0_nullableStruct_f, newElement_0_nullableStruct_g, - newElement_0_nullableStruct_h, newElement_0_nullableStruct_i); + newElement_0_nullableStruct = env->NewObject( + simpleStructStructClass_3, simpleStructStructCtor_3, newElement_0_nullableStruct_a, + newElement_0_nullableStruct_b, newElement_0_nullableStruct_c, newElement_0_nullableStruct_d, + newElement_0_nullableStruct_e, newElement_0_nullableStruct_f, newElement_0_nullableStruct_g, + newElement_0_nullableStruct_h, newElement_0_nullableStruct_i); + } } jobject newElement_0_optionalStruct; if (!entry_0.optionalStruct.HasValue()) @@ -44472,33 +46946,35 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_0_optionalStructInsideOptional_i); } - jclass simpleStructStructClass_3; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$UnitTestingClusterSimpleStruct", simpleStructStructClass_3); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$UnitTestingClusterSimpleStruct"); - return nullptr; - } + jclass simpleStructStructClass_3; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$UnitTestingClusterSimpleStruct", simpleStructStructClass_3); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$UnitTestingClusterSimpleStruct"); + return nullptr; + } - jmethodID simpleStructStructCtor_3; - err = chip::JniReferences::GetInstance().FindMethod( - env, simpleStructStructClass_3, "", - "(Ljava/lang/Integer;Ljava/lang/Boolean;Ljava/lang/Integer;[BLjava/lang/String;Ljava/lang/Integer;Ljava/" - "lang/Float;Ljava/lang/Double;Ljava/util/Optional;)V", - &simpleStructStructCtor_3); - if (err != CHIP_NO_ERROR || simpleStructStructCtor_3 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$UnitTestingClusterSimpleStruct constructor"); - return nullptr; - } + jmethodID simpleStructStructCtor_3; + err = chip::JniReferences::GetInstance().FindMethod( + env, simpleStructStructClass_3, "", + "(Ljava/lang/Integer;Ljava/lang/Boolean;Ljava/lang/Integer;[BLjava/lang/String;Ljava/lang/" + "Integer;Ljava/lang/Float;Ljava/lang/Double;Ljava/util/Optional;)V", + &simpleStructStructCtor_3); + if (err != CHIP_NO_ERROR || simpleStructStructCtor_3 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$UnitTestingClusterSimpleStruct constructor"); + return nullptr; + } - newElement_0_optionalStructInsideOptional = env->NewObject( - simpleStructStructClass_3, simpleStructStructCtor_3, newElement_0_optionalStructInsideOptional_a, - newElement_0_optionalStructInsideOptional_b, newElement_0_optionalStructInsideOptional_c, - newElement_0_optionalStructInsideOptional_d, newElement_0_optionalStructInsideOptional_e, - newElement_0_optionalStructInsideOptional_f, newElement_0_optionalStructInsideOptional_g, - newElement_0_optionalStructInsideOptional_h, newElement_0_optionalStructInsideOptional_i); + newElement_0_optionalStructInsideOptional = env->NewObject( + simpleStructStructClass_3, simpleStructStructCtor_3, newElement_0_optionalStructInsideOptional_a, + newElement_0_optionalStructInsideOptional_b, newElement_0_optionalStructInsideOptional_c, + newElement_0_optionalStructInsideOptional_d, newElement_0_optionalStructInsideOptional_e, + newElement_0_optionalStructInsideOptional_f, newElement_0_optionalStructInsideOptional_g, + newElement_0_optionalStructInsideOptional_h, newElement_0_optionalStructInsideOptional_i); + } chip::JniReferences::GetInstance().CreateOptional(newElement_0_optionalStructInsideOptional, newElement_0_optionalStruct); } @@ -44612,38 +47088,40 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_0_nullableOptionalStructInsideOptional_i); } - jclass simpleStructStructClass_4; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$UnitTestingClusterSimpleStruct", simpleStructStructClass_4); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$UnitTestingClusterSimpleStruct"); - return nullptr; - } + jclass simpleStructStructClass_4; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$UnitTestingClusterSimpleStruct", simpleStructStructClass_4); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$UnitTestingClusterSimpleStruct"); + return nullptr; + } - jmethodID simpleStructStructCtor_4; - err = chip::JniReferences::GetInstance().FindMethod( - env, simpleStructStructClass_4, "", - "(Ljava/lang/Integer;Ljava/lang/Boolean;Ljava/lang/Integer;[BLjava/lang/String;Ljava/lang/" - "Integer;Ljava/lang/Float;Ljava/lang/Double;Ljava/util/Optional;)V", - &simpleStructStructCtor_4); - if (err != CHIP_NO_ERROR || simpleStructStructCtor_4 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$UnitTestingClusterSimpleStruct constructor"); - return nullptr; - } + jmethodID simpleStructStructCtor_4; + err = chip::JniReferences::GetInstance().FindMethod( + env, simpleStructStructClass_4, "", + "(Ljava/lang/Integer;Ljava/lang/Boolean;Ljava/lang/Integer;[BLjava/lang/String;Ljava/lang/" + "Integer;Ljava/lang/Float;Ljava/lang/Double;Ljava/util/Optional;)V", + &simpleStructStructCtor_4); + if (err != CHIP_NO_ERROR || simpleStructStructCtor_4 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$UnitTestingClusterSimpleStruct constructor"); + return nullptr; + } - newElement_0_nullableOptionalStructInsideOptional = - env->NewObject(simpleStructStructClass_4, simpleStructStructCtor_4, - newElement_0_nullableOptionalStructInsideOptional_a, - newElement_0_nullableOptionalStructInsideOptional_b, - newElement_0_nullableOptionalStructInsideOptional_c, - newElement_0_nullableOptionalStructInsideOptional_d, - newElement_0_nullableOptionalStructInsideOptional_e, - newElement_0_nullableOptionalStructInsideOptional_f, - newElement_0_nullableOptionalStructInsideOptional_g, - newElement_0_nullableOptionalStructInsideOptional_h, - newElement_0_nullableOptionalStructInsideOptional_i); + newElement_0_nullableOptionalStructInsideOptional = + env->NewObject(simpleStructStructClass_4, simpleStructStructCtor_4, + newElement_0_nullableOptionalStructInsideOptional_a, + newElement_0_nullableOptionalStructInsideOptional_b, + newElement_0_nullableOptionalStructInsideOptional_c, + newElement_0_nullableOptionalStructInsideOptional_d, + newElement_0_nullableOptionalStructInsideOptional_e, + newElement_0_nullableOptionalStructInsideOptional_f, + newElement_0_nullableOptionalStructInsideOptional_g, + newElement_0_nullableOptionalStructInsideOptional_h, + newElement_0_nullableOptionalStructInsideOptional_i); + } } chip::JniReferences::GetInstance().CreateOptional(newElement_0_nullableOptionalStructInsideOptional, newElement_0_nullableOptionalStruct); @@ -44730,35 +47208,37 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_0_nullableOptionalList); } - jclass nullablesAndOptionalsStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$UnitTestingClusterNullablesAndOptionalsStruct", - nullablesAndOptionalsStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$UnitTestingClusterNullablesAndOptionalsStruct"); - return nullptr; - } + jclass nullablesAndOptionalsStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$UnitTestingClusterNullablesAndOptionalsStruct", + nullablesAndOptionalsStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$UnitTestingClusterNullablesAndOptionalsStruct"); + return nullptr; + } - jmethodID nullablesAndOptionalsStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod( - env, nullablesAndOptionalsStructStructClass_1, "", - "(Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;Ljava/lang/String;Ljava/util/Optional;Ljava/util/" - "Optional;Lchip/devicecontroller/ChipStructs$UnitTestingClusterSimpleStruct;Ljava/util/Optional;Ljava/util/" - "Optional;Ljava/util/ArrayList;Ljava/util/Optional;Ljava/util/Optional;)V", - &nullablesAndOptionalsStructStructCtor_1); - if (err != CHIP_NO_ERROR || nullablesAndOptionalsStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$UnitTestingClusterNullablesAndOptionalsStruct constructor"); - return nullptr; - } + jmethodID nullablesAndOptionalsStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, nullablesAndOptionalsStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;Ljava/lang/String;Ljava/util/Optional;Ljava/" + "util/Optional;Lchip/devicecontroller/ChipStructs$UnitTestingClusterSimpleStruct;Ljava/util/Optional;Ljava/" + "util/Optional;Ljava/util/ArrayList;Ljava/util/Optional;Ljava/util/Optional;)V", + &nullablesAndOptionalsStructStructCtor_1); + if (err != CHIP_NO_ERROR || nullablesAndOptionalsStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$UnitTestingClusterNullablesAndOptionalsStruct constructor"); + return nullptr; + } - newElement_0 = - env->NewObject(nullablesAndOptionalsStructStructClass_1, nullablesAndOptionalsStructStructCtor_1, - newElement_0_nullableInt, newElement_0_optionalInt, newElement_0_nullableOptionalInt, - newElement_0_nullableString, newElement_0_optionalString, newElement_0_nullableOptionalString, - newElement_0_nullableStruct, newElement_0_optionalStruct, newElement_0_nullableOptionalStruct, - newElement_0_nullableList, newElement_0_optionalList, newElement_0_nullableOptionalList); + newElement_0 = env->NewObject( + nullablesAndOptionalsStructStructClass_1, nullablesAndOptionalsStructStructCtor_1, newElement_0_nullableInt, + newElement_0_optionalInt, newElement_0_nullableOptionalInt, newElement_0_nullableString, + newElement_0_optionalString, newElement_0_nullableOptionalString, newElement_0_nullableStruct, + newElement_0_optionalStruct, newElement_0_nullableOptionalStruct, newElement_0_nullableList, + newElement_0_optionalList, newElement_0_nullableOptionalList); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -44848,29 +47328,31 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR chip::JniReferences::GetInstance().CreateOptional(value_iInsideOptional, value_i); } - jclass simpleStructStructClass_0; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$UnitTestingClusterSimpleStruct", simpleStructStructClass_0); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$UnitTestingClusterSimpleStruct"); - return nullptr; - } + jclass simpleStructStructClass_0; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$UnitTestingClusterSimpleStruct", simpleStructStructClass_0); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$UnitTestingClusterSimpleStruct"); + return nullptr; + } - jmethodID simpleStructStructCtor_0; - err = chip::JniReferences::GetInstance().FindMethod( - env, simpleStructStructClass_0, "", - "(Ljava/lang/Integer;Ljava/lang/Boolean;Ljava/lang/Integer;[BLjava/lang/String;Ljava/lang/Integer;Ljava/lang/" - "Float;Ljava/lang/Double;Ljava/util/Optional;)V", - &simpleStructStructCtor_0); - if (err != CHIP_NO_ERROR || simpleStructStructCtor_0 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$UnitTestingClusterSimpleStruct constructor"); - return nullptr; - } + jmethodID simpleStructStructCtor_0; + err = chip::JniReferences::GetInstance().FindMethod( + env, simpleStructStructClass_0, "", + "(Ljava/lang/Integer;Ljava/lang/Boolean;Ljava/lang/Integer;[BLjava/lang/String;Ljava/lang/Integer;Ljava/lang/" + "Float;Ljava/lang/Double;Ljava/util/Optional;)V", + &simpleStructStructCtor_0); + if (err != CHIP_NO_ERROR || simpleStructStructCtor_0 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$UnitTestingClusterSimpleStruct constructor"); + return nullptr; + } - value = env->NewObject(simpleStructStructClass_0, simpleStructStructCtor_0, value_a, value_b, value_c, value_d, value_e, - value_f, value_g, value_h, value_i); + value = env->NewObject(simpleStructStructClass_0, simpleStructStructCtor_0, value_a, value_b, value_c, value_d, + value_e, value_f, value_g, value_h, value_i); + } return value; } case Attributes::RangeRestrictedInt8u::Id: { @@ -45130,33 +47612,35 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_0_fabricSensitiveStruct_i); } - jclass simpleStructStructClass_2; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$UnitTestingClusterSimpleStruct", simpleStructStructClass_2); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$UnitTestingClusterSimpleStruct"); - return nullptr; - } + jclass simpleStructStructClass_2; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$UnitTestingClusterSimpleStruct", simpleStructStructClass_2); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$UnitTestingClusterSimpleStruct"); + return nullptr; + } - jmethodID simpleStructStructCtor_2; - err = chip::JniReferences::GetInstance().FindMethod( - env, simpleStructStructClass_2, "", - "(Ljava/lang/Integer;Ljava/lang/Boolean;Ljava/lang/Integer;[BLjava/lang/String;Ljava/lang/Integer;Ljava/lang/" - "Float;Ljava/lang/Double;Ljava/util/Optional;)V", - &simpleStructStructCtor_2); - if (err != CHIP_NO_ERROR || simpleStructStructCtor_2 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$UnitTestingClusterSimpleStruct constructor"); - return nullptr; - } + jmethodID simpleStructStructCtor_2; + err = chip::JniReferences::GetInstance().FindMethod( + env, simpleStructStructClass_2, "", + "(Ljava/lang/Integer;Ljava/lang/Boolean;Ljava/lang/Integer;[BLjava/lang/String;Ljava/lang/Integer;Ljava/" + "lang/Float;Ljava/lang/Double;Ljava/util/Optional;)V", + &simpleStructStructCtor_2); + if (err != CHIP_NO_ERROR || simpleStructStructCtor_2 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$UnitTestingClusterSimpleStruct constructor"); + return nullptr; + } - newElement_0_fabricSensitiveStruct = - env->NewObject(simpleStructStructClass_2, simpleStructStructCtor_2, newElement_0_fabricSensitiveStruct_a, - newElement_0_fabricSensitiveStruct_b, newElement_0_fabricSensitiveStruct_c, - newElement_0_fabricSensitiveStruct_d, newElement_0_fabricSensitiveStruct_e, - newElement_0_fabricSensitiveStruct_f, newElement_0_fabricSensitiveStruct_g, - newElement_0_fabricSensitiveStruct_h, newElement_0_fabricSensitiveStruct_i); + newElement_0_fabricSensitiveStruct = + env->NewObject(simpleStructStructClass_2, simpleStructStructCtor_2, newElement_0_fabricSensitiveStruct_a, + newElement_0_fabricSensitiveStruct_b, newElement_0_fabricSensitiveStruct_c, + newElement_0_fabricSensitiveStruct_d, newElement_0_fabricSensitiveStruct_e, + newElement_0_fabricSensitiveStruct_f, newElement_0_fabricSensitiveStruct_g, + newElement_0_fabricSensitiveStruct_h, newElement_0_fabricSensitiveStruct_i); + } jobject newElement_0_fabricSensitiveInt8uList; chip::JniReferences::GetInstance().CreateArrayList(newElement_0_fabricSensitiveInt8uList); @@ -45180,32 +47664,34 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_0_fabricIndexCtorSignature.c_str(), jninewElement_0_fabricIndex, newElement_0_fabricIndex); - jclass testFabricScopedStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$UnitTestingClusterTestFabricScoped", testFabricScopedStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$UnitTestingClusterTestFabricScoped"); - return nullptr; - } + jclass testFabricScopedStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$UnitTestingClusterTestFabricScoped", testFabricScopedStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$UnitTestingClusterTestFabricScoped"); + return nullptr; + } - jmethodID testFabricScopedStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod( - env, testFabricScopedStructClass_1, "", - "(Ljava/lang/Integer;Ljava/util/Optional;Ljava/lang/Integer;Ljava/util/Optional;Ljava/lang/String;Lchip/" - "devicecontroller/ChipStructs$UnitTestingClusterSimpleStruct;Ljava/util/ArrayList;Ljava/lang/Integer;)V", - &testFabricScopedStructCtor_1); - if (err != CHIP_NO_ERROR || testFabricScopedStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$UnitTestingClusterTestFabricScoped constructor"); - return nullptr; - } + jmethodID testFabricScopedStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, testFabricScopedStructClass_1, "", + "(Ljava/lang/Integer;Ljava/util/Optional;Ljava/lang/Integer;Ljava/util/Optional;Ljava/lang/String;Lchip/" + "devicecontroller/ChipStructs$UnitTestingClusterSimpleStruct;Ljava/util/ArrayList;Ljava/lang/Integer;)V", + &testFabricScopedStructCtor_1); + if (err != CHIP_NO_ERROR || testFabricScopedStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$UnitTestingClusterTestFabricScoped constructor"); + return nullptr; + } - newElement_0 = env->NewObject( - testFabricScopedStructClass_1, testFabricScopedStructCtor_1, newElement_0_fabricSensitiveInt8u, - newElement_0_optionalFabricSensitiveInt8u, newElement_0_nullableFabricSensitiveInt8u, - newElement_0_nullableOptionalFabricSensitiveInt8u, newElement_0_fabricSensitiveCharString, - newElement_0_fabricSensitiveStruct, newElement_0_fabricSensitiveInt8uList, newElement_0_fabricIndex); + newElement_0 = env->NewObject( + testFabricScopedStructClass_1, testFabricScopedStructCtor_1, newElement_0_fabricSensitiveInt8u, + newElement_0_optionalFabricSensitiveInt8u, newElement_0_nullableFabricSensitiveInt8u, + newElement_0_nullableOptionalFabricSensitiveInt8u, newElement_0_fabricSensitiveCharString, + newElement_0_fabricSensitiveStruct, newElement_0_fabricSensitiveInt8uList, newElement_0_fabricIndex); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -45322,27 +47808,29 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR chip::JniReferences::GetInstance().CreateOptional(value_myEnumInsideOptional, value_myEnum); } - jclass testGlobalStructStructClass_0; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$UnitTestingClusterTestGlobalStruct", testGlobalStructStructClass_0); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$UnitTestingClusterTestGlobalStruct"); - return nullptr; - } + jclass testGlobalStructStructClass_0; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$UnitTestingClusterTestGlobalStruct", testGlobalStructStructClass_0); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$UnitTestingClusterTestGlobalStruct"); + return nullptr; + } - jmethodID testGlobalStructStructCtor_0; - err = chip::JniReferences::GetInstance().FindMethod(env, testGlobalStructStructClass_0, "", - "(Ljava/lang/String;Ljava/lang/Long;Ljava/util/Optional;)V", - &testGlobalStructStructCtor_0); - if (err != CHIP_NO_ERROR || testGlobalStructStructCtor_0 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$UnitTestingClusterTestGlobalStruct constructor"); - return nullptr; - } + jmethodID testGlobalStructStructCtor_0; + err = chip::JniReferences::GetInstance().FindMethod(env, testGlobalStructStructClass_0, "", + "(Ljava/lang/String;Ljava/lang/Long;Ljava/util/Optional;)V", + &testGlobalStructStructCtor_0); + if (err != CHIP_NO_ERROR || testGlobalStructStructCtor_0 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$UnitTestingClusterTestGlobalStruct constructor"); + return nullptr; + } - value = env->NewObject(testGlobalStructStructClass_0, testGlobalStructStructCtor_0, value_name, value_myBitmap, - value_myEnum); + value = env->NewObject(testGlobalStructStructClass_0, testGlobalStructStructCtor_0, value_name, value_myBitmap, + value_myEnum); + } return value; } case Attributes::Unsupported::Id: { @@ -46107,29 +48595,31 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR chip::JniReferences::GetInstance().CreateOptional(value_iInsideOptional, value_i); } - jclass simpleStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$UnitTestingClusterSimpleStruct", simpleStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$UnitTestingClusterSimpleStruct"); - return nullptr; - } + jclass simpleStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$UnitTestingClusterSimpleStruct", simpleStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$UnitTestingClusterSimpleStruct"); + return nullptr; + } - jmethodID simpleStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod( - env, simpleStructStructClass_1, "", - "(Ljava/lang/Integer;Ljava/lang/Boolean;Ljava/lang/Integer;[BLjava/lang/String;Ljava/lang/Integer;Ljava/lang/" - "Float;Ljava/lang/Double;Ljava/util/Optional;)V", - &simpleStructStructCtor_1); - if (err != CHIP_NO_ERROR || simpleStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$UnitTestingClusterSimpleStruct constructor"); - return nullptr; - } + jmethodID simpleStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, simpleStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/lang/Boolean;Ljava/lang/Integer;[BLjava/lang/String;Ljava/lang/Integer;Ljava/" + "lang/Float;Ljava/lang/Double;Ljava/util/Optional;)V", + &simpleStructStructCtor_1); + if (err != CHIP_NO_ERROR || simpleStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$UnitTestingClusterSimpleStruct constructor"); + return nullptr; + } - value = env->NewObject(simpleStructStructClass_1, simpleStructStructCtor_1, value_a, value_b, value_c, value_d, - value_e, value_f, value_g, value_h, value_i); + value = env->NewObject(simpleStructStructClass_1, simpleStructStructCtor_1, value_a, value_b, value_c, value_d, + value_e, value_f, value_g, value_h, value_i); + } } return value; } @@ -46318,27 +48808,29 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR chip::JniReferences::GetInstance().CreateOptional(value_myEnumInsideOptional, value_myEnum); } - jclass testGlobalStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$UnitTestingClusterTestGlobalStruct", testGlobalStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$UnitTestingClusterTestGlobalStruct"); - return nullptr; - } + jclass testGlobalStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$UnitTestingClusterTestGlobalStruct", testGlobalStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$UnitTestingClusterTestGlobalStruct"); + return nullptr; + } - jmethodID testGlobalStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod(env, testGlobalStructStructClass_1, "", - "(Ljava/lang/String;Ljava/lang/Long;Ljava/util/Optional;)V", - &testGlobalStructStructCtor_1); - if (err != CHIP_NO_ERROR || testGlobalStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$UnitTestingClusterTestGlobalStruct constructor"); - return nullptr; - } + jmethodID testGlobalStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod(env, testGlobalStructStructClass_1, "", + "(Ljava/lang/String;Ljava/lang/Long;Ljava/util/Optional;)V", + &testGlobalStructStructCtor_1); + if (err != CHIP_NO_ERROR || testGlobalStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$UnitTestingClusterTestGlobalStruct constructor"); + return nullptr; + } - value = env->NewObject(testGlobalStructStructClass_1, testGlobalStructStructCtor_1, value_name, value_myBitmap, - value_myEnum); + value = env->NewObject(testGlobalStructStructClass_1, testGlobalStructStructCtor_1, value_name, value_myBitmap, + value_myEnum); + } } return value; } diff --git a/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp index 45f23441804336..5c22f492870d88 100644 --- a/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp @@ -255,29 +255,32 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & jninewElement_3_deviceType, newElement_3_deviceType); } - jclass accessControlTargetStructStructClass_4; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$AccessControlClusterAccessControlTargetStruct", - accessControlTargetStructStructClass_4); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Could not find class ChipStructs$AccessControlClusterAccessControlTargetStruct"); - return nullptr; - } - - jmethodID accessControlTargetStructStructCtor_4; - err = chip::JniReferences::GetInstance().FindMethod( - env, accessControlTargetStructStructClass_4, "", - "(Ljava/lang/Long;Ljava/lang/Integer;Ljava/lang/Long;)V", &accessControlTargetStructStructCtor_4); - if (err != CHIP_NO_ERROR || accessControlTargetStructStructCtor_4 == nullptr) { - ChipLogError(Zcl, - "Could not find ChipStructs$AccessControlClusterAccessControlTargetStruct constructor"); - return nullptr; + jclass accessControlTargetStructStructClass_4; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$AccessControlClusterAccessControlTargetStruct", + accessControlTargetStructStructClass_4); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$AccessControlClusterAccessControlTargetStruct"); + return nullptr; + } + + jmethodID accessControlTargetStructStructCtor_4; + err = chip::JniReferences::GetInstance().FindMethod( + env, accessControlTargetStructStructClass_4, "", + "(Ljava/lang/Long;Ljava/lang/Integer;Ljava/lang/Long;)V", &accessControlTargetStructStructCtor_4); + if (err != CHIP_NO_ERROR || accessControlTargetStructStructCtor_4 == nullptr) + { + ChipLogError( + Zcl, "Could not find ChipStructs$AccessControlClusterAccessControlTargetStruct constructor"); + return nullptr; + } + + newElement_3 = + env->NewObject(accessControlTargetStructStructClass_4, accessControlTargetStructStructCtor_4, + newElement_3_cluster, newElement_3_endpoint, newElement_3_deviceType); } - - newElement_3 = env->NewObject(accessControlTargetStructStructClass_4, accessControlTargetStructStructCtor_4, - newElement_3_cluster, newElement_3_endpoint, newElement_3_deviceType); chip::JniReferences::GetInstance().AddToList(value_latestValue_targets, newElement_3); } } @@ -289,31 +292,33 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & value_latestValue_fabricIndexClassName.c_str(), value_latestValue_fabricIndexCtorSignature.c_str(), jnivalue_latestValue_fabricIndex, value_latestValue_fabricIndex); - jclass accessControlEntryStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$AccessControlClusterAccessControlEntryStruct", - accessControlEntryStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$AccessControlClusterAccessControlEntryStruct"); - return nullptr; - } + jclass accessControlEntryStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$AccessControlClusterAccessControlEntryStruct", + accessControlEntryStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$AccessControlClusterAccessControlEntryStruct"); + return nullptr; + } - jmethodID accessControlEntryStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod( - env, accessControlEntryStructStructClass_1, "", - "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/util/ArrayList;Ljava/util/ArrayList;Ljava/lang/Integer;)V", - &accessControlEntryStructStructCtor_1); - if (err != CHIP_NO_ERROR || accessControlEntryStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$AccessControlClusterAccessControlEntryStruct constructor"); - return nullptr; - } + jmethodID accessControlEntryStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, accessControlEntryStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/util/ArrayList;Ljava/util/ArrayList;Ljava/lang/Integer;)V", + &accessControlEntryStructStructCtor_1); + if (err != CHIP_NO_ERROR || accessControlEntryStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$AccessControlClusterAccessControlEntryStruct constructor"); + return nullptr; + } - value_latestValue = - env->NewObject(accessControlEntryStructStructClass_1, accessControlEntryStructStructCtor_1, - value_latestValue_privilege, value_latestValue_authMode, value_latestValue_subjects, - value_latestValue_targets, value_latestValue_fabricIndex); + value_latestValue = + env->NewObject(accessControlEntryStructStructClass_1, accessControlEntryStructStructCtor_1, + value_latestValue_privilege, value_latestValue_authMode, value_latestValue_subjects, + value_latestValue_targets, value_latestValue_fabricIndex); + } } jobject value_fabricIndex; @@ -418,29 +423,32 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & value_latestValue_fabricIndexClassName.c_str(), value_latestValue_fabricIndexCtorSignature.c_str(), jnivalue_latestValue_fabricIndex, value_latestValue_fabricIndex); - jclass accessControlExtensionStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$AccessControlClusterAccessControlExtensionStruct", - accessControlExtensionStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$AccessControlClusterAccessControlExtensionStruct"); - return nullptr; - } + jclass accessControlExtensionStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$AccessControlClusterAccessControlExtensionStruct", + accessControlExtensionStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$AccessControlClusterAccessControlExtensionStruct"); + return nullptr; + } - jmethodID accessControlExtensionStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod(env, accessControlExtensionStructStructClass_1, "", - "([BLjava/lang/Integer;)V", - &accessControlExtensionStructStructCtor_1); - if (err != CHIP_NO_ERROR || accessControlExtensionStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$AccessControlClusterAccessControlExtensionStruct constructor"); - return nullptr; - } + jmethodID accessControlExtensionStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod(env, accessControlExtensionStructStructClass_1, "", + "([BLjava/lang/Integer;)V", + &accessControlExtensionStructStructCtor_1); + if (err != CHIP_NO_ERROR || accessControlExtensionStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$AccessControlClusterAccessControlExtensionStruct constructor"); + return nullptr; + } - value_latestValue = - env->NewObject(accessControlExtensionStructStructClass_1, accessControlExtensionStructStructCtor_1, - value_latestValue_data, value_latestValue_fabricIndex); + value_latestValue = + env->NewObject(accessControlExtensionStructStructClass_1, accessControlExtensionStructStructCtor_1, + value_latestValue_data, value_latestValue_fabricIndex); + } } jobject value_fabricIndex; @@ -2740,29 +2748,31 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & value_errorState_errorStateDetails); } - jclass errorStateStructStructClass_0; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$OvenCavityOperationalStateClusterErrorStateStruct", - errorStateStructStructClass_0); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$OvenCavityOperationalStateClusterErrorStateStruct"); - return nullptr; - } + jclass errorStateStructStructClass_0; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$OvenCavityOperationalStateClusterErrorStateStruct", + errorStateStructStructClass_0); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$OvenCavityOperationalStateClusterErrorStateStruct"); + return nullptr; + } - jmethodID errorStateStructStructCtor_0; - err = chip::JniReferences::GetInstance().FindMethod(env, errorStateStructStructClass_0, "", - "(Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;)V", - &errorStateStructStructCtor_0); - if (err != CHIP_NO_ERROR || errorStateStructStructCtor_0 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$OvenCavityOperationalStateClusterErrorStateStruct constructor"); - return nullptr; - } + jmethodID errorStateStructStructCtor_0; + err = chip::JniReferences::GetInstance().FindMethod( + env, errorStateStructStructClass_0, "", "(Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;)V", + &errorStateStructStructCtor_0); + if (err != CHIP_NO_ERROR || errorStateStructStructCtor_0 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$OvenCavityOperationalStateClusterErrorStateStruct constructor"); + return nullptr; + } - value_errorState = - env->NewObject(errorStateStructStructClass_0, errorStateStructStructCtor_0, value_errorState_errorStateID, - value_errorState_errorStateLabel, value_errorState_errorStateDetails); + value_errorState = + env->NewObject(errorStateStructStructClass_0, errorStateStructStructCtor_0, value_errorState_errorStateID, + value_errorState_errorStateLabel, value_errorState_errorStateDetails); + } jclass operationalErrorStructClass; err = chip::JniReferences::GetInstance().GetLocalClassRef( @@ -3573,28 +3583,31 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & value_errorState_errorStateDetails); } - jclass errorStateStructStructClass_0; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$OperationalStateClusterErrorStateStruct", errorStateStructStructClass_0); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$OperationalStateClusterErrorStateStruct"); - return nullptr; - } + jclass errorStateStructStructClass_0; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$OperationalStateClusterErrorStateStruct", + errorStateStructStructClass_0); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$OperationalStateClusterErrorStateStruct"); + return nullptr; + } - jmethodID errorStateStructStructCtor_0; - err = chip::JniReferences::GetInstance().FindMethod(env, errorStateStructStructClass_0, "", - "(Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;)V", - &errorStateStructStructCtor_0); - if (err != CHIP_NO_ERROR || errorStateStructStructCtor_0 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$OperationalStateClusterErrorStateStruct constructor"); - return nullptr; - } + jmethodID errorStateStructStructCtor_0; + err = chip::JniReferences::GetInstance().FindMethod( + env, errorStateStructStructClass_0, "", "(Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;)V", + &errorStateStructStructCtor_0); + if (err != CHIP_NO_ERROR || errorStateStructStructCtor_0 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$OperationalStateClusterErrorStateStruct constructor"); + return nullptr; + } - value_errorState = - env->NewObject(errorStateStructStructClass_0, errorStateStructStructCtor_0, value_errorState_errorStateID, - value_errorState_errorStateLabel, value_errorState_errorStateDetails); + value_errorState = + env->NewObject(errorStateStructStructClass_0, errorStateStructStructCtor_0, value_errorState_errorStateID, + value_errorState_errorStateLabel, value_errorState_errorStateDetails); + } jclass operationalErrorStructClass; err = chip::JniReferences::GetInstance().GetLocalClassRef( @@ -3763,28 +3776,31 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & value_errorState_errorStateDetails); } - jclass errorStateStructStructClass_0; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$RvcOperationalStateClusterErrorStateStruct", errorStateStructStructClass_0); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$RvcOperationalStateClusterErrorStateStruct"); - return nullptr; - } + jclass errorStateStructStructClass_0; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$RvcOperationalStateClusterErrorStateStruct", + errorStateStructStructClass_0); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$RvcOperationalStateClusterErrorStateStruct"); + return nullptr; + } - jmethodID errorStateStructStructCtor_0; - err = chip::JniReferences::GetInstance().FindMethod(env, errorStateStructStructClass_0, "", - "(Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;)V", - &errorStateStructStructCtor_0); - if (err != CHIP_NO_ERROR || errorStateStructStructCtor_0 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$RvcOperationalStateClusterErrorStateStruct constructor"); - return nullptr; - } + jmethodID errorStateStructStructCtor_0; + err = chip::JniReferences::GetInstance().FindMethod( + env, errorStateStructStructClass_0, "", "(Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;)V", + &errorStateStructStructCtor_0); + if (err != CHIP_NO_ERROR || errorStateStructStructCtor_0 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$RvcOperationalStateClusterErrorStateStruct constructor"); + return nullptr; + } - value_errorState = - env->NewObject(errorStateStructStructClass_0, errorStateStructStructCtor_0, value_errorState_errorStateID, - value_errorState_errorStateLabel, value_errorState_errorStateDetails); + value_errorState = + env->NewObject(errorStateStructStructClass_0, errorStateStructStructCtor_0, value_errorState_errorStateID, + value_errorState_errorStateLabel, value_errorState_errorStateDetails); + } jclass operationalErrorStructClass; err = chip::JniReferences::GetInstance().GetLocalClassRef( @@ -4334,35 +4350,38 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & newElement_0_maxSystime); } - jclass measurementRangeStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$ElectricalPowerMeasurementClusterMeasurementRangeStruct", - measurementRangeStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$ElectricalPowerMeasurementClusterMeasurementRangeStruct"); - return nullptr; - } + jclass measurementRangeStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$ElectricalPowerMeasurementClusterMeasurementRangeStruct", + measurementRangeStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, + "Could not find class ChipStructs$ElectricalPowerMeasurementClusterMeasurementRangeStruct"); + return nullptr; + } - jmethodID measurementRangeStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod( - env, measurementRangeStructStructClass_1, "", - "(Ljava/lang/Integer;Ljava/lang/Long;Ljava/lang/Long;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/" - "Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/" - "Optional;)V", - &measurementRangeStructStructCtor_1); - if (err != CHIP_NO_ERROR || measurementRangeStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, - "Could not find ChipStructs$ElectricalPowerMeasurementClusterMeasurementRangeStruct constructor"); - return nullptr; - } + jmethodID measurementRangeStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, measurementRangeStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/lang/Long;Ljava/lang/Long;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/" + "Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/" + "Optional;)V", + &measurementRangeStructStructCtor_1); + if (err != CHIP_NO_ERROR || measurementRangeStructStructCtor_1 == nullptr) + { + ChipLogError( + Zcl, "Could not find ChipStructs$ElectricalPowerMeasurementClusterMeasurementRangeStruct constructor"); + return nullptr; + } - newElement_0 = env->NewObject(measurementRangeStructStructClass_1, measurementRangeStructStructCtor_1, - newElement_0_measurementType, newElement_0_min, newElement_0_max, - newElement_0_startTimestamp, newElement_0_endTimestamp, newElement_0_minTimestamp, - newElement_0_maxTimestamp, newElement_0_startSystime, newElement_0_endSystime, - newElement_0_minSystime, newElement_0_maxSystime); + newElement_0 = env->NewObject(measurementRangeStructStructClass_1, measurementRangeStructStructCtor_1, + newElement_0_measurementType, newElement_0_min, newElement_0_max, + newElement_0_startTimestamp, newElement_0_endTimestamp, newElement_0_minTimestamp, + newElement_0_maxTimestamp, newElement_0_startSystime, newElement_0_endSystime, + newElement_0_minSystime, newElement_0_maxSystime); + } chip::JniReferences::GetInstance().AddToList(value_ranges, newElement_0); } @@ -4507,33 +4526,37 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & value_energyImportedInsideOptional_endSystime); } - jclass energyMeasurementStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$ElectricalEnergyMeasurementClusterEnergyMeasurementStruct", - energyMeasurementStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$ElectricalEnergyMeasurementClusterEnergyMeasurementStruct"); - return nullptr; - } + jclass energyMeasurementStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$ElectricalEnergyMeasurementClusterEnergyMeasurementStruct", + energyMeasurementStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, + "Could not find class ChipStructs$ElectricalEnergyMeasurementClusterEnergyMeasurementStruct"); + return nullptr; + } - jmethodID energyMeasurementStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod( - env, energyMeasurementStructStructClass_1, "", - "(Ljava/lang/Long;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;)V", - &energyMeasurementStructStructCtor_1); - if (err != CHIP_NO_ERROR || energyMeasurementStructStructCtor_1 == nullptr) - { - ChipLogError( - Zcl, "Could not find ChipStructs$ElectricalEnergyMeasurementClusterEnergyMeasurementStruct constructor"); - return nullptr; - } + jmethodID energyMeasurementStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, energyMeasurementStructStructClass_1, "", + "(Ljava/lang/Long;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;)V", + &energyMeasurementStructStructCtor_1); + if (err != CHIP_NO_ERROR || energyMeasurementStructStructCtor_1 == nullptr) + { + ChipLogError( + Zcl, + "Could not find ChipStructs$ElectricalEnergyMeasurementClusterEnergyMeasurementStruct constructor"); + return nullptr; + } - value_energyImportedInsideOptional = - env->NewObject(energyMeasurementStructStructClass_1, energyMeasurementStructStructCtor_1, - value_energyImportedInsideOptional_energy, value_energyImportedInsideOptional_startTimestamp, - value_energyImportedInsideOptional_endTimestamp, value_energyImportedInsideOptional_startSystime, - value_energyImportedInsideOptional_endSystime); + value_energyImportedInsideOptional = env->NewObject( + energyMeasurementStructStructClass_1, energyMeasurementStructStructCtor_1, + value_energyImportedInsideOptional_energy, value_energyImportedInsideOptional_startTimestamp, + value_energyImportedInsideOptional_endTimestamp, value_energyImportedInsideOptional_startSystime, + value_energyImportedInsideOptional_endSystime); + } chip::JniReferences::GetInstance().CreateOptional(value_energyImportedInsideOptional, value_energyImported); } @@ -4635,33 +4658,37 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & value_energyExportedInsideOptional_endSystime); } - jclass energyMeasurementStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$ElectricalEnergyMeasurementClusterEnergyMeasurementStruct", - energyMeasurementStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$ElectricalEnergyMeasurementClusterEnergyMeasurementStruct"); - return nullptr; - } + jclass energyMeasurementStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$ElectricalEnergyMeasurementClusterEnergyMeasurementStruct", + energyMeasurementStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, + "Could not find class ChipStructs$ElectricalEnergyMeasurementClusterEnergyMeasurementStruct"); + return nullptr; + } - jmethodID energyMeasurementStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod( - env, energyMeasurementStructStructClass_1, "", - "(Ljava/lang/Long;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;)V", - &energyMeasurementStructStructCtor_1); - if (err != CHIP_NO_ERROR || energyMeasurementStructStructCtor_1 == nullptr) - { - ChipLogError( - Zcl, "Could not find ChipStructs$ElectricalEnergyMeasurementClusterEnergyMeasurementStruct constructor"); - return nullptr; - } + jmethodID energyMeasurementStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, energyMeasurementStructStructClass_1, "", + "(Ljava/lang/Long;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;)V", + &energyMeasurementStructStructCtor_1); + if (err != CHIP_NO_ERROR || energyMeasurementStructStructCtor_1 == nullptr) + { + ChipLogError( + Zcl, + "Could not find ChipStructs$ElectricalEnergyMeasurementClusterEnergyMeasurementStruct constructor"); + return nullptr; + } - value_energyExportedInsideOptional = - env->NewObject(energyMeasurementStructStructClass_1, energyMeasurementStructStructCtor_1, - value_energyExportedInsideOptional_energy, value_energyExportedInsideOptional_startTimestamp, - value_energyExportedInsideOptional_endTimestamp, value_energyExportedInsideOptional_startSystime, - value_energyExportedInsideOptional_endSystime); + value_energyExportedInsideOptional = env->NewObject( + energyMeasurementStructStructClass_1, energyMeasurementStructStructCtor_1, + value_energyExportedInsideOptional_energy, value_energyExportedInsideOptional_startTimestamp, + value_energyExportedInsideOptional_endTimestamp, value_energyExportedInsideOptional_startSystime, + value_energyExportedInsideOptional_endSystime); + } chip::JniReferences::GetInstance().CreateOptional(value_energyExportedInsideOptional, value_energyExported); } @@ -4798,33 +4825,37 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & value_energyImportedInsideOptional_endSystime); } - jclass energyMeasurementStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$ElectricalEnergyMeasurementClusterEnergyMeasurementStruct", - energyMeasurementStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$ElectricalEnergyMeasurementClusterEnergyMeasurementStruct"); - return nullptr; - } + jclass energyMeasurementStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$ElectricalEnergyMeasurementClusterEnergyMeasurementStruct", + energyMeasurementStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, + "Could not find class ChipStructs$ElectricalEnergyMeasurementClusterEnergyMeasurementStruct"); + return nullptr; + } - jmethodID energyMeasurementStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod( - env, energyMeasurementStructStructClass_1, "", - "(Ljava/lang/Long;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;)V", - &energyMeasurementStructStructCtor_1); - if (err != CHIP_NO_ERROR || energyMeasurementStructStructCtor_1 == nullptr) - { - ChipLogError( - Zcl, "Could not find ChipStructs$ElectricalEnergyMeasurementClusterEnergyMeasurementStruct constructor"); - return nullptr; - } + jmethodID energyMeasurementStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, energyMeasurementStructStructClass_1, "", + "(Ljava/lang/Long;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;)V", + &energyMeasurementStructStructCtor_1); + if (err != CHIP_NO_ERROR || energyMeasurementStructStructCtor_1 == nullptr) + { + ChipLogError( + Zcl, + "Could not find ChipStructs$ElectricalEnergyMeasurementClusterEnergyMeasurementStruct constructor"); + return nullptr; + } - value_energyImportedInsideOptional = - env->NewObject(energyMeasurementStructStructClass_1, energyMeasurementStructStructCtor_1, - value_energyImportedInsideOptional_energy, value_energyImportedInsideOptional_startTimestamp, - value_energyImportedInsideOptional_endTimestamp, value_energyImportedInsideOptional_startSystime, - value_energyImportedInsideOptional_endSystime); + value_energyImportedInsideOptional = env->NewObject( + energyMeasurementStructStructClass_1, energyMeasurementStructStructCtor_1, + value_energyImportedInsideOptional_energy, value_energyImportedInsideOptional_startTimestamp, + value_energyImportedInsideOptional_endTimestamp, value_energyImportedInsideOptional_startSystime, + value_energyImportedInsideOptional_endSystime); + } chip::JniReferences::GetInstance().CreateOptional(value_energyImportedInsideOptional, value_energyImported); } @@ -4926,33 +4957,37 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & value_energyExportedInsideOptional_endSystime); } - jclass energyMeasurementStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$ElectricalEnergyMeasurementClusterEnergyMeasurementStruct", - energyMeasurementStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$ElectricalEnergyMeasurementClusterEnergyMeasurementStruct"); - return nullptr; - } + jclass energyMeasurementStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$ElectricalEnergyMeasurementClusterEnergyMeasurementStruct", + energyMeasurementStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, + "Could not find class ChipStructs$ElectricalEnergyMeasurementClusterEnergyMeasurementStruct"); + return nullptr; + } - jmethodID energyMeasurementStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod( - env, energyMeasurementStructStructClass_1, "", - "(Ljava/lang/Long;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;)V", - &energyMeasurementStructStructCtor_1); - if (err != CHIP_NO_ERROR || energyMeasurementStructStructCtor_1 == nullptr) - { - ChipLogError( - Zcl, "Could not find ChipStructs$ElectricalEnergyMeasurementClusterEnergyMeasurementStruct constructor"); - return nullptr; - } + jmethodID energyMeasurementStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, energyMeasurementStructStructClass_1, "", + "(Ljava/lang/Long;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;)V", + &energyMeasurementStructStructCtor_1); + if (err != CHIP_NO_ERROR || energyMeasurementStructStructCtor_1 == nullptr) + { + ChipLogError( + Zcl, + "Could not find ChipStructs$ElectricalEnergyMeasurementClusterEnergyMeasurementStruct constructor"); + return nullptr; + } - value_energyExportedInsideOptional = - env->NewObject(energyMeasurementStructStructClass_1, energyMeasurementStructStructCtor_1, - value_energyExportedInsideOptional_energy, value_energyExportedInsideOptional_startTimestamp, - value_energyExportedInsideOptional_endTimestamp, value_energyExportedInsideOptional_startSystime, - value_energyExportedInsideOptional_endSystime); + value_energyExportedInsideOptional = env->NewObject( + energyMeasurementStructStructClass_1, energyMeasurementStructStructCtor_1, + value_energyExportedInsideOptional_energy, value_energyExportedInsideOptional_startTimestamp, + value_energyExportedInsideOptional_endTimestamp, value_energyExportedInsideOptional_startSystime, + value_energyExportedInsideOptional_endSystime); + } chip::JniReferences::GetInstance().CreateOptional(value_energyExportedInsideOptional, value_energyExported); } @@ -5102,31 +5137,35 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & value_boostInfo_targetReheat); } - jclass waterHeaterBoostInfoStructStructClass_0; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$WaterHeaterManagementClusterWaterHeaterBoostInfoStruct", - waterHeaterBoostInfoStructStructClass_0); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$WaterHeaterManagementClusterWaterHeaterBoostInfoStruct"); - return nullptr; - } + jclass waterHeaterBoostInfoStructStructClass_0; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$WaterHeaterManagementClusterWaterHeaterBoostInfoStruct", + waterHeaterBoostInfoStructStructClass_0); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$WaterHeaterManagementClusterWaterHeaterBoostInfoStruct"); + return nullptr; + } - jmethodID waterHeaterBoostInfoStructStructCtor_0; - err = chip::JniReferences::GetInstance().FindMethod(env, waterHeaterBoostInfoStructStructClass_0, "", - "(Ljava/lang/Long;Ljava/util/Optional;Ljava/util/Optional;Ljava/" - "util/Optional;Ljava/util/Optional;Ljava/util/Optional;)V", - &waterHeaterBoostInfoStructStructCtor_0); - if (err != CHIP_NO_ERROR || waterHeaterBoostInfoStructStructCtor_0 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$WaterHeaterManagementClusterWaterHeaterBoostInfoStruct constructor"); - return nullptr; - } + jmethodID waterHeaterBoostInfoStructStructCtor_0; + err = + chip::JniReferences::GetInstance().FindMethod(env, waterHeaterBoostInfoStructStructClass_0, "", + "(Ljava/lang/Long;Ljava/util/Optional;Ljava/util/Optional;Ljava/" + "util/Optional;Ljava/util/Optional;Ljava/util/Optional;)V", + &waterHeaterBoostInfoStructStructCtor_0); + if (err != CHIP_NO_ERROR || waterHeaterBoostInfoStructStructCtor_0 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$WaterHeaterManagementClusterWaterHeaterBoostInfoStruct constructor"); + return nullptr; + } - value_boostInfo = - env->NewObject(waterHeaterBoostInfoStructStructClass_0, waterHeaterBoostInfoStructStructCtor_0, - value_boostInfo_duration, value_boostInfo_oneShot, value_boostInfo_emergencyBoost, - value_boostInfo_temporarySetpoint, value_boostInfo_targetPercentage, value_boostInfo_targetReheat); + value_boostInfo = env->NewObject(waterHeaterBoostInfoStructStructClass_0, waterHeaterBoostInfoStructStructCtor_0, + value_boostInfo_duration, value_boostInfo_oneShot, value_boostInfo_emergencyBoost, + value_boostInfo_temporarySetpoint, value_boostInfo_targetPercentage, + value_boostInfo_targetReheat); + } jclass boostStartedStructClass; err = chip::JniReferences::GetInstance().GetLocalClassRef( @@ -5380,35 +5419,38 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & value_temperatureControlInsideOptional_heatingTempSetpoint); } - jclass temperatureControlStructStructClass_2; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterTemperatureControlStruct", - temperatureControlStructStructClass_2); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, - "Could not find class ChipStructs$DemandResponseLoadControlClusterTemperatureControlStruct"); - return nullptr; - } + jclass temperatureControlStructStructClass_2; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterTemperatureControlStruct", + temperatureControlStructStructClass_2); + if (err != CHIP_NO_ERROR) + { + ChipLogError( + Zcl, "Could not find class ChipStructs$DemandResponseLoadControlClusterTemperatureControlStruct"); + return nullptr; + } - jmethodID temperatureControlStructStructCtor_2; - err = chip::JniReferences::GetInstance().FindMethod( - env, temperatureControlStructStructClass_2, "", - "(Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;)V", - &temperatureControlStructStructCtor_2); - if (err != CHIP_NO_ERROR || temperatureControlStructStructCtor_2 == nullptr) - { - ChipLogError( - Zcl, "Could not find ChipStructs$DemandResponseLoadControlClusterTemperatureControlStruct constructor"); - return nullptr; - } + jmethodID temperatureControlStructStructCtor_2; + err = chip::JniReferences::GetInstance().FindMethod( + env, temperatureControlStructStructClass_2, "", + "(Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;)V", + &temperatureControlStructStructCtor_2); + if (err != CHIP_NO_ERROR || temperatureControlStructStructCtor_2 == nullptr) + { + ChipLogError( + Zcl, + "Could not find ChipStructs$DemandResponseLoadControlClusterTemperatureControlStruct constructor"); + return nullptr; + } - value_temperatureControlInsideOptional = - env->NewObject(temperatureControlStructStructClass_2, temperatureControlStructStructCtor_2, - value_temperatureControlInsideOptional_coolingTempOffset, - value_temperatureControlInsideOptional_heatingtTempOffset, - value_temperatureControlInsideOptional_coolingTempSetpoint, - value_temperatureControlInsideOptional_heatingTempSetpoint); + value_temperatureControlInsideOptional = + env->NewObject(temperatureControlStructStructClass_2, temperatureControlStructStructCtor_2, + value_temperatureControlInsideOptional_coolingTempOffset, + value_temperatureControlInsideOptional_heatingtTempOffset, + value_temperatureControlInsideOptional_coolingTempSetpoint, + value_temperatureControlInsideOptional_heatingTempSetpoint); + } } chip::JniReferences::GetInstance().CreateOptional(value_temperatureControlInsideOptional, value_temperatureControl); } @@ -5438,31 +5480,34 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & jnivalue_averageLoadControlInsideOptional_loadAdjustment, value_averageLoadControlInsideOptional_loadAdjustment); - jclass averageLoadControlStructStructClass_2; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterAverageLoadControlStruct", - averageLoadControlStructStructClass_2); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, - "Could not find class ChipStructs$DemandResponseLoadControlClusterAverageLoadControlStruct"); - return nullptr; - } - - jmethodID averageLoadControlStructStructCtor_2; - err = chip::JniReferences::GetInstance().FindMethod(env, averageLoadControlStructStructClass_2, "", - "(Ljava/lang/Integer;)V", - &averageLoadControlStructStructCtor_2); - if (err != CHIP_NO_ERROR || averageLoadControlStructStructCtor_2 == nullptr) { - ChipLogError( - Zcl, "Could not find ChipStructs$DemandResponseLoadControlClusterAverageLoadControlStruct constructor"); - return nullptr; - } + jclass averageLoadControlStructStructClass_2; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterAverageLoadControlStruct", + averageLoadControlStructStructClass_2); + if (err != CHIP_NO_ERROR) + { + ChipLogError( + Zcl, "Could not find class ChipStructs$DemandResponseLoadControlClusterAverageLoadControlStruct"); + return nullptr; + } - value_averageLoadControlInsideOptional = - env->NewObject(averageLoadControlStructStructClass_2, averageLoadControlStructStructCtor_2, - value_averageLoadControlInsideOptional_loadAdjustment); + jmethodID averageLoadControlStructStructCtor_2; + err = chip::JniReferences::GetInstance().FindMethod(env, averageLoadControlStructStructClass_2, "", + "(Ljava/lang/Integer;)V", + &averageLoadControlStructStructCtor_2); + if (err != CHIP_NO_ERROR || averageLoadControlStructStructCtor_2 == nullptr) + { + ChipLogError( + Zcl, + "Could not find ChipStructs$DemandResponseLoadControlClusterAverageLoadControlStruct constructor"); + return nullptr; + } + + value_averageLoadControlInsideOptional = + env->NewObject(averageLoadControlStructStructClass_2, averageLoadControlStructStructCtor_2, + value_averageLoadControlInsideOptional_loadAdjustment); + } } chip::JniReferences::GetInstance().CreateOptional(value_averageLoadControlInsideOptional, value_averageLoadControl); } @@ -5491,31 +5536,34 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & value_dutyCycleControlInsideOptional_dutyCycleCtorSignature.c_str(), jnivalue_dutyCycleControlInsideOptional_dutyCycle, value_dutyCycleControlInsideOptional_dutyCycle); - jclass dutyCycleControlStructStructClass_2; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterDutyCycleControlStruct", - dutyCycleControlStructStructClass_2); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, - "Could not find class ChipStructs$DemandResponseLoadControlClusterDutyCycleControlStruct"); - return nullptr; - } + jclass dutyCycleControlStructStructClass_2; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterDutyCycleControlStruct", + dutyCycleControlStructStructClass_2); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, + "Could not find class ChipStructs$DemandResponseLoadControlClusterDutyCycleControlStruct"); + return nullptr; + } - jmethodID dutyCycleControlStructStructCtor_2; - err = chip::JniReferences::GetInstance().FindMethod(env, dutyCycleControlStructStructClass_2, "", - "(Ljava/lang/Integer;)V", - &dutyCycleControlStructStructCtor_2); - if (err != CHIP_NO_ERROR || dutyCycleControlStructStructCtor_2 == nullptr) - { - ChipLogError( - Zcl, "Could not find ChipStructs$DemandResponseLoadControlClusterDutyCycleControlStruct constructor"); - return nullptr; - } + jmethodID dutyCycleControlStructStructCtor_2; + err = chip::JniReferences::GetInstance().FindMethod(env, dutyCycleControlStructStructClass_2, "", + "(Ljava/lang/Integer;)V", + &dutyCycleControlStructStructCtor_2); + if (err != CHIP_NO_ERROR || dutyCycleControlStructStructCtor_2 == nullptr) + { + ChipLogError( + Zcl, + "Could not find ChipStructs$DemandResponseLoadControlClusterDutyCycleControlStruct constructor"); + return nullptr; + } - value_dutyCycleControlInsideOptional = - env->NewObject(dutyCycleControlStructStructClass_2, dutyCycleControlStructStructCtor_2, - value_dutyCycleControlInsideOptional_dutyCycle); + value_dutyCycleControlInsideOptional = + env->NewObject(dutyCycleControlStructStructClass_2, dutyCycleControlStructStructCtor_2, + value_dutyCycleControlInsideOptional_dutyCycle); + } } chip::JniReferences::GetInstance().CreateOptional(value_dutyCycleControlInsideOptional, value_dutyCycleControl); } @@ -5545,32 +5593,34 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & jnivalue_powerSavingsControlInsideOptional_powerSavings, value_powerSavingsControlInsideOptional_powerSavings); - jclass powerSavingsControlStructStructClass_2; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterPowerSavingsControlStruct", - powerSavingsControlStructStructClass_2); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, - "Could not find class ChipStructs$DemandResponseLoadControlClusterPowerSavingsControlStruct"); - return nullptr; - } + jclass powerSavingsControlStructStructClass_2; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterPowerSavingsControlStruct", + powerSavingsControlStructStructClass_2); + if (err != CHIP_NO_ERROR) + { + ChipLogError( + Zcl, "Could not find class ChipStructs$DemandResponseLoadControlClusterPowerSavingsControlStruct"); + return nullptr; + } - jmethodID powerSavingsControlStructStructCtor_2; - err = chip::JniReferences::GetInstance().FindMethod(env, powerSavingsControlStructStructClass_2, "", - "(Ljava/lang/Integer;)V", - &powerSavingsControlStructStructCtor_2); - if (err != CHIP_NO_ERROR || powerSavingsControlStructStructCtor_2 == nullptr) - { - ChipLogError( - Zcl, - "Could not find ChipStructs$DemandResponseLoadControlClusterPowerSavingsControlStruct constructor"); - return nullptr; - } + jmethodID powerSavingsControlStructStructCtor_2; + err = chip::JniReferences::GetInstance().FindMethod(env, powerSavingsControlStructStructClass_2, "", + "(Ljava/lang/Integer;)V", + &powerSavingsControlStructStructCtor_2); + if (err != CHIP_NO_ERROR || powerSavingsControlStructStructCtor_2 == nullptr) + { + ChipLogError( + Zcl, + "Could not find ChipStructs$DemandResponseLoadControlClusterPowerSavingsControlStruct constructor"); + return nullptr; + } - value_powerSavingsControlInsideOptional = - env->NewObject(powerSavingsControlStructStructClass_2, powerSavingsControlStructStructCtor_2, - value_powerSavingsControlInsideOptional_powerSavings); + value_powerSavingsControlInsideOptional = + env->NewObject(powerSavingsControlStructStructClass_2, powerSavingsControlStructStructCtor_2, + value_powerSavingsControlInsideOptional_powerSavings); + } } chip::JniReferences::GetInstance().CreateOptional(value_powerSavingsControlInsideOptional, value_powerSavingsControl); @@ -5601,32 +5651,34 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & jnivalue_heatingSourceControlInsideOptional_heatingSource, value_heatingSourceControlInsideOptional_heatingSource); - jclass heatingSourceControlStructStructClass_2; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterHeatingSourceControlStruct", - heatingSourceControlStructStructClass_2); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, - "Could not find class ChipStructs$DemandResponseLoadControlClusterHeatingSourceControlStruct"); - return nullptr; - } + jclass heatingSourceControlStructStructClass_2; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterHeatingSourceControlStruct", + heatingSourceControlStructStructClass_2); + if (err != CHIP_NO_ERROR) + { + ChipLogError( + Zcl, "Could not find class ChipStructs$DemandResponseLoadControlClusterHeatingSourceControlStruct"); + return nullptr; + } - jmethodID heatingSourceControlStructStructCtor_2; - err = chip::JniReferences::GetInstance().FindMethod(env, heatingSourceControlStructStructClass_2, "", - "(Ljava/lang/Integer;)V", - &heatingSourceControlStructStructCtor_2); - if (err != CHIP_NO_ERROR || heatingSourceControlStructStructCtor_2 == nullptr) - { - ChipLogError( - Zcl, - "Could not find ChipStructs$DemandResponseLoadControlClusterHeatingSourceControlStruct constructor"); - return nullptr; - } + jmethodID heatingSourceControlStructStructCtor_2; + err = chip::JniReferences::GetInstance().FindMethod(env, heatingSourceControlStructStructClass_2, "", + "(Ljava/lang/Integer;)V", + &heatingSourceControlStructStructCtor_2); + if (err != CHIP_NO_ERROR || heatingSourceControlStructStructCtor_2 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$DemandResponseLoadControlClusterHeatingSourceControlStruct " + "constructor"); + return nullptr; + } - value_heatingSourceControlInsideOptional = - env->NewObject(heatingSourceControlStructStructClass_2, heatingSourceControlStructStructCtor_2, - value_heatingSourceControlInsideOptional_heatingSource); + value_heatingSourceControlInsideOptional = + env->NewObject(heatingSourceControlStructStructClass_2, heatingSourceControlStructStructCtor_2, + value_heatingSourceControlInsideOptional_heatingSource); + } } chip::JniReferences::GetInstance().CreateOptional(value_heatingSourceControlInsideOptional, value_heatingSourceControl); @@ -6614,28 +6666,30 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & newElement_2_credentialIndexClassName.c_str(), newElement_2_credentialIndexCtorSignature.c_str(), jninewElement_2_credentialIndex, newElement_2_credentialIndex); - jclass credentialStructStructClass_3; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$DoorLockClusterCredentialStruct", - credentialStructStructClass_3); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$DoorLockClusterCredentialStruct"); - return nullptr; - } - - jmethodID credentialStructStructCtor_3; - err = chip::JniReferences::GetInstance().FindMethod(env, credentialStructStructClass_3, "", - "(Ljava/lang/Integer;Ljava/lang/Integer;)V", - &credentialStructStructCtor_3); - if (err != CHIP_NO_ERROR || credentialStructStructCtor_3 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$DoorLockClusterCredentialStruct constructor"); - return nullptr; + jclass credentialStructStructClass_3; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$DoorLockClusterCredentialStruct", + credentialStructStructClass_3); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$DoorLockClusterCredentialStruct"); + return nullptr; + } + + jmethodID credentialStructStructCtor_3; + err = chip::JniReferences::GetInstance().FindMethod(env, credentialStructStructClass_3, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;)V", + &credentialStructStructCtor_3); + if (err != CHIP_NO_ERROR || credentialStructStructCtor_3 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$DoorLockClusterCredentialStruct constructor"); + return nullptr; + } + + newElement_2 = env->NewObject(credentialStructStructClass_3, credentialStructStructCtor_3, + newElement_2_credentialType, newElement_2_credentialIndex); } - - newElement_2 = env->NewObject(credentialStructStructClass_3, credentialStructStructCtor_3, - newElement_2_credentialType, newElement_2_credentialIndex); chip::JniReferences::GetInstance().AddToList(value_credentialsInsideOptional, newElement_2); } } @@ -6779,28 +6833,30 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & newElement_2_credentialIndexClassName.c_str(), newElement_2_credentialIndexCtorSignature.c_str(), jninewElement_2_credentialIndex, newElement_2_credentialIndex); - jclass credentialStructStructClass_3; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$DoorLockClusterCredentialStruct", - credentialStructStructClass_3); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Could not find class ChipStructs$DoorLockClusterCredentialStruct"); - return nullptr; - } - - jmethodID credentialStructStructCtor_3; - err = chip::JniReferences::GetInstance().FindMethod(env, credentialStructStructClass_3, "", - "(Ljava/lang/Integer;Ljava/lang/Integer;)V", - &credentialStructStructCtor_3); - if (err != CHIP_NO_ERROR || credentialStructStructCtor_3 == nullptr) { - ChipLogError(Zcl, "Could not find ChipStructs$DoorLockClusterCredentialStruct constructor"); - return nullptr; + jclass credentialStructStructClass_3; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$DoorLockClusterCredentialStruct", + credentialStructStructClass_3); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$DoorLockClusterCredentialStruct"); + return nullptr; + } + + jmethodID credentialStructStructCtor_3; + err = chip::JniReferences::GetInstance().FindMethod(env, credentialStructStructClass_3, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;)V", + &credentialStructStructCtor_3); + if (err != CHIP_NO_ERROR || credentialStructStructCtor_3 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$DoorLockClusterCredentialStruct constructor"); + return nullptr; + } + + newElement_2 = env->NewObject(credentialStructStructClass_3, credentialStructStructCtor_3, + newElement_2_credentialType, newElement_2_credentialIndex); } - - newElement_2 = env->NewObject(credentialStructStructClass_3, credentialStructStructCtor_3, - newElement_2_credentialType, newElement_2_credentialIndex); chip::JniReferences::GetInstance().AddToList(value_credentialsInsideOptional, newElement_2); } } @@ -7844,27 +7900,30 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & jobject newElement_0_name; LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.name, newElement_0_name)); - jclass targetInfoStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$TargetNavigatorClusterTargetInfoStruct", targetInfoStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$TargetNavigatorClusterTargetInfoStruct"); - return nullptr; - } + jclass targetInfoStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$TargetNavigatorClusterTargetInfoStruct", + targetInfoStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$TargetNavigatorClusterTargetInfoStruct"); + return nullptr; + } - jmethodID targetInfoStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod(env, targetInfoStructStructClass_1, "", - "(Ljava/lang/Integer;Ljava/lang/String;)V", - &targetInfoStructStructCtor_1); - if (err != CHIP_NO_ERROR || targetInfoStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$TargetNavigatorClusterTargetInfoStruct constructor"); - return nullptr; - } + jmethodID targetInfoStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod(env, targetInfoStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/lang/String;)V", + &targetInfoStructStructCtor_1); + if (err != CHIP_NO_ERROR || targetInfoStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$TargetNavigatorClusterTargetInfoStruct constructor"); + return nullptr; + } - newElement_0 = env->NewObject(targetInfoStructStructClass_1, targetInfoStructStructCtor_1, newElement_0_identifier, - newElement_0_name); + newElement_0 = env->NewObject(targetInfoStructStructClass_1, targetInfoStructStructCtor_1, + newElement_0_identifier, newElement_0_name); + } chip::JniReferences::GetInstance().AddToList(value_targetList, newElement_0); } @@ -7967,28 +8026,30 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & jnivalue_sampledPosition_position, value_sampledPosition_position); } - jclass playbackPositionStructStructClass_0; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$MediaPlaybackClusterPlaybackPositionStruct", - playbackPositionStructStructClass_0); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$MediaPlaybackClusterPlaybackPositionStruct"); - return nullptr; - } + jclass playbackPositionStructStructClass_0; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$MediaPlaybackClusterPlaybackPositionStruct", + playbackPositionStructStructClass_0); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$MediaPlaybackClusterPlaybackPositionStruct"); + return nullptr; + } - jmethodID playbackPositionStructStructCtor_0; - err = chip::JniReferences::GetInstance().FindMethod(env, playbackPositionStructStructClass_0, "", - "(Ljava/lang/Long;Ljava/lang/Long;)V", - &playbackPositionStructStructCtor_0); - if (err != CHIP_NO_ERROR || playbackPositionStructStructCtor_0 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$MediaPlaybackClusterPlaybackPositionStruct constructor"); - return nullptr; - } + jmethodID playbackPositionStructStructCtor_0; + err = chip::JniReferences::GetInstance().FindMethod(env, playbackPositionStructStructClass_0, "", + "(Ljava/lang/Long;Ljava/lang/Long;)V", + &playbackPositionStructStructCtor_0); + if (err != CHIP_NO_ERROR || playbackPositionStructStructCtor_0 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$MediaPlaybackClusterPlaybackPositionStruct constructor"); + return nullptr; + } - value_sampledPosition = env->NewObject(playbackPositionStructStructClass_0, playbackPositionStructStructCtor_0, - value_sampledPosition_updatedAt, value_sampledPosition_position); + value_sampledPosition = env->NewObject(playbackPositionStructStructClass_0, playbackPositionStructStructCtor_0, + value_sampledPosition_updatedAt, value_sampledPosition_position); + } jobject value_playbackSpeed; std::string value_playbackSpeedClassName = "java/lang/Float"; @@ -8248,6 +8309,672 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & } break; } + case app::Clusters::CameraAvStreamManagement::Id: { + using namespace app::Clusters::CameraAvStreamManagement; + switch (aPath.mEventId) + { + case Events::VideoStreamChanged::Id: { + Events::VideoStreamChanged::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value_videoStreamID; + std::string value_videoStreamIDClassName = "java/lang/Integer"; + std::string value_videoStreamIDCtorSignature = "(I)V"; + jint jnivalue_videoStreamID = static_cast(cppValue.videoStreamID); + chip::JniReferences::GetInstance().CreateBoxedObject(value_videoStreamIDClassName.c_str(), + value_videoStreamIDCtorSignature.c_str(), + jnivalue_videoStreamID, value_videoStreamID); + + jobject value_streamType; + if (!cppValue.streamType.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_streamType); + } + else + { + jobject value_streamTypeInsideOptional; + std::string value_streamTypeInsideOptionalClassName = "java/lang/Integer"; + std::string value_streamTypeInsideOptionalCtorSignature = "(I)V"; + jint jnivalue_streamTypeInsideOptional = static_cast(cppValue.streamType.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_streamTypeInsideOptionalClassName.c_str(), value_streamTypeInsideOptionalCtorSignature.c_str(), + jnivalue_streamTypeInsideOptional, value_streamTypeInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(value_streamTypeInsideOptional, value_streamType); + } + + jobject value_videoCodec; + if (!cppValue.videoCodec.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_videoCodec); + } + else + { + jobject value_videoCodecInsideOptional; + std::string value_videoCodecInsideOptionalClassName = "java/lang/Integer"; + std::string value_videoCodecInsideOptionalCtorSignature = "(I)V"; + jint jnivalue_videoCodecInsideOptional = static_cast(cppValue.videoCodec.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_videoCodecInsideOptionalClassName.c_str(), value_videoCodecInsideOptionalCtorSignature.c_str(), + jnivalue_videoCodecInsideOptional, value_videoCodecInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(value_videoCodecInsideOptional, value_videoCodec); + } + + jobject value_minFrameRate; + if (!cppValue.minFrameRate.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_minFrameRate); + } + else + { + jobject value_minFrameRateInsideOptional; + std::string value_minFrameRateInsideOptionalClassName = "java/lang/Integer"; + std::string value_minFrameRateInsideOptionalCtorSignature = "(I)V"; + jint jnivalue_minFrameRateInsideOptional = static_cast(cppValue.minFrameRate.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_minFrameRateInsideOptionalClassName.c_str(), value_minFrameRateInsideOptionalCtorSignature.c_str(), + jnivalue_minFrameRateInsideOptional, value_minFrameRateInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(value_minFrameRateInsideOptional, value_minFrameRate); + } + + jobject value_maxFrameRate; + if (!cppValue.maxFrameRate.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_maxFrameRate); + } + else + { + jobject value_maxFrameRateInsideOptional; + std::string value_maxFrameRateInsideOptionalClassName = "java/lang/Integer"; + std::string value_maxFrameRateInsideOptionalCtorSignature = "(I)V"; + jint jnivalue_maxFrameRateInsideOptional = static_cast(cppValue.maxFrameRate.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_maxFrameRateInsideOptionalClassName.c_str(), value_maxFrameRateInsideOptionalCtorSignature.c_str(), + jnivalue_maxFrameRateInsideOptional, value_maxFrameRateInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(value_maxFrameRateInsideOptional, value_maxFrameRate); + } + + jobject value_minResolution; + if (!cppValue.minResolution.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_minResolution); + } + else + { + jobject value_minResolutionInsideOptional; + jobject value_minResolutionInsideOptional_width; + std::string value_minResolutionInsideOptional_widthClassName = "java/lang/Integer"; + std::string value_minResolutionInsideOptional_widthCtorSignature = "(I)V"; + jint jnivalue_minResolutionInsideOptional_width = static_cast(cppValue.minResolution.Value().width); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_minResolutionInsideOptional_widthClassName.c_str(), + value_minResolutionInsideOptional_widthCtorSignature.c_str(), jnivalue_minResolutionInsideOptional_width, + value_minResolutionInsideOptional_width); + jobject value_minResolutionInsideOptional_height; + std::string value_minResolutionInsideOptional_heightClassName = "java/lang/Integer"; + std::string value_minResolutionInsideOptional_heightCtorSignature = "(I)V"; + jint jnivalue_minResolutionInsideOptional_height = static_cast(cppValue.minResolution.Value().height); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_minResolutionInsideOptional_heightClassName.c_str(), + value_minResolutionInsideOptional_heightCtorSignature.c_str(), jnivalue_minResolutionInsideOptional_height, + value_minResolutionInsideOptional_height); + + { + jclass videoResolutionStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$CameraAvStreamManagementClusterVideoResolutionStruct", + videoResolutionStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$CameraAvStreamManagementClusterVideoResolutionStruct"); + return nullptr; + } + + jmethodID videoResolutionStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod(env, videoResolutionStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;)V", + &videoResolutionStructStructCtor_1); + if (err != CHIP_NO_ERROR || videoResolutionStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$CameraAvStreamManagementClusterVideoResolutionStruct constructor"); + return nullptr; + } + + value_minResolutionInsideOptional = + env->NewObject(videoResolutionStructStructClass_1, videoResolutionStructStructCtor_1, + value_minResolutionInsideOptional_width, value_minResolutionInsideOptional_height); + } + chip::JniReferences::GetInstance().CreateOptional(value_minResolutionInsideOptional, value_minResolution); + } + + jobject value_maxResolution; + if (!cppValue.maxResolution.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_maxResolution); + } + else + { + jobject value_maxResolutionInsideOptional; + jobject value_maxResolutionInsideOptional_width; + std::string value_maxResolutionInsideOptional_widthClassName = "java/lang/Integer"; + std::string value_maxResolutionInsideOptional_widthCtorSignature = "(I)V"; + jint jnivalue_maxResolutionInsideOptional_width = static_cast(cppValue.maxResolution.Value().width); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_maxResolutionInsideOptional_widthClassName.c_str(), + value_maxResolutionInsideOptional_widthCtorSignature.c_str(), jnivalue_maxResolutionInsideOptional_width, + value_maxResolutionInsideOptional_width); + jobject value_maxResolutionInsideOptional_height; + std::string value_maxResolutionInsideOptional_heightClassName = "java/lang/Integer"; + std::string value_maxResolutionInsideOptional_heightCtorSignature = "(I)V"; + jint jnivalue_maxResolutionInsideOptional_height = static_cast(cppValue.maxResolution.Value().height); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_maxResolutionInsideOptional_heightClassName.c_str(), + value_maxResolutionInsideOptional_heightCtorSignature.c_str(), jnivalue_maxResolutionInsideOptional_height, + value_maxResolutionInsideOptional_height); + + { + jclass videoResolutionStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$CameraAvStreamManagementClusterVideoResolutionStruct", + videoResolutionStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$CameraAvStreamManagementClusterVideoResolutionStruct"); + return nullptr; + } + + jmethodID videoResolutionStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod(env, videoResolutionStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;)V", + &videoResolutionStructStructCtor_1); + if (err != CHIP_NO_ERROR || videoResolutionStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$CameraAvStreamManagementClusterVideoResolutionStruct constructor"); + return nullptr; + } + + value_maxResolutionInsideOptional = + env->NewObject(videoResolutionStructStructClass_1, videoResolutionStructStructCtor_1, + value_maxResolutionInsideOptional_width, value_maxResolutionInsideOptional_height); + } + chip::JniReferences::GetInstance().CreateOptional(value_maxResolutionInsideOptional, value_maxResolution); + } + + jobject value_minBitRate; + if (!cppValue.minBitRate.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_minBitRate); + } + else + { + jobject value_minBitRateInsideOptional; + std::string value_minBitRateInsideOptionalClassName = "java/lang/Integer"; + std::string value_minBitRateInsideOptionalCtorSignature = "(I)V"; + jint jnivalue_minBitRateInsideOptional = static_cast(cppValue.minBitRate.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_minBitRateInsideOptionalClassName.c_str(), value_minBitRateInsideOptionalCtorSignature.c_str(), + jnivalue_minBitRateInsideOptional, value_minBitRateInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(value_minBitRateInsideOptional, value_minBitRate); + } + + jobject value_maxBitRate; + if (!cppValue.maxBitRate.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_maxBitRate); + } + else + { + jobject value_maxBitRateInsideOptional; + std::string value_maxBitRateInsideOptionalClassName = "java/lang/Integer"; + std::string value_maxBitRateInsideOptionalCtorSignature = "(I)V"; + jint jnivalue_maxBitRateInsideOptional = static_cast(cppValue.maxBitRate.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_maxBitRateInsideOptionalClassName.c_str(), value_maxBitRateInsideOptionalCtorSignature.c_str(), + jnivalue_maxBitRateInsideOptional, value_maxBitRateInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(value_maxBitRateInsideOptional, value_maxBitRate); + } + + jobject value_minFragmentLen; + if (!cppValue.minFragmentLen.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_minFragmentLen); + } + else + { + jobject value_minFragmentLenInsideOptional; + std::string value_minFragmentLenInsideOptionalClassName = "java/lang/Integer"; + std::string value_minFragmentLenInsideOptionalCtorSignature = "(I)V"; + jint jnivalue_minFragmentLenInsideOptional = static_cast(cppValue.minFragmentLen.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_minFragmentLenInsideOptionalClassName.c_str(), value_minFragmentLenInsideOptionalCtorSignature.c_str(), + jnivalue_minFragmentLenInsideOptional, value_minFragmentLenInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(value_minFragmentLenInsideOptional, value_minFragmentLen); + } + + jobject value_maxFragmentLen; + if (!cppValue.maxFragmentLen.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_maxFragmentLen); + } + else + { + jobject value_maxFragmentLenInsideOptional; + std::string value_maxFragmentLenInsideOptionalClassName = "java/lang/Integer"; + std::string value_maxFragmentLenInsideOptionalCtorSignature = "(I)V"; + jint jnivalue_maxFragmentLenInsideOptional = static_cast(cppValue.maxFragmentLen.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_maxFragmentLenInsideOptionalClassName.c_str(), value_maxFragmentLenInsideOptionalCtorSignature.c_str(), + jnivalue_maxFragmentLenInsideOptional, value_maxFragmentLenInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(value_maxFragmentLenInsideOptional, value_maxFragmentLen); + } + + jclass videoStreamChangedStructClass; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipEventStructs$CameraAvStreamManagementClusterVideoStreamChangedEvent", + videoStreamChangedStructClass); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipEventStructs$CameraAvStreamManagementClusterVideoStreamChangedEvent"); + return nullptr; + } + + jmethodID videoStreamChangedStructCtor; + err = chip::JniReferences::GetInstance().FindMethod( + env, videoStreamChangedStructClass, "", + "(Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/" + "Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;)V", + &videoStreamChangedStructCtor); + if (err != CHIP_NO_ERROR || videoStreamChangedStructCtor == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipEventStructs$CameraAvStreamManagementClusterVideoStreamChangedEvent constructor"); + return nullptr; + } + + jobject value = + env->NewObject(videoStreamChangedStructClass, videoStreamChangedStructCtor, value_videoStreamID, value_streamType, + value_videoCodec, value_minFrameRate, value_maxFrameRate, value_minResolution, value_maxResolution, + value_minBitRate, value_maxBitRate, value_minFragmentLen, value_maxFragmentLen); + + return value; + } + case Events::AudioStreamChanged::Id: { + Events::AudioStreamChanged::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value_audioStreamID; + std::string value_audioStreamIDClassName = "java/lang/Integer"; + std::string value_audioStreamIDCtorSignature = "(I)V"; + jint jnivalue_audioStreamID = static_cast(cppValue.audioStreamID); + chip::JniReferences::GetInstance().CreateBoxedObject(value_audioStreamIDClassName.c_str(), + value_audioStreamIDCtorSignature.c_str(), + jnivalue_audioStreamID, value_audioStreamID); + + jobject value_streamType; + if (!cppValue.streamType.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_streamType); + } + else + { + jobject value_streamTypeInsideOptional; + std::string value_streamTypeInsideOptionalClassName = "java/lang/Integer"; + std::string value_streamTypeInsideOptionalCtorSignature = "(I)V"; + jint jnivalue_streamTypeInsideOptional = static_cast(cppValue.streamType.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_streamTypeInsideOptionalClassName.c_str(), value_streamTypeInsideOptionalCtorSignature.c_str(), + jnivalue_streamTypeInsideOptional, value_streamTypeInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(value_streamTypeInsideOptional, value_streamType); + } + + jobject value_audioCodec; + if (!cppValue.audioCodec.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_audioCodec); + } + else + { + jobject value_audioCodecInsideOptional; + std::string value_audioCodecInsideOptionalClassName = "java/lang/Integer"; + std::string value_audioCodecInsideOptionalCtorSignature = "(I)V"; + jint jnivalue_audioCodecInsideOptional = static_cast(cppValue.audioCodec.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_audioCodecInsideOptionalClassName.c_str(), value_audioCodecInsideOptionalCtorSignature.c_str(), + jnivalue_audioCodecInsideOptional, value_audioCodecInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(value_audioCodecInsideOptional, value_audioCodec); + } + + jobject value_channelCount; + if (!cppValue.channelCount.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_channelCount); + } + else + { + jobject value_channelCountInsideOptional; + std::string value_channelCountInsideOptionalClassName = "java/lang/Integer"; + std::string value_channelCountInsideOptionalCtorSignature = "(I)V"; + jint jnivalue_channelCountInsideOptional = static_cast(cppValue.channelCount.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_channelCountInsideOptionalClassName.c_str(), value_channelCountInsideOptionalCtorSignature.c_str(), + jnivalue_channelCountInsideOptional, value_channelCountInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(value_channelCountInsideOptional, value_channelCount); + } + + jobject value_sampleRate; + if (!cppValue.sampleRate.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_sampleRate); + } + else + { + jobject value_sampleRateInsideOptional; + std::string value_sampleRateInsideOptionalClassName = "java/lang/Long"; + std::string value_sampleRateInsideOptionalCtorSignature = "(J)V"; + jlong jnivalue_sampleRateInsideOptional = static_cast(cppValue.sampleRate.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_sampleRateInsideOptionalClassName.c_str(), value_sampleRateInsideOptionalCtorSignature.c_str(), + jnivalue_sampleRateInsideOptional, value_sampleRateInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(value_sampleRateInsideOptional, value_sampleRate); + } + + jobject value_bitRate; + if (!cppValue.bitRate.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_bitRate); + } + else + { + jobject value_bitRateInsideOptional; + std::string value_bitRateInsideOptionalClassName = "java/lang/Long"; + std::string value_bitRateInsideOptionalCtorSignature = "(J)V"; + jlong jnivalue_bitRateInsideOptional = static_cast(cppValue.bitRate.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_bitRateInsideOptionalClassName.c_str(), value_bitRateInsideOptionalCtorSignature.c_str(), + jnivalue_bitRateInsideOptional, value_bitRateInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(value_bitRateInsideOptional, value_bitRate); + } + + jobject value_bitDepth; + if (!cppValue.bitDepth.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_bitDepth); + } + else + { + jobject value_bitDepthInsideOptional; + std::string value_bitDepthInsideOptionalClassName = "java/lang/Integer"; + std::string value_bitDepthInsideOptionalCtorSignature = "(I)V"; + jint jnivalue_bitDepthInsideOptional = static_cast(cppValue.bitDepth.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_bitDepthInsideOptionalClassName.c_str(), value_bitDepthInsideOptionalCtorSignature.c_str(), + jnivalue_bitDepthInsideOptional, value_bitDepthInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(value_bitDepthInsideOptional, value_bitDepth); + } + + jclass audioStreamChangedStructClass; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipEventStructs$CameraAvStreamManagementClusterAudioStreamChangedEvent", + audioStreamChangedStructClass); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipEventStructs$CameraAvStreamManagementClusterAudioStreamChangedEvent"); + return nullptr; + } + + jmethodID audioStreamChangedStructCtor; + err = chip::JniReferences::GetInstance().FindMethod( + env, audioStreamChangedStructClass, "", + "(Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/" + "Optional;Ljava/util/Optional;)V", + &audioStreamChangedStructCtor); + if (err != CHIP_NO_ERROR || audioStreamChangedStructCtor == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipEventStructs$CameraAvStreamManagementClusterAudioStreamChangedEvent constructor"); + return nullptr; + } + + jobject value = + env->NewObject(audioStreamChangedStructClass, audioStreamChangedStructCtor, value_audioStreamID, value_streamType, + value_audioCodec, value_channelCount, value_sampleRate, value_bitRate, value_bitDepth); + + return value; + } + case Events::SnapshotStreamChanged::Id: { + Events::SnapshotStreamChanged::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value_snapshotStreamID; + std::string value_snapshotStreamIDClassName = "java/lang/Integer"; + std::string value_snapshotStreamIDCtorSignature = "(I)V"; + jint jnivalue_snapshotStreamID = static_cast(cppValue.snapshotStreamID); + chip::JniReferences::GetInstance().CreateBoxedObject(value_snapshotStreamIDClassName.c_str(), + value_snapshotStreamIDCtorSignature.c_str(), + jnivalue_snapshotStreamID, value_snapshotStreamID); + + jobject value_imageCodec; + if (!cppValue.imageCodec.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_imageCodec); + } + else + { + jobject value_imageCodecInsideOptional; + std::string value_imageCodecInsideOptionalClassName = "java/lang/Integer"; + std::string value_imageCodecInsideOptionalCtorSignature = "(I)V"; + jint jnivalue_imageCodecInsideOptional = static_cast(cppValue.imageCodec.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_imageCodecInsideOptionalClassName.c_str(), value_imageCodecInsideOptionalCtorSignature.c_str(), + jnivalue_imageCodecInsideOptional, value_imageCodecInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(value_imageCodecInsideOptional, value_imageCodec); + } + + jobject value_frameRate; + if (!cppValue.frameRate.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_frameRate); + } + else + { + jobject value_frameRateInsideOptional; + std::string value_frameRateInsideOptionalClassName = "java/lang/Integer"; + std::string value_frameRateInsideOptionalCtorSignature = "(I)V"; + jint jnivalue_frameRateInsideOptional = static_cast(cppValue.frameRate.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_frameRateInsideOptionalClassName.c_str(), value_frameRateInsideOptionalCtorSignature.c_str(), + jnivalue_frameRateInsideOptional, value_frameRateInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(value_frameRateInsideOptional, value_frameRate); + } + + jobject value_bitRate; + if (!cppValue.bitRate.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_bitRate); + } + else + { + jobject value_bitRateInsideOptional; + std::string value_bitRateInsideOptionalClassName = "java/lang/Long"; + std::string value_bitRateInsideOptionalCtorSignature = "(J)V"; + jlong jnivalue_bitRateInsideOptional = static_cast(cppValue.bitRate.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_bitRateInsideOptionalClassName.c_str(), value_bitRateInsideOptionalCtorSignature.c_str(), + jnivalue_bitRateInsideOptional, value_bitRateInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(value_bitRateInsideOptional, value_bitRate); + } + + jobject value_minResolution; + if (!cppValue.minResolution.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_minResolution); + } + else + { + jobject value_minResolutionInsideOptional; + jobject value_minResolutionInsideOptional_width; + std::string value_minResolutionInsideOptional_widthClassName = "java/lang/Integer"; + std::string value_minResolutionInsideOptional_widthCtorSignature = "(I)V"; + jint jnivalue_minResolutionInsideOptional_width = static_cast(cppValue.minResolution.Value().width); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_minResolutionInsideOptional_widthClassName.c_str(), + value_minResolutionInsideOptional_widthCtorSignature.c_str(), jnivalue_minResolutionInsideOptional_width, + value_minResolutionInsideOptional_width); + jobject value_minResolutionInsideOptional_height; + std::string value_minResolutionInsideOptional_heightClassName = "java/lang/Integer"; + std::string value_minResolutionInsideOptional_heightCtorSignature = "(I)V"; + jint jnivalue_minResolutionInsideOptional_height = static_cast(cppValue.minResolution.Value().height); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_minResolutionInsideOptional_heightClassName.c_str(), + value_minResolutionInsideOptional_heightCtorSignature.c_str(), jnivalue_minResolutionInsideOptional_height, + value_minResolutionInsideOptional_height); + + { + jclass videoResolutionStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$CameraAvStreamManagementClusterVideoResolutionStruct", + videoResolutionStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$CameraAvStreamManagementClusterVideoResolutionStruct"); + return nullptr; + } + + jmethodID videoResolutionStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod(env, videoResolutionStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;)V", + &videoResolutionStructStructCtor_1); + if (err != CHIP_NO_ERROR || videoResolutionStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$CameraAvStreamManagementClusterVideoResolutionStruct constructor"); + return nullptr; + } + + value_minResolutionInsideOptional = + env->NewObject(videoResolutionStructStructClass_1, videoResolutionStructStructCtor_1, + value_minResolutionInsideOptional_width, value_minResolutionInsideOptional_height); + } + chip::JniReferences::GetInstance().CreateOptional(value_minResolutionInsideOptional, value_minResolution); + } + + jobject value_maxResolution; + if (!cppValue.maxResolution.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_maxResolution); + } + else + { + jobject value_maxResolutionInsideOptional; + jobject value_maxResolutionInsideOptional_width; + std::string value_maxResolutionInsideOptional_widthClassName = "java/lang/Integer"; + std::string value_maxResolutionInsideOptional_widthCtorSignature = "(I)V"; + jint jnivalue_maxResolutionInsideOptional_width = static_cast(cppValue.maxResolution.Value().width); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_maxResolutionInsideOptional_widthClassName.c_str(), + value_maxResolutionInsideOptional_widthCtorSignature.c_str(), jnivalue_maxResolutionInsideOptional_width, + value_maxResolutionInsideOptional_width); + jobject value_maxResolutionInsideOptional_height; + std::string value_maxResolutionInsideOptional_heightClassName = "java/lang/Integer"; + std::string value_maxResolutionInsideOptional_heightCtorSignature = "(I)V"; + jint jnivalue_maxResolutionInsideOptional_height = static_cast(cppValue.maxResolution.Value().height); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_maxResolutionInsideOptional_heightClassName.c_str(), + value_maxResolutionInsideOptional_heightCtorSignature.c_str(), jnivalue_maxResolutionInsideOptional_height, + value_maxResolutionInsideOptional_height); + + { + jclass videoResolutionStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$CameraAvStreamManagementClusterVideoResolutionStruct", + videoResolutionStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$CameraAvStreamManagementClusterVideoResolutionStruct"); + return nullptr; + } + + jmethodID videoResolutionStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod(env, videoResolutionStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;)V", + &videoResolutionStructStructCtor_1); + if (err != CHIP_NO_ERROR || videoResolutionStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$CameraAvStreamManagementClusterVideoResolutionStruct constructor"); + return nullptr; + } + + value_maxResolutionInsideOptional = + env->NewObject(videoResolutionStructStructClass_1, videoResolutionStructStructCtor_1, + value_maxResolutionInsideOptional_width, value_maxResolutionInsideOptional_height); + } + chip::JniReferences::GetInstance().CreateOptional(value_maxResolutionInsideOptional, value_maxResolution); + } + + jobject value_quality; + if (!cppValue.quality.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_quality); + } + else + { + jobject value_qualityInsideOptional; + std::string value_qualityInsideOptionalClassName = "java/lang/Integer"; + std::string value_qualityInsideOptionalCtorSignature = "(I)V"; + jint jnivalue_qualityInsideOptional = static_cast(cppValue.quality.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_qualityInsideOptionalClassName.c_str(), value_qualityInsideOptionalCtorSignature.c_str(), + jnivalue_qualityInsideOptional, value_qualityInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(value_qualityInsideOptional, value_quality); + } + + jclass snapshotStreamChangedStructClass; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipEventStructs$CameraAvStreamManagementClusterSnapshotStreamChangedEvent", + snapshotStreamChangedStructClass); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, + "Could not find class ChipEventStructs$CameraAvStreamManagementClusterSnapshotStreamChangedEvent"); + return nullptr; + } + + jmethodID snapshotStreamChangedStructCtor; + err = chip::JniReferences::GetInstance().FindMethod( + env, snapshotStreamChangedStructClass, "", + "(Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/" + "Optional;Ljava/util/Optional;)V", + &snapshotStreamChangedStructCtor); + if (err != CHIP_NO_ERROR || snapshotStreamChangedStructCtor == nullptr) + { + ChipLogError( + Zcl, "Could not find ChipEventStructs$CameraAvStreamManagementClusterSnapshotStreamChangedEvent constructor"); + return nullptr; + } + + jobject value = env->NewObject(snapshotStreamChangedStructClass, snapshotStreamChangedStructCtor, + value_snapshotStreamID, value_imageCodec, value_frameRate, value_bitRate, + value_minResolution, value_maxResolution, value_quality); + + return value; + } + default: + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; + break; + } + break; + } case app::Clusters::WebRTCTransportProvider::Id: { using namespace app::Clusters::WebRTCTransportProvider; switch (aPath.mEventId) @@ -8455,30 +9182,32 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & chip::JniReferences::GetInstance().CreateOptional(value_arg4_iInsideOptional, value_arg4_i); } - jclass simpleStructStructClass_0; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$UnitTestingClusterSimpleStruct", simpleStructStructClass_0); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$UnitTestingClusterSimpleStruct"); - return nullptr; - } + jclass simpleStructStructClass_0; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$UnitTestingClusterSimpleStruct", simpleStructStructClass_0); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$UnitTestingClusterSimpleStruct"); + return nullptr; + } - jmethodID simpleStructStructCtor_0; - err = chip::JniReferences::GetInstance().FindMethod( - env, simpleStructStructClass_0, "", - "(Ljava/lang/Integer;Ljava/lang/Boolean;Ljava/lang/Integer;[BLjava/lang/String;Ljava/lang/Integer;Ljava/lang/" - "Float;Ljava/lang/Double;Ljava/util/Optional;)V", - &simpleStructStructCtor_0); - if (err != CHIP_NO_ERROR || simpleStructStructCtor_0 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$UnitTestingClusterSimpleStruct constructor"); - return nullptr; - } + jmethodID simpleStructStructCtor_0; + err = chip::JniReferences::GetInstance().FindMethod( + env, simpleStructStructClass_0, "", + "(Ljava/lang/Integer;Ljava/lang/Boolean;Ljava/lang/Integer;[BLjava/lang/String;Ljava/lang/Integer;Ljava/lang/" + "Float;Ljava/lang/Double;Ljava/util/Optional;)V", + &simpleStructStructCtor_0); + if (err != CHIP_NO_ERROR || simpleStructStructCtor_0 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$UnitTestingClusterSimpleStruct constructor"); + return nullptr; + } - value_arg4 = - env->NewObject(simpleStructStructClass_0, simpleStructStructCtor_0, value_arg4_a, value_arg4_b, value_arg4_c, - value_arg4_d, value_arg4_e, value_arg4_f, value_arg4_g, value_arg4_h, value_arg4_i); + value_arg4 = + env->NewObject(simpleStructStructClass_0, simpleStructStructCtor_0, value_arg4_a, value_arg4_b, value_arg4_c, + value_arg4_d, value_arg4_e, value_arg4_f, value_arg4_g, value_arg4_h, value_arg4_i); + } jobject value_arg5; chip::JniReferences::GetInstance().CreateArrayList(value_arg5); @@ -8548,30 +9277,32 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & chip::JniReferences::GetInstance().CreateOptional(newElement_0_iInsideOptional, newElement_0_i); } - jclass simpleStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$UnitTestingClusterSimpleStruct", simpleStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$UnitTestingClusterSimpleStruct"); - return nullptr; - } + jclass simpleStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$UnitTestingClusterSimpleStruct", simpleStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$UnitTestingClusterSimpleStruct"); + return nullptr; + } - jmethodID simpleStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod( - env, simpleStructStructClass_1, "", - "(Ljava/lang/Integer;Ljava/lang/Boolean;Ljava/lang/Integer;[BLjava/lang/String;Ljava/lang/Integer;Ljava/lang/" - "Float;Ljava/lang/Double;Ljava/util/Optional;)V", - &simpleStructStructCtor_1); - if (err != CHIP_NO_ERROR || simpleStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$UnitTestingClusterSimpleStruct constructor"); - return nullptr; - } + jmethodID simpleStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, simpleStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/lang/Boolean;Ljava/lang/Integer;[BLjava/lang/String;Ljava/lang/Integer;Ljava/" + "lang/Float;Ljava/lang/Double;Ljava/util/Optional;)V", + &simpleStructStructCtor_1); + if (err != CHIP_NO_ERROR || simpleStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$UnitTestingClusterSimpleStruct constructor"); + return nullptr; + } - newElement_0 = env->NewObject(simpleStructStructClass_1, simpleStructStructCtor_1, newElement_0_a, newElement_0_b, - newElement_0_c, newElement_0_d, newElement_0_e, newElement_0_f, newElement_0_g, - newElement_0_h, newElement_0_i); + newElement_0 = env->NewObject(simpleStructStructClass_1, simpleStructStructCtor_1, newElement_0_a, + newElement_0_b, newElement_0_c, newElement_0_d, newElement_0_e, newElement_0_f, + newElement_0_g, newElement_0_h, newElement_0_i); + } chip::JniReferences::GetInstance().AddToList(value_arg5, newElement_0); } diff --git a/src/controller/python/chip/clusters/CHIPClusters.py b/src/controller/python/chip/clusters/CHIPClusters.py index e0aec013942a4b..7455412656ad23 100644 --- a/src/controller/python/chip/clusters/CHIPClusters.py +++ b/src/controller/python/chip/clusters/CHIPClusters.py @@ -13035,6 +13035,506 @@ class ChipClusters: }, }, } + _CAMERA_AV_STREAM_MANAGEMENT_CLUSTER_INFO = { + "clusterName": "CameraAvStreamManagement", + "clusterId": 0x00000551, + "commands": { + 0x00000000: { + "commandId": 0x00000000, + "commandName": "AudioStreamAllocate", + "args": { + "streamType": "int", + "audioCodec": "int", + "channelCount": "int", + "sampleRate": "int", + "bitRate": "int", + "bitDepth": "int", + }, + }, + 0x00000002: { + "commandId": 0x00000002, + "commandName": "AudioStreamDeallocate", + "args": { + "audioStreamID": "int", + }, + }, + 0x00000003: { + "commandId": 0x00000003, + "commandName": "VideoStreamAllocate", + "args": { + "streamType": "int", + "videoCodec": "int", + "minFrameRate": "int", + "maxFrameRate": "int", + "minResolution": "VideoResolutionStruct", + "maxResolution": "VideoResolutionStruct", + "minBitRate": "int", + "maxBitRate": "int", + "minFragmentLen": "int", + "maxFragmentLen": "int", + }, + }, + 0x00000005: { + "commandId": 0x00000005, + "commandName": "VideoStreamModify", + "args": { + "videoStreamID": "int", + "resolution": "VideoResolutionStruct", + }, + }, + 0x00000006: { + "commandId": 0x00000006, + "commandName": "VideoStreamDeallocate", + "args": { + "videoStreamID": "int", + }, + }, + 0x00000007: { + "commandId": 0x00000007, + "commandName": "SnapshotStreamAllocate", + "args": { + "imageCodec": "int", + "frameRate": "int", + "bitRate": "int", + "minResolution": "VideoResolutionStruct", + "maxResolution": "VideoResolutionStruct", + "quality": "int", + }, + }, + 0x00000009: { + "commandId": 0x00000009, + "commandName": "SnapshotStreamDeallocate", + "args": { + "snapshotStreamID": "int", + }, + }, + 0x0000000A: { + "commandId": 0x0000000A, + "commandName": "SetStreamPriority", + "args": { + }, + }, + 0x0000000B: { + "commandId": 0x0000000B, + "commandName": "CaptureSnapshot", + "args": { + "snapshotStreamID": "int", + "requestedResolution": "VideoResolutionStruct", + }, + }, + 0x0000000D: { + "commandId": 0x0000000D, + "commandName": "SetViewport", + "args": { + "viewport": "ViewportStruct", + }, + }, + 0x0000000E: { + "commandId": 0x0000000E, + "commandName": "SetImageRotation", + "args": { + "angle": "int", + }, + }, + 0x0000000F: { + "commandId": 0x0000000F, + "commandName": "SetImageFlipHorizontal", + "args": { + "enabled": "bool", + }, + }, + 0x00000010: { + "commandId": 0x00000010, + "commandName": "SetImageFlipVertical", + "args": { + "enabled": "bool", + }, + }, + 0x00000011: { + "commandId": 0x00000011, + "commandName": "SetWatermark", + "args": { + "videoStreamID": "int", + "enabled": "bool", + }, + }, + 0x00000012: { + "commandId": 0x00000012, + "commandName": "SetOSD", + "args": { + "videoStreamID": "int", + "enabled": "bool", + }, + }, + }, + "attributes": { + 0x00000000: { + "attributeName": "MaxConcurrentVideoEncoders", + "attributeId": 0x00000000, + "type": "int", + "reportable": True, + }, + 0x00000001: { + "attributeName": "MaxEncodedPixelRate", + "attributeId": 0x00000001, + "type": "int", + "reportable": True, + }, + 0x00000002: { + "attributeName": "VideoSensorParams", + "attributeId": 0x00000002, + "type": "", + "reportable": True, + }, + 0x00000003: { + "attributeName": "NightVisionCapable", + "attributeId": 0x00000003, + "type": "bool", + "reportable": True, + }, + 0x00000004: { + "attributeName": "MinViewPortWidth", + "attributeId": 0x00000004, + "type": "", + "reportable": True, + }, + 0x00000005: { + "attributeName": "MinViewPortHeight", + "attributeId": 0x00000005, + "type": "", + "reportable": True, + }, + 0x00000006: { + "attributeName": "RateDistortionTradeOffPoints", + "attributeId": 0x00000006, + "type": "", + "reportable": True, + }, + 0x00000007: { + "attributeName": "MaxPreRollBufferSize", + "attributeId": 0x00000007, + "type": "int", + "reportable": True, + }, + 0x00000008: { + "attributeName": "MicrophoneCapabilities", + "attributeId": 0x00000008, + "type": "", + "reportable": True, + }, + 0x00000009: { + "attributeName": "SpeakerCapabilities", + "attributeId": 0x00000009, + "type": "", + "reportable": True, + }, + 0x0000000A: { + "attributeName": "TwoWayTalkSupport", + "attributeId": 0x0000000A, + "type": "int", + "reportable": True, + }, + 0x0000000B: { + "attributeName": "SupportedSnapshotParams", + "attributeId": 0x0000000B, + "type": "", + "reportable": True, + }, + 0x0000000C: { + "attributeName": "HDRCapable", + "attributeId": 0x0000000C, + "type": "bool", + "reportable": True, + }, + 0x0000000D: { + "attributeName": "MaxNetworkBandwidth", + "attributeId": 0x0000000D, + "type": "int", + "reportable": True, + }, + 0x0000000E: { + "attributeName": "CurrentFrameRate", + "attributeId": 0x0000000E, + "type": "int", + "reportable": True, + }, + 0x0000000F: { + "attributeName": "HDRMode", + "attributeId": 0x0000000F, + "type": "bool", + "reportable": True, + "writable": True, + }, + 0x00000010: { + "attributeName": "CurrentVideoCodecs", + "attributeId": 0x00000010, + "type": "int", + "reportable": True, + }, + 0x00000011: { + "attributeName": "CurrentSnapshotConfig", + "attributeId": 0x00000011, + "type": "", + "reportable": True, + }, + 0x00000012: { + "attributeName": "FabricsUsingCamera", + "attributeId": 0x00000012, + "type": "int", + "reportable": True, + }, + 0x00000013: { + "attributeName": "AllocatedVideoStreams", + "attributeId": 0x00000013, + "type": "", + "reportable": True, + }, + 0x00000014: { + "attributeName": "AllocatedAudioStreams", + "attributeId": 0x00000014, + "type": "", + "reportable": True, + }, + 0x00000015: { + "attributeName": "AllocatedSnapshotStreams", + "attributeId": 0x00000015, + "type": "", + "reportable": True, + }, + 0x00000016: { + "attributeName": "RankedVideoStreamPrioritiesList", + "attributeId": 0x00000016, + "type": "int", + "reportable": True, + "writable": True, + }, + 0x00000017: { + "attributeName": "SoftRecordingPrivacyModeSetting", + "attributeId": 0x00000017, + "type": "bool", + "reportable": True, + "writable": True, + }, + 0x00000018: { + "attributeName": "SoftLivestreamPrivacyModeSetting", + "attributeId": 0x00000018, + "type": "bool", + "reportable": True, + "writable": True, + }, + 0x00000019: { + "attributeName": "HardPrivacyMode", + "attributeId": 0x00000019, + "type": "bool", + "reportable": True, + }, + 0x0000001A: { + "attributeName": "NightVision", + "attributeId": 0x0000001A, + "type": "int", + "reportable": True, + "writable": True, + }, + 0x0000001B: { + "attributeName": "NightVisionIllum", + "attributeId": 0x0000001B, + "type": "int", + "reportable": True, + "writable": True, + }, + 0x0000001C: { + "attributeName": "Awb", + "attributeId": 0x0000001C, + "type": "bool", + "reportable": True, + "writable": True, + }, + 0x0000001D: { + "attributeName": "ShutterSpeed", + "attributeId": 0x0000001D, + "type": "bool", + "reportable": True, + "writable": True, + }, + 0x0000001E: { + "attributeName": "Iso", + "attributeId": 0x0000001E, + "type": "bool", + "reportable": True, + "writable": True, + }, + 0x0000001F: { + "attributeName": "Viewport", + "attributeId": 0x0000001F, + "type": "", + "reportable": True, + }, + 0x00000020: { + "attributeName": "SpeakerEnabled", + "attributeId": 0x00000020, + "type": "bool", + "reportable": True, + "writable": True, + }, + 0x00000021: { + "attributeName": "SpeakerVolumeLevel", + "attributeId": 0x00000021, + "type": "int", + "reportable": True, + "writable": True, + }, + 0x00000022: { + "attributeName": "SpeakerMaxLevel", + "attributeId": 0x00000022, + "type": "int", + "reportable": True, + "writable": True, + }, + 0x00000023: { + "attributeName": "SpeakerMinLevel", + "attributeId": 0x00000023, + "type": "int", + "reportable": True, + "writable": True, + }, + 0x00000024: { + "attributeName": "MicStatus", + "attributeId": 0x00000024, + "type": "bool", + "reportable": True, + "writable": True, + }, + 0x00000025: { + "attributeName": "MicVolumeLevel", + "attributeId": 0x00000025, + "type": "int", + "reportable": True, + "writable": True, + }, + 0x00000026: { + "attributeName": "MicMaxLevel", + "attributeId": 0x00000026, + "type": "int", + "reportable": True, + "writable": True, + }, + 0x00000027: { + "attributeName": "MicMinLevel", + "attributeId": 0x00000027, + "type": "int", + "reportable": True, + "writable": True, + }, + 0x00000028: { + "attributeName": "MicAGCEnabled", + "attributeId": 0x00000028, + "type": "bool", + "reportable": True, + "writable": True, + }, + 0x00000029: { + "attributeName": "ImageRotation", + "attributeId": 0x00000029, + "type": "int", + "reportable": True, + }, + 0x0000002A: { + "attributeName": "ImageFlipHorizontal", + "attributeId": 0x0000002A, + "type": "bool", + "reportable": True, + }, + 0x0000002B: { + "attributeName": "ImageFlipVertical", + "attributeId": 0x0000002B, + "type": "bool", + "reportable": True, + }, + 0x0000002C: { + "attributeName": "LocalVideoRecordingEnabled", + "attributeId": 0x0000002C, + "type": "bool", + "reportable": True, + "writable": True, + }, + 0x0000002D: { + "attributeName": "LocalSnapshotRecordingEnabled", + "attributeId": 0x0000002D, + "type": "bool", + "reportable": True, + "writable": True, + }, + 0x0000002E: { + "attributeName": "StatusLight", + "attributeId": 0x0000002E, + "type": "bool", + "reportable": True, + "writable": True, + }, + 0x0000002F: { + "attributeName": "StatusLightBrightness", + "attributeId": 0x0000002F, + "type": "int", + "reportable": True, + "writable": True, + }, + 0x00000030: { + "attributeName": "DepthSensorStatus", + "attributeId": 0x00000030, + "type": "int", + "reportable": True, + "writable": True, + }, + 0x00000031: { + "attributeName": "WatermarkEnabled", + "attributeId": 0x00000031, + "type": "", + "reportable": True, + }, + 0x00000032: { + "attributeName": "OSDEnabled", + "attributeId": 0x00000032, + "type": "", + "reportable": True, + }, + 0x0000FFF8: { + "attributeName": "GeneratedCommandList", + "attributeId": 0x0000FFF8, + "type": "int", + "reportable": True, + }, + 0x0000FFF9: { + "attributeName": "AcceptedCommandList", + "attributeId": 0x0000FFF9, + "type": "int", + "reportable": True, + }, + 0x0000FFFA: { + "attributeName": "EventList", + "attributeId": 0x0000FFFA, + "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, + }, + }, + } _WEB_RTC_TRANSPORT_PROVIDER_CLUSTER_INFO = { "clusterName": "WebRTCTransportProvider", "clusterId": 0x00000553, @@ -14537,6 +15037,7 @@ class ChipClusters: 0x0000050E: _ACCOUNT_LOGIN_CLUSTER_INFO, 0x0000050F: _CONTENT_CONTROL_CLUSTER_INFO, 0x00000510: _CONTENT_APP_OBSERVER_CLUSTER_INFO, + 0x00000551: _CAMERA_AV_STREAM_MANAGEMENT_CLUSTER_INFO, 0x00000553: _WEB_RTC_TRANSPORT_PROVIDER_CLUSTER_INFO, 0x00000554: _WEB_RTC_TRANSPORT_REQUESTOR_CLUSTER_INFO, 0x00000556: _CHIME_CLUSTER_INFO, @@ -14665,6 +15166,7 @@ class ChipClusters: "AccountLogin": _ACCOUNT_LOGIN_CLUSTER_INFO, "ContentControl": _CONTENT_CONTROL_CLUSTER_INFO, "ContentAppObserver": _CONTENT_APP_OBSERVER_CLUSTER_INFO, + "CameraAvStreamManagement": _CAMERA_AV_STREAM_MANAGEMENT_CLUSTER_INFO, "WebRTCTransportProvider": _WEB_RTC_TRANSPORT_PROVIDER_CLUSTER_INFO, "WebRTCTransportRequestor": _WEB_RTC_TRANSPORT_REQUESTOR_CLUSTER_INFO, "Chime": _CHIME_CLUSTER_INFO, diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index 2daa5e799b6589..a4fb9c86f1e41d 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -156,6 +156,7 @@ "AccountLogin", "ContentControl", "ContentAppObserver", + "CameraAvStreamManagement", "WebRTCTransportProvider", "WebRTCTransportRequestor", "Chime", @@ -46537,6 +46538,1762 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: value: 'uint' = 0 +@dataclass +class CameraAvStreamManagement(Cluster): + id: typing.ClassVar[int] = 0x00000551 + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="maxConcurrentVideoEncoders", Tag=0x00000000, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="maxEncodedPixelRate", Tag=0x00000001, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="videoSensorParams", Tag=0x00000002, Type=typing.Optional[CameraAvStreamManagement.Structs.VideoSensorParamsStruct]), + ClusterObjectFieldDescriptor(Label="nightVisionCapable", Tag=0x00000003, Type=typing.Optional[bool]), + ClusterObjectFieldDescriptor(Label="minViewPortWidth", Tag=0x00000004, Type=typing.Optional[CameraAvStreamManagement.Structs.VideoResolutionStruct]), + ClusterObjectFieldDescriptor(Label="minViewPortHeight", Tag=0x00000005, Type=typing.Optional[CameraAvStreamManagement.Structs.VideoResolutionStruct]), + ClusterObjectFieldDescriptor(Label="rateDistortionTradeOffPoints", Tag=0x00000006, Type=typing.Optional[typing.List[CameraAvStreamManagement.Structs.RateDistortionTradeOffPointsStruct]]), + ClusterObjectFieldDescriptor(Label="maxPreRollBufferSize", Tag=0x00000007, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="microphoneCapabilities", Tag=0x00000008, Type=typing.Optional[CameraAvStreamManagement.Structs.AudioCapabilitiesStruct]), + ClusterObjectFieldDescriptor(Label="speakerCapabilities", Tag=0x00000009, Type=typing.Union[None, Nullable, CameraAvStreamManagement.Structs.AudioCapabilitiesStruct]), + ClusterObjectFieldDescriptor(Label="twoWayTalkSupport", Tag=0x0000000A, Type=typing.Optional[CameraAvStreamManagement.Enums.TwoWayTalkSupportTypeEnum]), + ClusterObjectFieldDescriptor(Label="supportedSnapshotParams", Tag=0x0000000B, Type=typing.Optional[typing.List[CameraAvStreamManagement.Structs.SnapshotParamsStruct]]), + ClusterObjectFieldDescriptor(Label="HDRCapable", Tag=0x0000000C, Type=typing.Optional[bool]), + ClusterObjectFieldDescriptor(Label="maxNetworkBandwidth", Tag=0x0000000D, Type=uint), + ClusterObjectFieldDescriptor(Label="currentFrameRate", Tag=0x0000000E, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="HDRMode", Tag=0x0000000F, Type=typing.Optional[bool]), + ClusterObjectFieldDescriptor(Label="currentVideoCodecs", Tag=0x00000010, Type=typing.Optional[typing.List[CameraAvStreamManagement.Enums.VideoCodecEnum]]), + ClusterObjectFieldDescriptor(Label="currentSnapshotConfig", Tag=0x00000011, Type=typing.Optional[CameraAvStreamManagement.Structs.SnapshotParamsStruct]), + ClusterObjectFieldDescriptor(Label="fabricsUsingCamera", Tag=0x00000012, Type=typing.List[uint]), + ClusterObjectFieldDescriptor(Label="allocatedVideoStreams", Tag=0x00000013, Type=typing.Optional[typing.List[CameraAvStreamManagement.Structs.VideoStreamStruct]]), + ClusterObjectFieldDescriptor(Label="allocatedAudioStreams", Tag=0x00000014, Type=typing.Optional[typing.List[CameraAvStreamManagement.Structs.AudioStreamStruct]]), + ClusterObjectFieldDescriptor(Label="allocatedSnapshotStreams", Tag=0x00000015, Type=typing.Optional[typing.List[CameraAvStreamManagement.Structs.SnapshotStreamStruct]]), + ClusterObjectFieldDescriptor(Label="rankedVideoStreamPrioritiesList", Tag=0x00000016, Type=typing.Optional[typing.List[CameraAvStreamManagement.Enums.StreamTypeEnum]]), + ClusterObjectFieldDescriptor(Label="softRecordingPrivacyModeSetting", Tag=0x00000017, Type=typing.Optional[bool]), + ClusterObjectFieldDescriptor(Label="softLivestreamPrivacyModeSetting", Tag=0x00000018, Type=typing.Optional[bool]), + ClusterObjectFieldDescriptor(Label="hardPrivacyMode", Tag=0x00000019, Type=typing.Optional[bool]), + ClusterObjectFieldDescriptor(Label="nightVision", Tag=0x0000001A, Type=typing.Optional[CameraAvStreamManagement.Enums.TriStateAutoEnum]), + ClusterObjectFieldDescriptor(Label="nightVisionIllum", Tag=0x0000001B, Type=typing.Optional[CameraAvStreamManagement.Enums.TriStateAutoEnum]), + ClusterObjectFieldDescriptor(Label="awb", Tag=0x0000001C, Type=typing.Optional[bool]), + ClusterObjectFieldDescriptor(Label="shutterSpeed", Tag=0x0000001D, Type=typing.Optional[bool]), + ClusterObjectFieldDescriptor(Label="iso", Tag=0x0000001E, Type=typing.Optional[bool]), + ClusterObjectFieldDescriptor(Label="viewport", Tag=0x0000001F, Type=typing.Optional[CameraAvStreamManagement.Structs.ViewportStruct]), + ClusterObjectFieldDescriptor(Label="speakerEnabled", Tag=0x00000020, Type=typing.Optional[bool]), + ClusterObjectFieldDescriptor(Label="speakerVolumeLevel", Tag=0x00000021, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="speakerMaxLevel", Tag=0x00000022, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="speakerMinLevel", Tag=0x00000023, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="micStatus", Tag=0x00000024, Type=typing.Optional[bool]), + ClusterObjectFieldDescriptor(Label="micVolumeLevel", Tag=0x00000025, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="micMaxLevel", Tag=0x00000026, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="micMinLevel", Tag=0x00000027, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="micAGCEnabled", Tag=0x00000028, Type=typing.Optional[bool]), + ClusterObjectFieldDescriptor(Label="imageRotation", Tag=0x00000029, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="imageFlipHorizontal", Tag=0x0000002A, Type=typing.Optional[bool]), + ClusterObjectFieldDescriptor(Label="imageFlipVertical", Tag=0x0000002B, Type=typing.Optional[bool]), + ClusterObjectFieldDescriptor(Label="localVideoRecordingEnabled", Tag=0x0000002C, Type=typing.Optional[bool]), + ClusterObjectFieldDescriptor(Label="localSnapshotRecordingEnabled", Tag=0x0000002D, Type=typing.Optional[bool]), + ClusterObjectFieldDescriptor(Label="statusLight", Tag=0x0000002E, Type=typing.Optional[bool]), + ClusterObjectFieldDescriptor(Label="statusLightBrightness", Tag=0x0000002F, Type=typing.Optional[Globals.Enums.ThreeLevelAutoEnum]), + ClusterObjectFieldDescriptor(Label="depthSensorStatus", Tag=0x00000030, Type=typing.Optional[CameraAvStreamManagement.Enums.TriStateAutoEnum]), + ClusterObjectFieldDescriptor(Label="watermarkEnabled", Tag=0x00000031, Type=typing.Optional[typing.List[CameraAvStreamManagement.Structs.PerStreamStruct]]), + ClusterObjectFieldDescriptor(Label="OSDEnabled", Tag=0x00000032, Type=typing.Optional[typing.List[CameraAvStreamManagement.Structs.PerStreamStruct]]), + ClusterObjectFieldDescriptor(Label="generatedCommandList", Tag=0x0000FFF8, Type=typing.List[uint]), + ClusterObjectFieldDescriptor(Label="acceptedCommandList", Tag=0x0000FFF9, Type=typing.List[uint]), + ClusterObjectFieldDescriptor(Label="eventList", Tag=0x0000FFFA, 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), + ]) + + maxConcurrentVideoEncoders: 'typing.Optional[uint]' = None + maxEncodedPixelRate: 'typing.Optional[uint]' = None + videoSensorParams: 'typing.Optional[CameraAvStreamManagement.Structs.VideoSensorParamsStruct]' = None + nightVisionCapable: 'typing.Optional[bool]' = None + minViewPortWidth: 'typing.Optional[CameraAvStreamManagement.Structs.VideoResolutionStruct]' = None + minViewPortHeight: 'typing.Optional[CameraAvStreamManagement.Structs.VideoResolutionStruct]' = None + rateDistortionTradeOffPoints: 'typing.Optional[typing.List[CameraAvStreamManagement.Structs.RateDistortionTradeOffPointsStruct]]' = None + maxPreRollBufferSize: 'typing.Optional[uint]' = None + microphoneCapabilities: 'typing.Optional[CameraAvStreamManagement.Structs.AudioCapabilitiesStruct]' = None + speakerCapabilities: 'typing.Union[None, Nullable, CameraAvStreamManagement.Structs.AudioCapabilitiesStruct]' = None + twoWayTalkSupport: 'typing.Optional[CameraAvStreamManagement.Enums.TwoWayTalkSupportTypeEnum]' = None + supportedSnapshotParams: 'typing.Optional[typing.List[CameraAvStreamManagement.Structs.SnapshotParamsStruct]]' = None + HDRCapable: 'typing.Optional[bool]' = None + maxNetworkBandwidth: 'uint' = None + currentFrameRate: 'typing.Optional[uint]' = None + HDRMode: 'typing.Optional[bool]' = None + currentVideoCodecs: 'typing.Optional[typing.List[CameraAvStreamManagement.Enums.VideoCodecEnum]]' = None + currentSnapshotConfig: 'typing.Optional[CameraAvStreamManagement.Structs.SnapshotParamsStruct]' = None + fabricsUsingCamera: 'typing.List[uint]' = None + allocatedVideoStreams: 'typing.Optional[typing.List[CameraAvStreamManagement.Structs.VideoStreamStruct]]' = None + allocatedAudioStreams: 'typing.Optional[typing.List[CameraAvStreamManagement.Structs.AudioStreamStruct]]' = None + allocatedSnapshotStreams: 'typing.Optional[typing.List[CameraAvStreamManagement.Structs.SnapshotStreamStruct]]' = None + rankedVideoStreamPrioritiesList: 'typing.Optional[typing.List[CameraAvStreamManagement.Enums.StreamTypeEnum]]' = None + softRecordingPrivacyModeSetting: 'typing.Optional[bool]' = None + softLivestreamPrivacyModeSetting: 'typing.Optional[bool]' = None + hardPrivacyMode: 'typing.Optional[bool]' = None + nightVision: 'typing.Optional[CameraAvStreamManagement.Enums.TriStateAutoEnum]' = None + nightVisionIllum: 'typing.Optional[CameraAvStreamManagement.Enums.TriStateAutoEnum]' = None + awb: 'typing.Optional[bool]' = None + shutterSpeed: 'typing.Optional[bool]' = None + iso: 'typing.Optional[bool]' = None + viewport: 'typing.Optional[CameraAvStreamManagement.Structs.ViewportStruct]' = None + speakerEnabled: 'typing.Optional[bool]' = None + speakerVolumeLevel: 'typing.Optional[uint]' = None + speakerMaxLevel: 'typing.Optional[uint]' = None + speakerMinLevel: 'typing.Optional[uint]' = None + micStatus: 'typing.Optional[bool]' = None + micVolumeLevel: 'typing.Optional[uint]' = None + micMaxLevel: 'typing.Optional[uint]' = None + micMinLevel: 'typing.Optional[uint]' = None + micAGCEnabled: 'typing.Optional[bool]' = None + imageRotation: 'typing.Optional[uint]' = None + imageFlipHorizontal: 'typing.Optional[bool]' = None + imageFlipVertical: 'typing.Optional[bool]' = None + localVideoRecordingEnabled: 'typing.Optional[bool]' = None + localSnapshotRecordingEnabled: 'typing.Optional[bool]' = None + statusLight: 'typing.Optional[bool]' = None + statusLightBrightness: 'typing.Optional[Globals.Enums.ThreeLevelAutoEnum]' = None + depthSensorStatus: 'typing.Optional[CameraAvStreamManagement.Enums.TriStateAutoEnum]' = None + watermarkEnabled: 'typing.Optional[typing.List[CameraAvStreamManagement.Structs.PerStreamStruct]]' = None + OSDEnabled: 'typing.Optional[typing.List[CameraAvStreamManagement.Structs.PerStreamStruct]]' = None + generatedCommandList: 'typing.List[uint]' = None + acceptedCommandList: 'typing.List[uint]' = None + eventList: 'typing.List[uint]' = None + attributeList: 'typing.List[uint]' = None + featureMap: 'uint' = None + clusterRevision: 'uint' = None + + class Enums: + class AudioCodecEnum(MatterIntEnum): + kOpus = 0x00 + kAacLc = 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 ImageCodecEnum(MatterIntEnum): + kJpeg = 0x00 + # All received enum values that are not listed above will be mapped + # to kUnknownEnumValue. This is a helper enum value that should only + # be used by code to process how it handles receiving an unknown + # enum value. This specific value should never be transmitted. + kUnknownEnumValue = 1, + + class StreamTypeEnum(MatterIntEnum): + kInternal = 0x00 + kRecording = 0x01 + kAnalysis = 0x02 + kLiveView = 0x03 + # All received enum values that are not listed above will be mapped + # to kUnknownEnumValue. This is a helper enum value that should only + # be used by code to process how it handles receiving an unknown + # enum value. This specific value should never be transmitted. + kUnknownEnumValue = 4, + + class TriStateAutoEnum(MatterIntEnum): + kOff = 0x00 + kOn = 0x01 + kAuto = 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 TwoWayTalkSupportTypeEnum(MatterIntEnum): + kNotSupported = 0x00 + kHalfDuplex = 0x01 + kFullDuplex = 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 VideoCodecEnum(MatterIntEnum): + kH264 = 0x00 + kHevc = 0x01 + kVvc = 0x02 + kAv1 = 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 Feature(IntFlag): + kPrivacy = 0x1 + kSensorControl = 0x2 + kAudio = 0x4 + kImageControl = 0x8 + kVideo = 0x10 + kSnapshot = 0x20 + kLocalStorage = 0x40 + + class Structs: + @dataclass + class VideoResolutionStruct(ClusterObject): + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="width", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="height", Tag=1, Type=uint), + ]) + + width: 'uint' = 0 + height: 'uint' = 0 + + @dataclass + class VideoStreamStruct(ClusterObject): + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="videoStreamID", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="streamType", Tag=1, Type=CameraAvStreamManagement.Enums.StreamTypeEnum), + ClusterObjectFieldDescriptor(Label="videoCodec", Tag=2, Type=CameraAvStreamManagement.Enums.VideoCodecEnum), + ClusterObjectFieldDescriptor(Label="minFrameRate", Tag=3, Type=uint), + ClusterObjectFieldDescriptor(Label="maxFrameRate", Tag=4, Type=uint), + ClusterObjectFieldDescriptor(Label="minResolution", Tag=5, Type=CameraAvStreamManagement.Structs.VideoResolutionStruct), + ClusterObjectFieldDescriptor(Label="maxResolution", Tag=6, Type=CameraAvStreamManagement.Structs.VideoResolutionStruct), + ClusterObjectFieldDescriptor(Label="minBitRate", Tag=7, Type=uint), + ClusterObjectFieldDescriptor(Label="maxBitRate", Tag=8, Type=uint), + ClusterObjectFieldDescriptor(Label="minFragmentLen", Tag=9, Type=uint), + ClusterObjectFieldDescriptor(Label="maxFragmentLen", Tag=10, Type=uint), + ClusterObjectFieldDescriptor(Label="referenceCount", Tag=11, Type=uint), + ]) + + videoStreamID: 'uint' = 0 + streamType: 'CameraAvStreamManagement.Enums.StreamTypeEnum' = 0 + videoCodec: 'CameraAvStreamManagement.Enums.VideoCodecEnum' = 0 + minFrameRate: 'uint' = 0 + maxFrameRate: 'uint' = 0 + minResolution: 'CameraAvStreamManagement.Structs.VideoResolutionStruct' = field(default_factory=lambda: CameraAvStreamManagement.Structs.VideoResolutionStruct()) + maxResolution: 'CameraAvStreamManagement.Structs.VideoResolutionStruct' = field(default_factory=lambda: CameraAvStreamManagement.Structs.VideoResolutionStruct()) + minBitRate: 'uint' = 0 + maxBitRate: 'uint' = 0 + minFragmentLen: 'uint' = 0 + maxFragmentLen: 'uint' = 0 + referenceCount: 'uint' = 0 + + @dataclass + class SnapshotStreamStruct(ClusterObject): + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="snapshotStreamID", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="imageCodec", Tag=1, Type=CameraAvStreamManagement.Enums.ImageCodecEnum), + ClusterObjectFieldDescriptor(Label="frameRate", Tag=2, Type=uint), + ClusterObjectFieldDescriptor(Label="bitRate", Tag=3, Type=uint), + ClusterObjectFieldDescriptor(Label="minResolution", Tag=4, Type=CameraAvStreamManagement.Structs.VideoResolutionStruct), + ClusterObjectFieldDescriptor(Label="maxResolution", Tag=5, Type=CameraAvStreamManagement.Structs.VideoResolutionStruct), + ClusterObjectFieldDescriptor(Label="quality", Tag=6, Type=uint), + ClusterObjectFieldDescriptor(Label="referenceCount", Tag=7, Type=uint), + ]) + + snapshotStreamID: 'uint' = 0 + imageCodec: 'CameraAvStreamManagement.Enums.ImageCodecEnum' = 0 + frameRate: 'uint' = 0 + bitRate: 'uint' = 0 + minResolution: 'CameraAvStreamManagement.Structs.VideoResolutionStruct' = field(default_factory=lambda: CameraAvStreamManagement.Structs.VideoResolutionStruct()) + maxResolution: 'CameraAvStreamManagement.Structs.VideoResolutionStruct' = field(default_factory=lambda: CameraAvStreamManagement.Structs.VideoResolutionStruct()) + quality: 'uint' = 0 + referenceCount: 'uint' = 0 + + @dataclass + class SnapshotParamsStruct(ClusterObject): + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="resolution", Tag=0, Type=CameraAvStreamManagement.Structs.VideoResolutionStruct), + ClusterObjectFieldDescriptor(Label="maxFrameRate", Tag=1, Type=uint), + ClusterObjectFieldDescriptor(Label="imageCodec", Tag=2, Type=CameraAvStreamManagement.Enums.ImageCodecEnum), + ]) + + resolution: 'CameraAvStreamManagement.Structs.VideoResolutionStruct' = field(default_factory=lambda: CameraAvStreamManagement.Structs.VideoResolutionStruct()) + maxFrameRate: 'uint' = 0 + imageCodec: 'CameraAvStreamManagement.Enums.ImageCodecEnum' = 0 + + @dataclass + class RateDistortionTradeOffPointsStruct(ClusterObject): + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="codec", Tag=0, Type=CameraAvStreamManagement.Enums.VideoCodecEnum), + ClusterObjectFieldDescriptor(Label="resolution", Tag=1, Type=CameraAvStreamManagement.Structs.VideoResolutionStruct), + ClusterObjectFieldDescriptor(Label="minBitRate", Tag=2, Type=uint), + ]) + + codec: 'CameraAvStreamManagement.Enums.VideoCodecEnum' = 0 + resolution: 'CameraAvStreamManagement.Structs.VideoResolutionStruct' = field(default_factory=lambda: CameraAvStreamManagement.Structs.VideoResolutionStruct()) + minBitRate: 'uint' = 0 + + @dataclass + class AudioCapabilitiesStruct(ClusterObject): + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="maxNumberOfChannels", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="supportedCodecs", Tag=1, Type=typing.List[CameraAvStreamManagement.Enums.AudioCodecEnum]), + ClusterObjectFieldDescriptor(Label="supportedSampleRates", Tag=2, Type=typing.List[uint]), + ClusterObjectFieldDescriptor(Label="supportedBitDepths", Tag=3, Type=typing.List[uint]), + ]) + + maxNumberOfChannels: 'uint' = 0 + supportedCodecs: 'typing.List[CameraAvStreamManagement.Enums.AudioCodecEnum]' = field(default_factory=lambda: []) + supportedSampleRates: 'typing.List[uint]' = field(default_factory=lambda: []) + supportedBitDepths: 'typing.List[uint]' = field(default_factory=lambda: []) + + @dataclass + class AudioStreamStruct(ClusterObject): + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="audioStreamID", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="streamType", Tag=1, Type=CameraAvStreamManagement.Enums.StreamTypeEnum), + ClusterObjectFieldDescriptor(Label="audioCodec", Tag=2, Type=CameraAvStreamManagement.Enums.AudioCodecEnum), + ClusterObjectFieldDescriptor(Label="channelCount", Tag=3, Type=uint), + ClusterObjectFieldDescriptor(Label="sampleRate", Tag=4, Type=uint), + ClusterObjectFieldDescriptor(Label="bitRate", Tag=5, Type=uint), + ClusterObjectFieldDescriptor(Label="bitDepth", Tag=6, Type=uint), + ClusterObjectFieldDescriptor(Label="referenceCount", Tag=7, Type=uint), + ]) + + audioStreamID: 'uint' = 0 + streamType: 'CameraAvStreamManagement.Enums.StreamTypeEnum' = 0 + audioCodec: 'CameraAvStreamManagement.Enums.AudioCodecEnum' = 0 + channelCount: 'uint' = 0 + sampleRate: 'uint' = 0 + bitRate: 'uint' = 0 + bitDepth: 'uint' = 0 + referenceCount: 'uint' = 0 + + @dataclass + class PerStreamStruct(ClusterObject): + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="streamID", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="enabled", Tag=1, Type=bool), + ]) + + streamID: 'uint' = 0 + enabled: 'bool' = False + + @dataclass + class VideoSensorParamsStruct(ClusterObject): + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="sensorWidth", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="sensorHeight", Tag=1, Type=uint), + ClusterObjectFieldDescriptor(Label="HDRCapable", Tag=2, Type=bool), + ClusterObjectFieldDescriptor(Label="maxFPS", Tag=3, Type=uint), + ClusterObjectFieldDescriptor(Label="maxHDRFPS", Tag=4, Type=uint), + ]) + + sensorWidth: 'uint' = 0 + sensorHeight: 'uint' = 0 + HDRCapable: 'bool' = False + maxFPS: 'uint' = 0 + maxHDRFPS: 'uint' = 0 + + @dataclass + class ViewportStruct(ClusterObject): + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="x1", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="y1", Tag=1, Type=uint), + ClusterObjectFieldDescriptor(Label="x2", Tag=2, Type=uint), + ClusterObjectFieldDescriptor(Label="y2", Tag=3, Type=uint), + ]) + + x1: 'uint' = 0 + y1: 'uint' = 0 + x2: 'uint' = 0 + y2: 'uint' = 0 + + class Commands: + @dataclass + class AudioStreamAllocate(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000551 + command_id: typing.ClassVar[int] = 0x00000000 + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = 'AudioStreamAllocateResponse' + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="streamType", Tag=0, Type=CameraAvStreamManagement.Enums.StreamTypeEnum), + ClusterObjectFieldDescriptor(Label="audioCodec", Tag=1, Type=CameraAvStreamManagement.Enums.AudioCodecEnum), + ClusterObjectFieldDescriptor(Label="channelCount", Tag=2, Type=uint), + ClusterObjectFieldDescriptor(Label="sampleRate", Tag=3, Type=uint), + ClusterObjectFieldDescriptor(Label="bitRate", Tag=4, Type=uint), + ClusterObjectFieldDescriptor(Label="bitDepth", Tag=5, Type=uint), + ]) + + streamType: 'CameraAvStreamManagement.Enums.StreamTypeEnum' = 0 + audioCodec: 'CameraAvStreamManagement.Enums.AudioCodecEnum' = 0 + channelCount: 'uint' = 0 + sampleRate: 'uint' = 0 + bitRate: 'uint' = 0 + bitDepth: 'uint' = 0 + + @dataclass + class AudioStreamAllocateResponse(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000551 + command_id: typing.ClassVar[int] = 0x00000001 + is_client: typing.ClassVar[bool] = False + response_type: typing.ClassVar[str] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="audioStreamID", Tag=0, Type=uint), + ]) + + audioStreamID: 'uint' = 0 + + @dataclass + class AudioStreamDeallocate(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000551 + command_id: typing.ClassVar[int] = 0x00000002 + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="audioStreamID", Tag=0, Type=uint), + ]) + + audioStreamID: 'uint' = 0 + + @dataclass + class VideoStreamAllocate(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000551 + command_id: typing.ClassVar[int] = 0x00000003 + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = 'VideoStreamAllocateResponse' + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="streamType", Tag=0, Type=CameraAvStreamManagement.Enums.StreamTypeEnum), + ClusterObjectFieldDescriptor(Label="videoCodec", Tag=1, Type=CameraAvStreamManagement.Enums.VideoCodecEnum), + ClusterObjectFieldDescriptor(Label="minFrameRate", Tag=2, Type=uint), + ClusterObjectFieldDescriptor(Label="maxFrameRate", Tag=3, Type=uint), + ClusterObjectFieldDescriptor(Label="minResolution", Tag=4, Type=CameraAvStreamManagement.Structs.VideoResolutionStruct), + ClusterObjectFieldDescriptor(Label="maxResolution", Tag=5, Type=CameraAvStreamManagement.Structs.VideoResolutionStruct), + ClusterObjectFieldDescriptor(Label="minBitRate", Tag=6, Type=uint), + ClusterObjectFieldDescriptor(Label="maxBitRate", Tag=7, Type=uint), + ClusterObjectFieldDescriptor(Label="minFragmentLen", Tag=8, Type=uint), + ClusterObjectFieldDescriptor(Label="maxFragmentLen", Tag=9, Type=uint), + ]) + + streamType: 'CameraAvStreamManagement.Enums.StreamTypeEnum' = 0 + videoCodec: 'CameraAvStreamManagement.Enums.VideoCodecEnum' = 0 + minFrameRate: 'uint' = 0 + maxFrameRate: 'uint' = 0 + minResolution: 'CameraAvStreamManagement.Structs.VideoResolutionStruct' = field(default_factory=lambda: CameraAvStreamManagement.Structs.VideoResolutionStruct()) + maxResolution: 'CameraAvStreamManagement.Structs.VideoResolutionStruct' = field(default_factory=lambda: CameraAvStreamManagement.Structs.VideoResolutionStruct()) + minBitRate: 'uint' = 0 + maxBitRate: 'uint' = 0 + minFragmentLen: 'uint' = 0 + maxFragmentLen: 'uint' = 0 + + @dataclass + class VideoStreamAllocateResponse(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000551 + command_id: typing.ClassVar[int] = 0x00000004 + is_client: typing.ClassVar[bool] = False + response_type: typing.ClassVar[str] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="videoStreamID", Tag=0, Type=uint), + ]) + + videoStreamID: 'uint' = 0 + + @dataclass + class VideoStreamModify(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000551 + command_id: typing.ClassVar[int] = 0x00000005 + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="videoStreamID", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="resolution", Tag=1, Type=CameraAvStreamManagement.Structs.VideoResolutionStruct), + ]) + + videoStreamID: 'uint' = 0 + resolution: 'CameraAvStreamManagement.Structs.VideoResolutionStruct' = field(default_factory=lambda: CameraAvStreamManagement.Structs.VideoResolutionStruct()) + + @dataclass + class VideoStreamDeallocate(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000551 + command_id: typing.ClassVar[int] = 0x00000006 + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="videoStreamID", Tag=0, Type=uint), + ]) + + videoStreamID: 'uint' = 0 + + @dataclass + class SnapshotStreamAllocate(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000551 + command_id: typing.ClassVar[int] = 0x00000007 + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = 'SnapshotStreamAllocateResponse' + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="imageCodec", Tag=0, Type=CameraAvStreamManagement.Enums.ImageCodecEnum), + ClusterObjectFieldDescriptor(Label="frameRate", Tag=1, Type=uint), + ClusterObjectFieldDescriptor(Label="bitRate", Tag=2, Type=uint), + ClusterObjectFieldDescriptor(Label="minResolution", Tag=3, Type=CameraAvStreamManagement.Structs.VideoResolutionStruct), + ClusterObjectFieldDescriptor(Label="maxResolution", Tag=4, Type=CameraAvStreamManagement.Structs.VideoResolutionStruct), + ClusterObjectFieldDescriptor(Label="quality", Tag=5, Type=uint), + ]) + + imageCodec: 'CameraAvStreamManagement.Enums.ImageCodecEnum' = 0 + frameRate: 'uint' = 0 + bitRate: 'uint' = 0 + minResolution: 'CameraAvStreamManagement.Structs.VideoResolutionStruct' = field(default_factory=lambda: CameraAvStreamManagement.Structs.VideoResolutionStruct()) + maxResolution: 'CameraAvStreamManagement.Structs.VideoResolutionStruct' = field(default_factory=lambda: CameraAvStreamManagement.Structs.VideoResolutionStruct()) + quality: 'uint' = 0 + + @dataclass + class SnapshotStreamAllocateResponse(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000551 + command_id: typing.ClassVar[int] = 0x00000008 + is_client: typing.ClassVar[bool] = False + response_type: typing.ClassVar[str] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="snapshotStreamID", Tag=0, Type=uint), + ]) + + snapshotStreamID: 'uint' = 0 + + @dataclass + class SnapshotStreamDeallocate(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000551 + command_id: typing.ClassVar[int] = 0x00000009 + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="snapshotStreamID", Tag=0, Type=uint), + ]) + + snapshotStreamID: 'uint' = 0 + + @dataclass + class SetStreamPriority(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000551 + command_id: typing.ClassVar[int] = 0x0000000A + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ]) + + @dataclass + class CaptureSnapshot(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000551 + command_id: typing.ClassVar[int] = 0x0000000B + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="snapshotStreamID", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="requestedResolution", Tag=1, Type=CameraAvStreamManagement.Structs.VideoResolutionStruct), + ]) + + snapshotStreamID: 'uint' = 0 + requestedResolution: 'CameraAvStreamManagement.Structs.VideoResolutionStruct' = field(default_factory=lambda: CameraAvStreamManagement.Structs.VideoResolutionStruct()) + + @dataclass + class CaptureSnapshotResponse(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000551 + command_id: typing.ClassVar[int] = 0x0000000C + is_client: typing.ClassVar[bool] = False + response_type: typing.ClassVar[str] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="data", Tag=0, Type=bytes), + ClusterObjectFieldDescriptor(Label="imageCodec", Tag=1, Type=CameraAvStreamManagement.Enums.ImageCodecEnum), + ClusterObjectFieldDescriptor(Label="resolution", Tag=2, Type=CameraAvStreamManagement.Structs.VideoResolutionStruct), + ]) + + data: 'bytes' = b"" + imageCodec: 'CameraAvStreamManagement.Enums.ImageCodecEnum' = 0 + resolution: 'CameraAvStreamManagement.Structs.VideoResolutionStruct' = field(default_factory=lambda: CameraAvStreamManagement.Structs.VideoResolutionStruct()) + + @dataclass + class SetViewport(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000551 + command_id: typing.ClassVar[int] = 0x0000000D + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="viewport", Tag=0, Type=CameraAvStreamManagement.Structs.ViewportStruct), + ]) + + viewport: 'CameraAvStreamManagement.Structs.ViewportStruct' = field(default_factory=lambda: CameraAvStreamManagement.Structs.ViewportStruct()) + + @dataclass + class SetImageRotation(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000551 + command_id: typing.ClassVar[int] = 0x0000000E + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="angle", Tag=0, Type=uint), + ]) + + angle: 'uint' = 0 + + @dataclass + class SetImageFlipHorizontal(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000551 + command_id: typing.ClassVar[int] = 0x0000000F + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="enabled", Tag=0, Type=bool), + ]) + + enabled: 'bool' = False + + @dataclass + class SetImageFlipVertical(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000551 + command_id: typing.ClassVar[int] = 0x00000010 + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="enabled", Tag=0, Type=bool), + ]) + + enabled: 'bool' = False + + @dataclass + class SetWatermark(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000551 + command_id: typing.ClassVar[int] = 0x00000011 + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="videoStreamID", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="enabled", Tag=1, Type=bool), + ]) + + videoStreamID: 'uint' = 0 + enabled: 'bool' = False + + @dataclass + class SetOSD(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000551 + command_id: typing.ClassVar[int] = 0x00000012 + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="videoStreamID", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="enabled", Tag=1, Type=bool), + ]) + + videoStreamID: 'uint' = 0 + enabled: 'bool' = False + + class Attributes: + @dataclass + class MaxConcurrentVideoEncoders(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000000 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) + + value: 'typing.Optional[uint]' = None + + @dataclass + class MaxEncodedPixelRate(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000001 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) + + value: 'typing.Optional[uint]' = None + + @dataclass + class VideoSensorParams(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000002 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[CameraAvStreamManagement.Structs.VideoSensorParamsStruct]) + + value: 'typing.Optional[CameraAvStreamManagement.Structs.VideoSensorParamsStruct]' = None + + @dataclass + class NightVisionCapable(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000003 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[bool]) + + value: 'typing.Optional[bool]' = None + + @dataclass + class MinViewPortWidth(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000004 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[CameraAvStreamManagement.Structs.VideoResolutionStruct]) + + value: 'typing.Optional[CameraAvStreamManagement.Structs.VideoResolutionStruct]' = None + + @dataclass + class MinViewPortHeight(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000005 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[CameraAvStreamManagement.Structs.VideoResolutionStruct]) + + value: 'typing.Optional[CameraAvStreamManagement.Structs.VideoResolutionStruct]' = None + + @dataclass + class RateDistortionTradeOffPoints(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000006 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[typing.List[CameraAvStreamManagement.Structs.RateDistortionTradeOffPointsStruct]]) + + value: 'typing.Optional[typing.List[CameraAvStreamManagement.Structs.RateDistortionTradeOffPointsStruct]]' = None + + @dataclass + class MaxPreRollBufferSize(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000007 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) + + value: 'typing.Optional[uint]' = None + + @dataclass + class MicrophoneCapabilities(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000008 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[CameraAvStreamManagement.Structs.AudioCapabilitiesStruct]) + + value: 'typing.Optional[CameraAvStreamManagement.Structs.AudioCapabilitiesStruct]' = None + + @dataclass + class SpeakerCapabilities(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000009 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Union[None, Nullable, CameraAvStreamManagement.Structs.AudioCapabilitiesStruct]) + + value: 'typing.Union[None, Nullable, CameraAvStreamManagement.Structs.AudioCapabilitiesStruct]' = None + + @dataclass + class TwoWayTalkSupport(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000000A + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[CameraAvStreamManagement.Enums.TwoWayTalkSupportTypeEnum]) + + value: 'typing.Optional[CameraAvStreamManagement.Enums.TwoWayTalkSupportTypeEnum]' = None + + @dataclass + class SupportedSnapshotParams(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000000B + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[typing.List[CameraAvStreamManagement.Structs.SnapshotParamsStruct]]) + + value: 'typing.Optional[typing.List[CameraAvStreamManagement.Structs.SnapshotParamsStruct]]' = None + + @dataclass + class HDRCapable(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000000C + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[bool]) + + value: 'typing.Optional[bool]' = None + + @dataclass + class MaxNetworkBandwidth(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000000D + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=uint) + + value: 'uint' = 0 + + @dataclass + class CurrentFrameRate(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000000E + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) + + value: 'typing.Optional[uint]' = None + + @dataclass + class HDRMode(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000000F + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[bool]) + + value: 'typing.Optional[bool]' = None + + @dataclass + class CurrentVideoCodecs(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000010 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[typing.List[CameraAvStreamManagement.Enums.VideoCodecEnum]]) + + value: 'typing.Optional[typing.List[CameraAvStreamManagement.Enums.VideoCodecEnum]]' = None + + @dataclass + class CurrentSnapshotConfig(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000011 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[CameraAvStreamManagement.Structs.SnapshotParamsStruct]) + + value: 'typing.Optional[CameraAvStreamManagement.Structs.SnapshotParamsStruct]' = None + + @dataclass + class FabricsUsingCamera(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000012 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.List[uint]) + + value: 'typing.List[uint]' = field(default_factory=lambda: []) + + @dataclass + class AllocatedVideoStreams(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000013 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[typing.List[CameraAvStreamManagement.Structs.VideoStreamStruct]]) + + value: 'typing.Optional[typing.List[CameraAvStreamManagement.Structs.VideoStreamStruct]]' = None + + @dataclass + class AllocatedAudioStreams(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000014 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[typing.List[CameraAvStreamManagement.Structs.AudioStreamStruct]]) + + value: 'typing.Optional[typing.List[CameraAvStreamManagement.Structs.AudioStreamStruct]]' = None + + @dataclass + class AllocatedSnapshotStreams(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000015 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[typing.List[CameraAvStreamManagement.Structs.SnapshotStreamStruct]]) + + value: 'typing.Optional[typing.List[CameraAvStreamManagement.Structs.SnapshotStreamStruct]]' = None + + @dataclass + class RankedVideoStreamPrioritiesList(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000016 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[typing.List[CameraAvStreamManagement.Enums.StreamTypeEnum]]) + + value: 'typing.Optional[typing.List[CameraAvStreamManagement.Enums.StreamTypeEnum]]' = None + + @dataclass + class SoftRecordingPrivacyModeSetting(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000017 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[bool]) + + value: 'typing.Optional[bool]' = None + + @dataclass + class SoftLivestreamPrivacyModeSetting(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000018 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[bool]) + + value: 'typing.Optional[bool]' = None + + @dataclass + class HardPrivacyMode(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000019 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[bool]) + + value: 'typing.Optional[bool]' = None + + @dataclass + class NightVision(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000001A + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[CameraAvStreamManagement.Enums.TriStateAutoEnum]) + + value: 'typing.Optional[CameraAvStreamManagement.Enums.TriStateAutoEnum]' = None + + @dataclass + class NightVisionIllum(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000001B + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[CameraAvStreamManagement.Enums.TriStateAutoEnum]) + + value: 'typing.Optional[CameraAvStreamManagement.Enums.TriStateAutoEnum]' = None + + @dataclass + class Awb(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000001C + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[bool]) + + value: 'typing.Optional[bool]' = None + + @dataclass + class ShutterSpeed(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000001D + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[bool]) + + value: 'typing.Optional[bool]' = None + + @dataclass + class Iso(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000001E + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[bool]) + + value: 'typing.Optional[bool]' = None + + @dataclass + class Viewport(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000001F + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[CameraAvStreamManagement.Structs.ViewportStruct]) + + value: 'typing.Optional[CameraAvStreamManagement.Structs.ViewportStruct]' = None + + @dataclass + class SpeakerEnabled(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000020 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[bool]) + + value: 'typing.Optional[bool]' = None + + @dataclass + class SpeakerVolumeLevel(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000021 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) + + value: 'typing.Optional[uint]' = None + + @dataclass + class SpeakerMaxLevel(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000022 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) + + value: 'typing.Optional[uint]' = None + + @dataclass + class SpeakerMinLevel(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000023 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) + + value: 'typing.Optional[uint]' = None + + @dataclass + class MicStatus(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000024 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[bool]) + + value: 'typing.Optional[bool]' = None + + @dataclass + class MicVolumeLevel(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000025 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) + + value: 'typing.Optional[uint]' = None + + @dataclass + class MicMaxLevel(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000026 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) + + value: 'typing.Optional[uint]' = None + + @dataclass + class MicMinLevel(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000027 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) + + value: 'typing.Optional[uint]' = None + + @dataclass + class MicAGCEnabled(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000028 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[bool]) + + value: 'typing.Optional[bool]' = None + + @dataclass + class ImageRotation(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000029 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) + + value: 'typing.Optional[uint]' = None + + @dataclass + class ImageFlipHorizontal(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000002A + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[bool]) + + value: 'typing.Optional[bool]' = None + + @dataclass + class ImageFlipVertical(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000002B + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[bool]) + + value: 'typing.Optional[bool]' = None + + @dataclass + class LocalVideoRecordingEnabled(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000002C + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[bool]) + + value: 'typing.Optional[bool]' = None + + @dataclass + class LocalSnapshotRecordingEnabled(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000002D + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[bool]) + + value: 'typing.Optional[bool]' = None + + @dataclass + class StatusLight(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000002E + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[bool]) + + value: 'typing.Optional[bool]' = None + + @dataclass + class StatusLightBrightness(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000002F + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[Globals.Enums.ThreeLevelAutoEnum]) + + value: 'typing.Optional[Globals.Enums.ThreeLevelAutoEnum]' = None + + @dataclass + class DepthSensorStatus(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000030 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[CameraAvStreamManagement.Enums.TriStateAutoEnum]) + + value: 'typing.Optional[CameraAvStreamManagement.Enums.TriStateAutoEnum]' = None + + @dataclass + class WatermarkEnabled(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000031 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[typing.List[CameraAvStreamManagement.Structs.PerStreamStruct]]) + + value: 'typing.Optional[typing.List[CameraAvStreamManagement.Structs.PerStreamStruct]]' = None + + @dataclass + class OSDEnabled(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000032 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[typing.List[CameraAvStreamManagement.Structs.PerStreamStruct]]) + + value: 'typing.Optional[typing.List[CameraAvStreamManagement.Structs.PerStreamStruct]]' = None + + @dataclass + class GeneratedCommandList(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @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 0x00000551 + + @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 EventList(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFFA + + @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 0x00000551 + + @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 0x00000551 + + @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 0x00000551 + + @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 VideoStreamChanged(ClusterEvent): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def event_id(cls) -> int: + return 0x00000000 + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="videoStreamID", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="streamType", Tag=1, Type=typing.Optional[CameraAvStreamManagement.Enums.StreamTypeEnum]), + ClusterObjectFieldDescriptor(Label="videoCodec", Tag=2, Type=typing.Optional[CameraAvStreamManagement.Enums.VideoCodecEnum]), + ClusterObjectFieldDescriptor(Label="minFrameRate", Tag=3, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="maxFrameRate", Tag=4, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="minResolution", Tag=5, Type=typing.Optional[CameraAvStreamManagement.Structs.VideoResolutionStruct]), + ClusterObjectFieldDescriptor(Label="maxResolution", Tag=6, Type=typing.Optional[CameraAvStreamManagement.Structs.VideoResolutionStruct]), + ClusterObjectFieldDescriptor(Label="minBitRate", Tag=7, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="maxBitRate", Tag=8, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="minFragmentLen", Tag=9, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="maxFragmentLen", Tag=10, Type=typing.Optional[uint]), + ]) + + videoStreamID: 'uint' = 0 + streamType: 'typing.Optional[CameraAvStreamManagement.Enums.StreamTypeEnum]' = None + videoCodec: 'typing.Optional[CameraAvStreamManagement.Enums.VideoCodecEnum]' = None + minFrameRate: 'typing.Optional[uint]' = None + maxFrameRate: 'typing.Optional[uint]' = None + minResolution: 'typing.Optional[CameraAvStreamManagement.Structs.VideoResolutionStruct]' = None + maxResolution: 'typing.Optional[CameraAvStreamManagement.Structs.VideoResolutionStruct]' = None + minBitRate: 'typing.Optional[uint]' = None + maxBitRate: 'typing.Optional[uint]' = None + minFragmentLen: 'typing.Optional[uint]' = None + maxFragmentLen: 'typing.Optional[uint]' = None + + @dataclass + class AudioStreamChanged(ClusterEvent): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def event_id(cls) -> int: + return 0x00000001 + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="audioStreamID", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="streamType", Tag=1, Type=typing.Optional[CameraAvStreamManagement.Enums.StreamTypeEnum]), + ClusterObjectFieldDescriptor(Label="audioCodec", Tag=2, Type=typing.Optional[CameraAvStreamManagement.Enums.AudioCodecEnum]), + ClusterObjectFieldDescriptor(Label="channelCount", Tag=3, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="sampleRate", Tag=4, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="bitRate", Tag=5, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="bitDepth", Tag=6, Type=typing.Optional[uint]), + ]) + + audioStreamID: 'uint' = 0 + streamType: 'typing.Optional[CameraAvStreamManagement.Enums.StreamTypeEnum]' = None + audioCodec: 'typing.Optional[CameraAvStreamManagement.Enums.AudioCodecEnum]' = None + channelCount: 'typing.Optional[uint]' = None + sampleRate: 'typing.Optional[uint]' = None + bitRate: 'typing.Optional[uint]' = None + bitDepth: 'typing.Optional[uint]' = None + + @dataclass + class SnapshotStreamChanged(ClusterEvent): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def event_id(cls) -> int: + return 0x00000002 + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="snapshotStreamID", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="imageCodec", Tag=1, Type=typing.Optional[CameraAvStreamManagement.Enums.ImageCodecEnum]), + ClusterObjectFieldDescriptor(Label="frameRate", Tag=2, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="bitRate", Tag=3, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="minResolution", Tag=4, Type=typing.Optional[CameraAvStreamManagement.Structs.VideoResolutionStruct]), + ClusterObjectFieldDescriptor(Label="maxResolution", Tag=5, Type=typing.Optional[CameraAvStreamManagement.Structs.VideoResolutionStruct]), + ClusterObjectFieldDescriptor(Label="quality", Tag=6, Type=typing.Optional[uint]), + ]) + + snapshotStreamID: 'uint' = 0 + imageCodec: 'typing.Optional[CameraAvStreamManagement.Enums.ImageCodecEnum]' = None + frameRate: 'typing.Optional[uint]' = None + bitRate: 'typing.Optional[uint]' = None + minResolution: 'typing.Optional[CameraAvStreamManagement.Structs.VideoResolutionStruct]' = None + maxResolution: 'typing.Optional[CameraAvStreamManagement.Structs.VideoResolutionStruct]' = None + quality: 'typing.Optional[uint]' = None + + @dataclass class WebRTCTransportProvider(Cluster): id: typing.ClassVar[int] = 0x00000553 diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm index a3d3649fb1de17..1d4b68447a5902 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm @@ -5915,6 +5915,186 @@ static BOOL AttributeIsSpecifiedInContentAppObserverCluster(AttributeId aAttribu } } } +static BOOL AttributeIsSpecifiedInCameraAVStreamManagementCluster(AttributeId aAttributeId) +{ + using namespace Clusters::CameraAvStreamManagement; + switch (aAttributeId) { + case Attributes::MaxConcurrentVideoEncoders::Id: { + return YES; + } + case Attributes::MaxEncodedPixelRate::Id: { + return YES; + } + case Attributes::VideoSensorParams::Id: { + return YES; + } + case Attributes::NightVisionCapable::Id: { + return YES; + } + case Attributes::MinViewPortWidth::Id: { + return YES; + } + case Attributes::MinViewPortHeight::Id: { + return YES; + } + case Attributes::RateDistortionTradeOffPoints::Id: { + return YES; + } + case Attributes::MaxPreRollBufferSize::Id: { + return YES; + } + case Attributes::MicrophoneCapabilities::Id: { + return YES; + } + case Attributes::SpeakerCapabilities::Id: { + return YES; + } + case Attributes::TwoWayTalkSupport::Id: { + return YES; + } + case Attributes::SupportedSnapshotParams::Id: { + return YES; + } + case Attributes::HDRCapable::Id: { + return YES; + } + case Attributes::MaxNetworkBandwidth::Id: { + return YES; + } + case Attributes::CurrentFrameRate::Id: { + return YES; + } + case Attributes::HDRMode::Id: { + return YES; + } + case Attributes::CurrentVideoCodecs::Id: { + return YES; + } + case Attributes::CurrentSnapshotConfig::Id: { + return YES; + } + case Attributes::FabricsUsingCamera::Id: { + return YES; + } + case Attributes::AllocatedVideoStreams::Id: { + return YES; + } + case Attributes::AllocatedAudioStreams::Id: { + return YES; + } + case Attributes::AllocatedSnapshotStreams::Id: { + return YES; + } + case Attributes::RankedVideoStreamPrioritiesList::Id: { + return YES; + } + case Attributes::SoftRecordingPrivacyModeSetting::Id: { + return YES; + } + case Attributes::SoftLivestreamPrivacyModeSetting::Id: { + return YES; + } + case Attributes::HardPrivacyMode::Id: { + return YES; + } + case Attributes::NightVision::Id: { + return YES; + } + case Attributes::NightVisionIllum::Id: { + return YES; + } + case Attributes::Awb::Id: { + return YES; + } + case Attributes::ShutterSpeed::Id: { + return YES; + } + case Attributes::Iso::Id: { + return YES; + } + case Attributes::Viewport::Id: { + return YES; + } + case Attributes::SpeakerEnabled::Id: { + return YES; + } + case Attributes::SpeakerVolumeLevel::Id: { + return YES; + } + case Attributes::SpeakerMaxLevel::Id: { + return YES; + } + case Attributes::SpeakerMinLevel::Id: { + return YES; + } + case Attributes::MicStatus::Id: { + return YES; + } + case Attributes::MicVolumeLevel::Id: { + return YES; + } + case Attributes::MicMaxLevel::Id: { + return YES; + } + case Attributes::MicMinLevel::Id: { + return YES; + } + case Attributes::MicAGCEnabled::Id: { + return YES; + } + case Attributes::ImageRotation::Id: { + return YES; + } + case Attributes::ImageFlipHorizontal::Id: { + return YES; + } + case Attributes::ImageFlipVertical::Id: { + return YES; + } + case Attributes::LocalVideoRecordingEnabled::Id: { + return YES; + } + case Attributes::LocalSnapshotRecordingEnabled::Id: { + return YES; + } + case Attributes::StatusLight::Id: { + return YES; + } + case Attributes::StatusLightBrightness::Id: { + return YES; + } + case Attributes::DepthSensorStatus::Id: { + return YES; + } + case Attributes::WatermarkEnabled::Id: { + return YES; + } + case Attributes::OSDEnabled::Id: { + return YES; + } + case Attributes::GeneratedCommandList::Id: { + return YES; + } + case Attributes::AcceptedCommandList::Id: { + return YES; + } + case Attributes::EventList::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 AttributeIsSpecifiedInWebRTCTransportProviderCluster(AttributeId aAttributeId) { using namespace Clusters::WebRTCTransportProvider; @@ -6744,6 +6924,9 @@ BOOL MTRAttributeIsSpecified(ClusterId aClusterId, AttributeId aAttributeId) case Clusters::ContentAppObserver::Id: { return AttributeIsSpecifiedInContentAppObserverCluster(aAttributeId); } + case Clusters::CameraAvStreamManagement::Id: { + return AttributeIsSpecifiedInCameraAVStreamManagementCluster(aAttributeId); + } case Clusters::WebRTCTransportProvider::Id: { return AttributeIsSpecifiedInWebRTCTransportProviderCluster(aAttributeId); } diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm index 686b92c333f6ee..7e0d824c52d5ed 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm @@ -16910,6 +16910,899 @@ static id _Nullable DecodeAttributeValueForContentAppObserverCluster(AttributeId *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; return nil; } +static id _Nullable DecodeAttributeValueForCameraAVStreamManagementCluster(AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::CameraAvStreamManagement; + switch (aAttributeId) { + case Attributes::MaxConcurrentVideoEncoders::Id: { + using TypeInfo = Attributes::MaxConcurrentVideoEncoders::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; + return value; + } + case Attributes::MaxEncodedPixelRate::Id: { + using TypeInfo = Attributes::MaxEncodedPixelRate::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedInt:cppValue]; + return value; + } + case Attributes::VideoSensorParams::Id: { + using TypeInfo = Attributes::VideoSensorParams::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + MTRCameraAVStreamManagementClusterVideoSensorParamsStruct * _Nonnull value; + value = [MTRCameraAVStreamManagementClusterVideoSensorParamsStruct new]; + value.sensorWidth = [NSNumber numberWithUnsignedShort:cppValue.sensorWidth]; + value.sensorHeight = [NSNumber numberWithUnsignedShort:cppValue.sensorHeight]; + value.hdrCapable = [NSNumber numberWithBool:cppValue.HDRCapable]; + value.maxFPS = [NSNumber numberWithUnsignedShort:cppValue.maxFPS]; + value.maxHDRFPS = [NSNumber numberWithUnsignedShort:cppValue.maxHDRFPS]; + return value; + } + case Attributes::NightVisionCapable::Id: { + using TypeInfo = Attributes::NightVisionCapable::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithBool:cppValue]; + return value; + } + case Attributes::MinViewPortWidth::Id: { + using TypeInfo = Attributes::MinViewPortWidth::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + MTRCameraAVStreamManagementClusterVideoResolutionStruct * _Nonnull value; + value = [MTRCameraAVStreamManagementClusterVideoResolutionStruct new]; + value.width = [NSNumber numberWithUnsignedShort:cppValue.width]; + value.height = [NSNumber numberWithUnsignedShort:cppValue.height]; + return value; + } + case Attributes::MinViewPortHeight::Id: { + using TypeInfo = Attributes::MinViewPortHeight::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + MTRCameraAVStreamManagementClusterVideoResolutionStruct * _Nonnull value; + value = [MTRCameraAVStreamManagementClusterVideoResolutionStruct new]; + value.width = [NSNumber numberWithUnsignedShort:cppValue.width]; + value.height = [NSNumber numberWithUnsignedShort:cppValue.height]; + return value; + } + case Attributes::RateDistortionTradeOffPoints::Id: { + using TypeInfo = Attributes::RateDistortionTradeOffPoints::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(); + MTRCameraAVStreamManagementClusterRateDistortionTradeOffPointsStruct * newElement_0; + newElement_0 = [MTRCameraAVStreamManagementClusterRateDistortionTradeOffPointsStruct new]; + newElement_0.codec = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.codec)]; + newElement_0.resolution = [MTRCameraAVStreamManagementClusterVideoResolutionStruct new]; + newElement_0.resolution.width = [NSNumber numberWithUnsignedShort:entry_0.resolution.width]; + newElement_0.resolution.height = [NSNumber numberWithUnsignedShort:entry_0.resolution.height]; + newElement_0.minBitRate = [NSNumber numberWithUnsignedInt:entry_0.minBitRate]; + [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; + } + case Attributes::MaxPreRollBufferSize::Id: { + using TypeInfo = Attributes::MaxPreRollBufferSize::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedInt:cppValue]; + return value; + } + case Attributes::MicrophoneCapabilities::Id: { + using TypeInfo = Attributes::MicrophoneCapabilities::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + MTRCameraAVStreamManagementClusterAudioCapabilitiesStruct * _Nonnull value; + value = [MTRCameraAVStreamManagementClusterAudioCapabilitiesStruct new]; + value.maxNumberOfChannels = [NSNumber numberWithUnsignedChar:cppValue.maxNumberOfChannels]; + { // Scope for our temporary variables + auto * array_1 = [NSMutableArray new]; + auto iter_1 = cppValue.supportedCodecs.begin(); + while (iter_1.Next()) { + auto & entry_1 = iter_1.GetValue(); + NSNumber * newElement_1; + newElement_1 = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_1)]; + [array_1 addObject:newElement_1]; + } + CHIP_ERROR err = iter_1.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value.supportedCodecs = array_1; + } + { // Scope for our temporary variables + auto * array_1 = [NSMutableArray new]; + auto iter_1 = cppValue.supportedSampleRates.begin(); + while (iter_1.Next()) { + auto & entry_1 = iter_1.GetValue(); + NSNumber * newElement_1; + newElement_1 = [NSNumber numberWithUnsignedInt:entry_1]; + [array_1 addObject:newElement_1]; + } + CHIP_ERROR err = iter_1.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value.supportedSampleRates = array_1; + } + { // Scope for our temporary variables + auto * array_1 = [NSMutableArray new]; + auto iter_1 = cppValue.supportedBitDepths.begin(); + while (iter_1.Next()) { + auto & entry_1 = iter_1.GetValue(); + NSNumber * newElement_1; + newElement_1 = [NSNumber numberWithUnsignedInt:entry_1]; + [array_1 addObject:newElement_1]; + } + CHIP_ERROR err = iter_1.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value.supportedBitDepths = array_1; + } + return value; + } + case Attributes::SpeakerCapabilities::Id: { + using TypeInfo = Attributes::SpeakerCapabilities::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + MTRCameraAVStreamManagementClusterAudioCapabilitiesStruct * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [MTRCameraAVStreamManagementClusterAudioCapabilitiesStruct new]; + value.maxNumberOfChannels = [NSNumber numberWithUnsignedChar:cppValue.Value().maxNumberOfChannels]; + { // Scope for our temporary variables + auto * array_2 = [NSMutableArray new]; + auto iter_2 = cppValue.Value().supportedCodecs.begin(); + while (iter_2.Next()) { + auto & entry_2 = iter_2.GetValue(); + NSNumber * newElement_2; + newElement_2 = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_2)]; + [array_2 addObject:newElement_2]; + } + CHIP_ERROR err = iter_2.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value.supportedCodecs = array_2; + } + { // Scope for our temporary variables + auto * array_2 = [NSMutableArray new]; + auto iter_2 = cppValue.Value().supportedSampleRates.begin(); + while (iter_2.Next()) { + auto & entry_2 = iter_2.GetValue(); + NSNumber * newElement_2; + newElement_2 = [NSNumber numberWithUnsignedInt:entry_2]; + [array_2 addObject:newElement_2]; + } + CHIP_ERROR err = iter_2.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value.supportedSampleRates = array_2; + } + { // Scope for our temporary variables + auto * array_2 = [NSMutableArray new]; + auto iter_2 = cppValue.Value().supportedBitDepths.begin(); + while (iter_2.Next()) { + auto & entry_2 = iter_2.GetValue(); + NSNumber * newElement_2; + newElement_2 = [NSNumber numberWithUnsignedInt:entry_2]; + [array_2 addObject:newElement_2]; + } + CHIP_ERROR err = iter_2.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value.supportedBitDepths = array_2; + } + } + return value; + } + case Attributes::TwoWayTalkSupport::Id: { + using TypeInfo = Attributes::TwoWayTalkSupport::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + return value; + } + case Attributes::SupportedSnapshotParams::Id: { + using TypeInfo = Attributes::SupportedSnapshotParams::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(); + MTRCameraAVStreamManagementClusterSnapshotParamsStruct * newElement_0; + newElement_0 = [MTRCameraAVStreamManagementClusterSnapshotParamsStruct new]; + newElement_0.resolution = [MTRCameraAVStreamManagementClusterVideoResolutionStruct new]; + newElement_0.resolution.width = [NSNumber numberWithUnsignedShort:entry_0.resolution.width]; + newElement_0.resolution.height = [NSNumber numberWithUnsignedShort:entry_0.resolution.height]; + newElement_0.maxFrameRate = [NSNumber numberWithUnsignedShort:entry_0.maxFrameRate]; + newElement_0.imageCodec = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.imageCodec)]; + [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; + } + case Attributes::HDRCapable::Id: { + using TypeInfo = Attributes::HDRCapable::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithBool:cppValue]; + return value; + } + case Attributes::MaxNetworkBandwidth::Id: { + using TypeInfo = Attributes::MaxNetworkBandwidth::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedInt:cppValue]; + return value; + } + case Attributes::CurrentFrameRate::Id: { + using TypeInfo = Attributes::CurrentFrameRate::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; + return value; + } + case Attributes::HDRMode::Id: { + using TypeInfo = Attributes::HDRMode::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithBool:cppValue]; + return value; + } + case Attributes::CurrentVideoCodecs::Id: { + using TypeInfo = Attributes::CurrentVideoCodecs::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 numberWithUnsignedChar:chip::to_underlying(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; + } + case Attributes::CurrentSnapshotConfig::Id: { + using TypeInfo = Attributes::CurrentSnapshotConfig::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + MTRCameraAVStreamManagementClusterSnapshotParamsStruct * _Nonnull value; + value = [MTRCameraAVStreamManagementClusterSnapshotParamsStruct new]; + value.resolution = [MTRCameraAVStreamManagementClusterVideoResolutionStruct new]; + value.resolution.width = [NSNumber numberWithUnsignedShort:cppValue.resolution.width]; + value.resolution.height = [NSNumber numberWithUnsignedShort:cppValue.resolution.height]; + value.maxFrameRate = [NSNumber numberWithUnsignedShort:cppValue.maxFrameRate]; + value.imageCodec = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.imageCodec)]; + return value; + } + case Attributes::FabricsUsingCamera::Id: { + using TypeInfo = Attributes::FabricsUsingCamera::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 numberWithUnsignedChar: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; + } + case Attributes::AllocatedVideoStreams::Id: { + using TypeInfo = Attributes::AllocatedVideoStreams::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(); + MTRCameraAVStreamManagementClusterVideoStreamStruct * newElement_0; + newElement_0 = [MTRCameraAVStreamManagementClusterVideoStreamStruct new]; + newElement_0.videoStreamID = [NSNumber numberWithUnsignedShort:entry_0.videoStreamID]; + newElement_0.streamType = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.streamType)]; + newElement_0.videoCodec = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.videoCodec)]; + newElement_0.minFrameRate = [NSNumber numberWithUnsignedShort:entry_0.minFrameRate]; + newElement_0.maxFrameRate = [NSNumber numberWithUnsignedShort:entry_0.maxFrameRate]; + newElement_0.minResolution = [MTRCameraAVStreamManagementClusterVideoResolutionStruct new]; + newElement_0.minResolution.width = [NSNumber numberWithUnsignedShort:entry_0.minResolution.width]; + newElement_0.minResolution.height = [NSNumber numberWithUnsignedShort:entry_0.minResolution.height]; + newElement_0.maxResolution = [MTRCameraAVStreamManagementClusterVideoResolutionStruct new]; + newElement_0.maxResolution.width = [NSNumber numberWithUnsignedShort:entry_0.maxResolution.width]; + newElement_0.maxResolution.height = [NSNumber numberWithUnsignedShort:entry_0.maxResolution.height]; + newElement_0.minBitRate = [NSNumber numberWithUnsignedShort:entry_0.minBitRate]; + newElement_0.maxBitRate = [NSNumber numberWithUnsignedShort:entry_0.maxBitRate]; + newElement_0.minFragmentLen = [NSNumber numberWithUnsignedShort:entry_0.minFragmentLen]; + newElement_0.maxFragmentLen = [NSNumber numberWithUnsignedShort:entry_0.maxFragmentLen]; + newElement_0.referenceCount = [NSNumber numberWithUnsignedChar:entry_0.referenceCount]; + [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; + } + case Attributes::AllocatedAudioStreams::Id: { + using TypeInfo = Attributes::AllocatedAudioStreams::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(); + MTRCameraAVStreamManagementClusterAudioStreamStruct * newElement_0; + newElement_0 = [MTRCameraAVStreamManagementClusterAudioStreamStruct new]; + newElement_0.audioStreamID = [NSNumber numberWithUnsignedShort:entry_0.audioStreamID]; + newElement_0.streamType = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.streamType)]; + newElement_0.audioCodec = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.audioCodec)]; + newElement_0.channelCount = [NSNumber numberWithUnsignedChar:entry_0.channelCount]; + newElement_0.sampleRate = [NSNumber numberWithUnsignedInt:entry_0.sampleRate]; + newElement_0.bitRate = [NSNumber numberWithUnsignedInt:entry_0.bitRate]; + newElement_0.bitDepth = [NSNumber numberWithUnsignedChar:entry_0.bitDepth]; + newElement_0.referenceCount = [NSNumber numberWithUnsignedChar:entry_0.referenceCount]; + [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; + } + case Attributes::AllocatedSnapshotStreams::Id: { + using TypeInfo = Attributes::AllocatedSnapshotStreams::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(); + MTRCameraAVStreamManagementClusterSnapshotStreamStruct * newElement_0; + newElement_0 = [MTRCameraAVStreamManagementClusterSnapshotStreamStruct new]; + newElement_0.snapshotStreamID = [NSNumber numberWithUnsignedShort:entry_0.snapshotStreamID]; + newElement_0.imageCodec = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.imageCodec)]; + newElement_0.frameRate = [NSNumber numberWithUnsignedShort:entry_0.frameRate]; + newElement_0.bitRate = [NSNumber numberWithUnsignedInt:entry_0.bitRate]; + newElement_0.minResolution = [MTRCameraAVStreamManagementClusterVideoResolutionStruct new]; + newElement_0.minResolution.width = [NSNumber numberWithUnsignedShort:entry_0.minResolution.width]; + newElement_0.minResolution.height = [NSNumber numberWithUnsignedShort:entry_0.minResolution.height]; + newElement_0.maxResolution = [MTRCameraAVStreamManagementClusterVideoResolutionStruct new]; + newElement_0.maxResolution.width = [NSNumber numberWithUnsignedShort:entry_0.maxResolution.width]; + newElement_0.maxResolution.height = [NSNumber numberWithUnsignedShort:entry_0.maxResolution.height]; + newElement_0.quality = [NSNumber numberWithUnsignedChar:entry_0.quality]; + newElement_0.referenceCount = [NSNumber numberWithUnsignedChar:entry_0.referenceCount]; + [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; + } + case Attributes::RankedVideoStreamPrioritiesList::Id: { + using TypeInfo = Attributes::RankedVideoStreamPrioritiesList::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 numberWithUnsignedChar:chip::to_underlying(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; + } + case Attributes::SoftRecordingPrivacyModeSetting::Id: { + using TypeInfo = Attributes::SoftRecordingPrivacyModeSetting::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithBool:cppValue]; + return value; + } + case Attributes::SoftLivestreamPrivacyModeSetting::Id: { + using TypeInfo = Attributes::SoftLivestreamPrivacyModeSetting::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithBool:cppValue]; + return value; + } + case Attributes::HardPrivacyMode::Id: { + using TypeInfo = Attributes::HardPrivacyMode::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithBool:cppValue]; + return value; + } + case Attributes::NightVision::Id: { + using TypeInfo = Attributes::NightVision::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + return value; + } + case Attributes::NightVisionIllum::Id: { + using TypeInfo = Attributes::NightVisionIllum::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + return value; + } + case Attributes::Awb::Id: { + using TypeInfo = Attributes::Awb::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithBool:cppValue]; + return value; + } + case Attributes::ShutterSpeed::Id: { + using TypeInfo = Attributes::ShutterSpeed::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithBool:cppValue]; + return value; + } + case Attributes::Iso::Id: { + using TypeInfo = Attributes::Iso::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithBool:cppValue]; + return value; + } + case Attributes::Viewport::Id: { + using TypeInfo = Attributes::Viewport::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + MTRCameraAVStreamManagementClusterViewportStruct * _Nonnull value; + value = [MTRCameraAVStreamManagementClusterViewportStruct new]; + value.x1 = [NSNumber numberWithUnsignedShort:cppValue.x1]; + value.y1 = [NSNumber numberWithUnsignedShort:cppValue.y1]; + value.x2 = [NSNumber numberWithUnsignedShort:cppValue.x2]; + value.y2 = [NSNumber numberWithUnsignedShort:cppValue.y2]; + return value; + } + case Attributes::SpeakerEnabled::Id: { + using TypeInfo = Attributes::SpeakerEnabled::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithBool:cppValue]; + return value; + } + case Attributes::SpeakerVolumeLevel::Id: { + using TypeInfo = Attributes::SpeakerVolumeLevel::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; + return value; + } + case Attributes::SpeakerMaxLevel::Id: { + using TypeInfo = Attributes::SpeakerMaxLevel::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; + return value; + } + case Attributes::SpeakerMinLevel::Id: { + using TypeInfo = Attributes::SpeakerMinLevel::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; + return value; + } + case Attributes::MicStatus::Id: { + using TypeInfo = Attributes::MicStatus::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithBool:cppValue]; + return value; + } + case Attributes::MicVolumeLevel::Id: { + using TypeInfo = Attributes::MicVolumeLevel::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; + return value; + } + case Attributes::MicMaxLevel::Id: { + using TypeInfo = Attributes::MicMaxLevel::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; + return value; + } + case Attributes::MicMinLevel::Id: { + using TypeInfo = Attributes::MicMinLevel::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; + return value; + } + case Attributes::MicAGCEnabled::Id: { + using TypeInfo = Attributes::MicAGCEnabled::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithBool:cppValue]; + return value; + } + case Attributes::ImageRotation::Id: { + using TypeInfo = Attributes::ImageRotation::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; + return value; + } + case Attributes::ImageFlipHorizontal::Id: { + using TypeInfo = Attributes::ImageFlipHorizontal::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithBool:cppValue]; + return value; + } + case Attributes::ImageFlipVertical::Id: { + using TypeInfo = Attributes::ImageFlipVertical::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithBool:cppValue]; + return value; + } + case Attributes::LocalVideoRecordingEnabled::Id: { + using TypeInfo = Attributes::LocalVideoRecordingEnabled::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithBool:cppValue]; + return value; + } + case Attributes::LocalSnapshotRecordingEnabled::Id: { + using TypeInfo = Attributes::LocalSnapshotRecordingEnabled::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithBool:cppValue]; + return value; + } + case Attributes::StatusLight::Id: { + using TypeInfo = Attributes::StatusLight::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithBool:cppValue]; + return value; + } + case Attributes::StatusLightBrightness::Id: { + using TypeInfo = Attributes::StatusLightBrightness::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + return value; + } + case Attributes::DepthSensorStatus::Id: { + using TypeInfo = Attributes::DepthSensorStatus::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + return value; + } + case Attributes::WatermarkEnabled::Id: { + using TypeInfo = Attributes::WatermarkEnabled::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(); + MTRCameraAVStreamManagementClusterPerStreamStruct * newElement_0; + newElement_0 = [MTRCameraAVStreamManagementClusterPerStreamStruct new]; + newElement_0.streamID = [NSNumber numberWithUnsignedShort:entry_0.streamID]; + newElement_0.enabled = [NSNumber numberWithBool:entry_0.enabled]; + [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; + } + case Attributes::OSDEnabled::Id: { + using TypeInfo = Attributes::OSDEnabled::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(); + MTRCameraAVStreamManagementClusterPerStreamStruct * newElement_0; + newElement_0 = [MTRCameraAVStreamManagementClusterPerStreamStruct new]; + newElement_0.streamID = [NSNumber numberWithUnsignedShort:entry_0.streamID]; + newElement_0.enabled = [NSNumber numberWithBool:entry_0.enabled]; + [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 DecodeAttributeValueForWebRTCTransportProviderCluster(AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) { using namespace Clusters::WebRTCTransportProvider; @@ -19192,6 +20085,9 @@ id _Nullable MTRDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::T case Clusters::ContentAppObserver::Id: { return DecodeAttributeValueForContentAppObserverCluster(aPath.mAttributeId, aReader, aError); } + case Clusters::CameraAvStreamManagement::Id: { + return DecodeAttributeValueForCameraAVStreamManagementCluster(aPath.mAttributeId, aReader, aError); + } case Clusters::WebRTCTransportProvider::Id: { return DecodeAttributeValueForWebRTCTransportProviderCluster(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 8f23fc159f2ad1..693696cfe83537 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h @@ -14762,6 +14762,512 @@ MTR_PROVISIONALLY_AVAILABLE @end +/** + * Cluster Camera AV Stream Management + * + * The Camera AV Stream Management cluster is used to allow clients to manage, control, and configure various audio, video, and snapshot streams on a camera. + */ +MTR_PROVISIONALLY_AVAILABLE +@interface MTRBaseClusterCameraAVStreamManagement : MTRGenericBaseCluster + +/** + * Command AudioStreamAllocate + * + * This command SHALL allocate an audio stream on the camera and return an allocated audio stream identifier. + */ +- (void)audioStreamAllocateWithParams:(MTRCameraAVStreamManagementClusterAudioStreamAllocateParams *)params completion:(void (^)(MTRCameraAVStreamManagementClusterAudioStreamAllocateResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +/** + * Command AudioStreamDeallocate + * + * This command SHALL deallocate an audio stream on the camera, corresponding to the given audio stream identifier. + */ +- (void)audioStreamDeallocateWithParams:(MTRCameraAVStreamManagementClusterAudioStreamDeallocateParams *)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +/** + * Command VideoStreamAllocate + * + * This command SHALL allocate a video stream on the camera and return an allocated video stream identifier. + */ +- (void)videoStreamAllocateWithParams:(MTRCameraAVStreamManagementClusterVideoStreamAllocateParams *)params completion:(void (^)(MTRCameraAVStreamManagementClusterVideoStreamAllocateResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +/** + * Command VideoStreamModify + * + * This command SHALL be used to modify the resolution of a stream specified by the VideoStreamID. + */ +- (void)videoStreamModifyWithParams:(MTRCameraAVStreamManagementClusterVideoStreamModifyParams *)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +/** + * Command VideoStreamDeallocate + * + * This command SHALL deallocate a video stream on the camera, corresponding to the given video stream identifier. + */ +- (void)videoStreamDeallocateWithParams:(MTRCameraAVStreamManagementClusterVideoStreamDeallocateParams *)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +/** + * Command SnapshotStreamAllocate + * + * This command SHALL allocate a snapshot stream on the device and return an allocated snapshot stream identifier. + */ +- (void)snapshotStreamAllocateWithParams:(MTRCameraAVStreamManagementClusterSnapshotStreamAllocateParams *)params completion:(void (^)(MTRCameraAVStreamManagementClusterSnapshotStreamAllocateResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +/** + * Command SnapshotStreamDeallocate + * + * This command SHALL deallocate an snapshot stream on the camera, corresponding to the given snapshot stream identifier. + */ +- (void)snapshotStreamDeallocateWithParams:(MTRCameraAVStreamManagementClusterSnapshotStreamDeallocateParams *)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +/** + * Command SetStreamPriority + * + * + */ +- (void)setStreamPriorityWithParams:(MTRCameraAVStreamManagementClusterSetStreamPriorityParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)setStreamPriorityWithCompletion:(MTRStatusCompletion)completion + MTR_PROVISIONALLY_AVAILABLE; +/** + * Command CaptureSnapshot + * + * This command SHALL return a Snapshot from the camera. + */ +- (void)captureSnapshotWithParams:(MTRCameraAVStreamManagementClusterCaptureSnapshotParams *)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +/** + * Command SetViewport + * + * This command SHALL set the viewport in all video streams. + */ +- (void)setViewportWithParams:(MTRCameraAVStreamManagementClusterSetViewportParams *)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +/** + * Command SetImageRotation + * + * The data fields for this command SHALL be as follows: + */ +- (void)setImageRotationWithParams:(MTRCameraAVStreamManagementClusterSetImageRotationParams *)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +/** + * Command SetImageFlipHorizontal + * + * The data fields for this command SHALL be as follows: + */ +- (void)setImageFlipHorizontalWithParams:(MTRCameraAVStreamManagementClusterSetImageFlipHorizontalParams *)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +/** + * Command SetImageFlipVertical + * + * The data fields for this command SHALL be as follows: + */ +- (void)setImageFlipVerticalWithParams:(MTRCameraAVStreamManagementClusterSetImageFlipVerticalParams *)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +/** + * Command SetWatermark + * + * This command controls if the manufacturer watermark logo is enabled for a given video stream. + */ +- (void)setWatermarkWithParams:(MTRCameraAVStreamManagementClusterSetWatermarkParams *)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +/** + * Command SetOSD + * + * This command controls if the On Screen Display (OSD) of text such as date, time, timezone, and/or device name, is enabled for a given video stream. + */ +- (void)setOSDWithParams:(MTRCameraAVStreamManagementClusterSetOSDParams *)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeMaxConcurrentVideoEncodersWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeMaxConcurrentVideoEncodersWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeMaxConcurrentVideoEncodersWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeMaxEncodedPixelRateWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeMaxEncodedPixelRateWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeMaxEncodedPixelRateWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeVideoSensorParamsWithCompletion:(void (^)(MTRCameraAVStreamManagementClusterVideoSensorParamsStruct * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeVideoSensorParamsWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(MTRCameraAVStreamManagementClusterVideoSensorParamsStruct * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeVideoSensorParamsWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(MTRCameraAVStreamManagementClusterVideoSensorParamsStruct * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeNightVisionCapableWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeNightVisionCapableWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeNightVisionCapableWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeMinViewPortWidthWithCompletion:(void (^)(MTRCameraAVStreamManagementClusterVideoResolutionStruct * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeMinViewPortWidthWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(MTRCameraAVStreamManagementClusterVideoResolutionStruct * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeMinViewPortWidthWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(MTRCameraAVStreamManagementClusterVideoResolutionStruct * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeMinViewPortHeightWithCompletion:(void (^)(MTRCameraAVStreamManagementClusterVideoResolutionStruct * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeMinViewPortHeightWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(MTRCameraAVStreamManagementClusterVideoResolutionStruct * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeMinViewPortHeightWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(MTRCameraAVStreamManagementClusterVideoResolutionStruct * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeRateDistortionTradeOffPointsWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeRateDistortionTradeOffPointsWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeRateDistortionTradeOffPointsWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeMaxPreRollBufferSizeWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeMaxPreRollBufferSizeWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeMaxPreRollBufferSizeWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeMicrophoneCapabilitiesWithCompletion:(void (^)(MTRCameraAVStreamManagementClusterAudioCapabilitiesStruct * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeMicrophoneCapabilitiesWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(MTRCameraAVStreamManagementClusterAudioCapabilitiesStruct * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeMicrophoneCapabilitiesWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(MTRCameraAVStreamManagementClusterAudioCapabilitiesStruct * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeSpeakerCapabilitiesWithCompletion:(void (^)(MTRCameraAVStreamManagementClusterAudioCapabilitiesStruct * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeSpeakerCapabilitiesWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(MTRCameraAVStreamManagementClusterAudioCapabilitiesStruct * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeSpeakerCapabilitiesWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(MTRCameraAVStreamManagementClusterAudioCapabilitiesStruct * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeTwoWayTalkSupportWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeTwoWayTalkSupportWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeTwoWayTalkSupportWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeSupportedSnapshotParamsWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeSupportedSnapshotParamsWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeSupportedSnapshotParamsWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeHDRCapableWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeHDRCapableWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeHDRCapableWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeMaxNetworkBandwidthWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeMaxNetworkBandwidthWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeMaxNetworkBandwidthWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeCurrentFrameRateWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeCurrentFrameRateWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeCurrentFrameRateWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeHDRModeWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeHDRModeWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeHDRModeWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeHDRModeWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeHDRModeWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeCurrentVideoCodecsWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeCurrentVideoCodecsWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeCurrentVideoCodecsWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeCurrentSnapshotConfigWithCompletion:(void (^)(MTRCameraAVStreamManagementClusterSnapshotParamsStruct * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeCurrentSnapshotConfigWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(MTRCameraAVStreamManagementClusterSnapshotParamsStruct * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeCurrentSnapshotConfigWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(MTRCameraAVStreamManagementClusterSnapshotParamsStruct * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeFabricsUsingCameraWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeFabricsUsingCameraWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeFabricsUsingCameraWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeAllocatedVideoStreamsWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeAllocatedVideoStreamsWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeAllocatedVideoStreamsWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeAllocatedAudioStreamsWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeAllocatedAudioStreamsWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeAllocatedAudioStreamsWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeAllocatedSnapshotStreamsWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeAllocatedSnapshotStreamsWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeAllocatedSnapshotStreamsWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeRankedVideoStreamPrioritiesListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeRankedVideoStreamPrioritiesListWithValue:(NSArray * _Nonnull)value completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeRankedVideoStreamPrioritiesListWithValue:(NSArray * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeRankedVideoStreamPrioritiesListWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeRankedVideoStreamPrioritiesListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeSoftRecordingPrivacyModeSettingWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeSoftRecordingPrivacyModeSettingWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeSoftRecordingPrivacyModeSettingWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeSoftRecordingPrivacyModeSettingWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeSoftRecordingPrivacyModeSettingWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeSoftLivestreamPrivacyModeSettingWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeSoftLivestreamPrivacyModeSettingWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeSoftLivestreamPrivacyModeSettingWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeSoftLivestreamPrivacyModeSettingWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeSoftLivestreamPrivacyModeSettingWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeHardPrivacyModeWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeHardPrivacyModeWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeHardPrivacyModeWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeNightVisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeNightVisionWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeNightVisionWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeNightVisionWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeNightVisionWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeNightVisionIllumWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeNightVisionIllumWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeNightVisionIllumWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeNightVisionIllumWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeNightVisionIllumWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeAWBWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeAWBWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeAWBWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeAWBWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeAWBWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeShutterSpeedWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeShutterSpeedWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeShutterSpeedWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeShutterSpeedWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeShutterSpeedWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeISOWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeISOWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeISOWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeISOWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeISOWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeViewportWithCompletion:(void (^)(MTRCameraAVStreamManagementClusterViewportStruct * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeViewportWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(MTRCameraAVStreamManagementClusterViewportStruct * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeViewportWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(MTRCameraAVStreamManagementClusterViewportStruct * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeSpeakerEnabledWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeSpeakerEnabledWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeSpeakerEnabledWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeSpeakerEnabledWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeSpeakerEnabledWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeSpeakerVolumeLevelWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeSpeakerVolumeLevelWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeSpeakerVolumeLevelWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeSpeakerVolumeLevelWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeSpeakerVolumeLevelWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeSpeakerMaxLevelWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeSpeakerMaxLevelWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeSpeakerMaxLevelWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeSpeakerMaxLevelWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeSpeakerMaxLevelWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeSpeakerMinLevelWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeSpeakerMinLevelWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeSpeakerMinLevelWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeSpeakerMinLevelWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeSpeakerMinLevelWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeMicStatusWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeMicStatusWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeMicStatusWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeMicStatusWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeMicStatusWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeMicVolumeLevelWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeMicVolumeLevelWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeMicVolumeLevelWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeMicVolumeLevelWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeMicVolumeLevelWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeMicMaxLevelWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeMicMaxLevelWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeMicMaxLevelWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeMicMaxLevelWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeMicMaxLevelWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeMicMinLevelWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeMicMinLevelWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeMicMinLevelWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeMicMinLevelWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeMicMinLevelWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeMicAGCEnabledWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeMicAGCEnabledWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeMicAGCEnabledWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeMicAGCEnabledWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeMicAGCEnabledWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeImageRotationWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeImageRotationWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeImageRotationWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeImageFlipHorizontalWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeImageFlipHorizontalWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeImageFlipHorizontalWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeImageFlipVerticalWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeImageFlipVerticalWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeImageFlipVerticalWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeLocalVideoRecordingEnabledWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeLocalVideoRecordingEnabledWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeLocalVideoRecordingEnabledWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeLocalVideoRecordingEnabledWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeLocalVideoRecordingEnabledWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeLocalSnapshotRecordingEnabledWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeLocalSnapshotRecordingEnabledWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeLocalSnapshotRecordingEnabledWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeLocalSnapshotRecordingEnabledWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeLocalSnapshotRecordingEnabledWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeStatusLightWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeStatusLightWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeStatusLightWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeStatusLightWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeStatusLightWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeStatusLightBrightnessWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeStatusLightBrightnessWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeStatusLightBrightnessWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeStatusLightBrightnessWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeStatusLightBrightnessWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeDepthSensorStatusWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeDepthSensorStatusWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeDepthSensorStatusWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeDepthSensorStatusWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeDepthSensorStatusWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeWatermarkEnabledWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeWatermarkEnabledWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeWatermarkEnabledWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeOSDEnabledWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeOSDEnabledWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeOSDEnabledWithClusterStateCache:(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)readAttributeEventListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeEventListWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeEventListWithClusterStateCache:(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 MTRBaseClusterCameraAVStreamManagement (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 WebRTC Transport Provider * @@ -20370,6 +20876,51 @@ typedef NS_ENUM(uint8_t, MTRContentAppObserverStatus) { MTRContentAppObserverStatusUnexpectedData MTR_PROVISIONALLY_AVAILABLE = 0x01, } MTR_PROVISIONALLY_AVAILABLE; +typedef NS_ENUM(uint8_t, MTRCameraAVStreamManagementAudioCodec) { + MTRCameraAVStreamManagementAudioCodecOPUS MTR_PROVISIONALLY_AVAILABLE = 0x00, + MTRCameraAVStreamManagementAudioCodecAACLC MTR_PROVISIONALLY_AVAILABLE = 0x01, +} MTR_PROVISIONALLY_AVAILABLE; + +typedef NS_ENUM(uint8_t, MTRCameraAVStreamManagementImageCodec) { + MTRCameraAVStreamManagementImageCodecJPEG MTR_PROVISIONALLY_AVAILABLE = 0x00, +} MTR_PROVISIONALLY_AVAILABLE; + +typedef NS_ENUM(uint8_t, MTRCameraAVStreamManagementStreamType) { + MTRCameraAVStreamManagementStreamTypeInternal MTR_PROVISIONALLY_AVAILABLE = 0x00, + MTRCameraAVStreamManagementStreamTypeRecording MTR_PROVISIONALLY_AVAILABLE = 0x01, + MTRCameraAVStreamManagementStreamTypeAnalysis MTR_PROVISIONALLY_AVAILABLE = 0x02, + MTRCameraAVStreamManagementStreamTypeLiveView MTR_PROVISIONALLY_AVAILABLE = 0x03, +} MTR_PROVISIONALLY_AVAILABLE; + +typedef NS_ENUM(uint8_t, MTRCameraAVStreamManagementTriStateAuto) { + MTRCameraAVStreamManagementTriStateAutoOff MTR_PROVISIONALLY_AVAILABLE = 0x00, + MTRCameraAVStreamManagementTriStateAutoOn MTR_PROVISIONALLY_AVAILABLE = 0x01, + MTRCameraAVStreamManagementTriStateAutoAuto MTR_PROVISIONALLY_AVAILABLE = 0x02, +} MTR_PROVISIONALLY_AVAILABLE; + +typedef NS_ENUM(uint8_t, MTRCameraAVStreamManagementTwoWayTalkSupportType) { + MTRCameraAVStreamManagementTwoWayTalkSupportTypeNotSupported MTR_PROVISIONALLY_AVAILABLE = 0x00, + MTRCameraAVStreamManagementTwoWayTalkSupportTypeHalfDuplex MTR_PROVISIONALLY_AVAILABLE = 0x01, + MTRCameraAVStreamManagementTwoWayTalkSupportTypeFullDuplex MTR_PROVISIONALLY_AVAILABLE = 0x02, +} MTR_PROVISIONALLY_AVAILABLE; + +typedef NS_ENUM(uint8_t, MTRCameraAVStreamManagementVideoCodec) { + MTRCameraAVStreamManagementVideoCodecH264 MTR_PROVISIONALLY_AVAILABLE = 0x00, + MTRCameraAVStreamManagementVideoCodecHEVC MTR_PROVISIONALLY_AVAILABLE = 0x01, + MTRCameraAVStreamManagementVideoCodecVVC MTR_PROVISIONALLY_AVAILABLE = 0x02, + MTRCameraAVStreamManagementVideoCodecAV1 MTR_PROVISIONALLY_AVAILABLE = 0x03, +} MTR_PROVISIONALLY_AVAILABLE; + +typedef NS_OPTIONS(uint32_t, MTRCameraAVStreamManagementFeature) { + MTRCameraAVStreamManagementFeaturePrivacy MTR_PROVISIONALLY_AVAILABLE = 0x1, + MTRCameraAVStreamManagementFeatureSensorControl MTR_PROVISIONALLY_AVAILABLE = 0x2, + MTRCameraAVStreamManagementFeatureAudio MTR_PROVISIONALLY_AVAILABLE = 0x4, + MTRCameraAVStreamManagementFeatureImageControl MTR_PROVISIONALLY_AVAILABLE = 0x8, + MTRCameraAVStreamManagementFeatureVideo MTR_PROVISIONALLY_AVAILABLE = 0x10, + MTRCameraAVStreamManagementFeatureSnapshot MTR_PROVISIONALLY_AVAILABLE = 0x20, + MTRCameraAVStreamManagementFeatureLocalStorage MTR_PROVISIONALLY_AVAILABLE = 0x40, +} MTR_PROVISIONALLY_AVAILABLE; + typedef NS_ENUM(uint8_t, MTRWebRTCTransportProviderStreamType) { MTRWebRTCTransportProviderStreamTypeInternal MTR_PROVISIONALLY_AVAILABLE = 0x00, MTRWebRTCTransportProviderStreamTypeRecording MTR_PROVISIONALLY_AVAILABLE = 0x01, diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm index 80e36303d3057e..e7032835f566bd 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm @@ -102121,6 +102121,3092 @@ + (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheC @end +@implementation MTRBaseClusterCameraAVStreamManagement + +- (void)audioStreamAllocateWithParams:(MTRCameraAVStreamManagementClusterAudioStreamAllocateParams *)params completion:(void (^)(MTRCameraAVStreamManagementClusterAudioStreamAllocateResponseParams * _Nullable data, NSError * _Nullable error))completion +{ + if (params == nil) { + params = [[MTRCameraAVStreamManagementClusterAudioStreamAllocateParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = CameraAvStreamManagement::Commands::AudioStreamAllocate::Type; + [self.device _invokeKnownCommandWithEndpointID:self.endpointID + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRCameraAVStreamManagementClusterAudioStreamAllocateResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} +- (void)audioStreamDeallocateWithParams:(MTRCameraAVStreamManagementClusterAudioStreamDeallocateParams *)params completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRCameraAVStreamManagementClusterAudioStreamDeallocateParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = CameraAvStreamManagement::Commands::AudioStreamDeallocate::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)videoStreamAllocateWithParams:(MTRCameraAVStreamManagementClusterVideoStreamAllocateParams *)params completion:(void (^)(MTRCameraAVStreamManagementClusterVideoStreamAllocateResponseParams * _Nullable data, NSError * _Nullable error))completion +{ + if (params == nil) { + params = [[MTRCameraAVStreamManagementClusterVideoStreamAllocateParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = CameraAvStreamManagement::Commands::VideoStreamAllocate::Type; + [self.device _invokeKnownCommandWithEndpointID:self.endpointID + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRCameraAVStreamManagementClusterVideoStreamAllocateResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} +- (void)videoStreamModifyWithParams:(MTRCameraAVStreamManagementClusterVideoStreamModifyParams *)params completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRCameraAVStreamManagementClusterVideoStreamModifyParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = CameraAvStreamManagement::Commands::VideoStreamModify::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)videoStreamDeallocateWithParams:(MTRCameraAVStreamManagementClusterVideoStreamDeallocateParams *)params completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRCameraAVStreamManagementClusterVideoStreamDeallocateParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = CameraAvStreamManagement::Commands::VideoStreamDeallocate::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)snapshotStreamAllocateWithParams:(MTRCameraAVStreamManagementClusterSnapshotStreamAllocateParams *)params completion:(void (^)(MTRCameraAVStreamManagementClusterSnapshotStreamAllocateResponseParams * _Nullable data, NSError * _Nullable error))completion +{ + if (params == nil) { + params = [[MTRCameraAVStreamManagementClusterSnapshotStreamAllocateParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = CameraAvStreamManagement::Commands::SnapshotStreamAllocate::Type; + [self.device _invokeKnownCommandWithEndpointID:self.endpointID + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRCameraAVStreamManagementClusterSnapshotStreamAllocateResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} +- (void)snapshotStreamDeallocateWithParams:(MTRCameraAVStreamManagementClusterSnapshotStreamDeallocateParams *)params completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRCameraAVStreamManagementClusterSnapshotStreamDeallocateParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = CameraAvStreamManagement::Commands::SnapshotStreamDeallocate::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)setStreamPriorityWithCompletion:(MTRStatusCompletion)completion +{ + [self setStreamPriorityWithParams:nil completion:completion]; +} +- (void)setStreamPriorityWithParams:(MTRCameraAVStreamManagementClusterSetStreamPriorityParams * _Nullable)params completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRCameraAVStreamManagementClusterSetStreamPriorityParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = CameraAvStreamManagement::Commands::SetStreamPriority::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)captureSnapshotWithParams:(MTRCameraAVStreamManagementClusterCaptureSnapshotParams *)params completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRCameraAVStreamManagementClusterCaptureSnapshotParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = CameraAvStreamManagement::Commands::CaptureSnapshot::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)setViewportWithParams:(MTRCameraAVStreamManagementClusterSetViewportParams *)params completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRCameraAVStreamManagementClusterSetViewportParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = CameraAvStreamManagement::Commands::SetViewport::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)setImageRotationWithParams:(MTRCameraAVStreamManagementClusterSetImageRotationParams *)params completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRCameraAVStreamManagementClusterSetImageRotationParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = CameraAvStreamManagement::Commands::SetImageRotation::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)setImageFlipHorizontalWithParams:(MTRCameraAVStreamManagementClusterSetImageFlipHorizontalParams *)params completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRCameraAVStreamManagementClusterSetImageFlipHorizontalParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = CameraAvStreamManagement::Commands::SetImageFlipHorizontal::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)setImageFlipVerticalWithParams:(MTRCameraAVStreamManagementClusterSetImageFlipVerticalParams *)params completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRCameraAVStreamManagementClusterSetImageFlipVerticalParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = CameraAvStreamManagement::Commands::SetImageFlipVertical::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)setWatermarkWithParams:(MTRCameraAVStreamManagementClusterSetWatermarkParams *)params completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRCameraAVStreamManagementClusterSetWatermarkParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = CameraAvStreamManagement::Commands::SetWatermark::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)setOSDWithParams:(MTRCameraAVStreamManagementClusterSetOSDParams *)params completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRCameraAVStreamManagementClusterSetOSDParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = CameraAvStreamManagement::Commands::SetOSD::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)readAttributeMaxConcurrentVideoEncodersWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::MaxConcurrentVideoEncoders::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeMaxConcurrentVideoEncodersWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvStreamManagement::Attributes::MaxConcurrentVideoEncoders::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeMaxConcurrentVideoEncodersWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::MaxConcurrentVideoEncoders::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeMaxEncodedPixelRateWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::MaxEncodedPixelRate::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeMaxEncodedPixelRateWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvStreamManagement::Attributes::MaxEncodedPixelRate::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeMaxEncodedPixelRateWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::MaxEncodedPixelRate::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeVideoSensorParamsWithCompletion:(void (^)(MTRCameraAVStreamManagementClusterVideoSensorParamsStruct * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::VideoSensorParams::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeVideoSensorParamsWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(MTRCameraAVStreamManagementClusterVideoSensorParamsStruct * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvStreamManagement::Attributes::VideoSensorParams::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeVideoSensorParamsWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(MTRCameraAVStreamManagementClusterVideoSensorParamsStruct * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::VideoSensorParams::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeNightVisionCapableWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::NightVisionCapable::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeNightVisionCapableWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvStreamManagement::Attributes::NightVisionCapable::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeNightVisionCapableWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::NightVisionCapable::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeMinViewPortWidthWithCompletion:(void (^)(MTRCameraAVStreamManagementClusterVideoResolutionStruct * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::MinViewPortWidth::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeMinViewPortWidthWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(MTRCameraAVStreamManagementClusterVideoResolutionStruct * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvStreamManagement::Attributes::MinViewPortWidth::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeMinViewPortWidthWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(MTRCameraAVStreamManagementClusterVideoResolutionStruct * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::MinViewPortWidth::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeMinViewPortHeightWithCompletion:(void (^)(MTRCameraAVStreamManagementClusterVideoResolutionStruct * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::MinViewPortHeight::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeMinViewPortHeightWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(MTRCameraAVStreamManagementClusterVideoResolutionStruct * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvStreamManagement::Attributes::MinViewPortHeight::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeMinViewPortHeightWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(MTRCameraAVStreamManagementClusterVideoResolutionStruct * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::MinViewPortHeight::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeRateDistortionTradeOffPointsWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::RateDistortionTradeOffPoints::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeRateDistortionTradeOffPointsWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvStreamManagement::Attributes::RateDistortionTradeOffPoints::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeRateDistortionTradeOffPointsWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::RateDistortionTradeOffPoints::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeMaxPreRollBufferSizeWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::MaxPreRollBufferSize::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeMaxPreRollBufferSizeWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvStreamManagement::Attributes::MaxPreRollBufferSize::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeMaxPreRollBufferSizeWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::MaxPreRollBufferSize::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeMicrophoneCapabilitiesWithCompletion:(void (^)(MTRCameraAVStreamManagementClusterAudioCapabilitiesStruct * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::MicrophoneCapabilities::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeMicrophoneCapabilitiesWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(MTRCameraAVStreamManagementClusterAudioCapabilitiesStruct * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvStreamManagement::Attributes::MicrophoneCapabilities::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeMicrophoneCapabilitiesWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(MTRCameraAVStreamManagementClusterAudioCapabilitiesStruct * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::MicrophoneCapabilities::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeSpeakerCapabilitiesWithCompletion:(void (^)(MTRCameraAVStreamManagementClusterAudioCapabilitiesStruct * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::SpeakerCapabilities::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeSpeakerCapabilitiesWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(MTRCameraAVStreamManagementClusterAudioCapabilitiesStruct * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvStreamManagement::Attributes::SpeakerCapabilities::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeSpeakerCapabilitiesWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(MTRCameraAVStreamManagementClusterAudioCapabilitiesStruct * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::SpeakerCapabilities::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeTwoWayTalkSupportWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::TwoWayTalkSupport::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeTwoWayTalkSupportWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvStreamManagement::Attributes::TwoWayTalkSupport::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeTwoWayTalkSupportWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::TwoWayTalkSupport::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeSupportedSnapshotParamsWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::SupportedSnapshotParams::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeSupportedSnapshotParamsWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvStreamManagement::Attributes::SupportedSnapshotParams::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeSupportedSnapshotParamsWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::SupportedSnapshotParams::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeHDRCapableWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::HDRCapable::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeHDRCapableWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvStreamManagement::Attributes::HDRCapable::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeHDRCapableWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::HDRCapable::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeMaxNetworkBandwidthWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::MaxNetworkBandwidth::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeMaxNetworkBandwidthWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvStreamManagement::Attributes::MaxNetworkBandwidth::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeMaxNetworkBandwidthWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::MaxNetworkBandwidth::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeCurrentFrameRateWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::CurrentFrameRate::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeCurrentFrameRateWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvStreamManagement::Attributes::CurrentFrameRate::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeCurrentFrameRateWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::CurrentFrameRate::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeHDRModeWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::HDRMode::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)writeAttributeHDRModeWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion +{ + [self writeAttributeHDRModeWithValue:(NSNumber * _Nonnull) value params:nil completion:completion]; +} +- (void)writeAttributeHDRModeWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion +{ + // Make a copy of params before we go async. + params = [params copy]; + value = [value copy]; + + auto * bridge = new MTRDefaultSuccessCallbackBridge(self.callbackQueue, ^(id _Nullable ignored, NSError * _Nullable error) { completion(error); }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, DefaultSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { + chip::Optional timedWriteTimeout; + if (params != nil) { + if (params.timedWriteTimeout != nil){ + timedWriteTimeout.SetValue(params.timedWriteTimeout.unsignedShortValue); + } + } + + ListFreer listFreer; + using TypeInfo = CameraAvStreamManagement::Attributes::HDRMode::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.boolValue; + + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); + return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); + std::move(*bridge).DispatchAction(self.device); +} + +- (void)subscribeAttributeHDRModeWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvStreamManagement::Attributes::HDRMode::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeHDRModeWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::HDRMode::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeCurrentVideoCodecsWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::CurrentVideoCodecs::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeCurrentVideoCodecsWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvStreamManagement::Attributes::CurrentVideoCodecs::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeCurrentVideoCodecsWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::CurrentVideoCodecs::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeCurrentSnapshotConfigWithCompletion:(void (^)(MTRCameraAVStreamManagementClusterSnapshotParamsStruct * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::CurrentSnapshotConfig::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeCurrentSnapshotConfigWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(MTRCameraAVStreamManagementClusterSnapshotParamsStruct * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvStreamManagement::Attributes::CurrentSnapshotConfig::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeCurrentSnapshotConfigWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(MTRCameraAVStreamManagementClusterSnapshotParamsStruct * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::CurrentSnapshotConfig::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeFabricsUsingCameraWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::FabricsUsingCamera::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeFabricsUsingCameraWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvStreamManagement::Attributes::FabricsUsingCamera::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeFabricsUsingCameraWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::FabricsUsingCamera::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeAllocatedVideoStreamsWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::AllocatedVideoStreams::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeAllocatedVideoStreamsWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvStreamManagement::Attributes::AllocatedVideoStreams::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeAllocatedVideoStreamsWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::AllocatedVideoStreams::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeAllocatedAudioStreamsWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::AllocatedAudioStreams::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeAllocatedAudioStreamsWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvStreamManagement::Attributes::AllocatedAudioStreams::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeAllocatedAudioStreamsWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::AllocatedAudioStreams::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeAllocatedSnapshotStreamsWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::AllocatedSnapshotStreams::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeAllocatedSnapshotStreamsWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvStreamManagement::Attributes::AllocatedSnapshotStreams::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeAllocatedSnapshotStreamsWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::AllocatedSnapshotStreams::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeRankedVideoStreamPrioritiesListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::RankedVideoStreamPrioritiesList::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)writeAttributeRankedVideoStreamPrioritiesListWithValue:(NSArray * _Nonnull)value completion:(MTRStatusCompletion)completion +{ + [self writeAttributeRankedVideoStreamPrioritiesListWithValue:(NSArray * _Nonnull) value params:nil completion:completion]; +} +- (void)writeAttributeRankedVideoStreamPrioritiesListWithValue:(NSArray * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion +{ + // Make a copy of params before we go async. + params = [params copy]; + value = [value copy]; + + auto * bridge = new MTRDefaultSuccessCallbackBridge(self.callbackQueue, ^(id _Nullable ignored, NSError * _Nullable error) { completion(error); }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, DefaultSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { + chip::Optional timedWriteTimeout; + if (params != nil) { + if (params.timedWriteTimeout != nil){ + timedWriteTimeout.SetValue(params.timedWriteTimeout.unsignedShortValue); + } + } + + ListFreer listFreer; + using TypeInfo = CameraAvStreamManagement::Attributes::RankedVideoStreamPrioritiesList::TypeInfo; + TypeInfo::Type cppValue; + { + using ListType_0 = std::remove_reference_t; + using ListMemberType_0 = ListMemberTypeGetter::Type; + if (value.count != 0) { + auto * listHolder_0 = new ListHolder(value.count); + if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_0); + for (size_t i_0 = 0; i_0 < value.count; ++i_0) { + if ( ! [value[i_0] isKindOfClass: [NSNumber class]] ) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_0 = (NSNumber *)value[i_0]; + listHolder_0->mList[i_0] = static_castmList[i_0])>>(element_0.unsignedCharValue); + } + cppValue = ListType_0(listHolder_0->mList, value.count); + } else { + cppValue = ListType_0(); + } + } + + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); + return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); + std::move(*bridge).DispatchAction(self.device); +} + +- (void)subscribeAttributeRankedVideoStreamPrioritiesListWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvStreamManagement::Attributes::RankedVideoStreamPrioritiesList::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeRankedVideoStreamPrioritiesListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::RankedVideoStreamPrioritiesList::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeSoftRecordingPrivacyModeSettingWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::SoftRecordingPrivacyModeSetting::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)writeAttributeSoftRecordingPrivacyModeSettingWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion +{ + [self writeAttributeSoftRecordingPrivacyModeSettingWithValue:(NSNumber * _Nonnull) value params:nil completion:completion]; +} +- (void)writeAttributeSoftRecordingPrivacyModeSettingWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion +{ + // Make a copy of params before we go async. + params = [params copy]; + value = [value copy]; + + auto * bridge = new MTRDefaultSuccessCallbackBridge(self.callbackQueue, ^(id _Nullable ignored, NSError * _Nullable error) { completion(error); }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, DefaultSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { + chip::Optional timedWriteTimeout; + if (params != nil) { + if (params.timedWriteTimeout != nil){ + timedWriteTimeout.SetValue(params.timedWriteTimeout.unsignedShortValue); + } + } + + ListFreer listFreer; + using TypeInfo = CameraAvStreamManagement::Attributes::SoftRecordingPrivacyModeSetting::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.boolValue; + + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); + return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); + std::move(*bridge).DispatchAction(self.device); +} + +- (void)subscribeAttributeSoftRecordingPrivacyModeSettingWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvStreamManagement::Attributes::SoftRecordingPrivacyModeSetting::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeSoftRecordingPrivacyModeSettingWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::SoftRecordingPrivacyModeSetting::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeSoftLivestreamPrivacyModeSettingWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::SoftLivestreamPrivacyModeSetting::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)writeAttributeSoftLivestreamPrivacyModeSettingWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion +{ + [self writeAttributeSoftLivestreamPrivacyModeSettingWithValue:(NSNumber * _Nonnull) value params:nil completion:completion]; +} +- (void)writeAttributeSoftLivestreamPrivacyModeSettingWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion +{ + // Make a copy of params before we go async. + params = [params copy]; + value = [value copy]; + + auto * bridge = new MTRDefaultSuccessCallbackBridge(self.callbackQueue, ^(id _Nullable ignored, NSError * _Nullable error) { completion(error); }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, DefaultSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { + chip::Optional timedWriteTimeout; + if (params != nil) { + if (params.timedWriteTimeout != nil){ + timedWriteTimeout.SetValue(params.timedWriteTimeout.unsignedShortValue); + } + } + + ListFreer listFreer; + using TypeInfo = CameraAvStreamManagement::Attributes::SoftLivestreamPrivacyModeSetting::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.boolValue; + + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); + return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); + std::move(*bridge).DispatchAction(self.device); +} + +- (void)subscribeAttributeSoftLivestreamPrivacyModeSettingWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvStreamManagement::Attributes::SoftLivestreamPrivacyModeSetting::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeSoftLivestreamPrivacyModeSettingWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::SoftLivestreamPrivacyModeSetting::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeHardPrivacyModeWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::HardPrivacyMode::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeHardPrivacyModeWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvStreamManagement::Attributes::HardPrivacyMode::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeHardPrivacyModeWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::HardPrivacyMode::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeNightVisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::NightVision::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)writeAttributeNightVisionWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion +{ + [self writeAttributeNightVisionWithValue:(NSNumber * _Nonnull) value params:nil completion:completion]; +} +- (void)writeAttributeNightVisionWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion +{ + // Make a copy of params before we go async. + params = [params copy]; + value = [value copy]; + + auto * bridge = new MTRDefaultSuccessCallbackBridge(self.callbackQueue, ^(id _Nullable ignored, NSError * _Nullable error) { completion(error); }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, DefaultSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { + chip::Optional timedWriteTimeout; + if (params != nil) { + if (params.timedWriteTimeout != nil){ + timedWriteTimeout.SetValue(params.timedWriteTimeout.unsignedShortValue); + } + } + + ListFreer listFreer; + using TypeInfo = CameraAvStreamManagement::Attributes::NightVision::TypeInfo; + TypeInfo::Type cppValue; + cppValue = static_cast>(value.unsignedCharValue); + + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); + return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); + std::move(*bridge).DispatchAction(self.device); +} + +- (void)subscribeAttributeNightVisionWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvStreamManagement::Attributes::NightVision::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeNightVisionWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::NightVision::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeNightVisionIllumWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::NightVisionIllum::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)writeAttributeNightVisionIllumWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion +{ + [self writeAttributeNightVisionIllumWithValue:(NSNumber * _Nonnull) value params:nil completion:completion]; +} +- (void)writeAttributeNightVisionIllumWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion +{ + // Make a copy of params before we go async. + params = [params copy]; + value = [value copy]; + + auto * bridge = new MTRDefaultSuccessCallbackBridge(self.callbackQueue, ^(id _Nullable ignored, NSError * _Nullable error) { completion(error); }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, DefaultSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { + chip::Optional timedWriteTimeout; + if (params != nil) { + if (params.timedWriteTimeout != nil){ + timedWriteTimeout.SetValue(params.timedWriteTimeout.unsignedShortValue); + } + } + + ListFreer listFreer; + using TypeInfo = CameraAvStreamManagement::Attributes::NightVisionIllum::TypeInfo; + TypeInfo::Type cppValue; + cppValue = static_cast>(value.unsignedCharValue); + + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); + return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); + std::move(*bridge).DispatchAction(self.device); +} + +- (void)subscribeAttributeNightVisionIllumWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvStreamManagement::Attributes::NightVisionIllum::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeNightVisionIllumWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::NightVisionIllum::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeAWBWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::Awb::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)writeAttributeAWBWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion +{ + [self writeAttributeAWBWithValue:(NSNumber * _Nonnull) value params:nil completion:completion]; +} +- (void)writeAttributeAWBWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion +{ + // Make a copy of params before we go async. + params = [params copy]; + value = [value copy]; + + auto * bridge = new MTRDefaultSuccessCallbackBridge(self.callbackQueue, ^(id _Nullable ignored, NSError * _Nullable error) { completion(error); }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, DefaultSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { + chip::Optional timedWriteTimeout; + if (params != nil) { + if (params.timedWriteTimeout != nil){ + timedWriteTimeout.SetValue(params.timedWriteTimeout.unsignedShortValue); + } + } + + ListFreer listFreer; + using TypeInfo = CameraAvStreamManagement::Attributes::Awb::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.boolValue; + + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); + return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); + std::move(*bridge).DispatchAction(self.device); +} + +- (void)subscribeAttributeAWBWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvStreamManagement::Attributes::Awb::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeAWBWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::Awb::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeShutterSpeedWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::ShutterSpeed::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)writeAttributeShutterSpeedWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion +{ + [self writeAttributeShutterSpeedWithValue:(NSNumber * _Nonnull) value params:nil completion:completion]; +} +- (void)writeAttributeShutterSpeedWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion +{ + // Make a copy of params before we go async. + params = [params copy]; + value = [value copy]; + + auto * bridge = new MTRDefaultSuccessCallbackBridge(self.callbackQueue, ^(id _Nullable ignored, NSError * _Nullable error) { completion(error); }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, DefaultSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { + chip::Optional timedWriteTimeout; + if (params != nil) { + if (params.timedWriteTimeout != nil){ + timedWriteTimeout.SetValue(params.timedWriteTimeout.unsignedShortValue); + } + } + + ListFreer listFreer; + using TypeInfo = CameraAvStreamManagement::Attributes::ShutterSpeed::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.boolValue; + + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); + return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); + std::move(*bridge).DispatchAction(self.device); +} + +- (void)subscribeAttributeShutterSpeedWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvStreamManagement::Attributes::ShutterSpeed::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeShutterSpeedWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::ShutterSpeed::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeISOWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::Iso::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)writeAttributeISOWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion +{ + [self writeAttributeISOWithValue:(NSNumber * _Nonnull) value params:nil completion:completion]; +} +- (void)writeAttributeISOWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion +{ + // Make a copy of params before we go async. + params = [params copy]; + value = [value copy]; + + auto * bridge = new MTRDefaultSuccessCallbackBridge(self.callbackQueue, ^(id _Nullable ignored, NSError * _Nullable error) { completion(error); }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, DefaultSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { + chip::Optional timedWriteTimeout; + if (params != nil) { + if (params.timedWriteTimeout != nil){ + timedWriteTimeout.SetValue(params.timedWriteTimeout.unsignedShortValue); + } + } + + ListFreer listFreer; + using TypeInfo = CameraAvStreamManagement::Attributes::Iso::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.boolValue; + + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); + return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); + std::move(*bridge).DispatchAction(self.device); +} + +- (void)subscribeAttributeISOWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvStreamManagement::Attributes::Iso::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeISOWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::Iso::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeViewportWithCompletion:(void (^)(MTRCameraAVStreamManagementClusterViewportStruct * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::Viewport::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeViewportWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(MTRCameraAVStreamManagementClusterViewportStruct * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvStreamManagement::Attributes::Viewport::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeViewportWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(MTRCameraAVStreamManagementClusterViewportStruct * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::Viewport::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeSpeakerEnabledWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::SpeakerEnabled::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)writeAttributeSpeakerEnabledWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion +{ + [self writeAttributeSpeakerEnabledWithValue:(NSNumber * _Nonnull) value params:nil completion:completion]; +} +- (void)writeAttributeSpeakerEnabledWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion +{ + // Make a copy of params before we go async. + params = [params copy]; + value = [value copy]; + + auto * bridge = new MTRDefaultSuccessCallbackBridge(self.callbackQueue, ^(id _Nullable ignored, NSError * _Nullable error) { completion(error); }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, DefaultSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { + chip::Optional timedWriteTimeout; + if (params != nil) { + if (params.timedWriteTimeout != nil){ + timedWriteTimeout.SetValue(params.timedWriteTimeout.unsignedShortValue); + } + } + + ListFreer listFreer; + using TypeInfo = CameraAvStreamManagement::Attributes::SpeakerEnabled::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.boolValue; + + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); + return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); + std::move(*bridge).DispatchAction(self.device); +} + +- (void)subscribeAttributeSpeakerEnabledWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvStreamManagement::Attributes::SpeakerEnabled::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeSpeakerEnabledWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::SpeakerEnabled::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeSpeakerVolumeLevelWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::SpeakerVolumeLevel::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)writeAttributeSpeakerVolumeLevelWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion +{ + [self writeAttributeSpeakerVolumeLevelWithValue:(NSNumber * _Nonnull) value params:nil completion:completion]; +} +- (void)writeAttributeSpeakerVolumeLevelWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion +{ + // Make a copy of params before we go async. + params = [params copy]; + value = [value copy]; + + auto * bridge = new MTRDefaultSuccessCallbackBridge(self.callbackQueue, ^(id _Nullable ignored, NSError * _Nullable error) { completion(error); }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, DefaultSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { + chip::Optional timedWriteTimeout; + if (params != nil) { + if (params.timedWriteTimeout != nil){ + timedWriteTimeout.SetValue(params.timedWriteTimeout.unsignedShortValue); + } + } + + ListFreer listFreer; + using TypeInfo = CameraAvStreamManagement::Attributes::SpeakerVolumeLevel::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedCharValue; + + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); + return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); + std::move(*bridge).DispatchAction(self.device); +} + +- (void)subscribeAttributeSpeakerVolumeLevelWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvStreamManagement::Attributes::SpeakerVolumeLevel::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeSpeakerVolumeLevelWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::SpeakerVolumeLevel::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeSpeakerMaxLevelWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::SpeakerMaxLevel::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)writeAttributeSpeakerMaxLevelWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion +{ + [self writeAttributeSpeakerMaxLevelWithValue:(NSNumber * _Nonnull) value params:nil completion:completion]; +} +- (void)writeAttributeSpeakerMaxLevelWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion +{ + // Make a copy of params before we go async. + params = [params copy]; + value = [value copy]; + + auto * bridge = new MTRDefaultSuccessCallbackBridge(self.callbackQueue, ^(id _Nullable ignored, NSError * _Nullable error) { completion(error); }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, DefaultSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { + chip::Optional timedWriteTimeout; + if (params != nil) { + if (params.timedWriteTimeout != nil){ + timedWriteTimeout.SetValue(params.timedWriteTimeout.unsignedShortValue); + } + } + + ListFreer listFreer; + using TypeInfo = CameraAvStreamManagement::Attributes::SpeakerMaxLevel::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedCharValue; + + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); + return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); + std::move(*bridge).DispatchAction(self.device); +} + +- (void)subscribeAttributeSpeakerMaxLevelWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvStreamManagement::Attributes::SpeakerMaxLevel::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeSpeakerMaxLevelWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::SpeakerMaxLevel::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeSpeakerMinLevelWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::SpeakerMinLevel::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)writeAttributeSpeakerMinLevelWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion +{ + [self writeAttributeSpeakerMinLevelWithValue:(NSNumber * _Nonnull) value params:nil completion:completion]; +} +- (void)writeAttributeSpeakerMinLevelWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion +{ + // Make a copy of params before we go async. + params = [params copy]; + value = [value copy]; + + auto * bridge = new MTRDefaultSuccessCallbackBridge(self.callbackQueue, ^(id _Nullable ignored, NSError * _Nullable error) { completion(error); }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, DefaultSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { + chip::Optional timedWriteTimeout; + if (params != nil) { + if (params.timedWriteTimeout != nil){ + timedWriteTimeout.SetValue(params.timedWriteTimeout.unsignedShortValue); + } + } + + ListFreer listFreer; + using TypeInfo = CameraAvStreamManagement::Attributes::SpeakerMinLevel::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedCharValue; + + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); + return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); + std::move(*bridge).DispatchAction(self.device); +} + +- (void)subscribeAttributeSpeakerMinLevelWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvStreamManagement::Attributes::SpeakerMinLevel::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeSpeakerMinLevelWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::SpeakerMinLevel::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeMicStatusWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::MicStatus::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)writeAttributeMicStatusWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion +{ + [self writeAttributeMicStatusWithValue:(NSNumber * _Nonnull) value params:nil completion:completion]; +} +- (void)writeAttributeMicStatusWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion +{ + // Make a copy of params before we go async. + params = [params copy]; + value = [value copy]; + + auto * bridge = new MTRDefaultSuccessCallbackBridge(self.callbackQueue, ^(id _Nullable ignored, NSError * _Nullable error) { completion(error); }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, DefaultSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { + chip::Optional timedWriteTimeout; + if (params != nil) { + if (params.timedWriteTimeout != nil){ + timedWriteTimeout.SetValue(params.timedWriteTimeout.unsignedShortValue); + } + } + + ListFreer listFreer; + using TypeInfo = CameraAvStreamManagement::Attributes::MicStatus::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.boolValue; + + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); + return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); + std::move(*bridge).DispatchAction(self.device); +} + +- (void)subscribeAttributeMicStatusWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvStreamManagement::Attributes::MicStatus::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeMicStatusWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::MicStatus::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeMicVolumeLevelWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::MicVolumeLevel::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)writeAttributeMicVolumeLevelWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion +{ + [self writeAttributeMicVolumeLevelWithValue:(NSNumber * _Nonnull) value params:nil completion:completion]; +} +- (void)writeAttributeMicVolumeLevelWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion +{ + // Make a copy of params before we go async. + params = [params copy]; + value = [value copy]; + + auto * bridge = new MTRDefaultSuccessCallbackBridge(self.callbackQueue, ^(id _Nullable ignored, NSError * _Nullable error) { completion(error); }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, DefaultSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { + chip::Optional timedWriteTimeout; + if (params != nil) { + if (params.timedWriteTimeout != nil){ + timedWriteTimeout.SetValue(params.timedWriteTimeout.unsignedShortValue); + } + } + + ListFreer listFreer; + using TypeInfo = CameraAvStreamManagement::Attributes::MicVolumeLevel::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedCharValue; + + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); + return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); + std::move(*bridge).DispatchAction(self.device); +} + +- (void)subscribeAttributeMicVolumeLevelWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvStreamManagement::Attributes::MicVolumeLevel::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeMicVolumeLevelWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::MicVolumeLevel::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeMicMaxLevelWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::MicMaxLevel::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)writeAttributeMicMaxLevelWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion +{ + [self writeAttributeMicMaxLevelWithValue:(NSNumber * _Nonnull) value params:nil completion:completion]; +} +- (void)writeAttributeMicMaxLevelWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion +{ + // Make a copy of params before we go async. + params = [params copy]; + value = [value copy]; + + auto * bridge = new MTRDefaultSuccessCallbackBridge(self.callbackQueue, ^(id _Nullable ignored, NSError * _Nullable error) { completion(error); }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, DefaultSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { + chip::Optional timedWriteTimeout; + if (params != nil) { + if (params.timedWriteTimeout != nil){ + timedWriteTimeout.SetValue(params.timedWriteTimeout.unsignedShortValue); + } + } + + ListFreer listFreer; + using TypeInfo = CameraAvStreamManagement::Attributes::MicMaxLevel::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedCharValue; + + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); + return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); + std::move(*bridge).DispatchAction(self.device); +} + +- (void)subscribeAttributeMicMaxLevelWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvStreamManagement::Attributes::MicMaxLevel::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeMicMaxLevelWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::MicMaxLevel::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeMicMinLevelWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::MicMinLevel::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)writeAttributeMicMinLevelWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion +{ + [self writeAttributeMicMinLevelWithValue:(NSNumber * _Nonnull) value params:nil completion:completion]; +} +- (void)writeAttributeMicMinLevelWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion +{ + // Make a copy of params before we go async. + params = [params copy]; + value = [value copy]; + + auto * bridge = new MTRDefaultSuccessCallbackBridge(self.callbackQueue, ^(id _Nullable ignored, NSError * _Nullable error) { completion(error); }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, DefaultSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { + chip::Optional timedWriteTimeout; + if (params != nil) { + if (params.timedWriteTimeout != nil){ + timedWriteTimeout.SetValue(params.timedWriteTimeout.unsignedShortValue); + } + } + + ListFreer listFreer; + using TypeInfo = CameraAvStreamManagement::Attributes::MicMinLevel::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedCharValue; + + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); + return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); + std::move(*bridge).DispatchAction(self.device); +} + +- (void)subscribeAttributeMicMinLevelWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvStreamManagement::Attributes::MicMinLevel::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeMicMinLevelWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::MicMinLevel::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeMicAGCEnabledWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::MicAGCEnabled::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)writeAttributeMicAGCEnabledWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion +{ + [self writeAttributeMicAGCEnabledWithValue:(NSNumber * _Nonnull) value params:nil completion:completion]; +} +- (void)writeAttributeMicAGCEnabledWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion +{ + // Make a copy of params before we go async. + params = [params copy]; + value = [value copy]; + + auto * bridge = new MTRDefaultSuccessCallbackBridge(self.callbackQueue, ^(id _Nullable ignored, NSError * _Nullable error) { completion(error); }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, DefaultSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { + chip::Optional timedWriteTimeout; + if (params != nil) { + if (params.timedWriteTimeout != nil){ + timedWriteTimeout.SetValue(params.timedWriteTimeout.unsignedShortValue); + } + } + + ListFreer listFreer; + using TypeInfo = CameraAvStreamManagement::Attributes::MicAGCEnabled::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.boolValue; + + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); + return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); + std::move(*bridge).DispatchAction(self.device); +} + +- (void)subscribeAttributeMicAGCEnabledWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvStreamManagement::Attributes::MicAGCEnabled::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeMicAGCEnabledWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::MicAGCEnabled::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeImageRotationWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::ImageRotation::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeImageRotationWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvStreamManagement::Attributes::ImageRotation::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeImageRotationWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::ImageRotation::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeImageFlipHorizontalWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::ImageFlipHorizontal::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeImageFlipHorizontalWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvStreamManagement::Attributes::ImageFlipHorizontal::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeImageFlipHorizontalWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::ImageFlipHorizontal::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeImageFlipVerticalWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::ImageFlipVertical::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeImageFlipVerticalWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvStreamManagement::Attributes::ImageFlipVertical::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeImageFlipVerticalWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::ImageFlipVertical::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeLocalVideoRecordingEnabledWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::LocalVideoRecordingEnabled::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)writeAttributeLocalVideoRecordingEnabledWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion +{ + [self writeAttributeLocalVideoRecordingEnabledWithValue:(NSNumber * _Nonnull) value params:nil completion:completion]; +} +- (void)writeAttributeLocalVideoRecordingEnabledWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion +{ + // Make a copy of params before we go async. + params = [params copy]; + value = [value copy]; + + auto * bridge = new MTRDefaultSuccessCallbackBridge(self.callbackQueue, ^(id _Nullable ignored, NSError * _Nullable error) { completion(error); }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, DefaultSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { + chip::Optional timedWriteTimeout; + if (params != nil) { + if (params.timedWriteTimeout != nil){ + timedWriteTimeout.SetValue(params.timedWriteTimeout.unsignedShortValue); + } + } + + ListFreer listFreer; + using TypeInfo = CameraAvStreamManagement::Attributes::LocalVideoRecordingEnabled::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.boolValue; + + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); + return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); + std::move(*bridge).DispatchAction(self.device); +} + +- (void)subscribeAttributeLocalVideoRecordingEnabledWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvStreamManagement::Attributes::LocalVideoRecordingEnabled::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeLocalVideoRecordingEnabledWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::LocalVideoRecordingEnabled::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeLocalSnapshotRecordingEnabledWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::LocalSnapshotRecordingEnabled::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)writeAttributeLocalSnapshotRecordingEnabledWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion +{ + [self writeAttributeLocalSnapshotRecordingEnabledWithValue:(NSNumber * _Nonnull) value params:nil completion:completion]; +} +- (void)writeAttributeLocalSnapshotRecordingEnabledWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion +{ + // Make a copy of params before we go async. + params = [params copy]; + value = [value copy]; + + auto * bridge = new MTRDefaultSuccessCallbackBridge(self.callbackQueue, ^(id _Nullable ignored, NSError * _Nullable error) { completion(error); }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, DefaultSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { + chip::Optional timedWriteTimeout; + if (params != nil) { + if (params.timedWriteTimeout != nil){ + timedWriteTimeout.SetValue(params.timedWriteTimeout.unsignedShortValue); + } + } + + ListFreer listFreer; + using TypeInfo = CameraAvStreamManagement::Attributes::LocalSnapshotRecordingEnabled::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.boolValue; + + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); + return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); + std::move(*bridge).DispatchAction(self.device); +} + +- (void)subscribeAttributeLocalSnapshotRecordingEnabledWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvStreamManagement::Attributes::LocalSnapshotRecordingEnabled::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeLocalSnapshotRecordingEnabledWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::LocalSnapshotRecordingEnabled::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeStatusLightWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::StatusLight::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)writeAttributeStatusLightWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion +{ + [self writeAttributeStatusLightWithValue:(NSNumber * _Nonnull) value params:nil completion:completion]; +} +- (void)writeAttributeStatusLightWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion +{ + // Make a copy of params before we go async. + params = [params copy]; + value = [value copy]; + + auto * bridge = new MTRDefaultSuccessCallbackBridge(self.callbackQueue, ^(id _Nullable ignored, NSError * _Nullable error) { completion(error); }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, DefaultSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { + chip::Optional timedWriteTimeout; + if (params != nil) { + if (params.timedWriteTimeout != nil){ + timedWriteTimeout.SetValue(params.timedWriteTimeout.unsignedShortValue); + } + } + + ListFreer listFreer; + using TypeInfo = CameraAvStreamManagement::Attributes::StatusLight::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.boolValue; + + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); + return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); + std::move(*bridge).DispatchAction(self.device); +} + +- (void)subscribeAttributeStatusLightWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvStreamManagement::Attributes::StatusLight::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeStatusLightWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::StatusLight::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeStatusLightBrightnessWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::StatusLightBrightness::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)writeAttributeStatusLightBrightnessWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion +{ + [self writeAttributeStatusLightBrightnessWithValue:(NSNumber * _Nonnull) value params:nil completion:completion]; +} +- (void)writeAttributeStatusLightBrightnessWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion +{ + // Make a copy of params before we go async. + params = [params copy]; + value = [value copy]; + + auto * bridge = new MTRDefaultSuccessCallbackBridge(self.callbackQueue, ^(id _Nullable ignored, NSError * _Nullable error) { completion(error); }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, DefaultSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { + chip::Optional timedWriteTimeout; + if (params != nil) { + if (params.timedWriteTimeout != nil){ + timedWriteTimeout.SetValue(params.timedWriteTimeout.unsignedShortValue); + } + } + + ListFreer listFreer; + using TypeInfo = CameraAvStreamManagement::Attributes::StatusLightBrightness::TypeInfo; + TypeInfo::Type cppValue; + cppValue = static_cast>(value.unsignedCharValue); + + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); + return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); + std::move(*bridge).DispatchAction(self.device); +} + +- (void)subscribeAttributeStatusLightBrightnessWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvStreamManagement::Attributes::StatusLightBrightness::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeStatusLightBrightnessWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::StatusLightBrightness::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeDepthSensorStatusWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::DepthSensorStatus::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)writeAttributeDepthSensorStatusWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion +{ + [self writeAttributeDepthSensorStatusWithValue:(NSNumber * _Nonnull) value params:nil completion:completion]; +} +- (void)writeAttributeDepthSensorStatusWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion +{ + // Make a copy of params before we go async. + params = [params copy]; + value = [value copy]; + + auto * bridge = new MTRDefaultSuccessCallbackBridge(self.callbackQueue, ^(id _Nullable ignored, NSError * _Nullable error) { completion(error); }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, DefaultSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { + chip::Optional timedWriteTimeout; + if (params != nil) { + if (params.timedWriteTimeout != nil){ + timedWriteTimeout.SetValue(params.timedWriteTimeout.unsignedShortValue); + } + } + + ListFreer listFreer; + using TypeInfo = CameraAvStreamManagement::Attributes::DepthSensorStatus::TypeInfo; + TypeInfo::Type cppValue; + cppValue = static_cast>(value.unsignedCharValue); + + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); + return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); + std::move(*bridge).DispatchAction(self.device); +} + +- (void)subscribeAttributeDepthSensorStatusWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvStreamManagement::Attributes::DepthSensorStatus::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeDepthSensorStatusWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::DepthSensorStatus::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeWatermarkEnabledWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::WatermarkEnabled::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeWatermarkEnabledWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvStreamManagement::Attributes::WatermarkEnabled::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeWatermarkEnabledWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::WatermarkEnabled::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeOSDEnabledWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::OSDEnabled::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeOSDEnabledWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvStreamManagement::Attributes::OSDEnabled::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeOSDEnabledWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::OSDEnabled::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 = CameraAvStreamManagement::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 = CameraAvStreamManagement::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 = CameraAvStreamManagement::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 = CameraAvStreamManagement::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 = CameraAvStreamManagement::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 = CameraAvStreamManagement::Attributes::AcceptedCommandList::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeEventListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::EventList::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeEventListWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvStreamManagement::Attributes::EventList::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeEventListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::EventList::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 = CameraAvStreamManagement::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 = CameraAvStreamManagement::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 = CameraAvStreamManagement::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 = CameraAvStreamManagement::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 = CameraAvStreamManagement::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 = CameraAvStreamManagement::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 = CameraAvStreamManagement::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 = CameraAvStreamManagement::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 = CameraAvStreamManagement::Attributes::ClusterRevision::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +@end + @implementation MTRBaseClusterWebRTCTransportProvider - (void)solicitOfferWithParams:(MTRWebRTCTransportProviderClusterSolicitOfferParams *)params completion:(void (^)(MTRWebRTCTransportProviderClusterSolicitOfferResponseParams * _Nullable data, NSError * _Nullable error))completion diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h index fdefd1f503b080..acb7c48d7f18df 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h @@ -197,6 +197,7 @@ typedef NS_ENUM(uint32_t, MTRClusterIDType) { MTRClusterIDTypeAccountLoginID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x0000050E, MTRClusterIDTypeContentControlID MTR_PROVISIONALLY_AVAILABLE = 0x0000050F, MTRClusterIDTypeContentAppObserverID MTR_PROVISIONALLY_AVAILABLE = 0x00000510, + MTRClusterIDTypeCameraAVStreamManagementID MTR_PROVISIONALLY_AVAILABLE = 0x00000551, MTRClusterIDTypeWebRTCTransportProviderID MTR_PROVISIONALLY_AVAILABLE = 0x00000553, MTRClusterIDTypeWebRTCTransportRequestorID MTR_PROVISIONALLY_AVAILABLE = 0x00000554, MTRClusterIDTypeChimeID MTR_PROVISIONALLY_AVAILABLE = 0x00000556, @@ -4742,6 +4743,65 @@ typedef NS_ENUM(uint32_t, MTRAttributeIDType) { MTRAttributeIDTypeClusterContentAppObserverAttributeFeatureMapID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeFeatureMapID, MTRAttributeIDTypeClusterContentAppObserverAttributeClusterRevisionID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeClusterRevisionID, + // Cluster CameraAVStreamManagement attributes + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeMaxConcurrentVideoEncodersID MTR_PROVISIONALLY_AVAILABLE = 0x00000000, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeMaxEncodedPixelRateID MTR_PROVISIONALLY_AVAILABLE = 0x00000001, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeVideoSensorParamsID MTR_PROVISIONALLY_AVAILABLE = 0x00000002, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeNightVisionCapableID MTR_PROVISIONALLY_AVAILABLE = 0x00000003, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeMinViewPortWidthID MTR_PROVISIONALLY_AVAILABLE = 0x00000004, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeMinViewPortHeightID MTR_PROVISIONALLY_AVAILABLE = 0x00000005, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeRateDistortionTradeOffPointsID MTR_PROVISIONALLY_AVAILABLE = 0x00000006, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeMaxPreRollBufferSizeID MTR_PROVISIONALLY_AVAILABLE = 0x00000007, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeMicrophoneCapabilitiesID MTR_PROVISIONALLY_AVAILABLE = 0x00000008, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeSpeakerCapabilitiesID MTR_PROVISIONALLY_AVAILABLE = 0x00000009, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeTwoWayTalkSupportID MTR_PROVISIONALLY_AVAILABLE = 0x0000000A, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeSupportedSnapshotParamsID MTR_PROVISIONALLY_AVAILABLE = 0x0000000B, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeHDRCapableID MTR_PROVISIONALLY_AVAILABLE = 0x0000000C, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeMaxNetworkBandwidthID MTR_PROVISIONALLY_AVAILABLE = 0x0000000D, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeCurrentFrameRateID MTR_PROVISIONALLY_AVAILABLE = 0x0000000E, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeHDRModeID MTR_PROVISIONALLY_AVAILABLE = 0x0000000F, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeCurrentVideoCodecsID MTR_PROVISIONALLY_AVAILABLE = 0x00000010, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeCurrentSnapshotConfigID MTR_PROVISIONALLY_AVAILABLE = 0x00000011, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeFabricsUsingCameraID MTR_PROVISIONALLY_AVAILABLE = 0x00000012, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeAllocatedVideoStreamsID MTR_PROVISIONALLY_AVAILABLE = 0x00000013, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeAllocatedAudioStreamsID MTR_PROVISIONALLY_AVAILABLE = 0x00000014, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeAllocatedSnapshotStreamsID MTR_PROVISIONALLY_AVAILABLE = 0x00000015, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeRankedVideoStreamPrioritiesListID MTR_PROVISIONALLY_AVAILABLE = 0x00000016, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeSoftRecordingPrivacyModeSettingID MTR_PROVISIONALLY_AVAILABLE = 0x00000017, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeSoftLivestreamPrivacyModeSettingID MTR_PROVISIONALLY_AVAILABLE = 0x00000018, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeHardPrivacyModeID MTR_PROVISIONALLY_AVAILABLE = 0x00000019, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeNightVisionID MTR_PROVISIONALLY_AVAILABLE = 0x0000001A, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeNightVisionIllumID MTR_PROVISIONALLY_AVAILABLE = 0x0000001B, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeAWBID MTR_PROVISIONALLY_AVAILABLE = 0x0000001C, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeShutterSpeedID MTR_PROVISIONALLY_AVAILABLE = 0x0000001D, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeISOID MTR_PROVISIONALLY_AVAILABLE = 0x0000001E, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeViewportID MTR_PROVISIONALLY_AVAILABLE = 0x0000001F, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeSpeakerEnabledID MTR_PROVISIONALLY_AVAILABLE = 0x00000020, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeSpeakerVolumeLevelID MTR_PROVISIONALLY_AVAILABLE = 0x00000021, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeSpeakerMaxLevelID MTR_PROVISIONALLY_AVAILABLE = 0x00000022, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeSpeakerMinLevelID MTR_PROVISIONALLY_AVAILABLE = 0x00000023, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeMicStatusID MTR_PROVISIONALLY_AVAILABLE = 0x00000024, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeMicVolumeLevelID MTR_PROVISIONALLY_AVAILABLE = 0x00000025, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeMicMaxLevelID MTR_PROVISIONALLY_AVAILABLE = 0x00000026, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeMicMinLevelID MTR_PROVISIONALLY_AVAILABLE = 0x00000027, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeMicAGCEnabledID MTR_PROVISIONALLY_AVAILABLE = 0x00000028, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeImageRotationID MTR_PROVISIONALLY_AVAILABLE = 0x00000029, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeImageFlipHorizontalID MTR_PROVISIONALLY_AVAILABLE = 0x0000002A, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeImageFlipVerticalID MTR_PROVISIONALLY_AVAILABLE = 0x0000002B, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeLocalVideoRecordingEnabledID MTR_PROVISIONALLY_AVAILABLE = 0x0000002C, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeLocalSnapshotRecordingEnabledID MTR_PROVISIONALLY_AVAILABLE = 0x0000002D, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeStatusLightID MTR_PROVISIONALLY_AVAILABLE = 0x0000002E, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeStatusLightBrightnessID MTR_PROVISIONALLY_AVAILABLE = 0x0000002F, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeDepthSensorStatusID MTR_PROVISIONALLY_AVAILABLE = 0x00000030, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeWatermarkEnabledID MTR_PROVISIONALLY_AVAILABLE = 0x00000031, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeOSDEnabledID MTR_PROVISIONALLY_AVAILABLE = 0x00000032, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeGeneratedCommandListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeGeneratedCommandListID, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeAcceptedCommandListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeAcceptedCommandListID, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeEventListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeEventListID, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeAttributeListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeAttributeListID, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeFeatureMapID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeFeatureMapID, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeClusterRevisionID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeClusterRevisionID, + // Cluster WebRTCTransportProvider attributes MTRAttributeIDTypeClusterWebRTCTransportProviderAttributeCurrentSessionsID MTR_PROVISIONALLY_AVAILABLE = 0x00000000, MTRAttributeIDTypeClusterWebRTCTransportProviderAttributeGeneratedCommandListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeGeneratedCommandListID, @@ -6964,6 +7024,27 @@ typedef NS_ENUM(uint32_t, MTRCommandIDType) { MTRCommandIDTypeClusterContentAppObserverCommandContentAppMessageID MTR_PROVISIONALLY_AVAILABLE = 0x00000000, MTRCommandIDTypeClusterContentAppObserverCommandContentAppMessageResponseID MTR_PROVISIONALLY_AVAILABLE = 0x00000001, + // Cluster CameraAVStreamManagement commands + MTRCommandIDTypeClusterCameraAVStreamManagementCommandAudioStreamAllocateID MTR_PROVISIONALLY_AVAILABLE = 0x00000000, + MTRCommandIDTypeClusterCameraAVStreamManagementCommandAudioStreamAllocateResponseID MTR_PROVISIONALLY_AVAILABLE = 0x00000001, + MTRCommandIDTypeClusterCameraAVStreamManagementCommandAudioStreamDeallocateID MTR_PROVISIONALLY_AVAILABLE = 0x00000002, + MTRCommandIDTypeClusterCameraAVStreamManagementCommandVideoStreamAllocateID MTR_PROVISIONALLY_AVAILABLE = 0x00000003, + MTRCommandIDTypeClusterCameraAVStreamManagementCommandVideoStreamAllocateResponseID MTR_PROVISIONALLY_AVAILABLE = 0x00000004, + MTRCommandIDTypeClusterCameraAVStreamManagementCommandVideoStreamModifyID MTR_PROVISIONALLY_AVAILABLE = 0x00000005, + MTRCommandIDTypeClusterCameraAVStreamManagementCommandVideoStreamDeallocateID MTR_PROVISIONALLY_AVAILABLE = 0x00000006, + MTRCommandIDTypeClusterCameraAVStreamManagementCommandSnapshotStreamAllocateID MTR_PROVISIONALLY_AVAILABLE = 0x00000007, + MTRCommandIDTypeClusterCameraAVStreamManagementCommandSnapshotStreamAllocateResponseID MTR_PROVISIONALLY_AVAILABLE = 0x00000008, + MTRCommandIDTypeClusterCameraAVStreamManagementCommandSnapshotStreamDeallocateID MTR_PROVISIONALLY_AVAILABLE = 0x00000009, + MTRCommandIDTypeClusterCameraAVStreamManagementCommandSetStreamPriorityID MTR_PROVISIONALLY_AVAILABLE = 0x0000000A, + MTRCommandIDTypeClusterCameraAVStreamManagementCommandCaptureSnapshotID MTR_PROVISIONALLY_AVAILABLE = 0x0000000B, + MTRCommandIDTypeClusterCameraAVStreamManagementCommandCaptureSnapshotResponseID MTR_PROVISIONALLY_AVAILABLE = 0x0000000C, + MTRCommandIDTypeClusterCameraAVStreamManagementCommandSetViewportID MTR_PROVISIONALLY_AVAILABLE = 0x0000000D, + MTRCommandIDTypeClusterCameraAVStreamManagementCommandSetImageRotationID MTR_PROVISIONALLY_AVAILABLE = 0x0000000E, + MTRCommandIDTypeClusterCameraAVStreamManagementCommandSetImageFlipHorizontalID MTR_PROVISIONALLY_AVAILABLE = 0x0000000F, + MTRCommandIDTypeClusterCameraAVStreamManagementCommandSetImageFlipVerticalID MTR_PROVISIONALLY_AVAILABLE = 0x00000010, + MTRCommandIDTypeClusterCameraAVStreamManagementCommandSetWatermarkID MTR_PROVISIONALLY_AVAILABLE = 0x00000011, + MTRCommandIDTypeClusterCameraAVStreamManagementCommandSetOSDID MTR_PROVISIONALLY_AVAILABLE = 0x00000012, + // Cluster WebRTCTransportProvider commands MTRCommandIDTypeClusterWebRTCTransportProviderCommandSolicitOfferID MTR_PROVISIONALLY_AVAILABLE = 0x00000001, MTRCommandIDTypeClusterWebRTCTransportProviderCommandSolicitOfferResponseID MTR_PROVISIONALLY_AVAILABLE = 0x00000002, @@ -7563,6 +7644,11 @@ typedef NS_ENUM(uint32_t, MTREventIDType) { // Cluster ContentControl events MTREventIDTypeClusterContentControlEventRemainingScreenTimeExpiredID MTR_PROVISIONALLY_AVAILABLE = 0x00000000, + // Cluster CameraAVStreamManagement events + MTREventIDTypeClusterCameraAVStreamManagementEventVideoStreamChangedID MTR_PROVISIONALLY_AVAILABLE = 0x00000000, + MTREventIDTypeClusterCameraAVStreamManagementEventAudioStreamChangedID MTR_PROVISIONALLY_AVAILABLE = 0x00000001, + MTREventIDTypeClusterCameraAVStreamManagementEventSnapshotStreamChangedID MTR_PROVISIONALLY_AVAILABLE = 0x00000002, + // 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 f69444d9a1b402..efd7f78539dda2 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm @@ -369,6 +369,9 @@ case MTRClusterIDTypeContentAppObserverID: result = @"ContentAppObserver"; break; + case MTRClusterIDTypeCameraAVStreamManagementID: + result = @"CameraAVStreamManagement"; + break; case MTRClusterIDTypeWebRTCTransportProviderID: result = @"WebRTCTransportProvider"; break; @@ -8149,6 +8152,245 @@ } break; + case MTRClusterIDTypeCameraAVStreamManagementID: + + switch (attributeID) { + + // Cluster CameraAVStreamManagement attributes + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeMaxConcurrentVideoEncodersID: + result = @"MaxConcurrentVideoEncoders"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeMaxEncodedPixelRateID: + result = @"MaxEncodedPixelRate"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeVideoSensorParamsID: + result = @"VideoSensorParams"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeNightVisionCapableID: + result = @"NightVisionCapable"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeMinViewPortWidthID: + result = @"MinViewPortWidth"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeMinViewPortHeightID: + result = @"MinViewPortHeight"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeRateDistortionTradeOffPointsID: + result = @"RateDistortionTradeOffPoints"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeMaxPreRollBufferSizeID: + result = @"MaxPreRollBufferSize"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeMicrophoneCapabilitiesID: + result = @"MicrophoneCapabilities"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeSpeakerCapabilitiesID: + result = @"SpeakerCapabilities"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeTwoWayTalkSupportID: + result = @"TwoWayTalkSupport"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeSupportedSnapshotParamsID: + result = @"SupportedSnapshotParams"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeHDRCapableID: + result = @"HDRCapable"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeMaxNetworkBandwidthID: + result = @"MaxNetworkBandwidth"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeCurrentFrameRateID: + result = @"CurrentFrameRate"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeHDRModeID: + result = @"HDRMode"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeCurrentVideoCodecsID: + result = @"CurrentVideoCodecs"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeCurrentSnapshotConfigID: + result = @"CurrentSnapshotConfig"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeFabricsUsingCameraID: + result = @"FabricsUsingCamera"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeAllocatedVideoStreamsID: + result = @"AllocatedVideoStreams"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeAllocatedAudioStreamsID: + result = @"AllocatedAudioStreams"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeAllocatedSnapshotStreamsID: + result = @"AllocatedSnapshotStreams"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeRankedVideoStreamPrioritiesListID: + result = @"RankedVideoStreamPrioritiesList"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeSoftRecordingPrivacyModeSettingID: + result = @"SoftRecordingPrivacyModeSetting"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeSoftLivestreamPrivacyModeSettingID: + result = @"SoftLivestreamPrivacyModeSetting"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeHardPrivacyModeID: + result = @"HardPrivacyMode"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeNightVisionID: + result = @"NightVision"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeNightVisionIllumID: + result = @"NightVisionIllum"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeAWBID: + result = @"AWB"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeShutterSpeedID: + result = @"ShutterSpeed"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeISOID: + result = @"ISO"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeViewportID: + result = @"Viewport"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeSpeakerEnabledID: + result = @"SpeakerEnabled"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeSpeakerVolumeLevelID: + result = @"SpeakerVolumeLevel"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeSpeakerMaxLevelID: + result = @"SpeakerMaxLevel"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeSpeakerMinLevelID: + result = @"SpeakerMinLevel"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeMicStatusID: + result = @"MicStatus"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeMicVolumeLevelID: + result = @"MicVolumeLevel"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeMicMaxLevelID: + result = @"MicMaxLevel"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeMicMinLevelID: + result = @"MicMinLevel"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeMicAGCEnabledID: + result = @"MicAGCEnabled"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeImageRotationID: + result = @"ImageRotation"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeImageFlipHorizontalID: + result = @"ImageFlipHorizontal"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeImageFlipVerticalID: + result = @"ImageFlipVertical"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeLocalVideoRecordingEnabledID: + result = @"LocalVideoRecordingEnabled"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeLocalSnapshotRecordingEnabledID: + result = @"LocalSnapshotRecordingEnabled"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeStatusLightID: + result = @"StatusLight"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeStatusLightBrightnessID: + result = @"StatusLightBrightness"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeDepthSensorStatusID: + result = @"DepthSensorStatus"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeWatermarkEnabledID: + result = @"WatermarkEnabled"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeOSDEnabledID: + result = @"OSDEnabled"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeGeneratedCommandListID: + result = @"GeneratedCommandList"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeAcceptedCommandListID: + result = @"AcceptedCommandList"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeEventListID: + result = @"EventList"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeAttributeListID: + result = @"AttributeList"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeFeatureMapID: + result = @"FeatureMap"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeClusterRevisionID: + result = @"ClusterRevision"; + break; + + default: + result = [NSString stringWithFormat:@"", attributeID]; + break; + } + break; + case MTRClusterIDTypeWebRTCTransportProviderID: switch (attributeID) { @@ -11002,6 +11244,76 @@ } break; + case MTRClusterIDTypeCameraAVStreamManagementID: + + switch (commandID) { + + case MTRCommandIDTypeClusterCameraAVStreamManagementCommandAudioStreamAllocateID: + result = @"AudioStreamAllocate"; + break; + + case MTRCommandIDTypeClusterCameraAVStreamManagementCommandAudioStreamDeallocateID: + result = @"AudioStreamDeallocate"; + break; + + case MTRCommandIDTypeClusterCameraAVStreamManagementCommandVideoStreamAllocateID: + result = @"VideoStreamAllocate"; + break; + + case MTRCommandIDTypeClusterCameraAVStreamManagementCommandVideoStreamModifyID: + result = @"VideoStreamModify"; + break; + + case MTRCommandIDTypeClusterCameraAVStreamManagementCommandVideoStreamDeallocateID: + result = @"VideoStreamDeallocate"; + break; + + case MTRCommandIDTypeClusterCameraAVStreamManagementCommandSnapshotStreamAllocateID: + result = @"SnapshotStreamAllocate"; + break; + + case MTRCommandIDTypeClusterCameraAVStreamManagementCommandSnapshotStreamDeallocateID: + result = @"SnapshotStreamDeallocate"; + break; + + case MTRCommandIDTypeClusterCameraAVStreamManagementCommandSetStreamPriorityID: + result = @"SetStreamPriority"; + break; + + case MTRCommandIDTypeClusterCameraAVStreamManagementCommandCaptureSnapshotID: + result = @"CaptureSnapshot"; + break; + + case MTRCommandIDTypeClusterCameraAVStreamManagementCommandSetViewportID: + result = @"SetViewport"; + break; + + case MTRCommandIDTypeClusterCameraAVStreamManagementCommandSetImageRotationID: + result = @"SetImageRotation"; + break; + + case MTRCommandIDTypeClusterCameraAVStreamManagementCommandSetImageFlipHorizontalID: + result = @"SetImageFlipHorizontal"; + break; + + case MTRCommandIDTypeClusterCameraAVStreamManagementCommandSetImageFlipVerticalID: + result = @"SetImageFlipVertical"; + break; + + case MTRCommandIDTypeClusterCameraAVStreamManagementCommandSetWatermarkID: + result = @"SetWatermark"; + break; + + case MTRCommandIDTypeClusterCameraAVStreamManagementCommandSetOSDID: + result = @"SetOSD"; + break; + + default: + result = [NSString stringWithFormat:@"", commandID]; + break; + } + break; + case MTRClusterIDTypeWebRTCTransportProviderID: switch (commandID) { @@ -12670,6 +12982,32 @@ } break; + case MTRClusterIDTypeCameraAVStreamManagementID: + + switch (commandID) { + + case MTRCommandIDTypeClusterCameraAVStreamManagementCommandAudioStreamAllocateResponseID: + result = @"AudioStreamAllocateResponse"; + break; + + case MTRCommandIDTypeClusterCameraAVStreamManagementCommandVideoStreamAllocateResponseID: + result = @"VideoStreamAllocateResponse"; + break; + + case MTRCommandIDTypeClusterCameraAVStreamManagementCommandSnapshotStreamAllocateResponseID: + result = @"SnapshotStreamAllocateResponse"; + break; + + case MTRCommandIDTypeClusterCameraAVStreamManagementCommandCaptureSnapshotResponseID: + result = @"CaptureSnapshotResponse"; + break; + + default: + result = [NSString stringWithFormat:@"", commandID]; + break; + } + break; + case MTRClusterIDTypeWebRTCTransportProviderID: switch (commandID) { @@ -14459,6 +14797,29 @@ } break; + case MTRClusterIDTypeCameraAVStreamManagementID: + + switch (eventID) { + + // Cluster CameraAVStreamManagement events + case MTREventIDTypeClusterCameraAVStreamManagementEventVideoStreamChangedID: + result = @"VideoStreamChanged"; + break; + + case MTREventIDTypeClusterCameraAVStreamManagementEventAudioStreamChangedID: + result = @"AudioStreamChanged"; + break; + + case MTREventIDTypeClusterCameraAVStreamManagementEventSnapshotStreamChangedID: + result = @"SnapshotStreamChanged"; + break; + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + case MTRClusterIDTypeWebRTCTransportProviderID: switch (eventID) { diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h index 4988732fe8dae1..9f2fe61312df6b 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h @@ -6826,6 +6826,208 @@ MTR_PROVISIONALLY_AVAILABLE @end +/** + * Cluster Camera AV Stream Management + * The Camera AV Stream Management cluster is used to allow clients to manage, control, and configure various audio, video, and snapshot streams on a camera. + */ +MTR_PROVISIONALLY_AVAILABLE +@interface MTRClusterCameraAVStreamManagement : MTRGenericCluster + +- (void)audioStreamAllocateWithParams:(MTRCameraAVStreamManagementClusterAudioStreamAllocateParams *)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(void (^)(MTRCameraAVStreamManagementClusterAudioStreamAllocateResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)audioStreamDeallocateWithParams:(MTRCameraAVStreamManagementClusterAudioStreamDeallocateParams *)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)videoStreamAllocateWithParams:(MTRCameraAVStreamManagementClusterVideoStreamAllocateParams *)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(void (^)(MTRCameraAVStreamManagementClusterVideoStreamAllocateResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)videoStreamModifyWithParams:(MTRCameraAVStreamManagementClusterVideoStreamModifyParams *)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)videoStreamDeallocateWithParams:(MTRCameraAVStreamManagementClusterVideoStreamDeallocateParams *)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)snapshotStreamAllocateWithParams:(MTRCameraAVStreamManagementClusterSnapshotStreamAllocateParams *)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(void (^)(MTRCameraAVStreamManagementClusterSnapshotStreamAllocateResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)snapshotStreamDeallocateWithParams:(MTRCameraAVStreamManagementClusterSnapshotStreamDeallocateParams *)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)setStreamPriorityWithParams:(MTRCameraAVStreamManagementClusterSetStreamPriorityParams * _Nullable)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)setStreamPriorityWithExpectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion + MTR_PROVISIONALLY_AVAILABLE; +- (void)captureSnapshotWithParams:(MTRCameraAVStreamManagementClusterCaptureSnapshotParams *)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)setViewportWithParams:(MTRCameraAVStreamManagementClusterSetViewportParams *)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)setImageRotationWithParams:(MTRCameraAVStreamManagementClusterSetImageRotationParams *)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)setImageFlipHorizontalWithParams:(MTRCameraAVStreamManagementClusterSetImageFlipHorizontalParams *)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)setImageFlipVerticalWithParams:(MTRCameraAVStreamManagementClusterSetImageFlipVerticalParams *)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)setWatermarkWithParams:(MTRCameraAVStreamManagementClusterSetWatermarkParams *)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)setOSDWithParams:(MTRCameraAVStreamManagementClusterSetOSDParams *)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeMaxConcurrentVideoEncodersWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeMaxEncodedPixelRateWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeVideoSensorParamsWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeNightVisionCapableWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeMinViewPortWidthWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeMinViewPortHeightWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeRateDistortionTradeOffPointsWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeMaxPreRollBufferSizeWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeMicrophoneCapabilitiesWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeSpeakerCapabilitiesWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeTwoWayTalkSupportWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeSupportedSnapshotParamsWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeHDRCapableWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeMaxNetworkBandwidthWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeCurrentFrameRateWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeHDRModeWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeHDRModeWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeHDRModeWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeCurrentVideoCodecsWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeCurrentSnapshotConfigWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeFabricsUsingCameraWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeAllocatedVideoStreamsWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeAllocatedAudioStreamsWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeAllocatedSnapshotStreamsWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeRankedVideoStreamPrioritiesListWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeRankedVideoStreamPrioritiesListWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeRankedVideoStreamPrioritiesListWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeSoftRecordingPrivacyModeSettingWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeSoftRecordingPrivacyModeSettingWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeSoftRecordingPrivacyModeSettingWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeSoftLivestreamPrivacyModeSettingWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeSoftLivestreamPrivacyModeSettingWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeSoftLivestreamPrivacyModeSettingWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeHardPrivacyModeWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeNightVisionWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeNightVisionWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeNightVisionWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeNightVisionIllumWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeNightVisionIllumWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeNightVisionIllumWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeAWBWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeAWBWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeAWBWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeShutterSpeedWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeShutterSpeedWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeShutterSpeedWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeISOWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeISOWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeISOWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeViewportWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeSpeakerEnabledWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeSpeakerEnabledWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeSpeakerEnabledWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeSpeakerVolumeLevelWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeSpeakerVolumeLevelWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeSpeakerVolumeLevelWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeSpeakerMaxLevelWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeSpeakerMaxLevelWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeSpeakerMaxLevelWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeSpeakerMinLevelWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeSpeakerMinLevelWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeSpeakerMinLevelWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeMicStatusWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeMicStatusWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeMicStatusWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeMicVolumeLevelWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeMicVolumeLevelWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeMicVolumeLevelWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeMicMaxLevelWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeMicMaxLevelWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeMicMaxLevelWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeMicMinLevelWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeMicMinLevelWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeMicMinLevelWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeMicAGCEnabledWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeMicAGCEnabledWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeMicAGCEnabledWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeImageRotationWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeImageFlipHorizontalWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeImageFlipVerticalWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeLocalVideoRecordingEnabledWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeLocalVideoRecordingEnabledWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeLocalVideoRecordingEnabledWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeLocalSnapshotRecordingEnabledWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeLocalSnapshotRecordingEnabledWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeLocalSnapshotRecordingEnabledWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeStatusLightWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeStatusLightWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeStatusLightWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeStatusLightBrightnessWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeStatusLightBrightnessWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeStatusLightBrightnessWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeDepthSensorStatusWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeDepthSensorStatusWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeDepthSensorStatusWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeWatermarkEnabledWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeOSDEnabledWithParams:(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)readAttributeEventListWithParams:(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 MTRClusterCameraAVStreamManagement (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 WebRTC Transport Provider * The WebRTC transport provider cluster provides a way for stream providers (e.g. Cameras) to stream or receive their data through WebRTC. diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm index 2c8bf9015fd9e8..88d53a5a053e90 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm @@ -19554,6 +19554,957 @@ - (void)contentAppMessageWithParams:(MTRContentAppObserverClusterContentAppMessa @end +@implementation MTRClusterCameraAVStreamManagement + +- (void)audioStreamAllocateWithParams:(MTRCameraAVStreamManagementClusterAudioStreamAllocateParams *)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(void (^)(MTRCameraAVStreamManagementClusterAudioStreamAllocateResponseParams * _Nullable data, NSError * _Nullable error))completion +{ + if (params == nil) { + params = [[MTRCameraAVStreamManagementClusterAudioStreamAllocateParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = CameraAvStreamManagement::Commands::AudioStreamAllocate::Type; + [self.device _invokeKnownCommandWithEndpointID:self.endpointID + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRCameraAVStreamManagementClusterAudioStreamAllocateResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} + +- (void)audioStreamDeallocateWithParams:(MTRCameraAVStreamManagementClusterAudioStreamDeallocateParams *)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRCameraAVStreamManagementClusterAudioStreamDeallocateParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = CameraAvStreamManagement::Commands::AudioStreamDeallocate::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)videoStreamAllocateWithParams:(MTRCameraAVStreamManagementClusterVideoStreamAllocateParams *)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(void (^)(MTRCameraAVStreamManagementClusterVideoStreamAllocateResponseParams * _Nullable data, NSError * _Nullable error))completion +{ + if (params == nil) { + params = [[MTRCameraAVStreamManagementClusterVideoStreamAllocateParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = CameraAvStreamManagement::Commands::VideoStreamAllocate::Type; + [self.device _invokeKnownCommandWithEndpointID:self.endpointID + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRCameraAVStreamManagementClusterVideoStreamAllocateResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} + +- (void)videoStreamModifyWithParams:(MTRCameraAVStreamManagementClusterVideoStreamModifyParams *)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRCameraAVStreamManagementClusterVideoStreamModifyParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = CameraAvStreamManagement::Commands::VideoStreamModify::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)videoStreamDeallocateWithParams:(MTRCameraAVStreamManagementClusterVideoStreamDeallocateParams *)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRCameraAVStreamManagementClusterVideoStreamDeallocateParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = CameraAvStreamManagement::Commands::VideoStreamDeallocate::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)snapshotStreamAllocateWithParams:(MTRCameraAVStreamManagementClusterSnapshotStreamAllocateParams *)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(void (^)(MTRCameraAVStreamManagementClusterSnapshotStreamAllocateResponseParams * _Nullable data, NSError * _Nullable error))completion +{ + if (params == nil) { + params = [[MTRCameraAVStreamManagementClusterSnapshotStreamAllocateParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = CameraAvStreamManagement::Commands::SnapshotStreamAllocate::Type; + [self.device _invokeKnownCommandWithEndpointID:self.endpointID + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRCameraAVStreamManagementClusterSnapshotStreamAllocateResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} + +- (void)snapshotStreamDeallocateWithParams:(MTRCameraAVStreamManagementClusterSnapshotStreamDeallocateParams *)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRCameraAVStreamManagementClusterSnapshotStreamDeallocateParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = CameraAvStreamManagement::Commands::SnapshotStreamDeallocate::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)setStreamPriorityWithExpectedValues:(NSArray *> *)expectedValues expectedValueInterval:(NSNumber *)expectedValueIntervalMs completion:(MTRStatusCompletion)completion +{ + [self setStreamPriorityWithParams:nil expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs completion:completion]; +} +- (void)setStreamPriorityWithParams:(MTRCameraAVStreamManagementClusterSetStreamPriorityParams * _Nullable)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRCameraAVStreamManagementClusterSetStreamPriorityParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = CameraAvStreamManagement::Commands::SetStreamPriority::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)captureSnapshotWithParams:(MTRCameraAVStreamManagementClusterCaptureSnapshotParams *)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRCameraAVStreamManagementClusterCaptureSnapshotParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = CameraAvStreamManagement::Commands::CaptureSnapshot::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)setViewportWithParams:(MTRCameraAVStreamManagementClusterSetViewportParams *)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRCameraAVStreamManagementClusterSetViewportParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = CameraAvStreamManagement::Commands::SetViewport::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)setImageRotationWithParams:(MTRCameraAVStreamManagementClusterSetImageRotationParams *)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRCameraAVStreamManagementClusterSetImageRotationParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = CameraAvStreamManagement::Commands::SetImageRotation::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)setImageFlipHorizontalWithParams:(MTRCameraAVStreamManagementClusterSetImageFlipHorizontalParams *)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRCameraAVStreamManagementClusterSetImageFlipHorizontalParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = CameraAvStreamManagement::Commands::SetImageFlipHorizontal::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)setImageFlipVerticalWithParams:(MTRCameraAVStreamManagementClusterSetImageFlipVerticalParams *)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRCameraAVStreamManagementClusterSetImageFlipVerticalParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = CameraAvStreamManagement::Commands::SetImageFlipVertical::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)setWatermarkWithParams:(MTRCameraAVStreamManagementClusterSetWatermarkParams *)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRCameraAVStreamManagementClusterSetWatermarkParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = CameraAvStreamManagement::Commands::SetWatermark::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)setOSDWithParams:(MTRCameraAVStreamManagementClusterSetOSDParams *)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRCameraAVStreamManagementClusterSetOSDParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = CameraAvStreamManagement::Commands::SetOSD::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]; +} + +- (NSDictionary * _Nullable)readAttributeMaxConcurrentVideoEncodersWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeMaxConcurrentVideoEncodersID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeMaxEncodedPixelRateWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeMaxEncodedPixelRateID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeVideoSensorParamsWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeVideoSensorParamsID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeNightVisionCapableWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeNightVisionCapableID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeMinViewPortWidthWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeMinViewPortWidthID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeMinViewPortHeightWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeMinViewPortHeightID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeRateDistortionTradeOffPointsWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeRateDistortionTradeOffPointsID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeMaxPreRollBufferSizeWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeMaxPreRollBufferSizeID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeMicrophoneCapabilitiesWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeMicrophoneCapabilitiesID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeSpeakerCapabilitiesWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeSpeakerCapabilitiesID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeTwoWayTalkSupportWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeTwoWayTalkSupportID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeSupportedSnapshotParamsWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeSupportedSnapshotParamsID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeHDRCapableWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeHDRCapableID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeMaxNetworkBandwidthWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeMaxNetworkBandwidthID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeCurrentFrameRateWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeCurrentFrameRateID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeHDRModeWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeHDRModeID) params:params]; +} + +- (void)writeAttributeHDRModeWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeHDRModeWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeHDRModeWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params +{ + NSNumber * timedWriteTimeout = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeHDRModeID) value:dataValueDictionary expectedValueInterval:expectedValueIntervalMs timedWriteTimeout:timedWriteTimeout]; +} + +- (NSDictionary * _Nullable)readAttributeCurrentVideoCodecsWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeCurrentVideoCodecsID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeCurrentSnapshotConfigWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeCurrentSnapshotConfigID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeFabricsUsingCameraWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeFabricsUsingCameraID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeAllocatedVideoStreamsWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeAllocatedVideoStreamsID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeAllocatedAudioStreamsWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeAllocatedAudioStreamsID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeAllocatedSnapshotStreamsWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeAllocatedSnapshotStreamsID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeRankedVideoStreamPrioritiesListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeRankedVideoStreamPrioritiesListID) params:params]; +} + +- (void)writeAttributeRankedVideoStreamPrioritiesListWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeRankedVideoStreamPrioritiesListWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeRankedVideoStreamPrioritiesListWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params +{ + NSNumber * timedWriteTimeout = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeRankedVideoStreamPrioritiesListID) value:dataValueDictionary expectedValueInterval:expectedValueIntervalMs timedWriteTimeout:timedWriteTimeout]; +} + +- (NSDictionary * _Nullable)readAttributeSoftRecordingPrivacyModeSettingWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeSoftRecordingPrivacyModeSettingID) params:params]; +} + +- (void)writeAttributeSoftRecordingPrivacyModeSettingWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeSoftRecordingPrivacyModeSettingWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeSoftRecordingPrivacyModeSettingWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params +{ + NSNumber * timedWriteTimeout = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeSoftRecordingPrivacyModeSettingID) value:dataValueDictionary expectedValueInterval:expectedValueIntervalMs timedWriteTimeout:timedWriteTimeout]; +} + +- (NSDictionary * _Nullable)readAttributeSoftLivestreamPrivacyModeSettingWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeSoftLivestreamPrivacyModeSettingID) params:params]; +} + +- (void)writeAttributeSoftLivestreamPrivacyModeSettingWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeSoftLivestreamPrivacyModeSettingWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeSoftLivestreamPrivacyModeSettingWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params +{ + NSNumber * timedWriteTimeout = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeSoftLivestreamPrivacyModeSettingID) value:dataValueDictionary expectedValueInterval:expectedValueIntervalMs timedWriteTimeout:timedWriteTimeout]; +} + +- (NSDictionary * _Nullable)readAttributeHardPrivacyModeWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeHardPrivacyModeID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeNightVisionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeNightVisionID) params:params]; +} + +- (void)writeAttributeNightVisionWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeNightVisionWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeNightVisionWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params +{ + NSNumber * timedWriteTimeout = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeNightVisionID) value:dataValueDictionary expectedValueInterval:expectedValueIntervalMs timedWriteTimeout:timedWriteTimeout]; +} + +- (NSDictionary * _Nullable)readAttributeNightVisionIllumWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeNightVisionIllumID) params:params]; +} + +- (void)writeAttributeNightVisionIllumWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeNightVisionIllumWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeNightVisionIllumWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params +{ + NSNumber * timedWriteTimeout = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeNightVisionIllumID) value:dataValueDictionary expectedValueInterval:expectedValueIntervalMs timedWriteTimeout:timedWriteTimeout]; +} + +- (NSDictionary * _Nullable)readAttributeAWBWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeAWBID) params:params]; +} + +- (void)writeAttributeAWBWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeAWBWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeAWBWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params +{ + NSNumber * timedWriteTimeout = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeAWBID) value:dataValueDictionary expectedValueInterval:expectedValueIntervalMs timedWriteTimeout:timedWriteTimeout]; +} + +- (NSDictionary * _Nullable)readAttributeShutterSpeedWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeShutterSpeedID) params:params]; +} + +- (void)writeAttributeShutterSpeedWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeShutterSpeedWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeShutterSpeedWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params +{ + NSNumber * timedWriteTimeout = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeShutterSpeedID) value:dataValueDictionary expectedValueInterval:expectedValueIntervalMs timedWriteTimeout:timedWriteTimeout]; +} + +- (NSDictionary * _Nullable)readAttributeISOWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeISOID) params:params]; +} + +- (void)writeAttributeISOWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeISOWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeISOWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params +{ + NSNumber * timedWriteTimeout = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeISOID) value:dataValueDictionary expectedValueInterval:expectedValueIntervalMs timedWriteTimeout:timedWriteTimeout]; +} + +- (NSDictionary * _Nullable)readAttributeViewportWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeViewportID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeSpeakerEnabledWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeSpeakerEnabledID) params:params]; +} + +- (void)writeAttributeSpeakerEnabledWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeSpeakerEnabledWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeSpeakerEnabledWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params +{ + NSNumber * timedWriteTimeout = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeSpeakerEnabledID) value:dataValueDictionary expectedValueInterval:expectedValueIntervalMs timedWriteTimeout:timedWriteTimeout]; +} + +- (NSDictionary * _Nullable)readAttributeSpeakerVolumeLevelWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeSpeakerVolumeLevelID) params:params]; +} + +- (void)writeAttributeSpeakerVolumeLevelWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeSpeakerVolumeLevelWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeSpeakerVolumeLevelWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params +{ + NSNumber * timedWriteTimeout = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeSpeakerVolumeLevelID) value:dataValueDictionary expectedValueInterval:expectedValueIntervalMs timedWriteTimeout:timedWriteTimeout]; +} + +- (NSDictionary * _Nullable)readAttributeSpeakerMaxLevelWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeSpeakerMaxLevelID) params:params]; +} + +- (void)writeAttributeSpeakerMaxLevelWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeSpeakerMaxLevelWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeSpeakerMaxLevelWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params +{ + NSNumber * timedWriteTimeout = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeSpeakerMaxLevelID) value:dataValueDictionary expectedValueInterval:expectedValueIntervalMs timedWriteTimeout:timedWriteTimeout]; +} + +- (NSDictionary * _Nullable)readAttributeSpeakerMinLevelWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeSpeakerMinLevelID) params:params]; +} + +- (void)writeAttributeSpeakerMinLevelWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeSpeakerMinLevelWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeSpeakerMinLevelWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params +{ + NSNumber * timedWriteTimeout = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeSpeakerMinLevelID) value:dataValueDictionary expectedValueInterval:expectedValueIntervalMs timedWriteTimeout:timedWriteTimeout]; +} + +- (NSDictionary * _Nullable)readAttributeMicStatusWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeMicStatusID) params:params]; +} + +- (void)writeAttributeMicStatusWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeMicStatusWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeMicStatusWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params +{ + NSNumber * timedWriteTimeout = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeMicStatusID) value:dataValueDictionary expectedValueInterval:expectedValueIntervalMs timedWriteTimeout:timedWriteTimeout]; +} + +- (NSDictionary * _Nullable)readAttributeMicVolumeLevelWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeMicVolumeLevelID) params:params]; +} + +- (void)writeAttributeMicVolumeLevelWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeMicVolumeLevelWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeMicVolumeLevelWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params +{ + NSNumber * timedWriteTimeout = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeMicVolumeLevelID) value:dataValueDictionary expectedValueInterval:expectedValueIntervalMs timedWriteTimeout:timedWriteTimeout]; +} + +- (NSDictionary * _Nullable)readAttributeMicMaxLevelWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeMicMaxLevelID) params:params]; +} + +- (void)writeAttributeMicMaxLevelWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeMicMaxLevelWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeMicMaxLevelWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params +{ + NSNumber * timedWriteTimeout = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeMicMaxLevelID) value:dataValueDictionary expectedValueInterval:expectedValueIntervalMs timedWriteTimeout:timedWriteTimeout]; +} + +- (NSDictionary * _Nullable)readAttributeMicMinLevelWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeMicMinLevelID) params:params]; +} + +- (void)writeAttributeMicMinLevelWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeMicMinLevelWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeMicMinLevelWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params +{ + NSNumber * timedWriteTimeout = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeMicMinLevelID) value:dataValueDictionary expectedValueInterval:expectedValueIntervalMs timedWriteTimeout:timedWriteTimeout]; +} + +- (NSDictionary * _Nullable)readAttributeMicAGCEnabledWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeMicAGCEnabledID) params:params]; +} + +- (void)writeAttributeMicAGCEnabledWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeMicAGCEnabledWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeMicAGCEnabledWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params +{ + NSNumber * timedWriteTimeout = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeMicAGCEnabledID) value:dataValueDictionary expectedValueInterval:expectedValueIntervalMs timedWriteTimeout:timedWriteTimeout]; +} + +- (NSDictionary * _Nullable)readAttributeImageRotationWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeImageRotationID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeImageFlipHorizontalWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeImageFlipHorizontalID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeImageFlipVerticalWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeImageFlipVerticalID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeLocalVideoRecordingEnabledWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeLocalVideoRecordingEnabledID) params:params]; +} + +- (void)writeAttributeLocalVideoRecordingEnabledWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeLocalVideoRecordingEnabledWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeLocalVideoRecordingEnabledWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params +{ + NSNumber * timedWriteTimeout = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeLocalVideoRecordingEnabledID) value:dataValueDictionary expectedValueInterval:expectedValueIntervalMs timedWriteTimeout:timedWriteTimeout]; +} + +- (NSDictionary * _Nullable)readAttributeLocalSnapshotRecordingEnabledWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeLocalSnapshotRecordingEnabledID) params:params]; +} + +- (void)writeAttributeLocalSnapshotRecordingEnabledWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeLocalSnapshotRecordingEnabledWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeLocalSnapshotRecordingEnabledWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params +{ + NSNumber * timedWriteTimeout = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeLocalSnapshotRecordingEnabledID) value:dataValueDictionary expectedValueInterval:expectedValueIntervalMs timedWriteTimeout:timedWriteTimeout]; +} + +- (NSDictionary * _Nullable)readAttributeStatusLightWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeStatusLightID) params:params]; +} + +- (void)writeAttributeStatusLightWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeStatusLightWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeStatusLightWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params +{ + NSNumber * timedWriteTimeout = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeStatusLightID) value:dataValueDictionary expectedValueInterval:expectedValueIntervalMs timedWriteTimeout:timedWriteTimeout]; +} + +- (NSDictionary * _Nullable)readAttributeStatusLightBrightnessWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeStatusLightBrightnessID) params:params]; +} + +- (void)writeAttributeStatusLightBrightnessWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeStatusLightBrightnessWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeStatusLightBrightnessWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params +{ + NSNumber * timedWriteTimeout = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeStatusLightBrightnessID) value:dataValueDictionary expectedValueInterval:expectedValueIntervalMs timedWriteTimeout:timedWriteTimeout]; +} + +- (NSDictionary * _Nullable)readAttributeDepthSensorStatusWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeDepthSensorStatusID) params:params]; +} + +- (void)writeAttributeDepthSensorStatusWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeDepthSensorStatusWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeDepthSensorStatusWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params +{ + NSNumber * timedWriteTimeout = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeDepthSensorStatusID) value:dataValueDictionary expectedValueInterval:expectedValueIntervalMs timedWriteTimeout:timedWriteTimeout]; +} + +- (NSDictionary * _Nullable)readAttributeWatermarkEnabledWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeWatermarkEnabledID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeOSDEnabledWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeOSDEnabledID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeGeneratedCommandListID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeAcceptedCommandListID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeEventListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeEventListID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeAttributeListID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeFeatureMapID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeClusterRevisionID) params:params]; +} + +@end + @implementation MTRClusterWebRTCTransportProvider - (void)solicitOfferWithParams:(MTRWebRTCTransportProviderClusterSolicitOfferParams *)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(void (^)(MTRWebRTCTransportProviderClusterSolicitOfferResponseParams * _Nullable data, NSError * _Nullable error))completion diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h index 63cbb1735676f6..3f865ba4f93f68 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h @@ -10835,6 +10835,580 @@ MTR_PROVISIONALLY_AVAILABLE error:(NSError * __autoreleasing *)error MTR_PROVISIONALLY_AVAILABLE; @end +MTR_PROVISIONALLY_AVAILABLE +@interface MTRCameraAVStreamManagementClusterAudioStreamAllocateParams : NSObject + +@property (nonatomic, copy) NSNumber * _Nonnull streamType MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) NSNumber * _Nonnull audioCodec MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) NSNumber * _Nonnull channelCount MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) NSNumber * _Nonnull sampleRate MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) NSNumber * _Nonnull bitRate MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) NSNumber * _Nonnull bitDepth 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 MTRCameraAVStreamManagementClusterAudioStreamAllocateResponseParams : NSObject + +@property (nonatomic, copy) NSNumber * _Nonnull audioStreamID MTR_PROVISIONALLY_AVAILABLE; + +/** + * Initialize an MTRCameraAVStreamManagementClusterAudioStreamAllocateResponseParams 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 MTRCameraAVStreamManagementClusterAudioStreamDeallocateParams : NSObject + +@property (nonatomic, copy) NSNumber * _Nonnull audioStreamID 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 MTRCameraAVStreamManagementClusterVideoStreamAllocateParams : NSObject + +@property (nonatomic, copy) NSNumber * _Nonnull streamType MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) NSNumber * _Nonnull videoCodec MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) NSNumber * _Nonnull minFrameRate MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) NSNumber * _Nonnull maxFrameRate MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) MTRCameraAVStreamManagementClusterVideoResolutionStruct * _Nonnull minResolution MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) MTRCameraAVStreamManagementClusterVideoResolutionStruct * _Nonnull maxResolution MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) NSNumber * _Nonnull minBitRate MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) NSNumber * _Nonnull maxBitRate MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) NSNumber * _Nonnull minFragmentLen MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) NSNumber * _Nonnull maxFragmentLen 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 MTRCameraAVStreamManagementClusterVideoStreamAllocateResponseParams : NSObject + +@property (nonatomic, copy) NSNumber * _Nonnull videoStreamID MTR_PROVISIONALLY_AVAILABLE; + +/** + * Initialize an MTRCameraAVStreamManagementClusterVideoStreamAllocateResponseParams 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 MTRCameraAVStreamManagementClusterVideoStreamModifyParams : NSObject + +@property (nonatomic, copy) NSNumber * _Nonnull videoStreamID MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) MTRCameraAVStreamManagementClusterVideoResolutionStruct * _Nonnull resolution 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 MTRCameraAVStreamManagementClusterVideoStreamDeallocateParams : NSObject + +@property (nonatomic, copy) NSNumber * _Nonnull videoStreamID 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 MTRCameraAVStreamManagementClusterSnapshotStreamAllocateParams : NSObject + +@property (nonatomic, copy) NSNumber * _Nonnull imageCodec MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) NSNumber * _Nonnull frameRate MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) NSNumber * _Nonnull bitRate MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) MTRCameraAVStreamManagementClusterVideoResolutionStruct * _Nonnull minResolution MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) MTRCameraAVStreamManagementClusterVideoResolutionStruct * _Nonnull maxResolution MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) NSNumber * _Nonnull quality 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 MTRCameraAVStreamManagementClusterSnapshotStreamAllocateResponseParams : NSObject + +@property (nonatomic, copy) NSNumber * _Nonnull snapshotStreamID MTR_PROVISIONALLY_AVAILABLE; + +/** + * Initialize an MTRCameraAVStreamManagementClusterSnapshotStreamAllocateResponseParams 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 MTRCameraAVStreamManagementClusterSnapshotStreamDeallocateParams : NSObject + +@property (nonatomic, copy) NSNumber * _Nonnull snapshotStreamID 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 MTRCameraAVStreamManagementClusterSetStreamPriorityParams : NSObject +/** + * 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 MTRCameraAVStreamManagementClusterCaptureSnapshotParams : NSObject + +@property (nonatomic, copy) NSNumber * _Nonnull snapshotStreamID MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) MTRCameraAVStreamManagementClusterVideoResolutionStruct * _Nonnull requestedResolution 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 MTRCameraAVStreamManagementClusterCaptureSnapshotResponseParams : NSObject + +@property (nonatomic, copy) NSData * _Nonnull data MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) NSNumber * _Nonnull imageCodec MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) MTRCameraAVStreamManagementClusterVideoResolutionStruct * _Nonnull resolution MTR_PROVISIONALLY_AVAILABLE; + +/** + * Initialize an MTRCameraAVStreamManagementClusterCaptureSnapshotResponseParams 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 MTRCameraAVStreamManagementClusterSetViewportParams : NSObject + +@property (nonatomic, copy) MTRCameraAVStreamManagementClusterViewportStruct * _Nonnull viewport 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 MTRCameraAVStreamManagementClusterSetImageRotationParams : NSObject + +@property (nonatomic, copy) NSNumber * _Nonnull angle 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 MTRCameraAVStreamManagementClusterSetImageFlipHorizontalParams : NSObject + +@property (nonatomic, copy) NSNumber * _Nonnull enabled 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 MTRCameraAVStreamManagementClusterSetImageFlipVerticalParams : NSObject + +@property (nonatomic, copy) NSNumber * _Nonnull enabled 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 MTRCameraAVStreamManagementClusterSetWatermarkParams : NSObject + +@property (nonatomic, copy) NSNumber * _Nonnull videoStreamID MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) NSNumber * _Nonnull enabled 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 MTRCameraAVStreamManagementClusterSetOSDParams : NSObject + +@property (nonatomic, copy) NSNumber * _Nonnull videoStreamID MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) NSNumber * _Nonnull enabled 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 MTRWebRTCTransportProviderClusterSolicitOfferParams : NSObject diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm index aaddab1b686a23..9c576e28d60c98 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm @@ -31337,6 +31337,1662 @@ - (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::ContentA @end +@implementation MTRCameraAVStreamManagementClusterAudioStreamAllocateParams +- (instancetype)init +{ + if (self = [super init]) { + + _streamType = @(0); + + _audioCodec = @(0); + + _channelCount = @(0); + + _sampleRate = @(0); + + _bitRate = @(0); + + _bitDepth = @(0); + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRCameraAVStreamManagementClusterAudioStreamAllocateParams alloc] init]; + + other.streamType = self.streamType; + other.audioCodec = self.audioCodec; + other.channelCount = self.channelCount; + other.sampleRate = self.sampleRate; + other.bitRate = self.bitRate; + other.bitDepth = self.bitDepth; + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: streamType:%@; audioCodec:%@; channelCount:%@; sampleRate:%@; bitRate:%@; bitDepth:%@; >", NSStringFromClass([self class]), _streamType, _audioCodec, _channelCount, _sampleRate, _bitRate, _bitDepth]; + return descriptionString; +} + +@end + +@implementation MTRCameraAVStreamManagementClusterAudioStreamAllocateParams (InternalMethods) + +- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader +{ + chip::app::Clusters::CameraAvStreamManagement::Commands::AudioStreamAllocate::Type encodableStruct; + ListFreer listFreer; + { + encodableStruct.streamType = static_cast>(self.streamType.unsignedCharValue); + } + { + encodableStruct.audioCodec = static_cast>(self.audioCodec.unsignedCharValue); + } + { + encodableStruct.channelCount = self.channelCount.unsignedCharValue; + } + { + encodableStruct.sampleRate = self.sampleRate.unsignedIntValue; + } + { + encodableStruct.bitRate = self.bitRate.unsignedIntValue; + } + { + encodableStruct.bitDepth = self.bitDepth.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 MTRCameraAVStreamManagementClusterAudioStreamAllocateResponseParams +- (instancetype)init +{ + if (self = [super init]) { + + _audioStreamID = @(0); + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRCameraAVStreamManagementClusterAudioStreamAllocateResponseParams alloc] init]; + + other.audioStreamID = self.audioStreamID; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: audioStreamID:%@; >", NSStringFromClass([self class]), _audioStreamID]; + return descriptionString; +} + +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error +{ + if (!(self = [super init])) { + return nil; + } + + using DecodableType = chip::app::Clusters::CameraAvStreamManagement::Commands::AudioStreamAllocateResponse::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 MTRCameraAVStreamManagementClusterAudioStreamAllocateResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::CameraAvStreamManagement::Commands::AudioStreamAllocateResponse::DecodableType &)decodableStruct +{ + { + self.audioStreamID = [NSNumber numberWithUnsignedShort:decodableStruct.audioStreamID]; + } + return CHIP_NO_ERROR; +} + +@end + +@implementation MTRCameraAVStreamManagementClusterAudioStreamDeallocateParams +- (instancetype)init +{ + if (self = [super init]) { + + _audioStreamID = @(0); + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRCameraAVStreamManagementClusterAudioStreamDeallocateParams alloc] init]; + + other.audioStreamID = self.audioStreamID; + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: audioStreamID:%@; >", NSStringFromClass([self class]), _audioStreamID]; + return descriptionString; +} + +@end + +@implementation MTRCameraAVStreamManagementClusterAudioStreamDeallocateParams (InternalMethods) + +- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader +{ + chip::app::Clusters::CameraAvStreamManagement::Commands::AudioStreamDeallocate::Type encodableStruct; + ListFreer listFreer; + { + encodableStruct.audioStreamID = self.audioStreamID.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 MTRCameraAVStreamManagementClusterVideoStreamAllocateParams +- (instancetype)init +{ + if (self = [super init]) { + + _streamType = @(0); + + _videoCodec = @(0); + + _minFrameRate = @(0); + + _maxFrameRate = @(0); + + _minResolution = [MTRCameraAVStreamManagementClusterVideoResolutionStruct new]; + + _maxResolution = [MTRCameraAVStreamManagementClusterVideoResolutionStruct new]; + + _minBitRate = @(0); + + _maxBitRate = @(0); + + _minFragmentLen = @(0); + + _maxFragmentLen = @(0); + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRCameraAVStreamManagementClusterVideoStreamAllocateParams alloc] init]; + + other.streamType = self.streamType; + other.videoCodec = self.videoCodec; + other.minFrameRate = self.minFrameRate; + other.maxFrameRate = self.maxFrameRate; + other.minResolution = self.minResolution; + other.maxResolution = self.maxResolution; + other.minBitRate = self.minBitRate; + other.maxBitRate = self.maxBitRate; + other.minFragmentLen = self.minFragmentLen; + other.maxFragmentLen = self.maxFragmentLen; + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: streamType:%@; videoCodec:%@; minFrameRate:%@; maxFrameRate:%@; minResolution:%@; maxResolution:%@; minBitRate:%@; maxBitRate:%@; minFragmentLen:%@; maxFragmentLen:%@; >", NSStringFromClass([self class]), _streamType, _videoCodec, _minFrameRate, _maxFrameRate, _minResolution, _maxResolution, _minBitRate, _maxBitRate, _minFragmentLen, _maxFragmentLen]; + return descriptionString; +} + +@end + +@implementation MTRCameraAVStreamManagementClusterVideoStreamAllocateParams (InternalMethods) + +- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader +{ + chip::app::Clusters::CameraAvStreamManagement::Commands::VideoStreamAllocate::Type encodableStruct; + ListFreer listFreer; + { + encodableStruct.streamType = static_cast>(self.streamType.unsignedCharValue); + } + { + encodableStruct.videoCodec = static_cast>(self.videoCodec.unsignedCharValue); + } + { + encodableStruct.minFrameRate = self.minFrameRate.unsignedShortValue; + } + { + encodableStruct.maxFrameRate = self.maxFrameRate.unsignedShortValue; + } + { + encodableStruct.minResolution.width = self.minResolution.width.unsignedShortValue; + encodableStruct.minResolution.height = self.minResolution.height.unsignedShortValue; + } + { + encodableStruct.maxResolution.width = self.maxResolution.width.unsignedShortValue; + encodableStruct.maxResolution.height = self.maxResolution.height.unsignedShortValue; + } + { + encodableStruct.minBitRate = self.minBitRate.unsignedIntValue; + } + { + encodableStruct.maxBitRate = self.maxBitRate.unsignedIntValue; + } + { + encodableStruct.minFragmentLen = self.minFragmentLen.unsignedShortValue; + } + { + encodableStruct.maxFragmentLen = self.maxFragmentLen.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 MTRCameraAVStreamManagementClusterVideoStreamAllocateResponseParams +- (instancetype)init +{ + if (self = [super init]) { + + _videoStreamID = @(0); + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRCameraAVStreamManagementClusterVideoStreamAllocateResponseParams alloc] init]; + + other.videoStreamID = self.videoStreamID; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: videoStreamID:%@; >", NSStringFromClass([self class]), _videoStreamID]; + return descriptionString; +} + +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error +{ + if (!(self = [super init])) { + return nil; + } + + using DecodableType = chip::app::Clusters::CameraAvStreamManagement::Commands::VideoStreamAllocateResponse::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 MTRCameraAVStreamManagementClusterVideoStreamAllocateResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::CameraAvStreamManagement::Commands::VideoStreamAllocateResponse::DecodableType &)decodableStruct +{ + { + self.videoStreamID = [NSNumber numberWithUnsignedShort:decodableStruct.videoStreamID]; + } + return CHIP_NO_ERROR; +} + +@end + +@implementation MTRCameraAVStreamManagementClusterVideoStreamModifyParams +- (instancetype)init +{ + if (self = [super init]) { + + _videoStreamID = @(0); + + _resolution = [MTRCameraAVStreamManagementClusterVideoResolutionStruct new]; + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRCameraAVStreamManagementClusterVideoStreamModifyParams alloc] init]; + + other.videoStreamID = self.videoStreamID; + other.resolution = self.resolution; + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: videoStreamID:%@; resolution:%@; >", NSStringFromClass([self class]), _videoStreamID, _resolution]; + return descriptionString; +} + +@end + +@implementation MTRCameraAVStreamManagementClusterVideoStreamModifyParams (InternalMethods) + +- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader +{ + chip::app::Clusters::CameraAvStreamManagement::Commands::VideoStreamModify::Type encodableStruct; + ListFreer listFreer; + { + encodableStruct.videoStreamID = self.videoStreamID.unsignedShortValue; + } + { + encodableStruct.resolution.width = self.resolution.width.unsignedShortValue; + encodableStruct.resolution.height = self.resolution.height.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 MTRCameraAVStreamManagementClusterVideoStreamDeallocateParams +- (instancetype)init +{ + if (self = [super init]) { + + _videoStreamID = @(0); + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRCameraAVStreamManagementClusterVideoStreamDeallocateParams alloc] init]; + + other.videoStreamID = self.videoStreamID; + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: videoStreamID:%@; >", NSStringFromClass([self class]), _videoStreamID]; + return descriptionString; +} + +@end + +@implementation MTRCameraAVStreamManagementClusterVideoStreamDeallocateParams (InternalMethods) + +- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader +{ + chip::app::Clusters::CameraAvStreamManagement::Commands::VideoStreamDeallocate::Type encodableStruct; + ListFreer listFreer; + { + encodableStruct.videoStreamID = self.videoStreamID.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 MTRCameraAVStreamManagementClusterSnapshotStreamAllocateParams +- (instancetype)init +{ + if (self = [super init]) { + + _imageCodec = @(0); + + _frameRate = @(0); + + _bitRate = @(0); + + _minResolution = [MTRCameraAVStreamManagementClusterVideoResolutionStruct new]; + + _maxResolution = [MTRCameraAVStreamManagementClusterVideoResolutionStruct new]; + + _quality = @(0); + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRCameraAVStreamManagementClusterSnapshotStreamAllocateParams alloc] init]; + + other.imageCodec = self.imageCodec; + other.frameRate = self.frameRate; + other.bitRate = self.bitRate; + other.minResolution = self.minResolution; + other.maxResolution = self.maxResolution; + other.quality = self.quality; + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: imageCodec:%@; frameRate:%@; bitRate:%@; minResolution:%@; maxResolution:%@; quality:%@; >", NSStringFromClass([self class]), _imageCodec, _frameRate, _bitRate, _minResolution, _maxResolution, _quality]; + return descriptionString; +} + +@end + +@implementation MTRCameraAVStreamManagementClusterSnapshotStreamAllocateParams (InternalMethods) + +- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader +{ + chip::app::Clusters::CameraAvStreamManagement::Commands::SnapshotStreamAllocate::Type encodableStruct; + ListFreer listFreer; + { + encodableStruct.imageCodec = static_cast>(self.imageCodec.unsignedCharValue); + } + { + encodableStruct.frameRate = self.frameRate.unsignedShortValue; + } + { + encodableStruct.bitRate = self.bitRate.unsignedIntValue; + } + { + encodableStruct.minResolution.width = self.minResolution.width.unsignedShortValue; + encodableStruct.minResolution.height = self.minResolution.height.unsignedShortValue; + } + { + encodableStruct.maxResolution.width = self.maxResolution.width.unsignedShortValue; + encodableStruct.maxResolution.height = self.maxResolution.height.unsignedShortValue; + } + { + encodableStruct.quality = self.quality.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 MTRCameraAVStreamManagementClusterSnapshotStreamAllocateResponseParams +- (instancetype)init +{ + if (self = [super init]) { + + _snapshotStreamID = @(0); + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRCameraAVStreamManagementClusterSnapshotStreamAllocateResponseParams alloc] init]; + + other.snapshotStreamID = self.snapshotStreamID; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: snapshotStreamID:%@; >", NSStringFromClass([self class]), _snapshotStreamID]; + return descriptionString; +} + +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error +{ + if (!(self = [super init])) { + return nil; + } + + using DecodableType = chip::app::Clusters::CameraAvStreamManagement::Commands::SnapshotStreamAllocateResponse::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 MTRCameraAVStreamManagementClusterSnapshotStreamAllocateResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::CameraAvStreamManagement::Commands::SnapshotStreamAllocateResponse::DecodableType &)decodableStruct +{ + { + self.snapshotStreamID = [NSNumber numberWithUnsignedShort:decodableStruct.snapshotStreamID]; + } + return CHIP_NO_ERROR; +} + +@end + +@implementation MTRCameraAVStreamManagementClusterSnapshotStreamDeallocateParams +- (instancetype)init +{ + if (self = [super init]) { + + _snapshotStreamID = @(0); + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRCameraAVStreamManagementClusterSnapshotStreamDeallocateParams alloc] init]; + + other.snapshotStreamID = self.snapshotStreamID; + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: snapshotStreamID:%@; >", NSStringFromClass([self class]), _snapshotStreamID]; + return descriptionString; +} + +@end + +@implementation MTRCameraAVStreamManagementClusterSnapshotStreamDeallocateParams (InternalMethods) + +- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader +{ + chip::app::Clusters::CameraAvStreamManagement::Commands::SnapshotStreamDeallocate::Type encodableStruct; + ListFreer listFreer; + { + encodableStruct.snapshotStreamID = self.snapshotStreamID.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 MTRCameraAVStreamManagementClusterSetStreamPriorityParams +- (instancetype)init +{ + if (self = [super init]) { + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRCameraAVStreamManagementClusterSetStreamPriorityParams alloc] init]; + + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: >", NSStringFromClass([self class])]; + return descriptionString; +} + +@end + +@implementation MTRCameraAVStreamManagementClusterSetStreamPriorityParams (InternalMethods) + +- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader +{ + chip::app::Clusters::CameraAvStreamManagement::Commands::SetStreamPriority::Type encodableStruct; + ListFreer listFreer; + + 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 MTRCameraAVStreamManagementClusterCaptureSnapshotParams +- (instancetype)init +{ + if (self = [super init]) { + + _snapshotStreamID = @(0); + + _requestedResolution = [MTRCameraAVStreamManagementClusterVideoResolutionStruct new]; + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRCameraAVStreamManagementClusterCaptureSnapshotParams alloc] init]; + + other.snapshotStreamID = self.snapshotStreamID; + other.requestedResolution = self.requestedResolution; + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: snapshotStreamID:%@; requestedResolution:%@; >", NSStringFromClass([self class]), _snapshotStreamID, _requestedResolution]; + return descriptionString; +} + +@end + +@implementation MTRCameraAVStreamManagementClusterCaptureSnapshotParams (InternalMethods) + +- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader +{ + chip::app::Clusters::CameraAvStreamManagement::Commands::CaptureSnapshot::Type encodableStruct; + ListFreer listFreer; + { + encodableStruct.snapshotStreamID = self.snapshotStreamID.unsignedShortValue; + } + { + encodableStruct.requestedResolution.width = self.requestedResolution.width.unsignedShortValue; + encodableStruct.requestedResolution.height = self.requestedResolution.height.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 MTRCameraAVStreamManagementClusterCaptureSnapshotResponseParams +- (instancetype)init +{ + if (self = [super init]) { + + _data = [NSData data]; + + _imageCodec = @(0); + + _resolution = [MTRCameraAVStreamManagementClusterVideoResolutionStruct new]; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRCameraAVStreamManagementClusterCaptureSnapshotResponseParams alloc] init]; + + other.data = self.data; + other.imageCodec = self.imageCodec; + other.resolution = self.resolution; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: data:%@; imageCodec:%@; resolution:%@; >", NSStringFromClass([self class]), [_data base64EncodedStringWithOptions:0], _imageCodec, _resolution]; + return descriptionString; +} + +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error +{ + if (!(self = [super init])) { + return nil; + } + + using DecodableType = chip::app::Clusters::CameraAvStreamManagement::Commands::CaptureSnapshotResponse::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 MTRCameraAVStreamManagementClusterCaptureSnapshotResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::CameraAvStreamManagement::Commands::CaptureSnapshotResponse::DecodableType &)decodableStruct +{ + { + self.data = AsData(decodableStruct.data); + } + { + self.imageCodec = [NSNumber numberWithUnsignedChar:chip::to_underlying(decodableStruct.imageCodec)]; + } + { + self.resolution = [MTRCameraAVStreamManagementClusterVideoResolutionStruct new]; + self.resolution.width = [NSNumber numberWithUnsignedShort:decodableStruct.resolution.width]; + self.resolution.height = [NSNumber numberWithUnsignedShort:decodableStruct.resolution.height]; + } + return CHIP_NO_ERROR; +} + +@end + +@implementation MTRCameraAVStreamManagementClusterSetViewportParams +- (instancetype)init +{ + if (self = [super init]) { + + _viewport = [MTRCameraAVStreamManagementClusterViewportStruct new]; + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRCameraAVStreamManagementClusterSetViewportParams alloc] init]; + + other.viewport = self.viewport; + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: viewport:%@; >", NSStringFromClass([self class]), _viewport]; + return descriptionString; +} + +@end + +@implementation MTRCameraAVStreamManagementClusterSetViewportParams (InternalMethods) + +- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader +{ + chip::app::Clusters::CameraAvStreamManagement::Commands::SetViewport::Type encodableStruct; + ListFreer listFreer; + { + encodableStruct.viewport.x1 = self.viewport.x1.unsignedShortValue; + encodableStruct.viewport.y1 = self.viewport.y1.unsignedShortValue; + encodableStruct.viewport.x2 = self.viewport.x2.unsignedShortValue; + encodableStruct.viewport.y2 = self.viewport.y2.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 MTRCameraAVStreamManagementClusterSetImageRotationParams +- (instancetype)init +{ + if (self = [super init]) { + + _angle = @(0); + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRCameraAVStreamManagementClusterSetImageRotationParams alloc] init]; + + other.angle = self.angle; + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: angle:%@; >", NSStringFromClass([self class]), _angle]; + return descriptionString; +} + +@end + +@implementation MTRCameraAVStreamManagementClusterSetImageRotationParams (InternalMethods) + +- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader +{ + chip::app::Clusters::CameraAvStreamManagement::Commands::SetImageRotation::Type encodableStruct; + ListFreer listFreer; + { + encodableStruct.angle = self.angle.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 MTRCameraAVStreamManagementClusterSetImageFlipHorizontalParams +- (instancetype)init +{ + if (self = [super init]) { + + _enabled = @(0); + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRCameraAVStreamManagementClusterSetImageFlipHorizontalParams alloc] init]; + + other.enabled = self.enabled; + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: enabled:%@; >", NSStringFromClass([self class]), _enabled]; + return descriptionString; +} + +@end + +@implementation MTRCameraAVStreamManagementClusterSetImageFlipHorizontalParams (InternalMethods) + +- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader +{ + chip::app::Clusters::CameraAvStreamManagement::Commands::SetImageFlipHorizontal::Type encodableStruct; + ListFreer listFreer; + { + encodableStruct.enabled = self.enabled.boolValue; + } + + 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 MTRCameraAVStreamManagementClusterSetImageFlipVerticalParams +- (instancetype)init +{ + if (self = [super init]) { + + _enabled = @(0); + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRCameraAVStreamManagementClusterSetImageFlipVerticalParams alloc] init]; + + other.enabled = self.enabled; + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: enabled:%@; >", NSStringFromClass([self class]), _enabled]; + return descriptionString; +} + +@end + +@implementation MTRCameraAVStreamManagementClusterSetImageFlipVerticalParams (InternalMethods) + +- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader +{ + chip::app::Clusters::CameraAvStreamManagement::Commands::SetImageFlipVertical::Type encodableStruct; + ListFreer listFreer; + { + encodableStruct.enabled = self.enabled.boolValue; + } + + 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 MTRCameraAVStreamManagementClusterSetWatermarkParams +- (instancetype)init +{ + if (self = [super init]) { + + _videoStreamID = @(0); + + _enabled = @(0); + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRCameraAVStreamManagementClusterSetWatermarkParams alloc] init]; + + other.videoStreamID = self.videoStreamID; + other.enabled = self.enabled; + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: videoStreamID:%@; enabled:%@; >", NSStringFromClass([self class]), _videoStreamID, _enabled]; + return descriptionString; +} + +@end + +@implementation MTRCameraAVStreamManagementClusterSetWatermarkParams (InternalMethods) + +- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader +{ + chip::app::Clusters::CameraAvStreamManagement::Commands::SetWatermark::Type encodableStruct; + ListFreer listFreer; + { + encodableStruct.videoStreamID = self.videoStreamID.unsignedShortValue; + } + { + encodableStruct.enabled = self.enabled.boolValue; + } + + 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 MTRCameraAVStreamManagementClusterSetOSDParams +- (instancetype)init +{ + if (self = [super init]) { + + _videoStreamID = @(0); + + _enabled = @(0); + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRCameraAVStreamManagementClusterSetOSDParams alloc] init]; + + other.videoStreamID = self.videoStreamID; + other.enabled = self.enabled; + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: videoStreamID:%@; enabled:%@; >", NSStringFromClass([self class]), _videoStreamID, _enabled]; + return descriptionString; +} + +@end + +@implementation MTRCameraAVStreamManagementClusterSetOSDParams (InternalMethods) + +- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader +{ + chip::app::Clusters::CameraAvStreamManagement::Commands::SetOSD::Type encodableStruct; + ListFreer listFreer; + { + encodableStruct.videoStreamID = self.videoStreamID.unsignedShortValue; + } + { + encodableStruct.enabled = self.enabled.boolValue; + } + + 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 MTRWebRTCTransportProviderClusterSolicitOfferParams - (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 b6345356d4daac..b91b3d9a3bf5a7 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h @@ -2032,6 +2032,120 @@ NS_ASSUME_NONNULL_BEGIN @end +@interface MTRCameraAVStreamManagementClusterAudioStreamAllocateParams (InternalMethods) + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; + +@end + +@interface MTRCameraAVStreamManagementClusterAudioStreamAllocateResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::CameraAvStreamManagement::Commands::AudioStreamAllocateResponse::DecodableType &)decodableStruct; + +@end + +@interface MTRCameraAVStreamManagementClusterAudioStreamDeallocateParams (InternalMethods) + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; + +@end + +@interface MTRCameraAVStreamManagementClusterVideoStreamAllocateParams (InternalMethods) + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; + +@end + +@interface MTRCameraAVStreamManagementClusterVideoStreamAllocateResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::CameraAvStreamManagement::Commands::VideoStreamAllocateResponse::DecodableType &)decodableStruct; + +@end + +@interface MTRCameraAVStreamManagementClusterVideoStreamModifyParams (InternalMethods) + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; + +@end + +@interface MTRCameraAVStreamManagementClusterVideoStreamDeallocateParams (InternalMethods) + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; + +@end + +@interface MTRCameraAVStreamManagementClusterSnapshotStreamAllocateParams (InternalMethods) + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; + +@end + +@interface MTRCameraAVStreamManagementClusterSnapshotStreamAllocateResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::CameraAvStreamManagement::Commands::SnapshotStreamAllocateResponse::DecodableType &)decodableStruct; + +@end + +@interface MTRCameraAVStreamManagementClusterSnapshotStreamDeallocateParams (InternalMethods) + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; + +@end + +@interface MTRCameraAVStreamManagementClusterSetStreamPriorityParams (InternalMethods) + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; + +@end + +@interface MTRCameraAVStreamManagementClusterCaptureSnapshotParams (InternalMethods) + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; + +@end + +@interface MTRCameraAVStreamManagementClusterCaptureSnapshotResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::CameraAvStreamManagement::Commands::CaptureSnapshotResponse::DecodableType &)decodableStruct; + +@end + +@interface MTRCameraAVStreamManagementClusterSetViewportParams (InternalMethods) + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; + +@end + +@interface MTRCameraAVStreamManagementClusterSetImageRotationParams (InternalMethods) + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; + +@end + +@interface MTRCameraAVStreamManagementClusterSetImageFlipHorizontalParams (InternalMethods) + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; + +@end + +@interface MTRCameraAVStreamManagementClusterSetImageFlipVerticalParams (InternalMethods) + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; + +@end + +@interface MTRCameraAVStreamManagementClusterSetWatermarkParams (InternalMethods) + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; + +@end + +@interface MTRCameraAVStreamManagementClusterSetOSDParams (InternalMethods) + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; + +@end + @interface MTRWebRTCTransportProviderClusterSolicitOfferParams (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 c330d2bb0d1748..86799ff813b625 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandTimedCheck.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandTimedCheck.mm @@ -1124,6 +1124,15 @@ static BOOL CommandNeedsTimedInvokeInContentAppObserverCluster(AttributeId aAttr } } } +static BOOL CommandNeedsTimedInvokeInCameraAVStreamManagementCluster(AttributeId aAttributeId) +{ + using namespace Clusters::CameraAvStreamManagement; + switch (aAttributeId) { + default: { + return NO; + } + } +} static BOOL CommandNeedsTimedInvokeInWebRTCTransportProviderCluster(AttributeId aAttributeId) { using namespace Clusters::WebRTCTransportProvider; @@ -1539,6 +1548,9 @@ BOOL MTRCommandNeedsTimedInvoke(NSNumber * _Nonnull aClusterID, NSNumber * _Nonn case Clusters::ContentAppObserver::Id: { return CommandNeedsTimedInvokeInContentAppObserverCluster(commandID); } + case Clusters::CameraAvStreamManagement::Id: { + return CommandNeedsTimedInvokeInCameraAVStreamManagementCluster(commandID); + } case Clusters::WebRTCTransportProvider::Id: { return CommandNeedsTimedInvokeInWebRTCTransportProviderCluster(commandID); } diff --git a/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm index 0ef12bcbba5df1..d14cf0ab706b8c 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm @@ -4543,6 +4543,275 @@ static id _Nullable DecodeEventPayloadForContentAppObserverCluster(EventId aEven *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; return nil; } +static id _Nullable DecodeEventPayloadForCameraAVStreamManagementCluster(EventId aEventId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::CameraAvStreamManagement; + switch (aEventId) { + case Events::VideoStreamChanged::Id: { + Events::VideoStreamChanged::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + + __auto_type * value = [MTRCameraAVStreamManagementClusterVideoStreamChangedEvent new]; + + do { + NSNumber * _Nonnull memberValue; + memberValue = [NSNumber numberWithUnsignedShort:cppValue.videoStreamID]; + value.videoStreamID = memberValue; + } while (0); + do { + NSNumber * _Nullable memberValue; + if (cppValue.streamType.HasValue()) { + memberValue = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.streamType.Value())]; + } else { + memberValue = nil; + } + value.streamType = memberValue; + } while (0); + do { + NSNumber * _Nullable memberValue; + if (cppValue.videoCodec.HasValue()) { + memberValue = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.videoCodec.Value())]; + } else { + memberValue = nil; + } + value.videoCodec = memberValue; + } while (0); + do { + NSNumber * _Nullable memberValue; + if (cppValue.minFrameRate.HasValue()) { + memberValue = [NSNumber numberWithUnsignedShort:cppValue.minFrameRate.Value()]; + } else { + memberValue = nil; + } + value.minFrameRate = memberValue; + } while (0); + do { + NSNumber * _Nullable memberValue; + if (cppValue.maxFrameRate.HasValue()) { + memberValue = [NSNumber numberWithUnsignedShort:cppValue.maxFrameRate.Value()]; + } else { + memberValue = nil; + } + value.maxFrameRate = memberValue; + } while (0); + do { + MTRCameraAVStreamManagementClusterVideoResolutionStruct * _Nullable memberValue; + if (cppValue.minResolution.HasValue()) { + memberValue = [MTRCameraAVStreamManagementClusterVideoResolutionStruct new]; + memberValue.width = [NSNumber numberWithUnsignedShort:cppValue.minResolution.Value().width]; + memberValue.height = [NSNumber numberWithUnsignedShort:cppValue.minResolution.Value().height]; + } else { + memberValue = nil; + } + value.minResolution = memberValue; + } while (0); + do { + MTRCameraAVStreamManagementClusterVideoResolutionStruct * _Nullable memberValue; + if (cppValue.maxResolution.HasValue()) { + memberValue = [MTRCameraAVStreamManagementClusterVideoResolutionStruct new]; + memberValue.width = [NSNumber numberWithUnsignedShort:cppValue.maxResolution.Value().width]; + memberValue.height = [NSNumber numberWithUnsignedShort:cppValue.maxResolution.Value().height]; + } else { + memberValue = nil; + } + value.maxResolution = memberValue; + } while (0); + do { + NSNumber * _Nullable memberValue; + if (cppValue.minBitRate.HasValue()) { + memberValue = [NSNumber numberWithUnsignedShort:cppValue.minBitRate.Value()]; + } else { + memberValue = nil; + } + value.minBitRate = memberValue; + } while (0); + do { + NSNumber * _Nullable memberValue; + if (cppValue.maxBitRate.HasValue()) { + memberValue = [NSNumber numberWithUnsignedShort:cppValue.maxBitRate.Value()]; + } else { + memberValue = nil; + } + value.maxBitRate = memberValue; + } while (0); + do { + NSNumber * _Nullable memberValue; + if (cppValue.minFragmentLen.HasValue()) { + memberValue = [NSNumber numberWithUnsignedShort:cppValue.minFragmentLen.Value()]; + } else { + memberValue = nil; + } + value.minFragmentLen = memberValue; + } while (0); + do { + NSNumber * _Nullable memberValue; + if (cppValue.maxFragmentLen.HasValue()) { + memberValue = [NSNumber numberWithUnsignedShort:cppValue.maxFragmentLen.Value()]; + } else { + memberValue = nil; + } + value.maxFragmentLen = memberValue; + } while (0); + + return value; + } + case Events::AudioStreamChanged::Id: { + Events::AudioStreamChanged::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + + __auto_type * value = [MTRCameraAVStreamManagementClusterAudioStreamChangedEvent new]; + + do { + NSNumber * _Nonnull memberValue; + memberValue = [NSNumber numberWithUnsignedShort:cppValue.audioStreamID]; + value.audioStreamID = memberValue; + } while (0); + do { + NSNumber * _Nullable memberValue; + if (cppValue.streamType.HasValue()) { + memberValue = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.streamType.Value())]; + } else { + memberValue = nil; + } + value.streamType = memberValue; + } while (0); + do { + NSNumber * _Nullable memberValue; + if (cppValue.audioCodec.HasValue()) { + memberValue = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.audioCodec.Value())]; + } else { + memberValue = nil; + } + value.audioCodec = memberValue; + } while (0); + do { + NSNumber * _Nullable memberValue; + if (cppValue.channelCount.HasValue()) { + memberValue = [NSNumber numberWithUnsignedChar:cppValue.channelCount.Value()]; + } else { + memberValue = nil; + } + value.channelCount = memberValue; + } while (0); + do { + NSNumber * _Nullable memberValue; + if (cppValue.sampleRate.HasValue()) { + memberValue = [NSNumber numberWithUnsignedInt:cppValue.sampleRate.Value()]; + } else { + memberValue = nil; + } + value.sampleRate = memberValue; + } while (0); + do { + NSNumber * _Nullable memberValue; + if (cppValue.bitRate.HasValue()) { + memberValue = [NSNumber numberWithUnsignedInt:cppValue.bitRate.Value()]; + } else { + memberValue = nil; + } + value.bitRate = memberValue; + } while (0); + do { + NSNumber * _Nullable memberValue; + if (cppValue.bitDepth.HasValue()) { + memberValue = [NSNumber numberWithUnsignedChar:cppValue.bitDepth.Value()]; + } else { + memberValue = nil; + } + value.bitDepth = memberValue; + } while (0); + + return value; + } + case Events::SnapshotStreamChanged::Id: { + Events::SnapshotStreamChanged::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + + __auto_type * value = [MTRCameraAVStreamManagementClusterSnapshotStreamChangedEvent new]; + + do { + NSNumber * _Nonnull memberValue; + memberValue = [NSNumber numberWithUnsignedShort:cppValue.snapshotStreamID]; + value.snapshotStreamID = memberValue; + } while (0); + do { + NSNumber * _Nullable memberValue; + if (cppValue.imageCodec.HasValue()) { + memberValue = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.imageCodec.Value())]; + } else { + memberValue = nil; + } + value.imageCodec = memberValue; + } while (0); + do { + NSNumber * _Nullable memberValue; + if (cppValue.frameRate.HasValue()) { + memberValue = [NSNumber numberWithUnsignedShort:cppValue.frameRate.Value()]; + } else { + memberValue = nil; + } + value.frameRate = memberValue; + } while (0); + do { + NSNumber * _Nullable memberValue; + if (cppValue.bitRate.HasValue()) { + memberValue = [NSNumber numberWithUnsignedInt:cppValue.bitRate.Value()]; + } else { + memberValue = nil; + } + value.bitRate = memberValue; + } while (0); + do { + MTRCameraAVStreamManagementClusterVideoResolutionStruct * _Nullable memberValue; + if (cppValue.minResolution.HasValue()) { + memberValue = [MTRCameraAVStreamManagementClusterVideoResolutionStruct new]; + memberValue.width = [NSNumber numberWithUnsignedShort:cppValue.minResolution.Value().width]; + memberValue.height = [NSNumber numberWithUnsignedShort:cppValue.minResolution.Value().height]; + } else { + memberValue = nil; + } + value.minResolution = memberValue; + } while (0); + do { + MTRCameraAVStreamManagementClusterVideoResolutionStruct * _Nullable memberValue; + if (cppValue.maxResolution.HasValue()) { + memberValue = [MTRCameraAVStreamManagementClusterVideoResolutionStruct new]; + memberValue.width = [NSNumber numberWithUnsignedShort:cppValue.maxResolution.Value().width]; + memberValue.height = [NSNumber numberWithUnsignedShort:cppValue.maxResolution.Value().height]; + } else { + memberValue = nil; + } + value.maxResolution = memberValue; + } while (0); + do { + NSNumber * _Nullable memberValue; + if (cppValue.quality.HasValue()) { + memberValue = [NSNumber numberWithUnsignedChar:cppValue.quality.Value()]; + } else { + memberValue = nil; + } + value.quality = memberValue; + } while (0); + + return value; + } + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; + return nil; +} static id _Nullable DecodeEventPayloadForWebRTCTransportProviderCluster(EventId aEventId, TLV::TLVReader & aReader, CHIP_ERROR * aError) { using namespace Clusters::WebRTCTransportProvider; @@ -5169,6 +5438,9 @@ id _Nullable MTRDecodeEventPayload(const ConcreteEventPath & aPath, TLV::TLVRead case Clusters::ContentAppObserver::Id: { return DecodeEventPayloadForContentAppObserverCluster(aPath.mEventId, aReader, aError); } + case Clusters::CameraAvStreamManagement::Id: { + return DecodeEventPayloadForCameraAVStreamManagementCluster(aPath.mEventId, aReader, aError); + } case Clusters::WebRTCTransportProvider::Id: { return DecodeEventPayloadForWebRTCTransportProviderCluster(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 fa103214b8e20d..6efdb535081aa9 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h @@ -2117,6 +2117,134 @@ MTR_PROVISIONALLY_AVAILABLE @interface MTRContentControlClusterRemainingScreenTimeExpiredEvent : NSObject @end +MTR_PROVISIONALLY_AVAILABLE +@interface MTRCameraAVStreamManagementClusterVideoResolutionStruct : NSObject +@property (nonatomic, copy) NSNumber * _Nonnull width MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull height MTR_PROVISIONALLY_AVAILABLE; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRCameraAVStreamManagementClusterVideoStreamStruct : NSObject +@property (nonatomic, copy) NSNumber * _Nonnull videoStreamID MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull streamType MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull videoCodec MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull minFrameRate MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull maxFrameRate MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) MTRCameraAVStreamManagementClusterVideoResolutionStruct * _Nonnull minResolution MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) MTRCameraAVStreamManagementClusterVideoResolutionStruct * _Nonnull maxResolution MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull minBitRate MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull maxBitRate MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull minFragmentLen MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull maxFragmentLen MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull referenceCount MTR_PROVISIONALLY_AVAILABLE; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRCameraAVStreamManagementClusterSnapshotStreamStruct : NSObject +@property (nonatomic, copy) NSNumber * _Nonnull snapshotStreamID MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull imageCodec MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull frameRate MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull bitRate MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) MTRCameraAVStreamManagementClusterVideoResolutionStruct * _Nonnull minResolution MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) MTRCameraAVStreamManagementClusterVideoResolutionStruct * _Nonnull maxResolution MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull quality MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull referenceCount MTR_PROVISIONALLY_AVAILABLE; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRCameraAVStreamManagementClusterSnapshotParamsStruct : NSObject +@property (nonatomic, copy) MTRCameraAVStreamManagementClusterVideoResolutionStruct * _Nonnull resolution MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull maxFrameRate MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull imageCodec MTR_PROVISIONALLY_AVAILABLE; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRCameraAVStreamManagementClusterRateDistortionTradeOffPointsStruct : NSObject +@property (nonatomic, copy) NSNumber * _Nonnull codec MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) MTRCameraAVStreamManagementClusterVideoResolutionStruct * _Nonnull resolution MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull minBitRate MTR_PROVISIONALLY_AVAILABLE; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRCameraAVStreamManagementClusterAudioCapabilitiesStruct : NSObject +@property (nonatomic, copy) NSNumber * _Nonnull maxNumberOfChannels MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSArray * _Nonnull supportedCodecs MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSArray * _Nonnull supportedSampleRates MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSArray * _Nonnull supportedBitDepths MTR_PROVISIONALLY_AVAILABLE; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRCameraAVStreamManagementClusterAudioStreamStruct : NSObject +@property (nonatomic, copy) NSNumber * _Nonnull audioStreamID MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull streamType MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull audioCodec MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull channelCount MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull sampleRate MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull bitRate MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull bitDepth MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull referenceCount MTR_PROVISIONALLY_AVAILABLE; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRCameraAVStreamManagementClusterPerStreamStruct : NSObject +@property (nonatomic, copy) NSNumber * _Nonnull streamID MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull enabled MTR_PROVISIONALLY_AVAILABLE; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRCameraAVStreamManagementClusterVideoSensorParamsStruct : NSObject +@property (nonatomic, copy) NSNumber * _Nonnull sensorWidth MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull sensorHeight MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull hdrCapable MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull maxFPS MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull maxHDRFPS MTR_PROVISIONALLY_AVAILABLE; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRCameraAVStreamManagementClusterViewportStruct : NSObject +@property (nonatomic, copy) NSNumber * _Nonnull x1 MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull y1 MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull x2 MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull y2 MTR_PROVISIONALLY_AVAILABLE; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRCameraAVStreamManagementClusterVideoStreamChangedEvent : NSObject +@property (nonatomic, copy) NSNumber * _Nonnull videoStreamID MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable streamType MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable videoCodec MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable minFrameRate MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable maxFrameRate MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) MTRCameraAVStreamManagementClusterVideoResolutionStruct * _Nullable minResolution MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) MTRCameraAVStreamManagementClusterVideoResolutionStruct * _Nullable maxResolution MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable minBitRate MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable maxBitRate MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable minFragmentLen MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable maxFragmentLen MTR_PROVISIONALLY_AVAILABLE; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRCameraAVStreamManagementClusterAudioStreamChangedEvent : NSObject +@property (nonatomic, copy) NSNumber * _Nonnull audioStreamID MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable streamType MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable audioCodec MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable channelCount MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable sampleRate MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable bitRate MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable bitDepth MTR_PROVISIONALLY_AVAILABLE; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRCameraAVStreamManagementClusterSnapshotStreamChangedEvent : NSObject +@property (nonatomic, copy) NSNumber * _Nonnull snapshotStreamID MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable imageCodec MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable frameRate MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable bitRate MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) MTRCameraAVStreamManagementClusterVideoResolutionStruct * _Nullable minResolution MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) MTRCameraAVStreamManagementClusterVideoResolutionStruct * _Nullable maxResolution MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable quality MTR_PROVISIONALLY_AVAILABLE; +@end + MTR_PROVISIONALLY_AVAILABLE @interface MTRWebRTCTransportProviderClusterICEServerStruct : NSObject @property (nonatomic, copy) NSArray * _Nonnull urls MTR_PROVISIONALLY_AVAILABLE; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm index e8153706aa6b53..1b6c78097b67cf 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm @@ -8768,6 +8768,546 @@ - (NSString *)description @end +@implementation MTRCameraAVStreamManagementClusterVideoResolutionStruct +- (instancetype)init +{ + if (self = [super init]) { + + _width = @(0); + + _height = @(0); + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRCameraAVStreamManagementClusterVideoResolutionStruct alloc] init]; + + other.width = self.width; + other.height = self.height; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: width:%@; height:%@; >", NSStringFromClass([self class]), _width, _height]; + return descriptionString; +} + +@end + +@implementation MTRCameraAVStreamManagementClusterVideoStreamStruct +- (instancetype)init +{ + if (self = [super init]) { + + _videoStreamID = @(0); + + _streamType = @(0); + + _videoCodec = @(0); + + _minFrameRate = @(0); + + _maxFrameRate = @(0); + + _minResolution = [MTRCameraAVStreamManagementClusterVideoResolutionStruct new]; + + _maxResolution = [MTRCameraAVStreamManagementClusterVideoResolutionStruct new]; + + _minBitRate = @(0); + + _maxBitRate = @(0); + + _minFragmentLen = @(0); + + _maxFragmentLen = @(0); + + _referenceCount = @(0); + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRCameraAVStreamManagementClusterVideoStreamStruct alloc] init]; + + other.videoStreamID = self.videoStreamID; + other.streamType = self.streamType; + other.videoCodec = self.videoCodec; + other.minFrameRate = self.minFrameRate; + other.maxFrameRate = self.maxFrameRate; + other.minResolution = self.minResolution; + other.maxResolution = self.maxResolution; + other.minBitRate = self.minBitRate; + other.maxBitRate = self.maxBitRate; + other.minFragmentLen = self.minFragmentLen; + other.maxFragmentLen = self.maxFragmentLen; + other.referenceCount = self.referenceCount; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: videoStreamID:%@; streamType:%@; videoCodec:%@; minFrameRate:%@; maxFrameRate:%@; minResolution:%@; maxResolution:%@; minBitRate:%@; maxBitRate:%@; minFragmentLen:%@; maxFragmentLen:%@; referenceCount:%@; >", NSStringFromClass([self class]), _videoStreamID, _streamType, _videoCodec, _minFrameRate, _maxFrameRate, _minResolution, _maxResolution, _minBitRate, _maxBitRate, _minFragmentLen, _maxFragmentLen, _referenceCount]; + return descriptionString; +} + +@end + +@implementation MTRCameraAVStreamManagementClusterSnapshotStreamStruct +- (instancetype)init +{ + if (self = [super init]) { + + _snapshotStreamID = @(0); + + _imageCodec = @(0); + + _frameRate = @(0); + + _bitRate = @(0); + + _minResolution = [MTRCameraAVStreamManagementClusterVideoResolutionStruct new]; + + _maxResolution = [MTRCameraAVStreamManagementClusterVideoResolutionStruct new]; + + _quality = @(0); + + _referenceCount = @(0); + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRCameraAVStreamManagementClusterSnapshotStreamStruct alloc] init]; + + other.snapshotStreamID = self.snapshotStreamID; + other.imageCodec = self.imageCodec; + other.frameRate = self.frameRate; + other.bitRate = self.bitRate; + other.minResolution = self.minResolution; + other.maxResolution = self.maxResolution; + other.quality = self.quality; + other.referenceCount = self.referenceCount; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: snapshotStreamID:%@; imageCodec:%@; frameRate:%@; bitRate:%@; minResolution:%@; maxResolution:%@; quality:%@; referenceCount:%@; >", NSStringFromClass([self class]), _snapshotStreamID, _imageCodec, _frameRate, _bitRate, _minResolution, _maxResolution, _quality, _referenceCount]; + return descriptionString; +} + +@end + +@implementation MTRCameraAVStreamManagementClusterSnapshotParamsStruct +- (instancetype)init +{ + if (self = [super init]) { + + _resolution = [MTRCameraAVStreamManagementClusterVideoResolutionStruct new]; + + _maxFrameRate = @(0); + + _imageCodec = @(0); + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRCameraAVStreamManagementClusterSnapshotParamsStruct alloc] init]; + + other.resolution = self.resolution; + other.maxFrameRate = self.maxFrameRate; + other.imageCodec = self.imageCodec; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: resolution:%@; maxFrameRate:%@; imageCodec:%@; >", NSStringFromClass([self class]), _resolution, _maxFrameRate, _imageCodec]; + return descriptionString; +} + +@end + +@implementation MTRCameraAVStreamManagementClusterRateDistortionTradeOffPointsStruct +- (instancetype)init +{ + if (self = [super init]) { + + _codec = @(0); + + _resolution = [MTRCameraAVStreamManagementClusterVideoResolutionStruct new]; + + _minBitRate = @(0); + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRCameraAVStreamManagementClusterRateDistortionTradeOffPointsStruct alloc] init]; + + other.codec = self.codec; + other.resolution = self.resolution; + other.minBitRate = self.minBitRate; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: codec:%@; resolution:%@; minBitRate:%@; >", NSStringFromClass([self class]), _codec, _resolution, _minBitRate]; + return descriptionString; +} + +@end + +@implementation MTRCameraAVStreamManagementClusterAudioCapabilitiesStruct +- (instancetype)init +{ + if (self = [super init]) { + + _maxNumberOfChannels = @(0); + + _supportedCodecs = [NSArray array]; + + _supportedSampleRates = [NSArray array]; + + _supportedBitDepths = [NSArray array]; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRCameraAVStreamManagementClusterAudioCapabilitiesStruct alloc] init]; + + other.maxNumberOfChannels = self.maxNumberOfChannels; + other.supportedCodecs = self.supportedCodecs; + other.supportedSampleRates = self.supportedSampleRates; + other.supportedBitDepths = self.supportedBitDepths; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: maxNumberOfChannels:%@; supportedCodecs:%@; supportedSampleRates:%@; supportedBitDepths:%@; >", NSStringFromClass([self class]), _maxNumberOfChannels, _supportedCodecs, _supportedSampleRates, _supportedBitDepths]; + return descriptionString; +} + +@end + +@implementation MTRCameraAVStreamManagementClusterAudioStreamStruct +- (instancetype)init +{ + if (self = [super init]) { + + _audioStreamID = @(0); + + _streamType = @(0); + + _audioCodec = @(0); + + _channelCount = @(0); + + _sampleRate = @(0); + + _bitRate = @(0); + + _bitDepth = @(0); + + _referenceCount = @(0); + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRCameraAVStreamManagementClusterAudioStreamStruct alloc] init]; + + other.audioStreamID = self.audioStreamID; + other.streamType = self.streamType; + other.audioCodec = self.audioCodec; + other.channelCount = self.channelCount; + other.sampleRate = self.sampleRate; + other.bitRate = self.bitRate; + other.bitDepth = self.bitDepth; + other.referenceCount = self.referenceCount; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: audioStreamID:%@; streamType:%@; audioCodec:%@; channelCount:%@; sampleRate:%@; bitRate:%@; bitDepth:%@; referenceCount:%@; >", NSStringFromClass([self class]), _audioStreamID, _streamType, _audioCodec, _channelCount, _sampleRate, _bitRate, _bitDepth, _referenceCount]; + return descriptionString; +} + +@end + +@implementation MTRCameraAVStreamManagementClusterPerStreamStruct +- (instancetype)init +{ + if (self = [super init]) { + + _streamID = @(0); + + _enabled = @(0); + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRCameraAVStreamManagementClusterPerStreamStruct alloc] init]; + + other.streamID = self.streamID; + other.enabled = self.enabled; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: streamID:%@; enabled:%@; >", NSStringFromClass([self class]), _streamID, _enabled]; + return descriptionString; +} + +@end + +@implementation MTRCameraAVStreamManagementClusterVideoSensorParamsStruct +- (instancetype)init +{ + if (self = [super init]) { + + _sensorWidth = @(0); + + _sensorHeight = @(0); + + _hdrCapable = @(0); + + _maxFPS = @(0); + + _maxHDRFPS = @(0); + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRCameraAVStreamManagementClusterVideoSensorParamsStruct alloc] init]; + + other.sensorWidth = self.sensorWidth; + other.sensorHeight = self.sensorHeight; + other.hdrCapable = self.hdrCapable; + other.maxFPS = self.maxFPS; + other.maxHDRFPS = self.maxHDRFPS; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: sensorWidth:%@; sensorHeight:%@; hdrCapable:%@; maxFPS:%@; maxHDRFPS:%@; >", NSStringFromClass([self class]), _sensorWidth, _sensorHeight, _hdrCapable, _maxFPS, _maxHDRFPS]; + return descriptionString; +} + +@end + +@implementation MTRCameraAVStreamManagementClusterViewportStruct +- (instancetype)init +{ + if (self = [super init]) { + + _x1 = @(0); + + _y1 = @(0); + + _x2 = @(0); + + _y2 = @(0); + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRCameraAVStreamManagementClusterViewportStruct alloc] init]; + + other.x1 = self.x1; + other.y1 = self.y1; + other.x2 = self.x2; + other.y2 = self.y2; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: x1:%@; y1:%@; x2:%@; y2:%@; >", NSStringFromClass([self class]), _x1, _y1, _x2, _y2]; + return descriptionString; +} + +@end + +@implementation MTRCameraAVStreamManagementClusterVideoStreamChangedEvent +- (instancetype)init +{ + if (self = [super init]) { + + _videoStreamID = @(0); + + _streamType = nil; + + _videoCodec = nil; + + _minFrameRate = nil; + + _maxFrameRate = nil; + + _minResolution = nil; + + _maxResolution = nil; + + _minBitRate = nil; + + _maxBitRate = nil; + + _minFragmentLen = nil; + + _maxFragmentLen = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRCameraAVStreamManagementClusterVideoStreamChangedEvent alloc] init]; + + other.videoStreamID = self.videoStreamID; + other.streamType = self.streamType; + other.videoCodec = self.videoCodec; + other.minFrameRate = self.minFrameRate; + other.maxFrameRate = self.maxFrameRate; + other.minResolution = self.minResolution; + other.maxResolution = self.maxResolution; + other.minBitRate = self.minBitRate; + other.maxBitRate = self.maxBitRate; + other.minFragmentLen = self.minFragmentLen; + other.maxFragmentLen = self.maxFragmentLen; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: videoStreamID:%@; streamType:%@; videoCodec:%@; minFrameRate:%@; maxFrameRate:%@; minResolution:%@; maxResolution:%@; minBitRate:%@; maxBitRate:%@; minFragmentLen:%@; maxFragmentLen:%@; >", NSStringFromClass([self class]), _videoStreamID, _streamType, _videoCodec, _minFrameRate, _maxFrameRate, _minResolution, _maxResolution, _minBitRate, _maxBitRate, _minFragmentLen, _maxFragmentLen]; + return descriptionString; +} + +@end + +@implementation MTRCameraAVStreamManagementClusterAudioStreamChangedEvent +- (instancetype)init +{ + if (self = [super init]) { + + _audioStreamID = @(0); + + _streamType = nil; + + _audioCodec = nil; + + _channelCount = nil; + + _sampleRate = nil; + + _bitRate = nil; + + _bitDepth = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRCameraAVStreamManagementClusterAudioStreamChangedEvent alloc] init]; + + other.audioStreamID = self.audioStreamID; + other.streamType = self.streamType; + other.audioCodec = self.audioCodec; + other.channelCount = self.channelCount; + other.sampleRate = self.sampleRate; + other.bitRate = self.bitRate; + other.bitDepth = self.bitDepth; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: audioStreamID:%@; streamType:%@; audioCodec:%@; channelCount:%@; sampleRate:%@; bitRate:%@; bitDepth:%@; >", NSStringFromClass([self class]), _audioStreamID, _streamType, _audioCodec, _channelCount, _sampleRate, _bitRate, _bitDepth]; + return descriptionString; +} + +@end + +@implementation MTRCameraAVStreamManagementClusterSnapshotStreamChangedEvent +- (instancetype)init +{ + if (self = [super init]) { + + _snapshotStreamID = @(0); + + _imageCodec = nil; + + _frameRate = nil; + + _bitRate = nil; + + _minResolution = nil; + + _maxResolution = nil; + + _quality = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRCameraAVStreamManagementClusterSnapshotStreamChangedEvent alloc] init]; + + other.snapshotStreamID = self.snapshotStreamID; + other.imageCodec = self.imageCodec; + other.frameRate = self.frameRate; + other.bitRate = self.bitRate; + other.minResolution = self.minResolution; + other.maxResolution = self.maxResolution; + other.quality = self.quality; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: snapshotStreamID:%@; imageCodec:%@; frameRate:%@; bitRate:%@; minResolution:%@; maxResolution:%@; quality:%@; >", NSStringFromClass([self class]), _snapshotStreamID, _imageCodec, _frameRate, _bitRate, _minResolution, _maxResolution, _quality]; + return descriptionString; +} + +@end + @implementation MTRWebRTCTransportProviderClusterICEServerStruct - (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 3141e1562abb14..4b5229dcfb3a25 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 @@ -37305,6 +37305,1715 @@ Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) } // namespace Attributes } // namespace ContentAppObserver +namespace CameraAvStreamManagement { +namespace Attributes { + +namespace MaxConcurrentVideoEncoders { + +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::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, 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::CameraAvStreamManagement::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::CameraAvStreamManagement::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); +} + +} // namespace MaxConcurrentVideoEncoders + +namespace MaxEncodedPixelRate { + +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::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, 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::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 MaxEncodedPixelRate + +namespace NightVisionCapable { + +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 NightVisionCapable + +namespace MaxPreRollBufferSize { + +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::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, 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::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 MaxPreRollBufferSize + +namespace TwoWayTalkSupport { + +Protocols::InteractionModel::Status Get(EndpointId endpoint, + chip::app::Clusters::CameraAvStreamManagement::TwoWayTalkSupportTypeEnum * 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::TwoWayTalkSupportTypeEnum 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_ENUM8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, + chip::app::Clusters::CameraAvStreamManagement::TwoWayTalkSupportTypeEnum 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_ENUM8_ATTRIBUTE_TYPE); +} + +} // namespace TwoWayTalkSupport + +namespace HDRCapable { + +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 HDRCapable + +namespace MaxNetworkBandwidth { + +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::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, 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::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 HDRMode { + +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 HDRMode + +namespace SoftRecordingPrivacyModeSetting { + +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 SoftRecordingPrivacyModeSetting + +namespace SoftLivestreamPrivacyModeSetting { + +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 SoftLivestreamPrivacyModeSetting + +namespace HardPrivacyMode { + +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 HardPrivacyMode + +namespace NightVision { + +Protocols::InteractionModel::Status Get(EndpointId endpoint, + chip::app::Clusters::CameraAvStreamManagement::TriStateAutoEnum * 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::TriStateAutoEnum 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_ENUM8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::CameraAvStreamManagement::TriStateAutoEnum 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_ENUM8_ATTRIBUTE_TYPE); +} + +} // namespace NightVision + +namespace NightVisionIllum { + +Protocols::InteractionModel::Status Get(EndpointId endpoint, + chip::app::Clusters::CameraAvStreamManagement::TriStateAutoEnum * 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::TriStateAutoEnum 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_ENUM8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::CameraAvStreamManagement::TriStateAutoEnum 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_ENUM8_ATTRIBUTE_TYPE); +} + +} // namespace NightVisionIllum + +namespace Awb { + +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 Awb + +namespace ShutterSpeed { + +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 ShutterSpeed + +namespace Iso { + +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 Iso + +namespace SpeakerEnabled { + +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 SpeakerEnabled + +namespace SpeakerVolumeLevel { + +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::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, 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::CameraAvStreamManagement::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::CameraAvStreamManagement::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); +} + +} // namespace SpeakerVolumeLevel + +namespace SpeakerMaxLevel { + +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::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, 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::CameraAvStreamManagement::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::CameraAvStreamManagement::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); +} + +} // namespace SpeakerMaxLevel + +namespace SpeakerMinLevel { + +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::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, 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::CameraAvStreamManagement::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::CameraAvStreamManagement::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); +} + +} // namespace SpeakerMinLevel + +namespace MicStatus { + +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 MicStatus + +namespace MicVolumeLevel { + +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::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, 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::CameraAvStreamManagement::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::CameraAvStreamManagement::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); +} + +} // namespace MicVolumeLevel + +namespace MicMaxLevel { + +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::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, 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::CameraAvStreamManagement::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::CameraAvStreamManagement::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); +} + +} // namespace MicMaxLevel + +namespace MicMinLevel { + +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::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, 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::CameraAvStreamManagement::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::CameraAvStreamManagement::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); +} + +} // namespace MicMinLevel + +namespace MicAGCEnabled { + +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 MicAGCEnabled + +namespace ImageRotation { + +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 ImageRotation + +namespace ImageFlipHorizontal { + +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 ImageFlipHorizontal + +namespace ImageFlipVertical { + +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 ImageFlipVertical + +namespace LocalVideoRecordingEnabled { + +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 LocalVideoRecordingEnabled + +namespace LocalSnapshotRecordingEnabled { + +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 LocalSnapshotRecordingEnabled + +namespace StatusLight { + +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 StatusLight + +namespace StatusLightBrightness { + +Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::app::Clusters::Globals::ThreeLevelAutoEnum * 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::Globals::ThreeLevelAutoEnum 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_ENUM8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::Globals::ThreeLevelAutoEnum 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_ENUM8_ATTRIBUTE_TYPE); +} + +} // namespace StatusLightBrightness + +namespace DepthSensorStatus { + +Protocols::InteractionModel::Status Get(EndpointId endpoint, + chip::app::Clusters::CameraAvStreamManagement::TriStateAutoEnum * 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::TriStateAutoEnum 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_ENUM8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::CameraAvStreamManagement::TriStateAutoEnum 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_ENUM8_ATTRIBUTE_TYPE); +} + +} // namespace DepthSensorStatus + +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::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, 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::CameraAvStreamManagement::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::CameraAvStreamManagement::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::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 ClusterRevision + +} // namespace Attributes +} // namespace CameraAvStreamManagement + namespace WebRTCTransportProvider { namespace Attributes { diff --git a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h index 30641f2c4dd8c8..ee4007c37e94d3 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 @@ -5641,6 +5641,241 @@ Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, Mar } // namespace Attributes } // namespace ContentAppObserver +namespace CameraAvStreamManagement { +namespace Attributes { + +namespace MaxConcurrentVideoEncoders { +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 MaxConcurrentVideoEncoders + +namespace MaxEncodedPixelRate { +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 MaxEncodedPixelRate + +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 MaxPreRollBufferSize { +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 MaxPreRollBufferSize + +namespace TwoWayTalkSupport { +Protocols::InteractionModel::Status +Get(EndpointId endpoint, + chip::app::Clusters::CameraAvStreamManagement::TwoWayTalkSupportTypeEnum * value); // TwoWayTalkSupportTypeEnum +Protocols::InteractionModel::Status Set(EndpointId endpoint, + chip::app::Clusters::CameraAvStreamManagement::TwoWayTalkSupportTypeEnum value); +Protocols::InteractionModel::Status Set(EndpointId endpoint, + chip::app::Clusters::CameraAvStreamManagement::TwoWayTalkSupportTypeEnum value, + MarkAttributeDirty markDirty); +} // namespace TwoWayTalkSupport + +namespace HDRCapable { +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 HDRCapable + +namespace MaxNetworkBandwidth { +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 MaxNetworkBandwidth + +namespace CurrentFrameRate { +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 CurrentFrameRate + +namespace HDRMode { +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 HDRMode + +namespace SoftRecordingPrivacyModeSetting { +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 SoftRecordingPrivacyModeSetting + +namespace SoftLivestreamPrivacyModeSetting { +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 SoftLivestreamPrivacyModeSetting + +namespace HardPrivacyMode { +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 HardPrivacyMode + +namespace NightVision { +Protocols::InteractionModel::Status +Get(EndpointId endpoint, chip::app::Clusters::CameraAvStreamManagement::TriStateAutoEnum * value); // TriStateAutoEnum +Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::CameraAvStreamManagement::TriStateAutoEnum value); +Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::CameraAvStreamManagement::TriStateAutoEnum value, + MarkAttributeDirty markDirty); +} // namespace NightVision + +namespace NightVisionIllum { +Protocols::InteractionModel::Status +Get(EndpointId endpoint, chip::app::Clusters::CameraAvStreamManagement::TriStateAutoEnum * value); // TriStateAutoEnum +Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::CameraAvStreamManagement::TriStateAutoEnum value); +Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::CameraAvStreamManagement::TriStateAutoEnum value, + MarkAttributeDirty markDirty); +} // namespace NightVisionIllum + +namespace Awb { +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 Awb + +namespace ShutterSpeed { +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 ShutterSpeed + +namespace Iso { +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 Iso + +namespace SpeakerEnabled { +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 SpeakerEnabled + +namespace SpeakerVolumeLevel { +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 SpeakerVolumeLevel + +namespace SpeakerMaxLevel { +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 SpeakerMaxLevel + +namespace SpeakerMinLevel { +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 SpeakerMinLevel + +namespace MicStatus { +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 MicStatus + +namespace MicVolumeLevel { +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 MicVolumeLevel + +namespace MicMaxLevel { +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 MicMaxLevel + +namespace MicMinLevel { +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 MicMinLevel + +namespace MicAGCEnabled { +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 MicAGCEnabled + +namespace ImageRotation { +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 ImageRotation + +namespace ImageFlipHorizontal { +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 ImageFlipHorizontal + +namespace ImageFlipVertical { +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 ImageFlipVertical + +namespace LocalVideoRecordingEnabled { +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 LocalVideoRecordingEnabled + +namespace LocalSnapshotRecordingEnabled { +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 LocalSnapshotRecordingEnabled + +namespace StatusLight { +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 StatusLight + +namespace StatusLightBrightness { +Protocols::InteractionModel::Status Get(EndpointId endpoint, + chip::app::Clusters::Globals::ThreeLevelAutoEnum * value); // ThreeLevelAutoEnum +Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::Globals::ThreeLevelAutoEnum value); +Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::Globals::ThreeLevelAutoEnum value, + MarkAttributeDirty markDirty); +} // namespace StatusLightBrightness + +namespace DepthSensorStatus { +Protocols::InteractionModel::Status +Get(EndpointId endpoint, chip::app::Clusters::CameraAvStreamManagement::TriStateAutoEnum * value); // TriStateAutoEnum +Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::CameraAvStreamManagement::TriStateAutoEnum value); +Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::CameraAvStreamManagement::TriStateAutoEnum value, + MarkAttributeDirty markDirty); +} // namespace DepthSensorStatus + +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 CameraAvStreamManagement + namespace WebRTCTransportProvider { namespace Attributes { diff --git a/zzz_generated/app-common/app-common/zap-generated/callback.h b/zzz_generated/app-common/app-common/zap-generated/callback.h index 61bd0a4962b36d..abf862b3454a32 100644 --- a/zzz_generated/app-common/app-common/zap-generated/callback.h +++ b/zzz_generated/app-common/app-common/zap-generated/callback.h @@ -618,6 +618,11 @@ void emberAfContentControlClusterInitCallback(chip::EndpointId endpoint); */ void emberAfContentAppObserverClusterInitCallback(chip::EndpointId endpoint); +/** + * @param endpoint Endpoint that is being initialized + */ +void emberAfCameraAvStreamManagementClusterInitCallback(chip::EndpointId endpoint); + /** * @param endpoint Endpoint that is being initialized */ @@ -5182,6 +5187,44 @@ chip::Protocols::InteractionModel::Status MatterContentAppObserverClusterServerP */ void emberAfContentAppObserverClusterServerTickCallback(chip::EndpointId endpoint); +// +// Camera AV Stream Management Cluster +// + +/** + * @param endpoint Endpoint that is being initialized + */ +void emberAfCameraAvStreamManagementClusterServerInitCallback(chip::EndpointId endpoint); + +/** + * @param endpoint Endpoint that is being shutdown + */ +void MatterCameraAvStreamManagementClusterServerShutdownCallback(chip::EndpointId endpoint); + +/** + * @param endpoint Endpoint that is being initialized + */ +void emberAfCameraAvStreamManagementClusterClientInitCallback(chip::EndpointId endpoint); + +/** + * @param attributePath Concrete attribute path that changed + */ +void MatterCameraAvStreamManagementClusterServerAttributeChangedCallback(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 MatterCameraAvStreamManagementClusterServerPreAttributeChangedCallback( + const chip::app::ConcreteAttributePath & attributePath, EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); + +/** + * @param endpoint Endpoint that is being served + */ +void emberAfCameraAvStreamManagementClusterServerTickCallback(chip::EndpointId endpoint); + // // WebRTC Transport Provider Cluster // @@ -6687,6 +6730,96 @@ bool emberAfContentControlClusterSetScheduledContentRatingThresholdCallback( bool emberAfContentAppObserverClusterContentAppMessageCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, const chip::app::Clusters::ContentAppObserver::Commands::ContentAppMessage::DecodableType & commandData); +/** + * @brief Camera AV Stream Management Cluster AudioStreamAllocate Command callback (from client) + */ +bool emberAfCameraAvStreamManagementClusterAudioStreamAllocateCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::CameraAvStreamManagement::Commands::AudioStreamAllocate::DecodableType & commandData); +/** + * @brief Camera AV Stream Management Cluster AudioStreamDeallocate Command callback (from client) + */ +bool emberAfCameraAvStreamManagementClusterAudioStreamDeallocateCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::CameraAvStreamManagement::Commands::AudioStreamDeallocate::DecodableType & commandData); +/** + * @brief Camera AV Stream Management Cluster VideoStreamAllocate Command callback (from client) + */ +bool emberAfCameraAvStreamManagementClusterVideoStreamAllocateCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::CameraAvStreamManagement::Commands::VideoStreamAllocate::DecodableType & commandData); +/** + * @brief Camera AV Stream Management Cluster VideoStreamModify Command callback (from client) + */ +bool emberAfCameraAvStreamManagementClusterVideoStreamModifyCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::CameraAvStreamManagement::Commands::VideoStreamModify::DecodableType & commandData); +/** + * @brief Camera AV Stream Management Cluster VideoStreamDeallocate Command callback (from client) + */ +bool emberAfCameraAvStreamManagementClusterVideoStreamDeallocateCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::CameraAvStreamManagement::Commands::VideoStreamDeallocate::DecodableType & commandData); +/** + * @brief Camera AV Stream Management Cluster SnapshotStreamAllocate Command callback (from client) + */ +bool emberAfCameraAvStreamManagementClusterSnapshotStreamAllocateCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::CameraAvStreamManagement::Commands::SnapshotStreamAllocate::DecodableType & commandData); +/** + * @brief Camera AV Stream Management Cluster SnapshotStreamDeallocate Command callback (from client) + */ +bool emberAfCameraAvStreamManagementClusterSnapshotStreamDeallocateCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::CameraAvStreamManagement::Commands::SnapshotStreamDeallocate::DecodableType & commandData); +/** + * @brief Camera AV Stream Management Cluster SetStreamPriority Command callback (from client) + */ +bool emberAfCameraAvStreamManagementClusterSetStreamPriorityCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::CameraAvStreamManagement::Commands::SetStreamPriority::DecodableType & commandData); +/** + * @brief Camera AV Stream Management Cluster CaptureSnapshot Command callback (from client) + */ +bool emberAfCameraAvStreamManagementClusterCaptureSnapshotCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::CameraAvStreamManagement::Commands::CaptureSnapshot::DecodableType & commandData); +/** + * @brief Camera AV Stream Management Cluster SetViewport Command callback (from client) + */ +bool emberAfCameraAvStreamManagementClusterSetViewportCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::CameraAvStreamManagement::Commands::SetViewport::DecodableType & commandData); +/** + * @brief Camera AV Stream Management Cluster SetImageRotation Command callback (from client) + */ +bool emberAfCameraAvStreamManagementClusterSetImageRotationCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::CameraAvStreamManagement::Commands::SetImageRotation::DecodableType & commandData); +/** + * @brief Camera AV Stream Management Cluster SetImageFlipHorizontal Command callback (from client) + */ +bool emberAfCameraAvStreamManagementClusterSetImageFlipHorizontalCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::CameraAvStreamManagement::Commands::SetImageFlipHorizontal::DecodableType & commandData); +/** + * @brief Camera AV Stream Management Cluster SetImageFlipVertical Command callback (from client) + */ +bool emberAfCameraAvStreamManagementClusterSetImageFlipVerticalCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::CameraAvStreamManagement::Commands::SetImageFlipVertical::DecodableType & commandData); +/** + * @brief Camera AV Stream Management Cluster SetWatermark Command callback (from client) + */ +bool emberAfCameraAvStreamManagementClusterSetWatermarkCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::CameraAvStreamManagement::Commands::SetWatermark::DecodableType & commandData); +/** + * @brief Camera AV Stream Management Cluster SetOSD Command callback (from client) + */ +bool emberAfCameraAvStreamManagementClusterSetOSDCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::CameraAvStreamManagement::Commands::SetOSD::DecodableType & commandData); /** * @brief WebRTC Transport Provider Cluster SolicitOffer 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 006c91ef14a4c4..c26163dd9d3507 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 @@ -3568,6 +3568,70 @@ static auto __attribute__((unused)) EnsureKnownEnumValue(ContentAppObserver::Sta } } +static auto __attribute__((unused)) EnsureKnownEnumValue(CameraAvStreamManagement::AudioCodecEnum val) +{ + using EnumType = CameraAvStreamManagement::AudioCodecEnum; + switch (val) + { + case EnumType::kOpus: + case EnumType::kAacLc: + return val; + default: + return EnumType::kUnknownEnumValue; + } +} +static auto __attribute__((unused)) EnsureKnownEnumValue(CameraAvStreamManagement::ImageCodecEnum val) +{ + using EnumType = CameraAvStreamManagement::ImageCodecEnum; + switch (val) + { + case EnumType::kJpeg: + return val; + default: + return EnumType::kUnknownEnumValue; + } +} +static auto __attribute__((unused)) EnsureKnownEnumValue(CameraAvStreamManagement::TriStateAutoEnum val) +{ + using EnumType = CameraAvStreamManagement::TriStateAutoEnum; + switch (val) + { + case EnumType::kOff: + case EnumType::kOn: + case EnumType::kAuto: + return val; + default: + return EnumType::kUnknownEnumValue; + } +} +static auto __attribute__((unused)) EnsureKnownEnumValue(CameraAvStreamManagement::TwoWayTalkSupportTypeEnum val) +{ + using EnumType = CameraAvStreamManagement::TwoWayTalkSupportTypeEnum; + switch (val) + { + case EnumType::kNotSupported: + case EnumType::kHalfDuplex: + case EnumType::kFullDuplex: + return val; + default: + return EnumType::kUnknownEnumValue; + } +} +static auto __attribute__((unused)) EnsureKnownEnumValue(CameraAvStreamManagement::VideoCodecEnum val) +{ + using EnumType = CameraAvStreamManagement::VideoCodecEnum; + switch (val) + { + case EnumType::kH264: + case EnumType::kHevc: + case EnumType::kVvc: + case EnumType::kAv1: + 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 8829a72561edbe..6f54a6a30b0b89 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 @@ -5448,6 +5448,86 @@ enum class StatusEnum : uint8_t }; } // namespace ContentAppObserver +namespace CameraAvStreamManagement { + +// Enum for AudioCodecEnum +enum class AudioCodecEnum : uint8_t +{ + kOpus = 0x00, + kAacLc = 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 ImageCodecEnum +enum class ImageCodecEnum : uint8_t +{ + kJpeg = 0x00, + // All received enum values that are not listed above will be mapped + // to kUnknownEnumValue. This is a helper enum value that should only + // be used by code to process how it handles receiving and unknown + // enum value. This specific should never be transmitted. + kUnknownEnumValue = 1, +}; + +using StreamTypeEnum = Clusters::detail::StreamTypeEnum; + +// Enum for TriStateAutoEnum +enum class TriStateAutoEnum : uint8_t +{ + kOff = 0x00, + kOn = 0x01, + kAuto = 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 TwoWayTalkSupportTypeEnum +enum class TwoWayTalkSupportTypeEnum : uint8_t +{ + kNotSupported = 0x00, + kHalfDuplex = 0x01, + kFullDuplex = 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 VideoCodecEnum +enum class VideoCodecEnum : uint8_t +{ + kH264 = 0x00, + kHevc = 0x01, + kVvc = 0x02, + kAv1 = 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 and unknown + // enum value. This specific should never be transmitted. + kUnknownEnumValue = 4, +}; + +// Bitmap for Feature +enum class Feature : uint32_t +{ + kPrivacy = 0x1, + kSensorControl = 0x2, + kAudio = 0x4, + kImageControl = 0x8, + kVideo = 0x10, + kSnapshot = 0x20, + kLocalStorage = 0x40, +}; +} // namespace CameraAvStreamManagement + namespace WebRTCTransportProvider { using StreamTypeEnum = Clusters::detail::StreamTypeEnum; 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 05164fb2f75da8..5a051fb1a8a4d3 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 @@ -555,6 +555,98 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) } // namespace OperationalStateStruct +namespace PerStreamStruct { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kStreamID), streamID); + encoder.Encode(to_underlying(Fields::kEnabled), enabled); + 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::kStreamID)) + { + err = DataModel::Decode(reader, streamID); + } + else if (__context_tag == to_underlying(Fields::kEnabled)) + { + err = DataModel::Decode(reader, enabled); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} + +} // namespace PerStreamStruct + +namespace ViewportStruct { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kX1), x1); + encoder.Encode(to_underlying(Fields::kY1), y1); + encoder.Encode(to_underlying(Fields::kX2), x2); + encoder.Encode(to_underlying(Fields::kY2), y2); + 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::kX1)) + { + err = DataModel::Decode(reader, x1); + } + else if (__context_tag == to_underlying(Fields::kY1)) + { + err = DataModel::Decode(reader, y1); + } + else if (__context_tag == to_underlying(Fields::kX2)) + { + err = DataModel::Decode(reader, x2); + } + else if (__context_tag == to_underlying(Fields::kY2)) + { + err = DataModel::Decode(reader, y2); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} + +} // namespace ViewportStruct + namespace WebRTCSessionStruct { CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const { @@ -28017,12 +28109,1963 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre } // namespace Attributes namespace Events { -namespace LoggedOut { +namespace LoggedOut { +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::kNode), node)); + 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::kNode)) + { + err = DataModel::Decode(reader, node); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace LoggedOut. +} // namespace Events + +} // namespace AccountLogin +namespace ContentControl { +namespace Structs { + +namespace RatingNameStruct { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kRatingName), ratingName); + encoder.Encode(to_underlying(Fields::kRatingNameDesc), ratingNameDesc); + 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::kRatingName)) + { + err = DataModel::Decode(reader, ratingName); + } + else if (__context_tag == to_underlying(Fields::kRatingNameDesc)) + { + err = DataModel::Decode(reader, ratingNameDesc); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} + +} // namespace RatingNameStruct +} // namespace Structs + +namespace Commands { +namespace UpdatePIN { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kOldPIN), oldPIN); + encoder.Encode(to_underlying(Fields::kNewPIN), newPIN); + 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::kOldPIN)) + { + err = DataModel::Decode(reader, oldPIN); + } + else if (__context_tag == to_underlying(Fields::kNewPIN)) + { + err = DataModel::Decode(reader, newPIN); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace UpdatePIN. +namespace ResetPIN { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + 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); + } + } +} +} // namespace ResetPIN. +namespace ResetPINResponse { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kPINCode), PINCode); + 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::kPINCode)) + { + err = DataModel::Decode(reader, PINCode); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace ResetPINResponse. +namespace Enable { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + 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); + } + } +} +} // namespace Enable. +namespace Disable { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + 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); + } + } +} +} // namespace Disable. +namespace AddBonusTime { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kPINCode), PINCode); + encoder.Encode(to_underlying(Fields::kBonusTime), bonusTime); + 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::kPINCode)) + { + err = DataModel::Decode(reader, PINCode); + } + else if (__context_tag == to_underlying(Fields::kBonusTime)) + { + err = DataModel::Decode(reader, bonusTime); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace AddBonusTime. +namespace SetScreenDailyTime { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kScreenTime), screenTime); + 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::kScreenTime)) + { + err = DataModel::Decode(reader, screenTime); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace SetScreenDailyTime. +namespace BlockUnratedContent { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + 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); + } + } +} +} // namespace BlockUnratedContent. +namespace UnblockUnratedContent { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + 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); + } + } +} +} // namespace UnblockUnratedContent. +namespace SetOnDemandRatingThreshold { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kRating), rating); + 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::kRating)) + { + err = DataModel::Decode(reader, rating); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace SetOnDemandRatingThreshold. +namespace SetScheduledContentRatingThreshold { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kRating), rating); + 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::kRating)) + { + err = DataModel::Decode(reader, rating); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace SetScheduledContentRatingThreshold. +} // namespace Commands + +namespace Attributes { +CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path) +{ + switch (path.mAttributeId) + { + case Attributes::Enabled::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, enabled); + case Attributes::OnDemandRatings::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, onDemandRatings); + case Attributes::OnDemandRatingThreshold::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, onDemandRatingThreshold); + case Attributes::ScheduledContentRatings::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, scheduledContentRatings); + case Attributes::ScheduledContentRatingThreshold::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, scheduledContentRatingThreshold); + case Attributes::ScreenDailyTime::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, screenDailyTime); + case Attributes::RemainingScreenTime::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, remainingScreenTime); + case Attributes::BlockUnrated::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, blockUnrated); + case Attributes::GeneratedCommandList::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, generatedCommandList); + case Attributes::AcceptedCommandList::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, acceptedCommandList); + case Attributes::EventList::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, eventList); + 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 RemainingScreenTimeExpired { +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 RemainingScreenTimeExpired. +} // namespace Events + +} // namespace ContentControl +namespace ContentAppObserver { + +namespace Commands { +namespace ContentAppMessage { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kData), data); + encoder.Encode(to_underlying(Fields::kEncodingHint), encodingHint); + 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::kData)) + { + err = DataModel::Decode(reader, data); + } + else if (__context_tag == to_underlying(Fields::kEncodingHint)) + { + err = DataModel::Decode(reader, encodingHint); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace ContentAppMessage. +namespace ContentAppMessageResponse { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kStatus), status); + encoder.Encode(to_underlying(Fields::kData), data); + encoder.Encode(to_underlying(Fields::kEncodingHint), encodingHint); + 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::kStatus)) + { + err = DataModel::Decode(reader, status); + } + else if (__context_tag == to_underlying(Fields::kData)) + { + err = DataModel::Decode(reader, data); + } + else if (__context_tag == to_underlying(Fields::kEncodingHint)) + { + err = DataModel::Decode(reader, encodingHint); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace ContentAppMessageResponse. +} // namespace Commands + +namespace Attributes { +CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path) +{ + switch (path.mAttributeId) + { + case Attributes::GeneratedCommandList::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, generatedCommandList); + case Attributes::AcceptedCommandList::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, acceptedCommandList); + case Attributes::EventList::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, eventList); + 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 Events + +} // namespace ContentAppObserver +namespace CameraAvStreamManagement { +namespace Structs { + +namespace VideoResolutionStruct { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kWidth), width); + encoder.Encode(to_underlying(Fields::kHeight), height); + 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::kWidth)) + { + err = DataModel::Decode(reader, width); + } + else if (__context_tag == to_underlying(Fields::kHeight)) + { + err = DataModel::Decode(reader, height); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} + +} // namespace VideoResolutionStruct + +namespace VideoStreamStruct { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kVideoStreamID), videoStreamID); + encoder.Encode(to_underlying(Fields::kStreamType), streamType); + encoder.Encode(to_underlying(Fields::kVideoCodec), videoCodec); + encoder.Encode(to_underlying(Fields::kMinFrameRate), minFrameRate); + encoder.Encode(to_underlying(Fields::kMaxFrameRate), maxFrameRate); + encoder.Encode(to_underlying(Fields::kMinResolution), minResolution); + encoder.Encode(to_underlying(Fields::kMaxResolution), maxResolution); + encoder.Encode(to_underlying(Fields::kMinBitRate), minBitRate); + encoder.Encode(to_underlying(Fields::kMaxBitRate), maxBitRate); + encoder.Encode(to_underlying(Fields::kMinFragmentLen), minFragmentLen); + encoder.Encode(to_underlying(Fields::kMaxFragmentLen), maxFragmentLen); + encoder.Encode(to_underlying(Fields::kReferenceCount), referenceCount); + 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::kVideoStreamID)) + { + err = DataModel::Decode(reader, videoStreamID); + } + else if (__context_tag == to_underlying(Fields::kStreamType)) + { + err = DataModel::Decode(reader, streamType); + } + else if (__context_tag == to_underlying(Fields::kVideoCodec)) + { + err = DataModel::Decode(reader, videoCodec); + } + else if (__context_tag == to_underlying(Fields::kMinFrameRate)) + { + err = DataModel::Decode(reader, minFrameRate); + } + else if (__context_tag == to_underlying(Fields::kMaxFrameRate)) + { + err = DataModel::Decode(reader, maxFrameRate); + } + else if (__context_tag == to_underlying(Fields::kMinResolution)) + { + err = DataModel::Decode(reader, minResolution); + } + else if (__context_tag == to_underlying(Fields::kMaxResolution)) + { + err = DataModel::Decode(reader, maxResolution); + } + else if (__context_tag == to_underlying(Fields::kMinBitRate)) + { + err = DataModel::Decode(reader, minBitRate); + } + else if (__context_tag == to_underlying(Fields::kMaxBitRate)) + { + err = DataModel::Decode(reader, maxBitRate); + } + else if (__context_tag == to_underlying(Fields::kMinFragmentLen)) + { + err = DataModel::Decode(reader, minFragmentLen); + } + else if (__context_tag == to_underlying(Fields::kMaxFragmentLen)) + { + err = DataModel::Decode(reader, maxFragmentLen); + } + else if (__context_tag == to_underlying(Fields::kReferenceCount)) + { + err = DataModel::Decode(reader, referenceCount); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} + +} // namespace VideoStreamStruct + +namespace SnapshotStreamStruct { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kSnapshotStreamID), snapshotStreamID); + encoder.Encode(to_underlying(Fields::kImageCodec), imageCodec); + encoder.Encode(to_underlying(Fields::kFrameRate), frameRate); + encoder.Encode(to_underlying(Fields::kBitRate), bitRate); + encoder.Encode(to_underlying(Fields::kMinResolution), minResolution); + encoder.Encode(to_underlying(Fields::kMaxResolution), maxResolution); + encoder.Encode(to_underlying(Fields::kQuality), quality); + encoder.Encode(to_underlying(Fields::kReferenceCount), referenceCount); + 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::kSnapshotStreamID)) + { + err = DataModel::Decode(reader, snapshotStreamID); + } + else if (__context_tag == to_underlying(Fields::kImageCodec)) + { + err = DataModel::Decode(reader, imageCodec); + } + else if (__context_tag == to_underlying(Fields::kFrameRate)) + { + err = DataModel::Decode(reader, frameRate); + } + else if (__context_tag == to_underlying(Fields::kBitRate)) + { + err = DataModel::Decode(reader, bitRate); + } + else if (__context_tag == to_underlying(Fields::kMinResolution)) + { + err = DataModel::Decode(reader, minResolution); + } + else if (__context_tag == to_underlying(Fields::kMaxResolution)) + { + err = DataModel::Decode(reader, maxResolution); + } + else if (__context_tag == to_underlying(Fields::kQuality)) + { + err = DataModel::Decode(reader, quality); + } + else if (__context_tag == to_underlying(Fields::kReferenceCount)) + { + err = DataModel::Decode(reader, referenceCount); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} + +} // namespace SnapshotStreamStruct + +namespace SnapshotParamsStruct { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kResolution), resolution); + encoder.Encode(to_underlying(Fields::kMaxFrameRate), maxFrameRate); + encoder.Encode(to_underlying(Fields::kImageCodec), imageCodec); + 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::kResolution)) + { + err = DataModel::Decode(reader, resolution); + } + else if (__context_tag == to_underlying(Fields::kMaxFrameRate)) + { + err = DataModel::Decode(reader, maxFrameRate); + } + else if (__context_tag == to_underlying(Fields::kImageCodec)) + { + err = DataModel::Decode(reader, imageCodec); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} + +} // namespace SnapshotParamsStruct + +namespace RateDistortionTradeOffPointsStruct { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kCodec), codec); + encoder.Encode(to_underlying(Fields::kResolution), resolution); + encoder.Encode(to_underlying(Fields::kMinBitRate), minBitRate); + 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::kCodec)) + { + err = DataModel::Decode(reader, codec); + } + else if (__context_tag == to_underlying(Fields::kResolution)) + { + err = DataModel::Decode(reader, resolution); + } + else if (__context_tag == to_underlying(Fields::kMinBitRate)) + { + err = DataModel::Decode(reader, minBitRate); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} + +} // namespace RateDistortionTradeOffPointsStruct + +namespace AudioCapabilitiesStruct { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kMaxNumberOfChannels), maxNumberOfChannels); + encoder.Encode(to_underlying(Fields::kSupportedCodecs), supportedCodecs); + encoder.Encode(to_underlying(Fields::kSupportedSampleRates), supportedSampleRates); + encoder.Encode(to_underlying(Fields::kSupportedBitDepths), supportedBitDepths); + 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::kMaxNumberOfChannels)) + { + err = DataModel::Decode(reader, maxNumberOfChannels); + } + else if (__context_tag == to_underlying(Fields::kSupportedCodecs)) + { + err = DataModel::Decode(reader, supportedCodecs); + } + else if (__context_tag == to_underlying(Fields::kSupportedSampleRates)) + { + err = DataModel::Decode(reader, supportedSampleRates); + } + else if (__context_tag == to_underlying(Fields::kSupportedBitDepths)) + { + err = DataModel::Decode(reader, supportedBitDepths); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} + +} // namespace AudioCapabilitiesStruct + +namespace AudioStreamStruct { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kAudioStreamID), audioStreamID); + encoder.Encode(to_underlying(Fields::kStreamType), streamType); + encoder.Encode(to_underlying(Fields::kAudioCodec), audioCodec); + encoder.Encode(to_underlying(Fields::kChannelCount), channelCount); + encoder.Encode(to_underlying(Fields::kSampleRate), sampleRate); + encoder.Encode(to_underlying(Fields::kBitRate), bitRate); + encoder.Encode(to_underlying(Fields::kBitDepth), bitDepth); + encoder.Encode(to_underlying(Fields::kReferenceCount), referenceCount); + 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::kAudioStreamID)) + { + err = DataModel::Decode(reader, audioStreamID); + } + else if (__context_tag == to_underlying(Fields::kStreamType)) + { + err = DataModel::Decode(reader, streamType); + } + else if (__context_tag == to_underlying(Fields::kAudioCodec)) + { + err = DataModel::Decode(reader, audioCodec); + } + else if (__context_tag == to_underlying(Fields::kChannelCount)) + { + err = DataModel::Decode(reader, channelCount); + } + else if (__context_tag == to_underlying(Fields::kSampleRate)) + { + err = DataModel::Decode(reader, sampleRate); + } + else if (__context_tag == to_underlying(Fields::kBitRate)) + { + err = DataModel::Decode(reader, bitRate); + } + else if (__context_tag == to_underlying(Fields::kBitDepth)) + { + err = DataModel::Decode(reader, bitDepth); + } + else if (__context_tag == to_underlying(Fields::kReferenceCount)) + { + err = DataModel::Decode(reader, referenceCount); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} + +} // namespace AudioStreamStruct + +namespace VideoSensorParamsStruct { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kSensorWidth), sensorWidth); + encoder.Encode(to_underlying(Fields::kSensorHeight), sensorHeight); + encoder.Encode(to_underlying(Fields::kHDRCapable), HDRCapable); + encoder.Encode(to_underlying(Fields::kMaxFPS), maxFPS); + encoder.Encode(to_underlying(Fields::kMaxHDRFPS), maxHDRFPS); + 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::kSensorWidth)) + { + err = DataModel::Decode(reader, sensorWidth); + } + else if (__context_tag == to_underlying(Fields::kSensorHeight)) + { + err = DataModel::Decode(reader, sensorHeight); + } + else if (__context_tag == to_underlying(Fields::kHDRCapable)) + { + err = DataModel::Decode(reader, HDRCapable); + } + else if (__context_tag == to_underlying(Fields::kMaxFPS)) + { + err = DataModel::Decode(reader, maxFPS); + } + else if (__context_tag == to_underlying(Fields::kMaxHDRFPS)) + { + err = DataModel::Decode(reader, maxHDRFPS); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} + +} // namespace VideoSensorParamsStruct +} // namespace Structs + +namespace Commands { +namespace AudioStreamAllocate { +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::kAudioCodec), audioCodec); + encoder.Encode(to_underlying(Fields::kChannelCount), channelCount); + encoder.Encode(to_underlying(Fields::kSampleRate), sampleRate); + encoder.Encode(to_underlying(Fields::kBitRate), bitRate); + encoder.Encode(to_underlying(Fields::kBitDepth), bitDepth); + 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::kAudioCodec)) + { + err = DataModel::Decode(reader, audioCodec); + } + else if (__context_tag == to_underlying(Fields::kChannelCount)) + { + err = DataModel::Decode(reader, channelCount); + } + else if (__context_tag == to_underlying(Fields::kSampleRate)) + { + err = DataModel::Decode(reader, sampleRate); + } + else if (__context_tag == to_underlying(Fields::kBitRate)) + { + err = DataModel::Decode(reader, bitRate); + } + else if (__context_tag == to_underlying(Fields::kBitDepth)) + { + err = DataModel::Decode(reader, bitDepth); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace AudioStreamAllocate. +namespace AudioStreamAllocateResponse { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kAudioStreamID), audioStreamID); + 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::kAudioStreamID)) + { + err = DataModel::Decode(reader, audioStreamID); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace AudioStreamAllocateResponse. +namespace AudioStreamDeallocate { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kAudioStreamID), audioStreamID); + 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::kAudioStreamID)) + { + err = DataModel::Decode(reader, audioStreamID); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace AudioStreamDeallocate. +namespace VideoStreamAllocate { +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::kVideoCodec), videoCodec); + encoder.Encode(to_underlying(Fields::kMinFrameRate), minFrameRate); + encoder.Encode(to_underlying(Fields::kMaxFrameRate), maxFrameRate); + encoder.Encode(to_underlying(Fields::kMinResolution), minResolution); + encoder.Encode(to_underlying(Fields::kMaxResolution), maxResolution); + encoder.Encode(to_underlying(Fields::kMinBitRate), minBitRate); + encoder.Encode(to_underlying(Fields::kMaxBitRate), maxBitRate); + encoder.Encode(to_underlying(Fields::kMinFragmentLen), minFragmentLen); + encoder.Encode(to_underlying(Fields::kMaxFragmentLen), maxFragmentLen); + 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::kVideoCodec)) + { + err = DataModel::Decode(reader, videoCodec); + } + else if (__context_tag == to_underlying(Fields::kMinFrameRate)) + { + err = DataModel::Decode(reader, minFrameRate); + } + else if (__context_tag == to_underlying(Fields::kMaxFrameRate)) + { + err = DataModel::Decode(reader, maxFrameRate); + } + else if (__context_tag == to_underlying(Fields::kMinResolution)) + { + err = DataModel::Decode(reader, minResolution); + } + else if (__context_tag == to_underlying(Fields::kMaxResolution)) + { + err = DataModel::Decode(reader, maxResolution); + } + else if (__context_tag == to_underlying(Fields::kMinBitRate)) + { + err = DataModel::Decode(reader, minBitRate); + } + else if (__context_tag == to_underlying(Fields::kMaxBitRate)) + { + err = DataModel::Decode(reader, maxBitRate); + } + else if (__context_tag == to_underlying(Fields::kMinFragmentLen)) + { + err = DataModel::Decode(reader, minFragmentLen); + } + else if (__context_tag == to_underlying(Fields::kMaxFragmentLen)) + { + err = DataModel::Decode(reader, maxFragmentLen); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace VideoStreamAllocate. +namespace VideoStreamAllocateResponse { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kVideoStreamID), videoStreamID); + 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::kVideoStreamID)) + { + err = DataModel::Decode(reader, videoStreamID); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace VideoStreamAllocateResponse. +namespace VideoStreamModify { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kVideoStreamID), videoStreamID); + encoder.Encode(to_underlying(Fields::kResolution), resolution); + 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::kVideoStreamID)) + { + err = DataModel::Decode(reader, videoStreamID); + } + else if (__context_tag == to_underlying(Fields::kResolution)) + { + err = DataModel::Decode(reader, resolution); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace VideoStreamModify. +namespace VideoStreamDeallocate { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kVideoStreamID), videoStreamID); + 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::kVideoStreamID)) + { + err = DataModel::Decode(reader, videoStreamID); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace VideoStreamDeallocate. +namespace SnapshotStreamAllocate { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kImageCodec), imageCodec); + encoder.Encode(to_underlying(Fields::kFrameRate), frameRate); + encoder.Encode(to_underlying(Fields::kBitRate), bitRate); + encoder.Encode(to_underlying(Fields::kMinResolution), minResolution); + encoder.Encode(to_underlying(Fields::kMaxResolution), maxResolution); + encoder.Encode(to_underlying(Fields::kQuality), quality); + 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::kImageCodec)) + { + err = DataModel::Decode(reader, imageCodec); + } + else if (__context_tag == to_underlying(Fields::kFrameRate)) + { + err = DataModel::Decode(reader, frameRate); + } + else if (__context_tag == to_underlying(Fields::kBitRate)) + { + err = DataModel::Decode(reader, bitRate); + } + else if (__context_tag == to_underlying(Fields::kMinResolution)) + { + err = DataModel::Decode(reader, minResolution); + } + else if (__context_tag == to_underlying(Fields::kMaxResolution)) + { + err = DataModel::Decode(reader, maxResolution); + } + else if (__context_tag == to_underlying(Fields::kQuality)) + { + err = DataModel::Decode(reader, quality); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace SnapshotStreamAllocate. +namespace SnapshotStreamAllocateResponse { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kSnapshotStreamID), snapshotStreamID); + 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::kSnapshotStreamID)) + { + err = DataModel::Decode(reader, snapshotStreamID); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace SnapshotStreamAllocateResponse. +namespace SnapshotStreamDeallocate { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kSnapshotStreamID), snapshotStreamID); + 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::kSnapshotStreamID)) + { + err = DataModel::Decode(reader, snapshotStreamID); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace SnapshotStreamDeallocate. +namespace SetStreamPriority { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + 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); + } + } +} +} // namespace SetStreamPriority. +namespace CaptureSnapshot { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kSnapshotStreamID), snapshotStreamID); + encoder.Encode(to_underlying(Fields::kRequestedResolution), requestedResolution); + 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::kSnapshotStreamID)) + { + err = DataModel::Decode(reader, snapshotStreamID); + } + else if (__context_tag == to_underlying(Fields::kRequestedResolution)) + { + err = DataModel::Decode(reader, requestedResolution); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace CaptureSnapshot. +namespace CaptureSnapshotResponse { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kData), data); + encoder.Encode(to_underlying(Fields::kImageCodec), imageCodec); + encoder.Encode(to_underlying(Fields::kResolution), resolution); + 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::kData)) + { + err = DataModel::Decode(reader, data); + } + else if (__context_tag == to_underlying(Fields::kImageCodec)) + { + err = DataModel::Decode(reader, imageCodec); + } + else if (__context_tag == to_underlying(Fields::kResolution)) + { + err = DataModel::Decode(reader, resolution); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace CaptureSnapshotResponse. +namespace SetViewport { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kViewport), viewport); + 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::kViewport)) + { + err = DataModel::Decode(reader, viewport); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace SetViewport. +namespace SetImageRotation { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kAngle), angle); + 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::kAngle)) + { + err = DataModel::Decode(reader, angle); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace SetImageRotation. +namespace SetImageFlipHorizontal { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kEnabled), enabled); + 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::kEnabled)) + { + err = DataModel::Decode(reader, enabled); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace SetImageFlipHorizontal. +namespace SetImageFlipVertical { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kEnabled), enabled); + 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::kEnabled)) + { + err = DataModel::Decode(reader, enabled); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace SetImageFlipVertical. +namespace SetWatermark { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kVideoStreamID), videoStreamID); + encoder.Encode(to_underlying(Fields::kEnabled), enabled); + 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::kVideoStreamID)) + { + err = DataModel::Decode(reader, videoStreamID); + } + else if (__context_tag == to_underlying(Fields::kEnabled)) + { + err = DataModel::Decode(reader, enabled); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace SetWatermark. +namespace SetOSD { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kVideoStreamID), videoStreamID); + encoder.Encode(to_underlying(Fields::kEnabled), enabled); + 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::kVideoStreamID)) + { + err = DataModel::Decode(reader, videoStreamID); + } + else if (__context_tag == to_underlying(Fields::kEnabled)) + { + err = DataModel::Decode(reader, enabled); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace SetOSD. +} // namespace Commands + +namespace Attributes { +CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path) +{ + switch (path.mAttributeId) + { + case Attributes::MaxConcurrentVideoEncoders::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, maxConcurrentVideoEncoders); + case Attributes::MaxEncodedPixelRate::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, maxEncodedPixelRate); + case Attributes::VideoSensorParams::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, videoSensorParams); + case Attributes::NightVisionCapable::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, nightVisionCapable); + case Attributes::MinViewPortWidth::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, minViewPortWidth); + case Attributes::MinViewPortHeight::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, minViewPortHeight); + case Attributes::RateDistortionTradeOffPoints::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, rateDistortionTradeOffPoints); + case Attributes::MaxPreRollBufferSize::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, maxPreRollBufferSize); + case Attributes::MicrophoneCapabilities::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, microphoneCapabilities); + case Attributes::SpeakerCapabilities::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, speakerCapabilities); + case Attributes::TwoWayTalkSupport::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, twoWayTalkSupport); + case Attributes::SupportedSnapshotParams::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, supportedSnapshotParams); + case Attributes::HDRCapable::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, HDRCapable); + case Attributes::MaxNetworkBandwidth::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, maxNetworkBandwidth); + case Attributes::CurrentFrameRate::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, currentFrameRate); + case Attributes::HDRMode::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, HDRMode); + case Attributes::CurrentVideoCodecs::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, currentVideoCodecs); + case Attributes::CurrentSnapshotConfig::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, currentSnapshotConfig); + case Attributes::FabricsUsingCamera::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, fabricsUsingCamera); + case Attributes::AllocatedVideoStreams::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, allocatedVideoStreams); + case Attributes::AllocatedAudioStreams::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, allocatedAudioStreams); + case Attributes::AllocatedSnapshotStreams::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, allocatedSnapshotStreams); + case Attributes::RankedVideoStreamPrioritiesList::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, rankedVideoStreamPrioritiesList); + case Attributes::SoftRecordingPrivacyModeSetting::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, softRecordingPrivacyModeSetting); + case Attributes::SoftLivestreamPrivacyModeSetting::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, softLivestreamPrivacyModeSetting); + case Attributes::HardPrivacyMode::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, hardPrivacyMode); + case Attributes::NightVision::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, nightVision); + case Attributes::NightVisionIllum::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, nightVisionIllum); + case Attributes::Awb::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, awb); + case Attributes::ShutterSpeed::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, shutterSpeed); + case Attributes::Iso::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, iso); + case Attributes::Viewport::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, viewport); + case Attributes::SpeakerEnabled::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, speakerEnabled); + case Attributes::SpeakerVolumeLevel::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, speakerVolumeLevel); + case Attributes::SpeakerMaxLevel::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, speakerMaxLevel); + case Attributes::SpeakerMinLevel::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, speakerMinLevel); + case Attributes::MicStatus::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, micStatus); + case Attributes::MicVolumeLevel::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, micVolumeLevel); + case Attributes::MicMaxLevel::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, micMaxLevel); + case Attributes::MicMinLevel::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, micMinLevel); + case Attributes::MicAGCEnabled::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, micAGCEnabled); + case Attributes::ImageRotation::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, imageRotation); + case Attributes::ImageFlipHorizontal::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, imageFlipHorizontal); + case Attributes::ImageFlipVertical::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, imageFlipVertical); + case Attributes::LocalVideoRecordingEnabled::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, localVideoRecordingEnabled); + case Attributes::LocalSnapshotRecordingEnabled::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, localSnapshotRecordingEnabled); + case Attributes::StatusLight::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, statusLight); + case Attributes::StatusLightBrightness::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, statusLightBrightness); + case Attributes::DepthSensorStatus::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, depthSensorStatus); + case Attributes::WatermarkEnabled::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, watermarkEnabled); + case Attributes::OSDEnabled::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, OSDEnabled); + case Attributes::GeneratedCommandList::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, generatedCommandList); + case Attributes::AcceptedCommandList::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, acceptedCommandList); + case Attributes::EventList::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, eventList); + 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 VideoStreamChanged { 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::kNode), node)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kVideoStreamID), videoStreamID)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kStreamType), streamType)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kVideoCodec), videoCodec)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kMinFrameRate), minFrameRate)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kMaxFrameRate), maxFrameRate)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kMinResolution), minResolution)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kMaxResolution), maxResolution)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kMinBitRate), minBitRate)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kMaxBitRate), maxBitRate)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kMinFragmentLen), minFragmentLen)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kMaxFragmentLen), maxFragmentLen)); return aWriter.EndContainer(outer); } @@ -28040,151 +30083,49 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) CHIP_ERROR err = CHIP_NO_ERROR; const uint8_t __context_tag = std::get(__element); - if (__context_tag == to_underlying(Fields::kNode)) + if (__context_tag == to_underlying(Fields::kVideoStreamID)) { - err = DataModel::Decode(reader, node); + err = DataModel::Decode(reader, videoStreamID); } - else + else if (__context_tag == to_underlying(Fields::kStreamType)) { + err = DataModel::Decode(reader, streamType); } - - ReturnErrorOnFailure(err); - } -} -} // namespace LoggedOut. -} // namespace Events - -} // namespace AccountLogin -namespace ContentControl { -namespace Structs { - -namespace RatingNameStruct { -CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const -{ - DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; - encoder.Encode(to_underlying(Fields::kRatingName), ratingName); - encoder.Encode(to_underlying(Fields::kRatingNameDesc), ratingNameDesc); - 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)) + else if (__context_tag == to_underlying(Fields::kVideoCodec)) { - return std::get(__element); + err = DataModel::Decode(reader, videoCodec); } - - CHIP_ERROR err = CHIP_NO_ERROR; - const uint8_t __context_tag = std::get(__element); - - if (__context_tag == to_underlying(Fields::kRatingName)) + else if (__context_tag == to_underlying(Fields::kMinFrameRate)) { - err = DataModel::Decode(reader, ratingName); + err = DataModel::Decode(reader, minFrameRate); } - else if (__context_tag == to_underlying(Fields::kRatingNameDesc)) + else if (__context_tag == to_underlying(Fields::kMaxFrameRate)) { - err = DataModel::Decode(reader, ratingNameDesc); + err = DataModel::Decode(reader, maxFrameRate); } - else + else if (__context_tag == to_underlying(Fields::kMinResolution)) { + err = DataModel::Decode(reader, minResolution); } - - ReturnErrorOnFailure(err); - } -} - -} // namespace RatingNameStruct -} // namespace Structs - -namespace Commands { -namespace UpdatePIN { -CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const -{ - DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; - encoder.Encode(to_underlying(Fields::kOldPIN), oldPIN); - encoder.Encode(to_underlying(Fields::kNewPIN), newPIN); - 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)) + else if (__context_tag == to_underlying(Fields::kMaxResolution)) { - return std::get(__element); + err = DataModel::Decode(reader, maxResolution); } - - CHIP_ERROR err = CHIP_NO_ERROR; - const uint8_t __context_tag = std::get(__element); - - if (__context_tag == to_underlying(Fields::kOldPIN)) + else if (__context_tag == to_underlying(Fields::kMinBitRate)) { - err = DataModel::Decode(reader, oldPIN); + err = DataModel::Decode(reader, minBitRate); } - else if (__context_tag == to_underlying(Fields::kNewPIN)) + else if (__context_tag == to_underlying(Fields::kMaxBitRate)) { - err = DataModel::Decode(reader, newPIN); + err = DataModel::Decode(reader, maxBitRate); } - else + else if (__context_tag == to_underlying(Fields::kMinFragmentLen)) { + err = DataModel::Decode(reader, minFragmentLen); } - - ReturnErrorOnFailure(err); - } -} -} // namespace UpdatePIN. -namespace ResetPIN { -CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const -{ - DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; - 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)) + else if (__context_tag == to_underlying(Fields::kMaxFragmentLen)) { - return std::get(__element); - } - } -} -} // namespace ResetPIN. -namespace ResetPINResponse { -CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const -{ - DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; - encoder.Encode(to_underlying(Fields::kPINCode), PINCode); - 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::kPINCode)) - { - err = DataModel::Decode(reader, PINCode); + err = DataModel::Decode(reader, maxFragmentLen); } else { @@ -28193,92 +30134,20 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(err); } } -} // namespace ResetPINResponse. -namespace Enable { -CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const -{ - DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; - 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); - } - } -} -} // namespace Enable. -namespace Disable { +} // namespace VideoStreamChanged. +namespace AudioStreamChanged { CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const { - DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; - 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); - } - } -} -} // namespace Disable. -namespace AddBonusTime { -CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const -{ - DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; - encoder.Encode(to_underlying(Fields::kPINCode), PINCode); - encoder.Encode(to_underlying(Fields::kBonusTime), bonusTime); - 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::kPINCode)) - { - err = DataModel::Decode(reader, PINCode); - } - else if (__context_tag == to_underlying(Fields::kBonusTime)) - { - err = DataModel::Decode(reader, bonusTime); - } - else - { - } - - ReturnErrorOnFailure(err); - } -} -} // namespace AddBonusTime. -namespace SetScreenDailyTime { -CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const -{ - DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; - encoder.Encode(to_underlying(Fields::kScreenTime), screenTime); - return encoder.Finalize(); + TLV::TLVType outer; + ReturnErrorOnFailure(aWriter.StartContainer(aTag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kAudioStreamID), audioStreamID)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kStreamType), streamType)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kAudioCodec), audioCodec)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kChannelCount), channelCount)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kSampleRate), sampleRate)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kBitRate), bitRate)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kBitDepth), bitDepth)); + return aWriter.EndContainer(outer); } CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) @@ -28295,117 +30164,33 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) CHIP_ERROR err = CHIP_NO_ERROR; const uint8_t __context_tag = std::get(__element); - if (__context_tag == to_underlying(Fields::kScreenTime)) - { - err = DataModel::Decode(reader, screenTime); - } - else - { - } - - ReturnErrorOnFailure(err); - } -} -} // namespace SetScreenDailyTime. -namespace BlockUnratedContent { -CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const -{ - DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; - 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)) + if (__context_tag == to_underlying(Fields::kAudioStreamID)) { - return std::get(__element); + err = DataModel::Decode(reader, audioStreamID); } - } -} -} // namespace BlockUnratedContent. -namespace UnblockUnratedContent { -CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const -{ - DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; - 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)) + else if (__context_tag == to_underlying(Fields::kStreamType)) { - return std::get(__element); + err = DataModel::Decode(reader, streamType); } - } -} -} // namespace UnblockUnratedContent. -namespace SetOnDemandRatingThreshold { -CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const -{ - DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; - encoder.Encode(to_underlying(Fields::kRating), rating); - 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)) + else if (__context_tag == to_underlying(Fields::kAudioCodec)) { - return std::get(__element); + err = DataModel::Decode(reader, audioCodec); } - - CHIP_ERROR err = CHIP_NO_ERROR; - const uint8_t __context_tag = std::get(__element); - - if (__context_tag == to_underlying(Fields::kRating)) + else if (__context_tag == to_underlying(Fields::kChannelCount)) { - err = DataModel::Decode(reader, rating); + err = DataModel::Decode(reader, channelCount); } - else + else if (__context_tag == to_underlying(Fields::kSampleRate)) { + err = DataModel::Decode(reader, sampleRate); } - - ReturnErrorOnFailure(err); - } -} -} // namespace SetOnDemandRatingThreshold. -namespace SetScheduledContentRatingThreshold { -CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const -{ - DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; - encoder.Encode(to_underlying(Fields::kRating), rating); - 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)) + else if (__context_tag == to_underlying(Fields::kBitRate)) { - return std::get(__element); + err = DataModel::Decode(reader, bitRate); } - - CHIP_ERROR err = CHIP_NO_ERROR; - const uint8_t __context_tag = std::get(__element); - - if (__context_tag == to_underlying(Fields::kRating)) + else if (__context_tag == to_underlying(Fields::kBitDepth)) { - err = DataModel::Decode(reader, rating); + err = DataModel::Decode(reader, bitDepth); } else { @@ -28414,85 +30199,22 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(err); } } -} // namespace SetScheduledContentRatingThreshold. -} // namespace Commands - -namespace Attributes { -CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path) -{ - switch (path.mAttributeId) - { - case Attributes::Enabled::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, enabled); - case Attributes::OnDemandRatings::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, onDemandRatings); - case Attributes::OnDemandRatingThreshold::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, onDemandRatingThreshold); - case Attributes::ScheduledContentRatings::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, scheduledContentRatings); - case Attributes::ScheduledContentRatingThreshold::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, scheduledContentRatingThreshold); - case Attributes::ScreenDailyTime::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, screenDailyTime); - case Attributes::RemainingScreenTime::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, remainingScreenTime); - case Attributes::BlockUnrated::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, blockUnrated); - case Attributes::GeneratedCommandList::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, generatedCommandList); - case Attributes::AcceptedCommandList::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, acceptedCommandList); - case Attributes::EventList::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, eventList); - 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 RemainingScreenTimeExpired { +} // namespace AudioStreamChanged. +namespace SnapshotStreamChanged { 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::kSnapshotStreamID), snapshotStreamID)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kImageCodec), imageCodec)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kFrameRate), frameRate)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kBitRate), bitRate)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kMinResolution), minResolution)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kMaxResolution), maxResolution)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kQuality), quality)); 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 RemainingScreenTimeExpired. -} // namespace Events - -} // namespace ContentControl -namespace ContentAppObserver { - -namespace Commands { -namespace ContentAppMessage { -CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const -{ - DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; - encoder.Encode(to_underlying(Fields::kData), data); - encoder.Encode(to_underlying(Fields::kEncodingHint), encodingHint); - return encoder.Finalize(); -} - CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) { detail::StructDecodeIterator __iterator(reader); @@ -28507,57 +30229,33 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) CHIP_ERROR err = CHIP_NO_ERROR; const uint8_t __context_tag = std::get(__element); - if (__context_tag == to_underlying(Fields::kData)) + if (__context_tag == to_underlying(Fields::kSnapshotStreamID)) { - err = DataModel::Decode(reader, data); + err = DataModel::Decode(reader, snapshotStreamID); } - else if (__context_tag == to_underlying(Fields::kEncodingHint)) + else if (__context_tag == to_underlying(Fields::kImageCodec)) { - err = DataModel::Decode(reader, encodingHint); + err = DataModel::Decode(reader, imageCodec); } - else + else if (__context_tag == to_underlying(Fields::kFrameRate)) { + err = DataModel::Decode(reader, frameRate); } - - ReturnErrorOnFailure(err); - } -} -} // namespace ContentAppMessage. -namespace ContentAppMessageResponse { -CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const -{ - DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; - encoder.Encode(to_underlying(Fields::kStatus), status); - encoder.Encode(to_underlying(Fields::kData), data); - encoder.Encode(to_underlying(Fields::kEncodingHint), encodingHint); - 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)) + else if (__context_tag == to_underlying(Fields::kBitRate)) { - return std::get(__element); + err = DataModel::Decode(reader, bitRate); } - - CHIP_ERROR err = CHIP_NO_ERROR; - const uint8_t __context_tag = std::get(__element); - - if (__context_tag == to_underlying(Fields::kStatus)) + else if (__context_tag == to_underlying(Fields::kMinResolution)) { - err = DataModel::Decode(reader, status); + err = DataModel::Decode(reader, minResolution); } - else if (__context_tag == to_underlying(Fields::kData)) + else if (__context_tag == to_underlying(Fields::kMaxResolution)) { - err = DataModel::Decode(reader, data); + err = DataModel::Decode(reader, maxResolution); } - else if (__context_tag == to_underlying(Fields::kEncodingHint)) + else if (__context_tag == to_underlying(Fields::kQuality)) { - err = DataModel::Decode(reader, encodingHint); + err = DataModel::Decode(reader, quality); } else { @@ -28566,35 +30264,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(err); } } -} // namespace ContentAppMessageResponse. -} // namespace Commands - -namespace Attributes { -CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path) -{ - switch (path.mAttributeId) - { - case Attributes::GeneratedCommandList::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, generatedCommandList); - case Attributes::AcceptedCommandList::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, acceptedCommandList); - case Attributes::EventList::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, eventList); - 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 Events +} // namespace SnapshotStreamChanged. +} // namespace Events -} // namespace ContentAppObserver +} // namespace CameraAvStreamManagement namespace WebRTCTransportProvider { namespace Structs {} // namespace Structs @@ -33190,6 +34863,13 @@ bool CommandIsFabricScoped(ClusterId aCluster, CommandId aCommand) return false; } } + case Clusters::CameraAvStreamManagement::Id: { + switch (aCommand) + { + default: + return false; + } + } case Clusters::WebRTCTransportProvider::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 19baf37416b889..b9b0cfb317a38e 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 @@ -326,6 +326,56 @@ struct Type using DecodableType = Type; } // namespace OperationalStateStruct +namespace PerStreamStruct { +enum class Fields : uint8_t +{ + kStreamID = 0, + kEnabled = 1, +}; + +struct Type +{ +public: + uint16_t streamID = static_cast(0); + bool enabled = 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 PerStreamStruct +namespace ViewportStruct { +enum class Fields : uint8_t +{ + kX1 = 0, + kY1 = 1, + kX2 = 2, + kY2 = 3, +}; + +struct Type +{ +public: + uint16_t x1 = static_cast(0); + uint16_t y1 = static_cast(0); + uint16_t x2 = static_cast(0); + uint16_t y2 = 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 ViewportStruct namespace WebRTCSessionStruct { enum class Fields : uint8_t { @@ -41278,6 +41328,1960 @@ struct TypeInfo }; } // namespace Attributes } // namespace ContentAppObserver +namespace CameraAvStreamManagement { +namespace Structs { +namespace VideoResolutionStruct { +enum class Fields : uint8_t +{ + kWidth = 0, + kHeight = 1, +}; + +struct Type +{ +public: + uint16_t width = static_cast(0); + uint16_t height = 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 VideoResolutionStruct +namespace VideoStreamStruct { +enum class Fields : uint8_t +{ + kVideoStreamID = 0, + kStreamType = 1, + kVideoCodec = 2, + kMinFrameRate = 3, + kMaxFrameRate = 4, + kMinResolution = 5, + kMaxResolution = 6, + kMinBitRate = 7, + kMaxBitRate = 8, + kMinFragmentLen = 9, + kMaxFragmentLen = 10, + kReferenceCount = 11, +}; + +struct Type +{ +public: + uint16_t videoStreamID = static_cast(0); + StreamTypeEnum streamType = static_cast(0); + VideoCodecEnum videoCodec = static_cast(0); + uint16_t minFrameRate = static_cast(0); + uint16_t maxFrameRate = static_cast(0); + Structs::VideoResolutionStruct::Type minResolution; + Structs::VideoResolutionStruct::Type maxResolution; + uint16_t minBitRate = static_cast(0); + uint16_t maxBitRate = static_cast(0); + uint16_t minFragmentLen = static_cast(0); + uint16_t maxFragmentLen = static_cast(0); + uint8_t referenceCount = 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 VideoStreamStruct +namespace SnapshotStreamStruct { +enum class Fields : uint8_t +{ + kSnapshotStreamID = 0, + kImageCodec = 1, + kFrameRate = 2, + kBitRate = 3, + kMinResolution = 4, + kMaxResolution = 5, + kQuality = 6, + kReferenceCount = 7, +}; + +struct Type +{ +public: + uint16_t snapshotStreamID = static_cast(0); + ImageCodecEnum imageCodec = static_cast(0); + uint16_t frameRate = static_cast(0); + uint32_t bitRate = static_cast(0); + Structs::VideoResolutionStruct::Type minResolution; + Structs::VideoResolutionStruct::Type maxResolution; + uint8_t quality = static_cast(0); + uint8_t referenceCount = 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 SnapshotStreamStruct +namespace SnapshotParamsStruct { +enum class Fields : uint8_t +{ + kResolution = 0, + kMaxFrameRate = 1, + kImageCodec = 2, +}; + +struct Type +{ +public: + Structs::VideoResolutionStruct::Type resolution; + uint16_t maxFrameRate = static_cast(0); + ImageCodecEnum imageCodec = 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 SnapshotParamsStruct +namespace RateDistortionTradeOffPointsStruct { +enum class Fields : uint8_t +{ + kCodec = 0, + kResolution = 1, + kMinBitRate = 2, +}; + +struct Type +{ +public: + VideoCodecEnum codec = static_cast(0); + Structs::VideoResolutionStruct::Type resolution; + uint32_t minBitRate = 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 RateDistortionTradeOffPointsStruct +namespace AudioCapabilitiesStruct { +enum class Fields : uint8_t +{ + kMaxNumberOfChannels = 0, + kSupportedCodecs = 1, + kSupportedSampleRates = 2, + kSupportedBitDepths = 3, +}; + +struct Type +{ +public: + uint8_t maxNumberOfChannels = static_cast(0); + DataModel::List supportedCodecs; + DataModel::List supportedSampleRates; + DataModel::List supportedBitDepths; + + static constexpr bool kIsFabricScoped = false; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; +}; + +struct DecodableType +{ +public: + uint8_t maxNumberOfChannels = static_cast(0); + DataModel::DecodableList supportedCodecs; + DataModel::DecodableList supportedSampleRates; + DataModel::DecodableList supportedBitDepths; + + CHIP_ERROR Decode(TLV::TLVReader & reader); + + static constexpr bool kIsFabricScoped = false; +}; + +} // namespace AudioCapabilitiesStruct +namespace AudioStreamStruct { +enum class Fields : uint8_t +{ + kAudioStreamID = 0, + kStreamType = 1, + kAudioCodec = 2, + kChannelCount = 3, + kSampleRate = 4, + kBitRate = 5, + kBitDepth = 6, + kReferenceCount = 7, +}; + +struct Type +{ +public: + uint16_t audioStreamID = static_cast(0); + StreamTypeEnum streamType = static_cast(0); + AudioCodecEnum audioCodec = static_cast(0); + uint8_t channelCount = static_cast(0); + uint32_t sampleRate = static_cast(0); + uint32_t bitRate = static_cast(0); + uint8_t bitDepth = static_cast(0); + uint8_t referenceCount = 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 AudioStreamStruct +namespace PerStreamStruct = Clusters::detail::Structs::PerStreamStruct; +namespace VideoSensorParamsStruct { +enum class Fields : uint8_t +{ + kSensorWidth = 0, + kSensorHeight = 1, + kHDRCapable = 2, + kMaxFPS = 3, + kMaxHDRFPS = 4, +}; + +struct Type +{ +public: + uint16_t sensorWidth = static_cast(0); + uint16_t sensorHeight = static_cast(0); + bool HDRCapable = static_cast(0); + uint16_t maxFPS = static_cast(0); + uint16_t maxHDRFPS = 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 VideoSensorParamsStruct +namespace ViewportStruct = Clusters::detail::Structs::ViewportStruct; +} // namespace Structs + +namespace Commands { +// Forward-declarations so we can reference these later. + +namespace AudioStreamAllocate { +struct Type; +struct DecodableType; +} // namespace AudioStreamAllocate + +namespace AudioStreamAllocateResponse { +struct Type; +struct DecodableType; +} // namespace AudioStreamAllocateResponse + +namespace AudioStreamDeallocate { +struct Type; +struct DecodableType; +} // namespace AudioStreamDeallocate + +namespace VideoStreamAllocate { +struct Type; +struct DecodableType; +} // namespace VideoStreamAllocate + +namespace VideoStreamAllocateResponse { +struct Type; +struct DecodableType; +} // namespace VideoStreamAllocateResponse + +namespace VideoStreamModify { +struct Type; +struct DecodableType; +} // namespace VideoStreamModify + +namespace VideoStreamDeallocate { +struct Type; +struct DecodableType; +} // namespace VideoStreamDeallocate + +namespace SnapshotStreamAllocate { +struct Type; +struct DecodableType; +} // namespace SnapshotStreamAllocate + +namespace SnapshotStreamAllocateResponse { +struct Type; +struct DecodableType; +} // namespace SnapshotStreamAllocateResponse + +namespace SnapshotStreamDeallocate { +struct Type; +struct DecodableType; +} // namespace SnapshotStreamDeallocate + +namespace SetStreamPriority { +struct Type; +struct DecodableType; +} // namespace SetStreamPriority + +namespace CaptureSnapshot { +struct Type; +struct DecodableType; +} // namespace CaptureSnapshot + +namespace CaptureSnapshotResponse { +struct Type; +struct DecodableType; +} // namespace CaptureSnapshotResponse + +namespace SetViewport { +struct Type; +struct DecodableType; +} // namespace SetViewport + +namespace SetImageRotation { +struct Type; +struct DecodableType; +} // namespace SetImageRotation + +namespace SetImageFlipHorizontal { +struct Type; +struct DecodableType; +} // namespace SetImageFlipHorizontal + +namespace SetImageFlipVertical { +struct Type; +struct DecodableType; +} // namespace SetImageFlipVertical + +namespace SetWatermark { +struct Type; +struct DecodableType; +} // namespace SetWatermark + +namespace SetOSD { +struct Type; +struct DecodableType; +} // namespace SetOSD + +} // namespace Commands + +namespace Commands { +namespace AudioStreamAllocate { +enum class Fields : uint8_t +{ + kStreamType = 0, + kAudioCodec = 1, + kChannelCount = 2, + kSampleRate = 3, + kBitRate = 4, + kBitDepth = 5, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::AudioStreamAllocate::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + + StreamTypeEnum streamType = static_cast(0); + AudioCodecEnum audioCodec = static_cast(0); + uint8_t channelCount = static_cast(0); + uint32_t sampleRate = static_cast(0); + uint32_t bitRate = static_cast(0); + uint8_t bitDepth = static_cast(0); + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; + + using ResponseType = Clusters::CameraAvStreamManagement::Commands::AudioStreamAllocateResponse::DecodableType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::AudioStreamAllocate::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + + StreamTypeEnum streamType = static_cast(0); + AudioCodecEnum audioCodec = static_cast(0); + uint8_t channelCount = static_cast(0); + uint32_t sampleRate = static_cast(0); + uint32_t bitRate = static_cast(0); + uint8_t bitDepth = static_cast(0); + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace AudioStreamAllocate +namespace AudioStreamAllocateResponse { +enum class Fields : uint8_t +{ + kAudioStreamID = 0, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::AudioStreamAllocateResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + + uint16_t audioStreamID = 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::AudioStreamAllocateResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + + uint16_t audioStreamID = static_cast(0); + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace AudioStreamAllocateResponse +namespace AudioStreamDeallocate { +enum class Fields : uint8_t +{ + kAudioStreamID = 0, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::AudioStreamDeallocate::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + + uint16_t audioStreamID = 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::AudioStreamDeallocate::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + + uint16_t audioStreamID = static_cast(0); + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace AudioStreamDeallocate +namespace VideoStreamAllocate { +enum class Fields : uint8_t +{ + kStreamType = 0, + kVideoCodec = 1, + kMinFrameRate = 2, + kMaxFrameRate = 3, + kMinResolution = 4, + kMaxResolution = 5, + kMinBitRate = 6, + kMaxBitRate = 7, + kMinFragmentLen = 8, + kMaxFragmentLen = 9, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::VideoStreamAllocate::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + + StreamTypeEnum streamType = static_cast(0); + VideoCodecEnum videoCodec = static_cast(0); + uint16_t minFrameRate = static_cast(0); + uint16_t maxFrameRate = static_cast(0); + Structs::VideoResolutionStruct::Type minResolution; + Structs::VideoResolutionStruct::Type maxResolution; + uint32_t minBitRate = static_cast(0); + uint32_t maxBitRate = static_cast(0); + uint16_t minFragmentLen = static_cast(0); + uint16_t maxFragmentLen = static_cast(0); + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; + + using ResponseType = Clusters::CameraAvStreamManagement::Commands::VideoStreamAllocateResponse::DecodableType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::VideoStreamAllocate::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + + StreamTypeEnum streamType = static_cast(0); + VideoCodecEnum videoCodec = static_cast(0); + uint16_t minFrameRate = static_cast(0); + uint16_t maxFrameRate = static_cast(0); + Structs::VideoResolutionStruct::DecodableType minResolution; + Structs::VideoResolutionStruct::DecodableType maxResolution; + uint32_t minBitRate = static_cast(0); + uint32_t maxBitRate = static_cast(0); + uint16_t minFragmentLen = static_cast(0); + uint16_t maxFragmentLen = static_cast(0); + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace VideoStreamAllocate +namespace VideoStreamAllocateResponse { +enum class Fields : uint8_t +{ + kVideoStreamID = 0, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::VideoStreamAllocateResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + + uint16_t videoStreamID = 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::VideoStreamAllocateResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + + uint16_t videoStreamID = static_cast(0); + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace VideoStreamAllocateResponse +namespace VideoStreamModify { +enum class Fields : uint8_t +{ + kVideoStreamID = 0, + kResolution = 1, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::VideoStreamModify::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + + uint16_t videoStreamID = static_cast(0); + Structs::VideoResolutionStruct::Type resolution; + + 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::VideoStreamModify::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + + uint16_t videoStreamID = static_cast(0); + Structs::VideoResolutionStruct::DecodableType resolution; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace VideoStreamModify +namespace VideoStreamDeallocate { +enum class Fields : uint8_t +{ + kVideoStreamID = 0, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::VideoStreamDeallocate::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + + uint16_t videoStreamID = 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::VideoStreamDeallocate::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + + uint16_t videoStreamID = static_cast(0); + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace VideoStreamDeallocate +namespace SnapshotStreamAllocate { +enum class Fields : uint8_t +{ + kImageCodec = 0, + kFrameRate = 1, + kBitRate = 2, + kMinResolution = 3, + kMaxResolution = 4, + kQuality = 5, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::SnapshotStreamAllocate::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + + ImageCodecEnum imageCodec = static_cast(0); + uint16_t frameRate = static_cast(0); + uint32_t bitRate = static_cast(0); + Structs::VideoResolutionStruct::Type minResolution; + Structs::VideoResolutionStruct::Type maxResolution; + uint8_t quality = static_cast(0); + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; + + using ResponseType = Clusters::CameraAvStreamManagement::Commands::SnapshotStreamAllocateResponse::DecodableType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::SnapshotStreamAllocate::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + + ImageCodecEnum imageCodec = static_cast(0); + uint16_t frameRate = static_cast(0); + uint32_t bitRate = static_cast(0); + Structs::VideoResolutionStruct::DecodableType minResolution; + Structs::VideoResolutionStruct::DecodableType maxResolution; + uint8_t quality = static_cast(0); + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace SnapshotStreamAllocate +namespace SnapshotStreamAllocateResponse { +enum class Fields : uint8_t +{ + kSnapshotStreamID = 0, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::SnapshotStreamAllocateResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + + uint16_t snapshotStreamID = 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::SnapshotStreamAllocateResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + + uint16_t snapshotStreamID = static_cast(0); + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace SnapshotStreamAllocateResponse +namespace SnapshotStreamDeallocate { +enum class Fields : uint8_t +{ + kSnapshotStreamID = 0, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::SnapshotStreamDeallocate::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + + uint16_t snapshotStreamID = 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::SnapshotStreamDeallocate::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + + uint16_t snapshotStreamID = static_cast(0); + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace SnapshotStreamDeallocate +namespace SetStreamPriority { +enum class Fields : uint8_t +{ +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::SetStreamPriority::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + + 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::SetStreamPriority::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace SetStreamPriority +namespace CaptureSnapshot { +enum class Fields : uint8_t +{ + kSnapshotStreamID = 0, + kRequestedResolution = 1, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::CaptureSnapshot::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + + uint16_t snapshotStreamID = static_cast(0); + Structs::VideoResolutionStruct::Type requestedResolution; + + 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::CaptureSnapshot::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + + uint16_t snapshotStreamID = static_cast(0); + Structs::VideoResolutionStruct::DecodableType requestedResolution; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace CaptureSnapshot +namespace CaptureSnapshotResponse { +enum class Fields : uint8_t +{ + kData = 0, + kImageCodec = 1, + kResolution = 2, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::CaptureSnapshotResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + + chip::ByteSpan data; + ImageCodecEnum imageCodec = static_cast(0); + Structs::VideoResolutionStruct::Type resolution; + + 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::CaptureSnapshotResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + + chip::ByteSpan data; + ImageCodecEnum imageCodec = static_cast(0); + Structs::VideoResolutionStruct::DecodableType resolution; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace CaptureSnapshotResponse +namespace SetViewport { +enum class Fields : uint8_t +{ + kViewport = 0, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::SetViewport::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + + Structs::ViewportStruct::Type viewport; + + 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::SetViewport::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + + Structs::ViewportStruct::DecodableType viewport; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace SetViewport +namespace SetImageRotation { +enum class Fields : uint8_t +{ + kAngle = 0, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::SetImageRotation::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + + uint16_t angle = 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::SetImageRotation::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + + uint16_t angle = static_cast(0); + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace SetImageRotation +namespace SetImageFlipHorizontal { +enum class Fields : uint8_t +{ + kEnabled = 0, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::SetImageFlipHorizontal::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + + bool enabled = 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::SetImageFlipHorizontal::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + + bool enabled = static_cast(0); + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace SetImageFlipHorizontal +namespace SetImageFlipVertical { +enum class Fields : uint8_t +{ + kEnabled = 0, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::SetImageFlipVertical::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + + bool enabled = 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::SetImageFlipVertical::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + + bool enabled = static_cast(0); + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace SetImageFlipVertical +namespace SetWatermark { +enum class Fields : uint8_t +{ + kVideoStreamID = 0, + kEnabled = 1, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::SetWatermark::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + + uint16_t videoStreamID = static_cast(0); + bool enabled = 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::SetWatermark::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + + uint16_t videoStreamID = static_cast(0); + bool enabled = static_cast(0); + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace SetWatermark +namespace SetOSD { +enum class Fields : uint8_t +{ + kVideoStreamID = 0, + kEnabled = 1, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::SetOSD::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + + uint16_t videoStreamID = static_cast(0); + bool enabled = 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::SetOSD::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + + uint16_t videoStreamID = static_cast(0); + bool enabled = static_cast(0); + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace SetOSD +} // namespace Commands + +namespace Attributes { + +namespace MaxConcurrentVideoEncoders { +struct TypeInfo +{ + using Type = uint8_t; + using DecodableType = uint8_t; + using DecodableArgType = uint8_t; + + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::MaxConcurrentVideoEncoders::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace MaxConcurrentVideoEncoders +namespace MaxEncodedPixelRate { +struct TypeInfo +{ + using Type = uint32_t; + using DecodableType = uint32_t; + using DecodableArgType = uint32_t; + + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::MaxEncodedPixelRate::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace MaxEncodedPixelRate +namespace VideoSensorParams { +struct TypeInfo +{ + using Type = chip::app::Clusters::CameraAvStreamManagement::Structs::VideoSensorParamsStruct::Type; + using DecodableType = chip::app::Clusters::CameraAvStreamManagement::Structs::VideoSensorParamsStruct::DecodableType; + using DecodableArgType = const chip::app::Clusters::CameraAvStreamManagement::Structs::VideoSensorParamsStruct::DecodableType &; + + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::VideoSensorParams::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace VideoSensorParams +namespace NightVisionCapable { +struct TypeInfo +{ + using Type = bool; + using DecodableType = bool; + using DecodableArgType = bool; + + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::NightVisionCapable::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace NightVisionCapable +namespace MinViewPortWidth { +struct TypeInfo +{ + using Type = chip::app::Clusters::CameraAvStreamManagement::Structs::VideoResolutionStruct::Type; + using DecodableType = chip::app::Clusters::CameraAvStreamManagement::Structs::VideoResolutionStruct::DecodableType; + using DecodableArgType = const chip::app::Clusters::CameraAvStreamManagement::Structs::VideoResolutionStruct::DecodableType &; + + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::MinViewPortWidth::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace MinViewPortWidth +namespace MinViewPortHeight { +struct TypeInfo +{ + using Type = chip::app::Clusters::CameraAvStreamManagement::Structs::VideoResolutionStruct::Type; + using DecodableType = chip::app::Clusters::CameraAvStreamManagement::Structs::VideoResolutionStruct::DecodableType; + using DecodableArgType = const chip::app::Clusters::CameraAvStreamManagement::Structs::VideoResolutionStruct::DecodableType &; + + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::MinViewPortHeight::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace MinViewPortHeight +namespace RateDistortionTradeOffPoints { +struct TypeInfo +{ + using Type = chip::app::DataModel::List< + const chip::app::Clusters::CameraAvStreamManagement::Structs::RateDistortionTradeOffPointsStruct::Type>; + using DecodableType = chip::app::DataModel::DecodableList< + chip::app::Clusters::CameraAvStreamManagement::Structs::RateDistortionTradeOffPointsStruct::DecodableType>; + using DecodableArgType = const chip::app::DataModel::DecodableList< + chip::app::Clusters::CameraAvStreamManagement::Structs::RateDistortionTradeOffPointsStruct::DecodableType> &; + + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::RateDistortionTradeOffPoints::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace RateDistortionTradeOffPoints +namespace MaxPreRollBufferSize { +struct TypeInfo +{ + using Type = uint32_t; + using DecodableType = uint32_t; + using DecodableArgType = uint32_t; + + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::MaxPreRollBufferSize::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace MaxPreRollBufferSize +namespace MicrophoneCapabilities { +struct TypeInfo +{ + using Type = chip::app::Clusters::CameraAvStreamManagement::Structs::AudioCapabilitiesStruct::Type; + using DecodableType = chip::app::Clusters::CameraAvStreamManagement::Structs::AudioCapabilitiesStruct::DecodableType; + using DecodableArgType = const chip::app::Clusters::CameraAvStreamManagement::Structs::AudioCapabilitiesStruct::DecodableType &; + + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::MicrophoneCapabilities::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace MicrophoneCapabilities +namespace SpeakerCapabilities { +struct TypeInfo +{ + using Type = + chip::app::DataModel::Nullable; + using DecodableType = chip::app::DataModel::Nullable< + chip::app::Clusters::CameraAvStreamManagement::Structs::AudioCapabilitiesStruct::DecodableType>; + using DecodableArgType = const chip::app::DataModel::Nullable< + chip::app::Clusters::CameraAvStreamManagement::Structs::AudioCapabilitiesStruct::DecodableType> &; + + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::SpeakerCapabilities::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace SpeakerCapabilities +namespace TwoWayTalkSupport { +struct TypeInfo +{ + using Type = chip::app::Clusters::CameraAvStreamManagement::TwoWayTalkSupportTypeEnum; + using DecodableType = chip::app::Clusters::CameraAvStreamManagement::TwoWayTalkSupportTypeEnum; + using DecodableArgType = chip::app::Clusters::CameraAvStreamManagement::TwoWayTalkSupportTypeEnum; + + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::TwoWayTalkSupport::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace TwoWayTalkSupport +namespace SupportedSnapshotParams { +struct TypeInfo +{ + using Type = + chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList< + chip::app::Clusters::CameraAvStreamManagement::Structs::SnapshotParamsStruct::DecodableType>; + using DecodableArgType = const chip::app::DataModel::DecodableList< + chip::app::Clusters::CameraAvStreamManagement::Structs::SnapshotParamsStruct::DecodableType> &; + + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::SupportedSnapshotParams::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace SupportedSnapshotParams +namespace HDRCapable { +struct TypeInfo +{ + using Type = bool; + using DecodableType = bool; + using DecodableArgType = bool; + + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::HDRCapable::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace HDRCapable +namespace MaxNetworkBandwidth { +struct TypeInfo +{ + using Type = uint32_t; + using DecodableType = uint32_t; + using DecodableArgType = uint32_t; + + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::MaxNetworkBandwidth::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace MaxNetworkBandwidth +namespace CurrentFrameRate { +struct TypeInfo +{ + using Type = uint16_t; + using DecodableType = uint16_t; + using DecodableArgType = uint16_t; + + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::CurrentFrameRate::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace CurrentFrameRate +namespace HDRMode { +struct TypeInfo +{ + using Type = bool; + using DecodableType = bool; + using DecodableArgType = bool; + + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::HDRMode::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace HDRMode +namespace CurrentVideoCodecs { +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::CameraAvStreamManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::CurrentVideoCodecs::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace CurrentVideoCodecs +namespace CurrentSnapshotConfig { +struct TypeInfo +{ + using Type = chip::app::Clusters::CameraAvStreamManagement::Structs::SnapshotParamsStruct::Type; + using DecodableType = chip::app::Clusters::CameraAvStreamManagement::Structs::SnapshotParamsStruct::DecodableType; + using DecodableArgType = const chip::app::Clusters::CameraAvStreamManagement::Structs::SnapshotParamsStruct::DecodableType &; + + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::CurrentSnapshotConfig::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace CurrentSnapshotConfig +namespace FabricsUsingCamera { +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::CameraAvStreamManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::FabricsUsingCamera::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace FabricsUsingCamera +namespace AllocatedVideoStreams { +struct TypeInfo +{ + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList< + chip::app::Clusters::CameraAvStreamManagement::Structs::VideoStreamStruct::DecodableType>; + using DecodableArgType = const chip::app::DataModel::DecodableList< + chip::app::Clusters::CameraAvStreamManagement::Structs::VideoStreamStruct::DecodableType> &; + + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::AllocatedVideoStreams::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace AllocatedVideoStreams +namespace AllocatedAudioStreams { +struct TypeInfo +{ + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList< + chip::app::Clusters::CameraAvStreamManagement::Structs::AudioStreamStruct::DecodableType>; + using DecodableArgType = const chip::app::DataModel::DecodableList< + chip::app::Clusters::CameraAvStreamManagement::Structs::AudioStreamStruct::DecodableType> &; + + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::AllocatedAudioStreams::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace AllocatedAudioStreams +namespace AllocatedSnapshotStreams { +struct TypeInfo +{ + using Type = + chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList< + chip::app::Clusters::CameraAvStreamManagement::Structs::SnapshotStreamStruct::DecodableType>; + using DecodableArgType = const chip::app::DataModel::DecodableList< + chip::app::Clusters::CameraAvStreamManagement::Structs::SnapshotStreamStruct::DecodableType> &; + + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::AllocatedSnapshotStreams::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace AllocatedSnapshotStreams +namespace RankedVideoStreamPrioritiesList { +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::CameraAvStreamManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::RankedVideoStreamPrioritiesList::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace RankedVideoStreamPrioritiesList +namespace SoftRecordingPrivacyModeSetting { +struct TypeInfo +{ + using Type = bool; + using DecodableType = bool; + using DecodableArgType = bool; + + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::SoftRecordingPrivacyModeSetting::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace SoftRecordingPrivacyModeSetting +namespace SoftLivestreamPrivacyModeSetting { +struct TypeInfo +{ + using Type = bool; + using DecodableType = bool; + using DecodableArgType = bool; + + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::SoftLivestreamPrivacyModeSetting::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace SoftLivestreamPrivacyModeSetting +namespace HardPrivacyMode { +struct TypeInfo +{ + using Type = bool; + using DecodableType = bool; + using DecodableArgType = bool; + + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::HardPrivacyMode::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace HardPrivacyMode +namespace NightVision { +struct TypeInfo +{ + using Type = chip::app::Clusters::CameraAvStreamManagement::TriStateAutoEnum; + using DecodableType = chip::app::Clusters::CameraAvStreamManagement::TriStateAutoEnum; + using DecodableArgType = chip::app::Clusters::CameraAvStreamManagement::TriStateAutoEnum; + + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::NightVision::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace NightVision +namespace NightVisionIllum { +struct TypeInfo +{ + using Type = chip::app::Clusters::CameraAvStreamManagement::TriStateAutoEnum; + using DecodableType = chip::app::Clusters::CameraAvStreamManagement::TriStateAutoEnum; + using DecodableArgType = chip::app::Clusters::CameraAvStreamManagement::TriStateAutoEnum; + + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::NightVisionIllum::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace NightVisionIllum +namespace Awb { +struct TypeInfo +{ + using Type = bool; + using DecodableType = bool; + using DecodableArgType = bool; + + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::Awb::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace Awb +namespace ShutterSpeed { +struct TypeInfo +{ + using Type = bool; + using DecodableType = bool; + using DecodableArgType = bool; + + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::ShutterSpeed::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace ShutterSpeed +namespace Iso { +struct TypeInfo +{ + using Type = bool; + using DecodableType = bool; + using DecodableArgType = bool; + + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::Iso::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace Iso +namespace Viewport { +struct TypeInfo +{ + using Type = chip::app::Clusters::CameraAvStreamManagement::Structs::ViewportStruct::Type; + using DecodableType = chip::app::Clusters::CameraAvStreamManagement::Structs::ViewportStruct::DecodableType; + using DecodableArgType = const chip::app::Clusters::CameraAvStreamManagement::Structs::ViewportStruct::DecodableType &; + + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::Viewport::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace Viewport +namespace SpeakerEnabled { +struct TypeInfo +{ + using Type = bool; + using DecodableType = bool; + using DecodableArgType = bool; + + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::SpeakerEnabled::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace SpeakerEnabled +namespace SpeakerVolumeLevel { +struct TypeInfo +{ + using Type = uint8_t; + using DecodableType = uint8_t; + using DecodableArgType = uint8_t; + + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::SpeakerVolumeLevel::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace SpeakerVolumeLevel +namespace SpeakerMaxLevel { +struct TypeInfo +{ + using Type = uint8_t; + using DecodableType = uint8_t; + using DecodableArgType = uint8_t; + + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::SpeakerMaxLevel::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace SpeakerMaxLevel +namespace SpeakerMinLevel { +struct TypeInfo +{ + using Type = uint8_t; + using DecodableType = uint8_t; + using DecodableArgType = uint8_t; + + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::SpeakerMinLevel::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace SpeakerMinLevel +namespace MicStatus { +struct TypeInfo +{ + using Type = bool; + using DecodableType = bool; + using DecodableArgType = bool; + + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::MicStatus::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace MicStatus +namespace MicVolumeLevel { +struct TypeInfo +{ + using Type = uint8_t; + using DecodableType = uint8_t; + using DecodableArgType = uint8_t; + + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::MicVolumeLevel::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace MicVolumeLevel +namespace MicMaxLevel { +struct TypeInfo +{ + using Type = uint8_t; + using DecodableType = uint8_t; + using DecodableArgType = uint8_t; + + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::MicMaxLevel::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace MicMaxLevel +namespace MicMinLevel { +struct TypeInfo +{ + using Type = uint8_t; + using DecodableType = uint8_t; + using DecodableArgType = uint8_t; + + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::MicMinLevel::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace MicMinLevel +namespace MicAGCEnabled { +struct TypeInfo +{ + using Type = bool; + using DecodableType = bool; + using DecodableArgType = bool; + + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::MicAGCEnabled::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace MicAGCEnabled +namespace ImageRotation { +struct TypeInfo +{ + using Type = uint16_t; + using DecodableType = uint16_t; + using DecodableArgType = uint16_t; + + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::ImageRotation::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace ImageRotation +namespace ImageFlipHorizontal { +struct TypeInfo +{ + using Type = bool; + using DecodableType = bool; + using DecodableArgType = bool; + + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::ImageFlipHorizontal::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace ImageFlipHorizontal +namespace ImageFlipVertical { +struct TypeInfo +{ + using Type = bool; + using DecodableType = bool; + using DecodableArgType = bool; + + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::ImageFlipVertical::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace ImageFlipVertical +namespace LocalVideoRecordingEnabled { +struct TypeInfo +{ + using Type = bool; + using DecodableType = bool; + using DecodableArgType = bool; + + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::LocalVideoRecordingEnabled::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace LocalVideoRecordingEnabled +namespace LocalSnapshotRecordingEnabled { +struct TypeInfo +{ + using Type = bool; + using DecodableType = bool; + using DecodableArgType = bool; + + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::LocalSnapshotRecordingEnabled::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace LocalSnapshotRecordingEnabled +namespace StatusLight { +struct TypeInfo +{ + using Type = bool; + using DecodableType = bool; + using DecodableArgType = bool; + + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::StatusLight::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace StatusLight +namespace StatusLightBrightness { +struct TypeInfo +{ + using Type = chip::app::Clusters::Globals::ThreeLevelAutoEnum; + using DecodableType = chip::app::Clusters::Globals::ThreeLevelAutoEnum; + using DecodableArgType = chip::app::Clusters::Globals::ThreeLevelAutoEnum; + + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::StatusLightBrightness::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace StatusLightBrightness +namespace DepthSensorStatus { +struct TypeInfo +{ + using Type = chip::app::Clusters::CameraAvStreamManagement::TriStateAutoEnum; + using DecodableType = chip::app::Clusters::CameraAvStreamManagement::TriStateAutoEnum; + using DecodableArgType = chip::app::Clusters::CameraAvStreamManagement::TriStateAutoEnum; + + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::DepthSensorStatus::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace DepthSensorStatus +namespace WatermarkEnabled { +struct TypeInfo +{ + using Type = chip::app::DataModel::List; + using DecodableType = + chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList< + chip::app::Clusters::CameraAvStreamManagement::Structs::PerStreamStruct::DecodableType> &; + + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::WatermarkEnabled::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace WatermarkEnabled +namespace OSDEnabled { +struct TypeInfo +{ + using Type = chip::app::DataModel::List; + using DecodableType = + chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList< + chip::app::Clusters::CameraAvStreamManagement::Structs::PerStreamStruct::DecodableType> &; + + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::OSDEnabled::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace OSDEnabled +namespace GeneratedCommandList { +struct TypeInfo : public Clusters::Globals::Attributes::GeneratedCommandList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } +}; +} // namespace GeneratedCommandList +namespace AcceptedCommandList { +struct TypeInfo : public Clusters::Globals::Attributes::AcceptedCommandList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } +}; +} // namespace AcceptedCommandList +namespace EventList { +struct TypeInfo : public Clusters::Globals::Attributes::EventList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } +}; +} // namespace EventList +namespace AttributeList { +struct TypeInfo : public Clusters::Globals::Attributes::AttributeList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } +}; +} // namespace AttributeList +namespace FeatureMap { +struct TypeInfo : public Clusters::Globals::Attributes::FeatureMap::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } +}; +} // namespace FeatureMap +namespace ClusterRevision { +struct TypeInfo : public Clusters::Globals::Attributes::ClusterRevision::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } +}; +} // namespace ClusterRevision + +struct TypeInfo +{ + struct DecodableType + { + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + + CHIP_ERROR Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path); + + Attributes::MaxConcurrentVideoEncoders::TypeInfo::DecodableType maxConcurrentVideoEncoders = static_cast(0); + Attributes::MaxEncodedPixelRate::TypeInfo::DecodableType maxEncodedPixelRate = static_cast(0); + Attributes::VideoSensorParams::TypeInfo::DecodableType videoSensorParams; + Attributes::NightVisionCapable::TypeInfo::DecodableType nightVisionCapable = static_cast(0); + Attributes::MinViewPortWidth::TypeInfo::DecodableType minViewPortWidth; + Attributes::MinViewPortHeight::TypeInfo::DecodableType minViewPortHeight; + Attributes::RateDistortionTradeOffPoints::TypeInfo::DecodableType rateDistortionTradeOffPoints; + Attributes::MaxPreRollBufferSize::TypeInfo::DecodableType maxPreRollBufferSize = static_cast(0); + Attributes::MicrophoneCapabilities::TypeInfo::DecodableType microphoneCapabilities; + Attributes::SpeakerCapabilities::TypeInfo::DecodableType speakerCapabilities; + Attributes::TwoWayTalkSupport::TypeInfo::DecodableType twoWayTalkSupport = + static_cast(0); + Attributes::SupportedSnapshotParams::TypeInfo::DecodableType supportedSnapshotParams; + Attributes::HDRCapable::TypeInfo::DecodableType HDRCapable = static_cast(0); + Attributes::MaxNetworkBandwidth::TypeInfo::DecodableType maxNetworkBandwidth = static_cast(0); + Attributes::CurrentFrameRate::TypeInfo::DecodableType currentFrameRate = static_cast(0); + Attributes::HDRMode::TypeInfo::DecodableType HDRMode = static_cast(0); + Attributes::CurrentVideoCodecs::TypeInfo::DecodableType currentVideoCodecs; + Attributes::CurrentSnapshotConfig::TypeInfo::DecodableType currentSnapshotConfig; + Attributes::FabricsUsingCamera::TypeInfo::DecodableType fabricsUsingCamera; + Attributes::AllocatedVideoStreams::TypeInfo::DecodableType allocatedVideoStreams; + Attributes::AllocatedAudioStreams::TypeInfo::DecodableType allocatedAudioStreams; + Attributes::AllocatedSnapshotStreams::TypeInfo::DecodableType allocatedSnapshotStreams; + Attributes::RankedVideoStreamPrioritiesList::TypeInfo::DecodableType rankedVideoStreamPrioritiesList; + Attributes::SoftRecordingPrivacyModeSetting::TypeInfo::DecodableType softRecordingPrivacyModeSetting = static_cast(0); + Attributes::SoftLivestreamPrivacyModeSetting::TypeInfo::DecodableType softLivestreamPrivacyModeSetting = + static_cast(0); + Attributes::HardPrivacyMode::TypeInfo::DecodableType hardPrivacyMode = static_cast(0); + Attributes::NightVision::TypeInfo::DecodableType nightVision = + static_cast(0); + Attributes::NightVisionIllum::TypeInfo::DecodableType nightVisionIllum = + static_cast(0); + Attributes::Awb::TypeInfo::DecodableType awb = static_cast(0); + Attributes::ShutterSpeed::TypeInfo::DecodableType shutterSpeed = static_cast(0); + Attributes::Iso::TypeInfo::DecodableType iso = static_cast(0); + Attributes::Viewport::TypeInfo::DecodableType viewport; + Attributes::SpeakerEnabled::TypeInfo::DecodableType speakerEnabled = static_cast(0); + Attributes::SpeakerVolumeLevel::TypeInfo::DecodableType speakerVolumeLevel = static_cast(0); + Attributes::SpeakerMaxLevel::TypeInfo::DecodableType speakerMaxLevel = static_cast(0); + Attributes::SpeakerMinLevel::TypeInfo::DecodableType speakerMinLevel = static_cast(0); + Attributes::MicStatus::TypeInfo::DecodableType micStatus = static_cast(0); + Attributes::MicVolumeLevel::TypeInfo::DecodableType micVolumeLevel = static_cast(0); + Attributes::MicMaxLevel::TypeInfo::DecodableType micMaxLevel = static_cast(0); + Attributes::MicMinLevel::TypeInfo::DecodableType micMinLevel = static_cast(0); + Attributes::MicAGCEnabled::TypeInfo::DecodableType micAGCEnabled = static_cast(0); + Attributes::ImageRotation::TypeInfo::DecodableType imageRotation = static_cast(0); + Attributes::ImageFlipHorizontal::TypeInfo::DecodableType imageFlipHorizontal = static_cast(0); + Attributes::ImageFlipVertical::TypeInfo::DecodableType imageFlipVertical = static_cast(0); + Attributes::LocalVideoRecordingEnabled::TypeInfo::DecodableType localVideoRecordingEnabled = static_cast(0); + Attributes::LocalSnapshotRecordingEnabled::TypeInfo::DecodableType localSnapshotRecordingEnabled = static_cast(0); + Attributes::StatusLight::TypeInfo::DecodableType statusLight = static_cast(0); + Attributes::StatusLightBrightness::TypeInfo::DecodableType statusLightBrightness = + static_cast(0); + Attributes::DepthSensorStatus::TypeInfo::DecodableType depthSensorStatus = + static_cast(0); + Attributes::WatermarkEnabled::TypeInfo::DecodableType watermarkEnabled; + Attributes::OSDEnabled::TypeInfo::DecodableType OSDEnabled; + Attributes::GeneratedCommandList::TypeInfo::DecodableType generatedCommandList; + Attributes::AcceptedCommandList::TypeInfo::DecodableType acceptedCommandList; + Attributes::EventList::TypeInfo::DecodableType eventList; + 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 VideoStreamChanged { +static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; + +enum class Fields : uint8_t +{ + kVideoStreamID = 0, + kStreamType = 1, + kVideoCodec = 2, + kMinFrameRate = 3, + kMaxFrameRate = 4, + kMinResolution = 5, + kMaxResolution = 6, + kMinBitRate = 7, + kMaxBitRate = 8, + kMinFragmentLen = 9, + kMaxFragmentLen = 10, +}; + +struct Type +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return Events::VideoStreamChanged::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + static constexpr bool kIsFabricScoped = false; + + uint16_t videoStreamID = static_cast(0); + Optional streamType; + Optional videoCodec; + Optional minFrameRate; + Optional maxFrameRate; + Optional minResolution; + Optional maxResolution; + Optional minBitRate; + Optional maxBitRate; + Optional minFragmentLen; + Optional maxFragmentLen; + + 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::VideoStreamChanged::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + + uint16_t videoStreamID = static_cast(0); + Optional streamType; + Optional videoCodec; + Optional minFrameRate; + Optional maxFrameRate; + Optional minResolution; + Optional maxResolution; + Optional minBitRate; + Optional maxBitRate; + Optional minFragmentLen; + Optional maxFragmentLen; + + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +} // namespace VideoStreamChanged +namespace AudioStreamChanged { +static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; + +enum class Fields : uint8_t +{ + kAudioStreamID = 0, + kStreamType = 1, + kAudioCodec = 2, + kChannelCount = 3, + kSampleRate = 4, + kBitRate = 5, + kBitDepth = 6, +}; + +struct Type +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return Events::AudioStreamChanged::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + static constexpr bool kIsFabricScoped = false; + + uint16_t audioStreamID = static_cast(0); + Optional streamType; + Optional audioCodec; + Optional channelCount; + Optional sampleRate; + Optional bitRate; + Optional bitDepth; + + 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::AudioStreamChanged::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + + uint16_t audioStreamID = static_cast(0); + Optional streamType; + Optional audioCodec; + Optional channelCount; + Optional sampleRate; + Optional bitRate; + Optional bitDepth; + + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +} // namespace AudioStreamChanged +namespace SnapshotStreamChanged { +static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; + +enum class Fields : uint8_t +{ + kSnapshotStreamID = 0, + kImageCodec = 1, + kFrameRate = 2, + kBitRate = 3, + kMinResolution = 4, + kMaxResolution = 5, + kQuality = 6, +}; + +struct Type +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return Events::SnapshotStreamChanged::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + static constexpr bool kIsFabricScoped = false; + + uint16_t snapshotStreamID = static_cast(0); + Optional imageCodec; + Optional frameRate; + Optional bitRate; + Optional minResolution; + Optional maxResolution; + Optional quality; + + 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::SnapshotStreamChanged::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + + uint16_t snapshotStreamID = static_cast(0); + Optional imageCodec; + Optional frameRate; + Optional bitRate; + Optional minResolution; + Optional maxResolution; + Optional quality; + + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +} // namespace SnapshotStreamChanged +} // namespace Events +} // namespace CameraAvStreamManagement namespace WebRTCTransportProvider { namespace Structs { namespace ICEServerStruct = Clusters::detail::Structs::ICEServerStruct; 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 88942771fa85b7..174996d0807196 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 @@ -7317,6 +7317,240 @@ static constexpr AttributeId Id = Globals::Attributes::ClusterRevision::Id; } // namespace Attributes } // namespace ContentAppObserver +namespace CameraAvStreamManagement { +namespace Attributes { + +namespace MaxConcurrentVideoEncoders { +static constexpr AttributeId Id = 0x00000000; +} // namespace MaxConcurrentVideoEncoders + +namespace MaxEncodedPixelRate { +static constexpr AttributeId Id = 0x00000001; +} // namespace MaxEncodedPixelRate + +namespace VideoSensorParams { +static constexpr AttributeId Id = 0x00000002; +} // namespace VideoSensorParams + +namespace NightVisionCapable { +static constexpr AttributeId Id = 0x00000003; +} // namespace NightVisionCapable + +namespace MinViewPortWidth { +static constexpr AttributeId Id = 0x00000004; +} // namespace MinViewPortWidth + +namespace MinViewPortHeight { +static constexpr AttributeId Id = 0x00000005; +} // namespace MinViewPortHeight + +namespace RateDistortionTradeOffPoints { +static constexpr AttributeId Id = 0x00000006; +} // namespace RateDistortionTradeOffPoints + +namespace MaxPreRollBufferSize { +static constexpr AttributeId Id = 0x00000007; +} // namespace MaxPreRollBufferSize + +namespace MicrophoneCapabilities { +static constexpr AttributeId Id = 0x00000008; +} // namespace MicrophoneCapabilities + +namespace SpeakerCapabilities { +static constexpr AttributeId Id = 0x00000009; +} // namespace SpeakerCapabilities + +namespace TwoWayTalkSupport { +static constexpr AttributeId Id = 0x0000000A; +} // namespace TwoWayTalkSupport + +namespace SupportedSnapshotParams { +static constexpr AttributeId Id = 0x0000000B; +} // namespace SupportedSnapshotParams + +namespace HDRCapable { +static constexpr AttributeId Id = 0x0000000C; +} // namespace HDRCapable + +namespace MaxNetworkBandwidth { +static constexpr AttributeId Id = 0x0000000D; +} // namespace MaxNetworkBandwidth + +namespace CurrentFrameRate { +static constexpr AttributeId Id = 0x0000000E; +} // namespace CurrentFrameRate + +namespace HDRMode { +static constexpr AttributeId Id = 0x0000000F; +} // namespace HDRMode + +namespace CurrentVideoCodecs { +static constexpr AttributeId Id = 0x00000010; +} // namespace CurrentVideoCodecs + +namespace CurrentSnapshotConfig { +static constexpr AttributeId Id = 0x00000011; +} // namespace CurrentSnapshotConfig + +namespace FabricsUsingCamera { +static constexpr AttributeId Id = 0x00000012; +} // namespace FabricsUsingCamera + +namespace AllocatedVideoStreams { +static constexpr AttributeId Id = 0x00000013; +} // namespace AllocatedVideoStreams + +namespace AllocatedAudioStreams { +static constexpr AttributeId Id = 0x00000014; +} // namespace AllocatedAudioStreams + +namespace AllocatedSnapshotStreams { +static constexpr AttributeId Id = 0x00000015; +} // namespace AllocatedSnapshotStreams + +namespace RankedVideoStreamPrioritiesList { +static constexpr AttributeId Id = 0x00000016; +} // namespace RankedVideoStreamPrioritiesList + +namespace SoftRecordingPrivacyModeSetting { +static constexpr AttributeId Id = 0x00000017; +} // namespace SoftRecordingPrivacyModeSetting + +namespace SoftLivestreamPrivacyModeSetting { +static constexpr AttributeId Id = 0x00000018; +} // namespace SoftLivestreamPrivacyModeSetting + +namespace HardPrivacyMode { +static constexpr AttributeId Id = 0x00000019; +} // namespace HardPrivacyMode + +namespace NightVision { +static constexpr AttributeId Id = 0x0000001A; +} // namespace NightVision + +namespace NightVisionIllum { +static constexpr AttributeId Id = 0x0000001B; +} // namespace NightVisionIllum + +namespace Awb { +static constexpr AttributeId Id = 0x0000001C; +} // namespace Awb + +namespace ShutterSpeed { +static constexpr AttributeId Id = 0x0000001D; +} // namespace ShutterSpeed + +namespace Iso { +static constexpr AttributeId Id = 0x0000001E; +} // namespace Iso + +namespace Viewport { +static constexpr AttributeId Id = 0x0000001F; +} // namespace Viewport + +namespace SpeakerEnabled { +static constexpr AttributeId Id = 0x00000020; +} // namespace SpeakerEnabled + +namespace SpeakerVolumeLevel { +static constexpr AttributeId Id = 0x00000021; +} // namespace SpeakerVolumeLevel + +namespace SpeakerMaxLevel { +static constexpr AttributeId Id = 0x00000022; +} // namespace SpeakerMaxLevel + +namespace SpeakerMinLevel { +static constexpr AttributeId Id = 0x00000023; +} // namespace SpeakerMinLevel + +namespace MicStatus { +static constexpr AttributeId Id = 0x00000024; +} // namespace MicStatus + +namespace MicVolumeLevel { +static constexpr AttributeId Id = 0x00000025; +} // namespace MicVolumeLevel + +namespace MicMaxLevel { +static constexpr AttributeId Id = 0x00000026; +} // namespace MicMaxLevel + +namespace MicMinLevel { +static constexpr AttributeId Id = 0x00000027; +} // namespace MicMinLevel + +namespace MicAGCEnabled { +static constexpr AttributeId Id = 0x00000028; +} // namespace MicAGCEnabled + +namespace ImageRotation { +static constexpr AttributeId Id = 0x00000029; +} // namespace ImageRotation + +namespace ImageFlipHorizontal { +static constexpr AttributeId Id = 0x0000002A; +} // namespace ImageFlipHorizontal + +namespace ImageFlipVertical { +static constexpr AttributeId Id = 0x0000002B; +} // namespace ImageFlipVertical + +namespace LocalVideoRecordingEnabled { +static constexpr AttributeId Id = 0x0000002C; +} // namespace LocalVideoRecordingEnabled + +namespace LocalSnapshotRecordingEnabled { +static constexpr AttributeId Id = 0x0000002D; +} // namespace LocalSnapshotRecordingEnabled + +namespace StatusLight { +static constexpr AttributeId Id = 0x0000002E; +} // namespace StatusLight + +namespace StatusLightBrightness { +static constexpr AttributeId Id = 0x0000002F; +} // namespace StatusLightBrightness + +namespace DepthSensorStatus { +static constexpr AttributeId Id = 0x00000030; +} // namespace DepthSensorStatus + +namespace WatermarkEnabled { +static constexpr AttributeId Id = 0x00000031; +} // namespace WatermarkEnabled + +namespace OSDEnabled { +static constexpr AttributeId Id = 0x00000032; +} // namespace OSDEnabled + +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 EventList { +static constexpr AttributeId Id = Globals::Attributes::EventList::Id; +} // namespace EventList + +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 CameraAvStreamManagement + namespace WebRTCTransportProvider { 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 f7139e275606c9..f30dde29f48d6c 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 @@ -376,6 +376,9 @@ static constexpr ClusterId Id = 0x0000050F; namespace ContentAppObserver { static constexpr ClusterId Id = 0x00000510; } // namespace ContentAppObserver +namespace CameraAvStreamManagement { +static constexpr ClusterId Id = 0x00000551; +} // namespace CameraAvStreamManagement namespace WebRTCTransportProvider { static constexpr ClusterId Id = 0x00000553; } // namespace WebRTCTransportProvider 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 da67d0d99931fe..59287993f67cec 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 @@ -1803,6 +1803,88 @@ static constexpr CommandId Id = 0x00000001; } // namespace Commands } // namespace ContentAppObserver +namespace CameraAvStreamManagement { +namespace Commands { + +namespace AudioStreamAllocate { +static constexpr CommandId Id = 0x00000000; +} // namespace AudioStreamAllocate + +namespace AudioStreamAllocateResponse { +static constexpr CommandId Id = 0x00000001; +} // namespace AudioStreamAllocateResponse + +namespace AudioStreamDeallocate { +static constexpr CommandId Id = 0x00000002; +} // namespace AudioStreamDeallocate + +namespace VideoStreamAllocate { +static constexpr CommandId Id = 0x00000003; +} // namespace VideoStreamAllocate + +namespace VideoStreamAllocateResponse { +static constexpr CommandId Id = 0x00000004; +} // namespace VideoStreamAllocateResponse + +namespace VideoStreamModify { +static constexpr CommandId Id = 0x00000005; +} // namespace VideoStreamModify + +namespace VideoStreamDeallocate { +static constexpr CommandId Id = 0x00000006; +} // namespace VideoStreamDeallocate + +namespace SnapshotStreamAllocate { +static constexpr CommandId Id = 0x00000007; +} // namespace SnapshotStreamAllocate + +namespace SnapshotStreamAllocateResponse { +static constexpr CommandId Id = 0x00000008; +} // namespace SnapshotStreamAllocateResponse + +namespace SnapshotStreamDeallocate { +static constexpr CommandId Id = 0x00000009; +} // namespace SnapshotStreamDeallocate + +namespace SetStreamPriority { +static constexpr CommandId Id = 0x0000000A; +} // namespace SetStreamPriority + +namespace CaptureSnapshot { +static constexpr CommandId Id = 0x0000000B; +} // namespace CaptureSnapshot + +namespace CaptureSnapshotResponse { +static constexpr CommandId Id = 0x0000000C; +} // namespace CaptureSnapshotResponse + +namespace SetViewport { +static constexpr CommandId Id = 0x0000000D; +} // namespace SetViewport + +namespace SetImageRotation { +static constexpr CommandId Id = 0x0000000E; +} // namespace SetImageRotation + +namespace SetImageFlipHorizontal { +static constexpr CommandId Id = 0x0000000F; +} // namespace SetImageFlipHorizontal + +namespace SetImageFlipVertical { +static constexpr CommandId Id = 0x00000010; +} // namespace SetImageFlipVertical + +namespace SetWatermark { +static constexpr CommandId Id = 0x00000011; +} // namespace SetWatermark + +namespace SetOSD { +static constexpr CommandId Id = 0x00000012; +} // namespace SetOSD + +} // namespace Commands +} // namespace CameraAvStreamManagement + namespace WebRTCTransportProvider { 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 0756af5268e9ed..5c3d37d85ab565 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 @@ -683,6 +683,24 @@ static constexpr EventId Id = 0x00000000; } // namespace Events } // namespace ContentControl +namespace CameraAvStreamManagement { +namespace Events { + +namespace VideoStreamChanged { +static constexpr EventId Id = 0x00000000; +} // namespace VideoStreamChanged + +namespace AudioStreamChanged { +static constexpr EventId Id = 0x00000001; +} // namespace AudioStreamChanged + +namespace SnapshotStreamChanged { +static constexpr EventId Id = 0x00000002; +} // namespace SnapshotStreamChanged + +} // namespace Events +} // namespace CameraAvStreamManagement + 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 1bbecf1c4bb1ff..d2a1385f3d46c0 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h @@ -152,6 +152,7 @@ | AccountLogin | 0x050E | | ContentControl | 0x050F | | ContentAppObserver | 0x0510 | +| CameraAvStreamManagement | 0x0551 | | WebRTCTransportProvider | 0x0553 | | WebRTCTransportRequestor | 0x0554 | | Chime | 0x0556 | @@ -13649,6 +13650,696 @@ class ContentAppObserverContentAppMessage : public ClusterCommand chip::app::Clusters::ContentAppObserver::Commands::ContentAppMessage::Type mRequest; }; +/*----------------------------------------------------------------------------*\ +| Cluster CameraAvStreamManagement | 0x0551 | +|------------------------------------------------------------------------------| +| Commands: | | +| * AudioStreamAllocate | 0x00 | +| * AudioStreamDeallocate | 0x02 | +| * VideoStreamAllocate | 0x03 | +| * VideoStreamModify | 0x05 | +| * VideoStreamDeallocate | 0x06 | +| * SnapshotStreamAllocate | 0x07 | +| * SnapshotStreamDeallocate | 0x09 | +| * SetStreamPriority | 0x0A | +| * CaptureSnapshot | 0x0B | +| * SetViewport | 0x0D | +| * SetImageRotation | 0x0E | +| * SetImageFlipHorizontal | 0x0F | +| * SetImageFlipVertical | 0x10 | +| * SetWatermark | 0x11 | +| * SetOSD | 0x12 | +|------------------------------------------------------------------------------| +| Attributes: | | +| * MaxConcurrentVideoEncoders | 0x0000 | +| * MaxEncodedPixelRate | 0x0001 | +| * VideoSensorParams | 0x0002 | +| * NightVisionCapable | 0x0003 | +| * MinViewPortWidth | 0x0004 | +| * MinViewPortHeight | 0x0005 | +| * RateDistortionTradeOffPoints | 0x0006 | +| * MaxPreRollBufferSize | 0x0007 | +| * MicrophoneCapabilities | 0x0008 | +| * SpeakerCapabilities | 0x0009 | +| * TwoWayTalkSupport | 0x000A | +| * SupportedSnapshotParams | 0x000B | +| * HDRCapable | 0x000C | +| * MaxNetworkBandwidth | 0x000D | +| * CurrentFrameRate | 0x000E | +| * HDRMode | 0x000F | +| * CurrentVideoCodecs | 0x0010 | +| * CurrentSnapshotConfig | 0x0011 | +| * FabricsUsingCamera | 0x0012 | +| * AllocatedVideoStreams | 0x0013 | +| * AllocatedAudioStreams | 0x0014 | +| * AllocatedSnapshotStreams | 0x0015 | +| * RankedVideoStreamPrioritiesList | 0x0016 | +| * SoftRecordingPrivacyModeSetting | 0x0017 | +| * SoftLivestreamPrivacyModeSetting | 0x0018 | +| * HardPrivacyMode | 0x0019 | +| * NightVision | 0x001A | +| * NightVisionIllum | 0x001B | +| * Awb | 0x001C | +| * ShutterSpeed | 0x001D | +| * Iso | 0x001E | +| * Viewport | 0x001F | +| * SpeakerEnabled | 0x0020 | +| * SpeakerVolumeLevel | 0x0021 | +| * SpeakerMaxLevel | 0x0022 | +| * SpeakerMinLevel | 0x0023 | +| * MicStatus | 0x0024 | +| * MicVolumeLevel | 0x0025 | +| * MicMaxLevel | 0x0026 | +| * MicMinLevel | 0x0027 | +| * MicAGCEnabled | 0x0028 | +| * ImageRotation | 0x0029 | +| * ImageFlipHorizontal | 0x002A | +| * ImageFlipVertical | 0x002B | +| * LocalVideoRecordingEnabled | 0x002C | +| * LocalSnapshotRecordingEnabled | 0x002D | +| * StatusLight | 0x002E | +| * StatusLightBrightness | 0x002F | +| * DepthSensorStatus | 0x0030 | +| * WatermarkEnabled | 0x0031 | +| * OSDEnabled | 0x0032 | +| * GeneratedCommandList | 0xFFF8 | +| * AcceptedCommandList | 0xFFF9 | +| * EventList | 0xFFFA | +| * AttributeList | 0xFFFB | +| * FeatureMap | 0xFFFC | +| * ClusterRevision | 0xFFFD | +|------------------------------------------------------------------------------| +| Events: | | +| * VideoStreamChanged | 0x0000 | +| * AudioStreamChanged | 0x0001 | +| * SnapshotStreamChanged | 0x0002 | +\*----------------------------------------------------------------------------*/ + +/* + * Command AudioStreamAllocate + */ +class CameraAvStreamManagementAudioStreamAllocate : public ClusterCommand +{ +public: + CameraAvStreamManagementAudioStreamAllocate(CredentialIssuerCommands * credsIssuerConfig) : + ClusterCommand("audio-stream-allocate", credsIssuerConfig) + { + AddArgument("StreamType", 0, UINT8_MAX, &mRequest.streamType); + AddArgument("AudioCodec", 0, UINT8_MAX, &mRequest.audioCodec); + AddArgument("ChannelCount", 0, UINT8_MAX, &mRequest.channelCount); + AddArgument("SampleRate", 0, UINT32_MAX, &mRequest.sampleRate); + AddArgument("BitRate", 0, UINT32_MAX, &mRequest.bitRate); + AddArgument("BitDepth", 0, UINT8_MAX, &mRequest.bitDepth); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::CameraAvStreamManagement::Commands::AudioStreamAllocate::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::CameraAvStreamManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::CameraAvStreamManagement::Commands::AudioStreamAllocate::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::CameraAvStreamManagement::Commands::AudioStreamAllocate::Type mRequest; +}; + +/* + * Command AudioStreamDeallocate + */ +class CameraAvStreamManagementAudioStreamDeallocate : public ClusterCommand +{ +public: + CameraAvStreamManagementAudioStreamDeallocate(CredentialIssuerCommands * credsIssuerConfig) : + ClusterCommand("audio-stream-deallocate", credsIssuerConfig) + { + AddArgument("AudioStreamID", 0, UINT16_MAX, &mRequest.audioStreamID); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::CameraAvStreamManagement::Commands::AudioStreamDeallocate::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::CameraAvStreamManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::CameraAvStreamManagement::Commands::AudioStreamDeallocate::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::CameraAvStreamManagement::Commands::AudioStreamDeallocate::Type mRequest; +}; + +/* + * Command VideoStreamAllocate + */ +class CameraAvStreamManagementVideoStreamAllocate : public ClusterCommand +{ +public: + CameraAvStreamManagementVideoStreamAllocate(CredentialIssuerCommands * credsIssuerConfig) : + ClusterCommand("video-stream-allocate", credsIssuerConfig), mComplex_MinResolution(&mRequest.minResolution), + mComplex_MaxResolution(&mRequest.maxResolution) + { + AddArgument("StreamType", 0, UINT8_MAX, &mRequest.streamType); + AddArgument("VideoCodec", 0, UINT8_MAX, &mRequest.videoCodec); + AddArgument("MinFrameRate", 0, UINT16_MAX, &mRequest.minFrameRate); + AddArgument("MaxFrameRate", 0, UINT16_MAX, &mRequest.maxFrameRate); + AddArgument("MinResolution", &mComplex_MinResolution); + AddArgument("MaxResolution", &mComplex_MaxResolution); + AddArgument("MinBitRate", 0, UINT32_MAX, &mRequest.minBitRate); + AddArgument("MaxBitRate", 0, UINT32_MAX, &mRequest.maxBitRate); + AddArgument("MinFragmentLen", 0, UINT16_MAX, &mRequest.minFragmentLen); + AddArgument("MaxFragmentLen", 0, UINT16_MAX, &mRequest.maxFragmentLen); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::CameraAvStreamManagement::Commands::VideoStreamAllocate::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::CameraAvStreamManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::CameraAvStreamManagement::Commands::VideoStreamAllocate::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::CameraAvStreamManagement::Commands::VideoStreamAllocate::Type mRequest; + TypedComplexArgument + mComplex_MinResolution; + TypedComplexArgument + mComplex_MaxResolution; +}; + +/* + * Command VideoStreamModify + */ +class CameraAvStreamManagementVideoStreamModify : public ClusterCommand +{ +public: + CameraAvStreamManagementVideoStreamModify(CredentialIssuerCommands * credsIssuerConfig) : + ClusterCommand("video-stream-modify", credsIssuerConfig), mComplex_Resolution(&mRequest.resolution) + { + AddArgument("VideoStreamID", 0, UINT16_MAX, &mRequest.videoStreamID); + AddArgument("Resolution", &mComplex_Resolution); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::CameraAvStreamManagement::Commands::VideoStreamModify::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::CameraAvStreamManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::CameraAvStreamManagement::Commands::VideoStreamModify::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::CameraAvStreamManagement::Commands::VideoStreamModify::Type mRequest; + TypedComplexArgument mComplex_Resolution; +}; + +/* + * Command VideoStreamDeallocate + */ +class CameraAvStreamManagementVideoStreamDeallocate : public ClusterCommand +{ +public: + CameraAvStreamManagementVideoStreamDeallocate(CredentialIssuerCommands * credsIssuerConfig) : + ClusterCommand("video-stream-deallocate", credsIssuerConfig) + { + AddArgument("VideoStreamID", 0, UINT16_MAX, &mRequest.videoStreamID); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::CameraAvStreamManagement::Commands::VideoStreamDeallocate::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::CameraAvStreamManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::CameraAvStreamManagement::Commands::VideoStreamDeallocate::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::CameraAvStreamManagement::Commands::VideoStreamDeallocate::Type mRequest; +}; + +/* + * Command SnapshotStreamAllocate + */ +class CameraAvStreamManagementSnapshotStreamAllocate : public ClusterCommand +{ +public: + CameraAvStreamManagementSnapshotStreamAllocate(CredentialIssuerCommands * credsIssuerConfig) : + ClusterCommand("snapshot-stream-allocate", credsIssuerConfig), mComplex_MinResolution(&mRequest.minResolution), + mComplex_MaxResolution(&mRequest.maxResolution) + { + AddArgument("ImageCodec", 0, UINT8_MAX, &mRequest.imageCodec); + AddArgument("FrameRate", 0, UINT16_MAX, &mRequest.frameRate); + AddArgument("BitRate", 0, UINT32_MAX, &mRequest.bitRate); + AddArgument("MinResolution", &mComplex_MinResolution); + AddArgument("MaxResolution", &mComplex_MaxResolution); + AddArgument("Quality", 0, UINT8_MAX, &mRequest.quality); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::CameraAvStreamManagement::Commands::SnapshotStreamAllocate::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::CameraAvStreamManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::CameraAvStreamManagement::Commands::SnapshotStreamAllocate::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::CameraAvStreamManagement::Commands::SnapshotStreamAllocate::Type mRequest; + TypedComplexArgument + mComplex_MinResolution; + TypedComplexArgument + mComplex_MaxResolution; +}; + +/* + * Command SnapshotStreamDeallocate + */ +class CameraAvStreamManagementSnapshotStreamDeallocate : public ClusterCommand +{ +public: + CameraAvStreamManagementSnapshotStreamDeallocate(CredentialIssuerCommands * credsIssuerConfig) : + ClusterCommand("snapshot-stream-deallocate", credsIssuerConfig) + { + AddArgument("SnapshotStreamID", 0, UINT16_MAX, &mRequest.snapshotStreamID); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::CameraAvStreamManagement::Commands::SnapshotStreamDeallocate::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::CameraAvStreamManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::CameraAvStreamManagement::Commands::SnapshotStreamDeallocate::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::CameraAvStreamManagement::Commands::SnapshotStreamDeallocate::Type mRequest; +}; + +/* + * Command SetStreamPriority + */ +class CameraAvStreamManagementSetStreamPriority : public ClusterCommand +{ +public: + CameraAvStreamManagementSetStreamPriority(CredentialIssuerCommands * credsIssuerConfig) : + ClusterCommand("set-stream-priority", credsIssuerConfig) + { + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::CameraAvStreamManagement::Commands::SetStreamPriority::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::CameraAvStreamManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::CameraAvStreamManagement::Commands::SetStreamPriority::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::CameraAvStreamManagement::Commands::SetStreamPriority::Type mRequest; +}; + +/* + * Command CaptureSnapshot + */ +class CameraAvStreamManagementCaptureSnapshot : public ClusterCommand +{ +public: + CameraAvStreamManagementCaptureSnapshot(CredentialIssuerCommands * credsIssuerConfig) : + ClusterCommand("capture-snapshot", credsIssuerConfig), mComplex_RequestedResolution(&mRequest.requestedResolution) + { + AddArgument("SnapshotStreamID", 0, UINT16_MAX, &mRequest.snapshotStreamID); + AddArgument("RequestedResolution", &mComplex_RequestedResolution); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::CameraAvStreamManagement::Commands::CaptureSnapshot::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::CameraAvStreamManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::CameraAvStreamManagement::Commands::CaptureSnapshot::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::CameraAvStreamManagement::Commands::CaptureSnapshot::Type mRequest; + TypedComplexArgument + mComplex_RequestedResolution; +}; + +/* + * Command SetViewport + */ +class CameraAvStreamManagementSetViewport : public ClusterCommand +{ +public: + CameraAvStreamManagementSetViewport(CredentialIssuerCommands * credsIssuerConfig) : + ClusterCommand("set-viewport", credsIssuerConfig), mComplex_Viewport(&mRequest.viewport) + { + AddArgument("Viewport", &mComplex_Viewport); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::CameraAvStreamManagement::Commands::SetViewport::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::CameraAvStreamManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::CameraAvStreamManagement::Commands::SetViewport::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::CameraAvStreamManagement::Commands::SetViewport::Type mRequest; + TypedComplexArgument mComplex_Viewport; +}; + +/* + * Command SetImageRotation + */ +class CameraAvStreamManagementSetImageRotation : public ClusterCommand +{ +public: + CameraAvStreamManagementSetImageRotation(CredentialIssuerCommands * credsIssuerConfig) : + ClusterCommand("set-image-rotation", credsIssuerConfig) + { + AddArgument("Angle", 0, UINT16_MAX, &mRequest.angle); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::CameraAvStreamManagement::Commands::SetImageRotation::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::CameraAvStreamManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::CameraAvStreamManagement::Commands::SetImageRotation::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::CameraAvStreamManagement::Commands::SetImageRotation::Type mRequest; +}; + +/* + * Command SetImageFlipHorizontal + */ +class CameraAvStreamManagementSetImageFlipHorizontal : public ClusterCommand +{ +public: + CameraAvStreamManagementSetImageFlipHorizontal(CredentialIssuerCommands * credsIssuerConfig) : + ClusterCommand("set-image-flip-horizontal", credsIssuerConfig) + { + AddArgument("Enabled", 0, 1, &mRequest.enabled); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::CameraAvStreamManagement::Commands::SetImageFlipHorizontal::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::CameraAvStreamManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::CameraAvStreamManagement::Commands::SetImageFlipHorizontal::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::CameraAvStreamManagement::Commands::SetImageFlipHorizontal::Type mRequest; +}; + +/* + * Command SetImageFlipVertical + */ +class CameraAvStreamManagementSetImageFlipVertical : public ClusterCommand +{ +public: + CameraAvStreamManagementSetImageFlipVertical(CredentialIssuerCommands * credsIssuerConfig) : + ClusterCommand("set-image-flip-vertical", credsIssuerConfig) + { + AddArgument("Enabled", 0, 1, &mRequest.enabled); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::CameraAvStreamManagement::Commands::SetImageFlipVertical::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::CameraAvStreamManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::CameraAvStreamManagement::Commands::SetImageFlipVertical::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::CameraAvStreamManagement::Commands::SetImageFlipVertical::Type mRequest; +}; + +/* + * Command SetWatermark + */ +class CameraAvStreamManagementSetWatermark : public ClusterCommand +{ +public: + CameraAvStreamManagementSetWatermark(CredentialIssuerCommands * credsIssuerConfig) : + ClusterCommand("set-watermark", credsIssuerConfig) + { + AddArgument("VideoStreamID", 0, UINT16_MAX, &mRequest.videoStreamID); + AddArgument("Enabled", 0, 1, &mRequest.enabled); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::CameraAvStreamManagement::Commands::SetWatermark::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::CameraAvStreamManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::CameraAvStreamManagement::Commands::SetWatermark::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::CameraAvStreamManagement::Commands::SetWatermark::Type mRequest; +}; + +/* + * Command SetOSD + */ +class CameraAvStreamManagementSetOSD : public ClusterCommand +{ +public: + CameraAvStreamManagementSetOSD(CredentialIssuerCommands * credsIssuerConfig) : ClusterCommand("set-osd", credsIssuerConfig) + { + AddArgument("VideoStreamID", 0, UINT16_MAX, &mRequest.videoStreamID); + AddArgument("Enabled", 0, 1, &mRequest.enabled); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::CameraAvStreamManagement::Commands::SetOSD::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::CameraAvStreamManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::CameraAvStreamManagement::Commands::SetOSD::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::CameraAvStreamManagement::Commands::SetOSD::Type mRequest; +}; + /*----------------------------------------------------------------------------*\ | Cluster WebRTCTransportProvider | 0x0553 | |------------------------------------------------------------------------------| @@ -26643,6 +27334,324 @@ void registerClusterContentAppObserver(Commands & commands, CredentialIssuerComm commands.RegisterCluster(clusterName, clusterCommands); } +void registerClusterCameraAvStreamManagement(Commands & commands, CredentialIssuerCommands * credsIssuerConfig) +{ + using namespace chip::app::Clusters::CameraAvStreamManagement; + + const char * clusterName = "CameraAvStreamManagement"; + + 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), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(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, "max-concurrent-video-encoders", Attributes::MaxConcurrentVideoEncoders::Id, + credsIssuerConfig), // + make_unique(Id, "max-encoded-pixel-rate", Attributes::MaxEncodedPixelRate::Id, credsIssuerConfig), // + make_unique(Id, "video-sensor-params", Attributes::VideoSensorParams::Id, credsIssuerConfig), // + make_unique(Id, "night-vision-capable", Attributes::NightVisionCapable::Id, credsIssuerConfig), // + make_unique(Id, "min-view-port-width", Attributes::MinViewPortWidth::Id, credsIssuerConfig), // + make_unique(Id, "min-view-port-height", Attributes::MinViewPortHeight::Id, credsIssuerConfig), // + make_unique(Id, "rate-distortion-trade-off-points", Attributes::RateDistortionTradeOffPoints::Id, + credsIssuerConfig), // + make_unique(Id, "max-pre-roll-buffer-size", Attributes::MaxPreRollBufferSize::Id, credsIssuerConfig), // + make_unique(Id, "microphone-capabilities", Attributes::MicrophoneCapabilities::Id, credsIssuerConfig), // + make_unique(Id, "speaker-capabilities", Attributes::SpeakerCapabilities::Id, credsIssuerConfig), // + make_unique(Id, "two-way-talk-support", Attributes::TwoWayTalkSupport::Id, credsIssuerConfig), // + make_unique(Id, "supported-snapshot-params", Attributes::SupportedSnapshotParams::Id, credsIssuerConfig), // + make_unique(Id, "hdrcapable", Attributes::HDRCapable::Id, credsIssuerConfig), // + make_unique(Id, "max-network-bandwidth", Attributes::MaxNetworkBandwidth::Id, credsIssuerConfig), // + make_unique(Id, "current-frame-rate", Attributes::CurrentFrameRate::Id, credsIssuerConfig), // + make_unique(Id, "hdrmode", Attributes::HDRMode::Id, credsIssuerConfig), // + make_unique(Id, "current-video-codecs", Attributes::CurrentVideoCodecs::Id, credsIssuerConfig), // + make_unique(Id, "current-snapshot-config", Attributes::CurrentSnapshotConfig::Id, credsIssuerConfig), // + make_unique(Id, "fabrics-using-camera", Attributes::FabricsUsingCamera::Id, credsIssuerConfig), // + make_unique(Id, "allocated-video-streams", Attributes::AllocatedVideoStreams::Id, credsIssuerConfig), // + make_unique(Id, "allocated-audio-streams", Attributes::AllocatedAudioStreams::Id, credsIssuerConfig), // + make_unique(Id, "allocated-snapshot-streams", Attributes::AllocatedSnapshotStreams::Id, + credsIssuerConfig), // + make_unique(Id, "ranked-video-stream-priorities-list", Attributes::RankedVideoStreamPrioritiesList::Id, + credsIssuerConfig), // + make_unique(Id, "soft-recording-privacy-mode-setting", Attributes::SoftRecordingPrivacyModeSetting::Id, + credsIssuerConfig), // + make_unique(Id, "soft-livestream-privacy-mode-setting", Attributes::SoftLivestreamPrivacyModeSetting::Id, + credsIssuerConfig), // + make_unique(Id, "hard-privacy-mode", Attributes::HardPrivacyMode::Id, credsIssuerConfig), // + make_unique(Id, "night-vision", Attributes::NightVision::Id, credsIssuerConfig), // + make_unique(Id, "night-vision-illum", Attributes::NightVisionIllum::Id, credsIssuerConfig), // + make_unique(Id, "awb", Attributes::Awb::Id, credsIssuerConfig), // + make_unique(Id, "shutter-speed", Attributes::ShutterSpeed::Id, credsIssuerConfig), // + make_unique(Id, "iso", Attributes::Iso::Id, credsIssuerConfig), // + make_unique(Id, "viewport", Attributes::Viewport::Id, credsIssuerConfig), // + make_unique(Id, "speaker-enabled", Attributes::SpeakerEnabled::Id, credsIssuerConfig), // + make_unique(Id, "speaker-volume-level", Attributes::SpeakerVolumeLevel::Id, credsIssuerConfig), // + make_unique(Id, "speaker-max-level", Attributes::SpeakerMaxLevel::Id, credsIssuerConfig), // + make_unique(Id, "speaker-min-level", Attributes::SpeakerMinLevel::Id, credsIssuerConfig), // + make_unique(Id, "mic-status", Attributes::MicStatus::Id, credsIssuerConfig), // + make_unique(Id, "mic-volume-level", Attributes::MicVolumeLevel::Id, credsIssuerConfig), // + make_unique(Id, "mic-max-level", Attributes::MicMaxLevel::Id, credsIssuerConfig), // + make_unique(Id, "mic-min-level", Attributes::MicMinLevel::Id, credsIssuerConfig), // + make_unique(Id, "mic-agcenabled", Attributes::MicAGCEnabled::Id, credsIssuerConfig), // + make_unique(Id, "image-rotation", Attributes::ImageRotation::Id, credsIssuerConfig), // + make_unique(Id, "image-flip-horizontal", Attributes::ImageFlipHorizontal::Id, credsIssuerConfig), // + make_unique(Id, "image-flip-vertical", Attributes::ImageFlipVertical::Id, credsIssuerConfig), // + make_unique(Id, "local-video-recording-enabled", Attributes::LocalVideoRecordingEnabled::Id, + credsIssuerConfig), // + make_unique(Id, "local-snapshot-recording-enabled", Attributes::LocalSnapshotRecordingEnabled::Id, + credsIssuerConfig), // + make_unique(Id, "status-light", Attributes::StatusLight::Id, credsIssuerConfig), // + make_unique(Id, "status-light-brightness", Attributes::StatusLightBrightness::Id, credsIssuerConfig), // + make_unique(Id, "depth-sensor-status", Attributes::DepthSensorStatus::Id, credsIssuerConfig), // + make_unique(Id, "watermark-enabled", Attributes::WatermarkEnabled::Id, credsIssuerConfig), // + make_unique(Id, "osdenabled", Attributes::OSDEnabled::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, "event-list", Attributes::EventList::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, "max-concurrent-video-encoders", 0, UINT8_MAX, + Attributes::MaxConcurrentVideoEncoders::Id, WriteCommandType::kForceWrite, + credsIssuerConfig), // + make_unique>(Id, "max-encoded-pixel-rate", 0, UINT32_MAX, Attributes::MaxEncodedPixelRate::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>( + Id, "video-sensor-params", Attributes::VideoSensorParams::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>(Id, "night-vision-capable", 0, 1, Attributes::NightVisionCapable::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>( + Id, "min-view-port-width", Attributes::MinViewPortWidth::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>( + Id, "min-view-port-height", Attributes::MinViewPortHeight::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>( + Id, "rate-distortion-trade-off-points", Attributes::RateDistortionTradeOffPoints::Id, WriteCommandType::kForceWrite, + credsIssuerConfig), // + make_unique>(Id, "max-pre-roll-buffer-size", 0, UINT32_MAX, Attributes::MaxPreRollBufferSize::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>( + Id, "microphone-capabilities", Attributes::MicrophoneCapabilities::Id, WriteCommandType::kForceWrite, + credsIssuerConfig), // + make_unique>>( + Id, "speaker-capabilities", Attributes::SpeakerCapabilities::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>( + Id, "two-way-talk-support", 0, UINT8_MAX, Attributes::TwoWayTalkSupport::Id, WriteCommandType::kForceWrite, + credsIssuerConfig), // + make_unique>>( + Id, "supported-snapshot-params", Attributes::SupportedSnapshotParams::Id, WriteCommandType::kForceWrite, + credsIssuerConfig), // + make_unique>(Id, "hdrcapable", 0, 1, Attributes::HDRCapable::Id, WriteCommandType::kForceWrite, + credsIssuerConfig), // + make_unique>(Id, "max-network-bandwidth", 0, UINT32_MAX, Attributes::MaxNetworkBandwidth::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>(Id, "current-frame-rate", 0, UINT16_MAX, Attributes::CurrentFrameRate::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>(Id, "hdrmode", 0, 1, Attributes::HDRMode::Id, WriteCommandType::kWrite, + credsIssuerConfig), // + make_unique>>( + Id, "current-video-codecs", Attributes::CurrentVideoCodecs::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>( + Id, "current-snapshot-config", Attributes::CurrentSnapshotConfig::Id, WriteCommandType::kForceWrite, + credsIssuerConfig), // + make_unique>>( + Id, "fabrics-using-camera", Attributes::FabricsUsingCamera::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>( + Id, "allocated-video-streams", Attributes::AllocatedVideoStreams::Id, WriteCommandType::kForceWrite, + credsIssuerConfig), // + make_unique>>( + Id, "allocated-audio-streams", Attributes::AllocatedAudioStreams::Id, WriteCommandType::kForceWrite, + credsIssuerConfig), // + make_unique>>( + Id, "allocated-snapshot-streams", Attributes::AllocatedSnapshotStreams::Id, WriteCommandType::kForceWrite, + credsIssuerConfig), // + make_unique>>( + Id, "ranked-video-stream-priorities-list", Attributes::RankedVideoStreamPrioritiesList::Id, WriteCommandType::kWrite, + credsIssuerConfig), // + make_unique>(Id, "soft-recording-privacy-mode-setting", 0, 1, + Attributes::SoftRecordingPrivacyModeSetting::Id, WriteCommandType::kWrite, + credsIssuerConfig), // + make_unique>(Id, "soft-livestream-privacy-mode-setting", 0, 1, + Attributes::SoftLivestreamPrivacyModeSetting::Id, WriteCommandType::kWrite, + credsIssuerConfig), // + make_unique>(Id, "hard-privacy-mode", 0, 1, Attributes::HardPrivacyMode::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>( + Id, "night-vision", 0, UINT8_MAX, Attributes::NightVision::Id, WriteCommandType::kWrite, credsIssuerConfig), // + make_unique>( + Id, "night-vision-illum", 0, UINT8_MAX, Attributes::NightVisionIllum::Id, WriteCommandType::kWrite, + credsIssuerConfig), // + make_unique>(Id, "awb", 0, 1, Attributes::Awb::Id, WriteCommandType::kWrite, credsIssuerConfig), // + make_unique>(Id, "shutter-speed", 0, 1, Attributes::ShutterSpeed::Id, WriteCommandType::kWrite, + credsIssuerConfig), // + make_unique>(Id, "iso", 0, 1, Attributes::Iso::Id, WriteCommandType::kWrite, credsIssuerConfig), // + make_unique>( + Id, "viewport", Attributes::Viewport::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>(Id, "speaker-enabled", 0, 1, Attributes::SpeakerEnabled::Id, WriteCommandType::kWrite, + credsIssuerConfig), // + make_unique>(Id, "speaker-volume-level", 0, UINT8_MAX, Attributes::SpeakerVolumeLevel::Id, + WriteCommandType::kWrite, credsIssuerConfig), // + make_unique>(Id, "speaker-max-level", 0, UINT8_MAX, Attributes::SpeakerMaxLevel::Id, + WriteCommandType::kWrite, credsIssuerConfig), // + make_unique>(Id, "speaker-min-level", 0, UINT8_MAX, Attributes::SpeakerMinLevel::Id, + WriteCommandType::kWrite, credsIssuerConfig), // + make_unique>(Id, "mic-status", 0, 1, Attributes::MicStatus::Id, WriteCommandType::kWrite, + credsIssuerConfig), // + make_unique>(Id, "mic-volume-level", 0, UINT8_MAX, Attributes::MicVolumeLevel::Id, + WriteCommandType::kWrite, credsIssuerConfig), // + make_unique>(Id, "mic-max-level", 0, UINT8_MAX, Attributes::MicMaxLevel::Id, + WriteCommandType::kWrite, credsIssuerConfig), // + make_unique>(Id, "mic-min-level", 0, UINT8_MAX, Attributes::MicMinLevel::Id, + WriteCommandType::kWrite, credsIssuerConfig), // + make_unique>(Id, "mic-agcenabled", 0, 1, Attributes::MicAGCEnabled::Id, WriteCommandType::kWrite, + credsIssuerConfig), // + make_unique>(Id, "image-rotation", 0, UINT16_MAX, Attributes::ImageRotation::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>(Id, "image-flip-horizontal", 0, 1, Attributes::ImageFlipHorizontal::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>(Id, "image-flip-vertical", 0, 1, Attributes::ImageFlipVertical::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>(Id, "local-video-recording-enabled", 0, 1, Attributes::LocalVideoRecordingEnabled::Id, + WriteCommandType::kWrite, credsIssuerConfig), // + make_unique>(Id, "local-snapshot-recording-enabled", 0, 1, + Attributes::LocalSnapshotRecordingEnabled::Id, WriteCommandType::kWrite, + credsIssuerConfig), // + make_unique>(Id, "status-light", 0, 1, Attributes::StatusLight::Id, WriteCommandType::kWrite, + credsIssuerConfig), // + make_unique>( + Id, "status-light-brightness", 0, UINT8_MAX, Attributes::StatusLightBrightness::Id, WriteCommandType::kWrite, + credsIssuerConfig), // + make_unique>( + Id, "depth-sensor-status", 0, UINT8_MAX, Attributes::DepthSensorStatus::Id, WriteCommandType::kWrite, + credsIssuerConfig), // + make_unique>>( + Id, "watermark-enabled", Attributes::WatermarkEnabled::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>( + Id, "osdenabled", Attributes::OSDEnabled::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, "event-list", Attributes::EventList::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, "max-concurrent-video-encoders", Attributes::MaxConcurrentVideoEncoders::Id, + credsIssuerConfig), // + make_unique(Id, "max-encoded-pixel-rate", Attributes::MaxEncodedPixelRate::Id, credsIssuerConfig), // + make_unique(Id, "video-sensor-params", Attributes::VideoSensorParams::Id, credsIssuerConfig), // + make_unique(Id, "night-vision-capable", Attributes::NightVisionCapable::Id, credsIssuerConfig), // + make_unique(Id, "min-view-port-width", Attributes::MinViewPortWidth::Id, credsIssuerConfig), // + make_unique(Id, "min-view-port-height", Attributes::MinViewPortHeight::Id, credsIssuerConfig), // + make_unique(Id, "rate-distortion-trade-off-points", Attributes::RateDistortionTradeOffPoints::Id, + credsIssuerConfig), // + make_unique(Id, "max-pre-roll-buffer-size", Attributes::MaxPreRollBufferSize::Id, credsIssuerConfig), // + make_unique(Id, "microphone-capabilities", Attributes::MicrophoneCapabilities::Id, + credsIssuerConfig), // + make_unique(Id, "speaker-capabilities", Attributes::SpeakerCapabilities::Id, credsIssuerConfig), // + make_unique(Id, "two-way-talk-support", Attributes::TwoWayTalkSupport::Id, credsIssuerConfig), // + make_unique(Id, "supported-snapshot-params", Attributes::SupportedSnapshotParams::Id, + credsIssuerConfig), // + make_unique(Id, "hdrcapable", Attributes::HDRCapable::Id, credsIssuerConfig), // + make_unique(Id, "max-network-bandwidth", Attributes::MaxNetworkBandwidth::Id, credsIssuerConfig), // + make_unique(Id, "current-frame-rate", Attributes::CurrentFrameRate::Id, credsIssuerConfig), // + make_unique(Id, "hdrmode", Attributes::HDRMode::Id, credsIssuerConfig), // + make_unique(Id, "current-video-codecs", Attributes::CurrentVideoCodecs::Id, credsIssuerConfig), // + make_unique(Id, "current-snapshot-config", Attributes::CurrentSnapshotConfig::Id, credsIssuerConfig), // + make_unique(Id, "fabrics-using-camera", Attributes::FabricsUsingCamera::Id, credsIssuerConfig), // + make_unique(Id, "allocated-video-streams", Attributes::AllocatedVideoStreams::Id, credsIssuerConfig), // + make_unique(Id, "allocated-audio-streams", Attributes::AllocatedAudioStreams::Id, credsIssuerConfig), // + make_unique(Id, "allocated-snapshot-streams", Attributes::AllocatedSnapshotStreams::Id, + credsIssuerConfig), // + make_unique(Id, "ranked-video-stream-priorities-list", Attributes::RankedVideoStreamPrioritiesList::Id, + credsIssuerConfig), // + make_unique(Id, "soft-recording-privacy-mode-setting", Attributes::SoftRecordingPrivacyModeSetting::Id, + credsIssuerConfig), // + make_unique(Id, "soft-livestream-privacy-mode-setting", + Attributes::SoftLivestreamPrivacyModeSetting::Id, credsIssuerConfig), // + make_unique(Id, "hard-privacy-mode", Attributes::HardPrivacyMode::Id, credsIssuerConfig), // + make_unique(Id, "night-vision", Attributes::NightVision::Id, credsIssuerConfig), // + make_unique(Id, "night-vision-illum", Attributes::NightVisionIllum::Id, credsIssuerConfig), // + make_unique(Id, "awb", Attributes::Awb::Id, credsIssuerConfig), // + make_unique(Id, "shutter-speed", Attributes::ShutterSpeed::Id, credsIssuerConfig), // + make_unique(Id, "iso", Attributes::Iso::Id, credsIssuerConfig), // + make_unique(Id, "viewport", Attributes::Viewport::Id, credsIssuerConfig), // + make_unique(Id, "speaker-enabled", Attributes::SpeakerEnabled::Id, credsIssuerConfig), // + make_unique(Id, "speaker-volume-level", Attributes::SpeakerVolumeLevel::Id, credsIssuerConfig), // + make_unique(Id, "speaker-max-level", Attributes::SpeakerMaxLevel::Id, credsIssuerConfig), // + make_unique(Id, "speaker-min-level", Attributes::SpeakerMinLevel::Id, credsIssuerConfig), // + make_unique(Id, "mic-status", Attributes::MicStatus::Id, credsIssuerConfig), // + make_unique(Id, "mic-volume-level", Attributes::MicVolumeLevel::Id, credsIssuerConfig), // + make_unique(Id, "mic-max-level", Attributes::MicMaxLevel::Id, credsIssuerConfig), // + make_unique(Id, "mic-min-level", Attributes::MicMinLevel::Id, credsIssuerConfig), // + make_unique(Id, "mic-agcenabled", Attributes::MicAGCEnabled::Id, credsIssuerConfig), // + make_unique(Id, "image-rotation", Attributes::ImageRotation::Id, credsIssuerConfig), // + make_unique(Id, "image-flip-horizontal", Attributes::ImageFlipHorizontal::Id, credsIssuerConfig), // + make_unique(Id, "image-flip-vertical", Attributes::ImageFlipVertical::Id, credsIssuerConfig), // + make_unique(Id, "local-video-recording-enabled", Attributes::LocalVideoRecordingEnabled::Id, + credsIssuerConfig), // + make_unique(Id, "local-snapshot-recording-enabled", Attributes::LocalSnapshotRecordingEnabled::Id, + credsIssuerConfig), // + make_unique(Id, "status-light", Attributes::StatusLight::Id, credsIssuerConfig), // + make_unique(Id, "status-light-brightness", Attributes::StatusLightBrightness::Id, credsIssuerConfig), // + make_unique(Id, "depth-sensor-status", Attributes::DepthSensorStatus::Id, credsIssuerConfig), // + make_unique(Id, "watermark-enabled", Attributes::WatermarkEnabled::Id, credsIssuerConfig), // + make_unique(Id, "osdenabled", Attributes::OSDEnabled::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, "event-list", Attributes::EventList::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, "video-stream-changed", Events::VideoStreamChanged::Id, credsIssuerConfig), // + make_unique(Id, "audio-stream-changed", Events::AudioStreamChanged::Id, credsIssuerConfig), // + make_unique(Id, "snapshot-stream-changed", Events::SnapshotStreamChanged::Id, credsIssuerConfig), // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, "video-stream-changed", Events::VideoStreamChanged::Id, credsIssuerConfig), // + make_unique(Id, "audio-stream-changed", Events::AudioStreamChanged::Id, credsIssuerConfig), // + make_unique(Id, "snapshot-stream-changed", Events::SnapshotStreamChanged::Id, credsIssuerConfig), // + }; + + commands.RegisterCluster(clusterName, clusterCommands); +} void registerClusterWebRTCTransportProvider(Commands & commands, CredentialIssuerCommands * credsIssuerConfig) { using namespace chip::app::Clusters::WebRTCTransportProvider; @@ -27692,6 +28701,7 @@ void registerClusters(Commands & commands, CredentialIssuerCommands * credsIssue registerClusterAccountLogin(commands, credsIssuerConfig); registerClusterContentControl(commands, credsIssuerConfig); registerClusterContentAppObserver(commands, credsIssuerConfig); + registerClusterCameraAvStreamManagement(commands, credsIssuerConfig); registerClusterWebRTCTransportProvider(commands, credsIssuerConfig); registerClusterWebRTCTransportRequestor(commands, credsIssuerConfig); registerClusterChime(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 76313bf47a2198..3c420872734cf7 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp @@ -540,6 +540,77 @@ void ComplexArgumentParser::Finalize(chip::app::Clusters::detail::Structs::Opera ComplexArgumentParser::Finalize(request.operationalStateLabel); } +CHIP_ERROR ComplexArgumentParser::Setup(const char * label, chip::app::Clusters::detail::Structs::PerStreamStruct::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("PerStreamStruct.streamID", "streamID", value.isMember("streamID"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("PerStreamStruct.enabled", "enabled", value.isMember("enabled"))); + + char labelWithMember[kMaxLabelLength]; + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "streamID"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.streamID, value["streamID"])); + valueCopy.removeMember("streamID"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "enabled"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.enabled, value["enabled"])); + valueCopy.removeMember("enabled"); + + return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); +} + +void ComplexArgumentParser::Finalize(chip::app::Clusters::detail::Structs::PerStreamStruct::Type & request) +{ + ComplexArgumentParser::Finalize(request.streamID); + ComplexArgumentParser::Finalize(request.enabled); +} + +CHIP_ERROR ComplexArgumentParser::Setup(const char * label, chip::app::Clusters::detail::Structs::ViewportStruct::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("ViewportStruct.x1", "x1", value.isMember("x1"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("ViewportStruct.y1", "y1", value.isMember("y1"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("ViewportStruct.x2", "x2", value.isMember("x2"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("ViewportStruct.y2", "y2", value.isMember("y2"))); + + char labelWithMember[kMaxLabelLength]; + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "x1"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.x1, value["x1"])); + valueCopy.removeMember("x1"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "y1"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.y1, value["y1"])); + valueCopy.removeMember("y1"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "x2"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.x2, value["x2"])); + valueCopy.removeMember("x2"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "y2"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.y2, value["y2"])); + valueCopy.removeMember("y2"); + + return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); +} + +void ComplexArgumentParser::Finalize(chip::app::Clusters::detail::Structs::ViewportStruct::Type & request) +{ + ComplexArgumentParser::Finalize(request.x1); + ComplexArgumentParser::Finalize(request.y1); + ComplexArgumentParser::Finalize(request.x2); + ComplexArgumentParser::Finalize(request.y2); +} + CHIP_ERROR ComplexArgumentParser::Setup(const char * label, chip::app::Clusters::detail::Structs::WebRTCSessionStruct::Type & request, Json::Value & value) @@ -5784,6 +5855,473 @@ void ComplexArgumentParser::Finalize(chip::app::Clusters::ContentControl::Struct ComplexArgumentParser::Finalize(request.ratingNameDesc); } +CHIP_ERROR +ComplexArgumentParser::Setup(const char * label, + chip::app::Clusters::CameraAvStreamManagement::Structs::VideoResolutionStruct::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("VideoResolutionStruct.width", "width", value.isMember("width"))); + ReturnErrorOnFailure( + ComplexArgumentParser::EnsureMemberExist("VideoResolutionStruct.height", "height", value.isMember("height"))); + + char labelWithMember[kMaxLabelLength]; + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "width"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.width, value["width"])); + valueCopy.removeMember("width"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "height"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.height, value["height"])); + valueCopy.removeMember("height"); + + return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); +} + +void ComplexArgumentParser::Finalize(chip::app::Clusters::CameraAvStreamManagement::Structs::VideoResolutionStruct::Type & request) +{ + ComplexArgumentParser::Finalize(request.width); + ComplexArgumentParser::Finalize(request.height); +} + +CHIP_ERROR ComplexArgumentParser::Setup(const char * label, + chip::app::Clusters::CameraAvStreamManagement::Structs::VideoStreamStruct::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("VideoStreamStruct.videoStreamID", "videoStreamID", + value.isMember("videoStreamID"))); + ReturnErrorOnFailure( + ComplexArgumentParser::EnsureMemberExist("VideoStreamStruct.streamType", "streamType", value.isMember("streamType"))); + ReturnErrorOnFailure( + ComplexArgumentParser::EnsureMemberExist("VideoStreamStruct.videoCodec", "videoCodec", value.isMember("videoCodec"))); + ReturnErrorOnFailure( + ComplexArgumentParser::EnsureMemberExist("VideoStreamStruct.minFrameRate", "minFrameRate", value.isMember("minFrameRate"))); + ReturnErrorOnFailure( + ComplexArgumentParser::EnsureMemberExist("VideoStreamStruct.maxFrameRate", "maxFrameRate", value.isMember("maxFrameRate"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("VideoStreamStruct.minResolution", "minResolution", + value.isMember("minResolution"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("VideoStreamStruct.maxResolution", "maxResolution", + value.isMember("maxResolution"))); + ReturnErrorOnFailure( + ComplexArgumentParser::EnsureMemberExist("VideoStreamStruct.minBitRate", "minBitRate", value.isMember("minBitRate"))); + ReturnErrorOnFailure( + ComplexArgumentParser::EnsureMemberExist("VideoStreamStruct.maxBitRate", "maxBitRate", value.isMember("maxBitRate"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("VideoStreamStruct.minFragmentLen", "minFragmentLen", + value.isMember("minFragmentLen"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("VideoStreamStruct.maxFragmentLen", "maxFragmentLen", + value.isMember("maxFragmentLen"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("VideoStreamStruct.referenceCount", "referenceCount", + value.isMember("referenceCount"))); + + char labelWithMember[kMaxLabelLength]; + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "videoStreamID"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.videoStreamID, value["videoStreamID"])); + valueCopy.removeMember("videoStreamID"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "streamType"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.streamType, value["streamType"])); + valueCopy.removeMember("streamType"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "videoCodec"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.videoCodec, value["videoCodec"])); + valueCopy.removeMember("videoCodec"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "minFrameRate"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.minFrameRate, value["minFrameRate"])); + valueCopy.removeMember("minFrameRate"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "maxFrameRate"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.maxFrameRate, value["maxFrameRate"])); + valueCopy.removeMember("maxFrameRate"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "minResolution"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.minResolution, value["minResolution"])); + valueCopy.removeMember("minResolution"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "maxResolution"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.maxResolution, value["maxResolution"])); + valueCopy.removeMember("maxResolution"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "minBitRate"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.minBitRate, value["minBitRate"])); + valueCopy.removeMember("minBitRate"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "maxBitRate"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.maxBitRate, value["maxBitRate"])); + valueCopy.removeMember("maxBitRate"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "minFragmentLen"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.minFragmentLen, value["minFragmentLen"])); + valueCopy.removeMember("minFragmentLen"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "maxFragmentLen"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.maxFragmentLen, value["maxFragmentLen"])); + valueCopy.removeMember("maxFragmentLen"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "referenceCount"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.referenceCount, value["referenceCount"])); + valueCopy.removeMember("referenceCount"); + + return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); +} + +void ComplexArgumentParser::Finalize(chip::app::Clusters::CameraAvStreamManagement::Structs::VideoStreamStruct::Type & request) +{ + ComplexArgumentParser::Finalize(request.videoStreamID); + ComplexArgumentParser::Finalize(request.streamType); + ComplexArgumentParser::Finalize(request.videoCodec); + ComplexArgumentParser::Finalize(request.minFrameRate); + ComplexArgumentParser::Finalize(request.maxFrameRate); + ComplexArgumentParser::Finalize(request.minResolution); + ComplexArgumentParser::Finalize(request.maxResolution); + ComplexArgumentParser::Finalize(request.minBitRate); + ComplexArgumentParser::Finalize(request.maxBitRate); + ComplexArgumentParser::Finalize(request.minFragmentLen); + ComplexArgumentParser::Finalize(request.maxFragmentLen); + ComplexArgumentParser::Finalize(request.referenceCount); +} + +CHIP_ERROR +ComplexArgumentParser::Setup(const char * label, + chip::app::Clusters::CameraAvStreamManagement::Structs::SnapshotStreamStruct::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("SnapshotStreamStruct.snapshotStreamID", "snapshotStreamID", + value.isMember("snapshotStreamID"))); + ReturnErrorOnFailure( + ComplexArgumentParser::EnsureMemberExist("SnapshotStreamStruct.imageCodec", "imageCodec", value.isMember("imageCodec"))); + ReturnErrorOnFailure( + ComplexArgumentParser::EnsureMemberExist("SnapshotStreamStruct.frameRate", "frameRate", value.isMember("frameRate"))); + ReturnErrorOnFailure( + ComplexArgumentParser::EnsureMemberExist("SnapshotStreamStruct.bitRate", "bitRate", value.isMember("bitRate"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("SnapshotStreamStruct.minResolution", "minResolution", + value.isMember("minResolution"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("SnapshotStreamStruct.maxResolution", "maxResolution", + value.isMember("maxResolution"))); + ReturnErrorOnFailure( + ComplexArgumentParser::EnsureMemberExist("SnapshotStreamStruct.quality", "quality", value.isMember("quality"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("SnapshotStreamStruct.referenceCount", "referenceCount", + value.isMember("referenceCount"))); + + char labelWithMember[kMaxLabelLength]; + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "snapshotStreamID"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.snapshotStreamID, value["snapshotStreamID"])); + valueCopy.removeMember("snapshotStreamID"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "imageCodec"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.imageCodec, value["imageCodec"])); + valueCopy.removeMember("imageCodec"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "frameRate"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.frameRate, value["frameRate"])); + valueCopy.removeMember("frameRate"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "bitRate"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.bitRate, value["bitRate"])); + valueCopy.removeMember("bitRate"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "minResolution"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.minResolution, value["minResolution"])); + valueCopy.removeMember("minResolution"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "maxResolution"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.maxResolution, value["maxResolution"])); + valueCopy.removeMember("maxResolution"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "quality"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.quality, value["quality"])); + valueCopy.removeMember("quality"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "referenceCount"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.referenceCount, value["referenceCount"])); + valueCopy.removeMember("referenceCount"); + + return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); +} + +void ComplexArgumentParser::Finalize(chip::app::Clusters::CameraAvStreamManagement::Structs::SnapshotStreamStruct::Type & request) +{ + ComplexArgumentParser::Finalize(request.snapshotStreamID); + ComplexArgumentParser::Finalize(request.imageCodec); + ComplexArgumentParser::Finalize(request.frameRate); + ComplexArgumentParser::Finalize(request.bitRate); + ComplexArgumentParser::Finalize(request.minResolution); + ComplexArgumentParser::Finalize(request.maxResolution); + ComplexArgumentParser::Finalize(request.quality); + ComplexArgumentParser::Finalize(request.referenceCount); +} + +CHIP_ERROR +ComplexArgumentParser::Setup(const char * label, + chip::app::Clusters::CameraAvStreamManagement::Structs::SnapshotParamsStruct::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("SnapshotParamsStruct.resolution", "resolution", value.isMember("resolution"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("SnapshotParamsStruct.maxFrameRate", "maxFrameRate", + value.isMember("maxFrameRate"))); + ReturnErrorOnFailure( + ComplexArgumentParser::EnsureMemberExist("SnapshotParamsStruct.imageCodec", "imageCodec", value.isMember("imageCodec"))); + + char labelWithMember[kMaxLabelLength]; + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "resolution"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.resolution, value["resolution"])); + valueCopy.removeMember("resolution"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "maxFrameRate"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.maxFrameRate, value["maxFrameRate"])); + valueCopy.removeMember("maxFrameRate"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "imageCodec"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.imageCodec, value["imageCodec"])); + valueCopy.removeMember("imageCodec"); + + return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); +} + +void ComplexArgumentParser::Finalize(chip::app::Clusters::CameraAvStreamManagement::Structs::SnapshotParamsStruct::Type & request) +{ + ComplexArgumentParser::Finalize(request.resolution); + ComplexArgumentParser::Finalize(request.maxFrameRate); + ComplexArgumentParser::Finalize(request.imageCodec); +} + +CHIP_ERROR ComplexArgumentParser::Setup( + const char * label, chip::app::Clusters::CameraAvStreamManagement::Structs::RateDistortionTradeOffPointsStruct::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("RateDistortionTradeOffPointsStruct.codec", "codec", value.isMember("codec"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("RateDistortionTradeOffPointsStruct.resolution", "resolution", + value.isMember("resolution"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("RateDistortionTradeOffPointsStruct.minBitRate", "minBitRate", + value.isMember("minBitRate"))); + + char labelWithMember[kMaxLabelLength]; + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "codec"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.codec, value["codec"])); + valueCopy.removeMember("codec"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "resolution"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.resolution, value["resolution"])); + valueCopy.removeMember("resolution"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "minBitRate"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.minBitRate, value["minBitRate"])); + valueCopy.removeMember("minBitRate"); + + return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); +} + +void ComplexArgumentParser::Finalize( + chip::app::Clusters::CameraAvStreamManagement::Structs::RateDistortionTradeOffPointsStruct::Type & request) +{ + ComplexArgumentParser::Finalize(request.codec); + ComplexArgumentParser::Finalize(request.resolution); + ComplexArgumentParser::Finalize(request.minBitRate); +} + +CHIP_ERROR +ComplexArgumentParser::Setup(const char * label, + chip::app::Clusters::CameraAvStreamManagement::Structs::AudioCapabilitiesStruct::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("AudioCapabilitiesStruct.maxNumberOfChannels", + "maxNumberOfChannels", value.isMember("maxNumberOfChannels"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("AudioCapabilitiesStruct.supportedCodecs", "supportedCodecs", + value.isMember("supportedCodecs"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("AudioCapabilitiesStruct.supportedSampleRates", + "supportedSampleRates", value.isMember("supportedSampleRates"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("AudioCapabilitiesStruct.supportedBitDepths", + "supportedBitDepths", value.isMember("supportedBitDepths"))); + + char labelWithMember[kMaxLabelLength]; + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "maxNumberOfChannels"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.maxNumberOfChannels, value["maxNumberOfChannels"])); + valueCopy.removeMember("maxNumberOfChannels"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "supportedCodecs"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.supportedCodecs, value["supportedCodecs"])); + valueCopy.removeMember("supportedCodecs"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "supportedSampleRates"); + ReturnErrorOnFailure( + ComplexArgumentParser::Setup(labelWithMember, request.supportedSampleRates, value["supportedSampleRates"])); + valueCopy.removeMember("supportedSampleRates"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "supportedBitDepths"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.supportedBitDepths, value["supportedBitDepths"])); + valueCopy.removeMember("supportedBitDepths"); + + return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); +} + +void ComplexArgumentParser::Finalize( + chip::app::Clusters::CameraAvStreamManagement::Structs::AudioCapabilitiesStruct::Type & request) +{ + ComplexArgumentParser::Finalize(request.maxNumberOfChannels); + ComplexArgumentParser::Finalize(request.supportedCodecs); + ComplexArgumentParser::Finalize(request.supportedSampleRates); + ComplexArgumentParser::Finalize(request.supportedBitDepths); +} + +CHIP_ERROR ComplexArgumentParser::Setup(const char * label, + chip::app::Clusters::CameraAvStreamManagement::Structs::AudioStreamStruct::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("AudioStreamStruct.audioStreamID", "audioStreamID", + value.isMember("audioStreamID"))); + ReturnErrorOnFailure( + ComplexArgumentParser::EnsureMemberExist("AudioStreamStruct.streamType", "streamType", value.isMember("streamType"))); + ReturnErrorOnFailure( + ComplexArgumentParser::EnsureMemberExist("AudioStreamStruct.audioCodec", "audioCodec", value.isMember("audioCodec"))); + ReturnErrorOnFailure( + ComplexArgumentParser::EnsureMemberExist("AudioStreamStruct.channelCount", "channelCount", value.isMember("channelCount"))); + ReturnErrorOnFailure( + ComplexArgumentParser::EnsureMemberExist("AudioStreamStruct.sampleRate", "sampleRate", value.isMember("sampleRate"))); + ReturnErrorOnFailure( + ComplexArgumentParser::EnsureMemberExist("AudioStreamStruct.bitRate", "bitRate", value.isMember("bitRate"))); + ReturnErrorOnFailure( + ComplexArgumentParser::EnsureMemberExist("AudioStreamStruct.bitDepth", "bitDepth", value.isMember("bitDepth"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("AudioStreamStruct.referenceCount", "referenceCount", + value.isMember("referenceCount"))); + + char labelWithMember[kMaxLabelLength]; + 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, "streamType"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.streamType, value["streamType"])); + valueCopy.removeMember("streamType"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "audioCodec"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.audioCodec, value["audioCodec"])); + valueCopy.removeMember("audioCodec"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "channelCount"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.channelCount, value["channelCount"])); + valueCopy.removeMember("channelCount"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "sampleRate"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.sampleRate, value["sampleRate"])); + valueCopy.removeMember("sampleRate"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "bitRate"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.bitRate, value["bitRate"])); + valueCopy.removeMember("bitRate"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "bitDepth"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.bitDepth, value["bitDepth"])); + valueCopy.removeMember("bitDepth"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "referenceCount"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.referenceCount, value["referenceCount"])); + valueCopy.removeMember("referenceCount"); + + return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); +} + +void ComplexArgumentParser::Finalize(chip::app::Clusters::CameraAvStreamManagement::Structs::AudioStreamStruct::Type & request) +{ + ComplexArgumentParser::Finalize(request.audioStreamID); + ComplexArgumentParser::Finalize(request.streamType); + ComplexArgumentParser::Finalize(request.audioCodec); + ComplexArgumentParser::Finalize(request.channelCount); + ComplexArgumentParser::Finalize(request.sampleRate); + ComplexArgumentParser::Finalize(request.bitRate); + ComplexArgumentParser::Finalize(request.bitDepth); + ComplexArgumentParser::Finalize(request.referenceCount); +} + +CHIP_ERROR +ComplexArgumentParser::Setup(const char * label, + chip::app::Clusters::CameraAvStreamManagement::Structs::VideoSensorParamsStruct::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("VideoSensorParamsStruct.sensorWidth", "sensorWidth", + value.isMember("sensorWidth"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("VideoSensorParamsStruct.sensorHeight", "sensorHeight", + value.isMember("sensorHeight"))); + ReturnErrorOnFailure( + ComplexArgumentParser::EnsureMemberExist("VideoSensorParamsStruct.HDRCapable", "HDRCapable", value.isMember("HDRCapable"))); + ReturnErrorOnFailure( + ComplexArgumentParser::EnsureMemberExist("VideoSensorParamsStruct.maxFPS", "maxFPS", value.isMember("maxFPS"))); + ReturnErrorOnFailure( + ComplexArgumentParser::EnsureMemberExist("VideoSensorParamsStruct.maxHDRFPS", "maxHDRFPS", value.isMember("maxHDRFPS"))); + + char labelWithMember[kMaxLabelLength]; + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "sensorWidth"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.sensorWidth, value["sensorWidth"])); + valueCopy.removeMember("sensorWidth"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "sensorHeight"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.sensorHeight, value["sensorHeight"])); + valueCopy.removeMember("sensorHeight"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "HDRCapable"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.HDRCapable, value["HDRCapable"])); + valueCopy.removeMember("HDRCapable"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "maxFPS"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.maxFPS, value["maxFPS"])); + valueCopy.removeMember("maxFPS"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "maxHDRFPS"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.maxHDRFPS, value["maxHDRFPS"])); + valueCopy.removeMember("maxHDRFPS"); + + return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); +} + +void ComplexArgumentParser::Finalize( + chip::app::Clusters::CameraAvStreamManagement::Structs::VideoSensorParamsStruct::Type & request) +{ + ComplexArgumentParser::Finalize(request.sensorWidth); + ComplexArgumentParser::Finalize(request.sensorHeight); + ComplexArgumentParser::Finalize(request.HDRCapable); + ComplexArgumentParser::Finalize(request.maxFPS); + ComplexArgumentParser::Finalize(request.maxHDRFPS); +} + 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 777f61afb98aed..cac80ee84c4529 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h @@ -86,6 +86,16 @@ static CHIP_ERROR Setup(const char * label, chip::app::Clusters::detail::Structs static void Finalize(chip::app::Clusters::detail::Structs::OperationalStateStruct::Type & request); +static CHIP_ERROR Setup(const char * label, chip::app::Clusters::detail::Structs::PerStreamStruct::Type & request, + Json::Value & value); + +static void Finalize(chip::app::Clusters::detail::Structs::PerStreamStruct::Type & request); + +static CHIP_ERROR Setup(const char * label, chip::app::Clusters::detail::Structs::ViewportStruct::Type & request, + Json::Value & value); + +static void Finalize(chip::app::Clusters::detail::Structs::ViewportStruct::Type & request); + static CHIP_ERROR Setup(const char * label, chip::app::Clusters::detail::Structs::WebRTCSessionStruct::Type & request, Json::Value & value); @@ -668,6 +678,54 @@ static CHIP_ERROR Setup(const char * label, chip::app::Clusters::ContentControl: static void Finalize(chip::app::Clusters::ContentControl::Structs::RatingNameStruct::Type & request); +static CHIP_ERROR Setup(const char * label, + chip::app::Clusters::CameraAvStreamManagement::Structs::VideoResolutionStruct::Type & request, + Json::Value & value); + +static void Finalize(chip::app::Clusters::CameraAvStreamManagement::Structs::VideoResolutionStruct::Type & request); + +static CHIP_ERROR Setup(const char * label, + chip::app::Clusters::CameraAvStreamManagement::Structs::VideoStreamStruct::Type & request, + Json::Value & value); + +static void Finalize(chip::app::Clusters::CameraAvStreamManagement::Structs::VideoStreamStruct::Type & request); + +static CHIP_ERROR Setup(const char * label, + chip::app::Clusters::CameraAvStreamManagement::Structs::SnapshotStreamStruct::Type & request, + Json::Value & value); + +static void Finalize(chip::app::Clusters::CameraAvStreamManagement::Structs::SnapshotStreamStruct::Type & request); + +static CHIP_ERROR Setup(const char * label, + chip::app::Clusters::CameraAvStreamManagement::Structs::SnapshotParamsStruct::Type & request, + Json::Value & value); + +static void Finalize(chip::app::Clusters::CameraAvStreamManagement::Structs::SnapshotParamsStruct::Type & request); + +static CHIP_ERROR Setup(const char * label, + chip::app::Clusters::CameraAvStreamManagement::Structs::RateDistortionTradeOffPointsStruct::Type & request, + Json::Value & value); + +static void Finalize(chip::app::Clusters::CameraAvStreamManagement::Structs::RateDistortionTradeOffPointsStruct::Type & request); + +static CHIP_ERROR Setup(const char * label, + chip::app::Clusters::CameraAvStreamManagement::Structs::AudioCapabilitiesStruct::Type & request, + Json::Value & value); + +static void Finalize(chip::app::Clusters::CameraAvStreamManagement::Structs::AudioCapabilitiesStruct::Type & request); + +static CHIP_ERROR Setup(const char * label, + chip::app::Clusters::CameraAvStreamManagement::Structs::AudioStreamStruct::Type & request, + Json::Value & value); + +static void Finalize(chip::app::Clusters::CameraAvStreamManagement::Structs::AudioStreamStruct::Type & request); + +static CHIP_ERROR Setup(const char * label, + chip::app::Clusters::CameraAvStreamManagement::Structs::VideoSensorParamsStruct::Type & request, + Json::Value & value); + +static void Finalize(chip::app::Clusters::CameraAvStreamManagement::Structs::VideoSensorParamsStruct::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 c6682c0350a921..067eadeca349a0 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp @@ -465,6 +465,72 @@ 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 chip::app::Clusters::detail::Structs::PerStreamStruct::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = LogValue("StreamID", indent + 1, value.streamID); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'StreamID'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("Enabled", indent + 1, value.enabled); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Enabled'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} + +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const chip::app::Clusters::detail::Structs::ViewportStruct::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = LogValue("X1", indent + 1, value.x1); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'X1'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("Y1", indent + 1, value.y1); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Y1'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("X2", indent + 1, value.x2); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'X2'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("Y2", indent + 1, value.y2); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Y2'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} + CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const chip::app::Clusters::detail::Structs::WebRTCSessionStruct::DecodableType & value) { @@ -5103,23 +5169,24 @@ 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 chip::app::Clusters::Chime::Structs::ChimeSoundStruct::DecodableType & value) +CHIP_ERROR DataModelLogger::LogValue( + const char * label, size_t indent, + const chip::app::Clusters::CameraAvStreamManagement::Structs::VideoResolutionStruct::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = LogValue("ChimeID", indent + 1, value.chimeID); + CHIP_ERROR err = LogValue("Width", indent + 1, value.width); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'ChimeID'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Width'"); return err; } } { - CHIP_ERROR err = LogValue("Name", indent + 1, value.name); + CHIP_ERROR err = LogValue("Height", indent + 1, value.height); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Name'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Height'"); return err; } } @@ -5130,112 +5197,102 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const chip::app::Clusters::EcosystemInformation::Structs::EcosystemDeviceStruct::DecodableType & value) + const chip::app::Clusters::CameraAvStreamManagement::Structs::VideoStreamStruct::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = LogValue("DeviceName", indent + 1, value.deviceName); + 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 'DeviceName'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'VideoStreamID'"); return err; } } { - CHIP_ERROR err = LogValue("DeviceNameLastEdit", indent + 1, value.deviceNameLastEdit); + 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 'DeviceNameLastEdit'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'StreamType'"); return err; } } { - CHIP_ERROR err = LogValue("BridgedEndpoint", indent + 1, value.bridgedEndpoint); + CHIP_ERROR err = LogValue("VideoCodec", indent + 1, value.videoCodec); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'BridgedEndpoint'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'VideoCodec'"); return err; } } { - CHIP_ERROR err = LogValue("OriginalEndpoint", indent + 1, value.originalEndpoint); + CHIP_ERROR err = LogValue("MinFrameRate", indent + 1, value.minFrameRate); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'OriginalEndpoint'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'MinFrameRate'"); return err; } } { - CHIP_ERROR err = LogValue("DeviceTypes", indent + 1, value.deviceTypes); + CHIP_ERROR err = LogValue("MaxFrameRate", indent + 1, value.maxFrameRate); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'DeviceTypes'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'MaxFrameRate'"); return err; } } { - CHIP_ERROR err = LogValue("UniqueLocationIDs", indent + 1, value.uniqueLocationIDs); + CHIP_ERROR err = LogValue("MinResolution", indent + 1, value.minResolution); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'UniqueLocationIDs'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'MinResolution'"); return err; } } { - CHIP_ERROR err = LogValue("UniqueLocationIDsLastEdit", indent + 1, value.uniqueLocationIDsLastEdit); + CHIP_ERROR err = LogValue("MaxResolution", indent + 1, value.maxResolution); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'UniqueLocationIDsLastEdit'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'MaxResolution'"); return err; } } { - CHIP_ERROR err = LogValue("FabricIndex", indent + 1, value.fabricIndex); + CHIP_ERROR err = LogValue("MinBitRate", indent + 1, value.minBitRate); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'FabricIndex'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'MinBitRate'"); return err; } } - DataModelLogger::LogString(indent, "}"); - - return CHIP_NO_ERROR; -} - -CHIP_ERROR -DataModelLogger::LogValue(const char * label, size_t indent, - const chip::app::Clusters::EcosystemInformation::Structs::EcosystemLocationStruct::DecodableType & value) -{ - DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = LogValue("UniqueLocationID", indent + 1, value.uniqueLocationID); + CHIP_ERROR err = LogValue("MaxBitRate", indent + 1, value.maxBitRate); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'UniqueLocationID'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'MaxBitRate'"); return err; } } { - CHIP_ERROR err = LogValue("LocationDescriptor", indent + 1, value.locationDescriptor); + CHIP_ERROR err = LogValue("MinFragmentLen", indent + 1, value.minFragmentLen); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'LocationDescriptor'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'MinFragmentLen'"); return err; } } { - CHIP_ERROR err = LogValue("LocationDescriptorLastEdit", indent + 1, value.locationDescriptorLastEdit); + CHIP_ERROR err = LogValue("MaxFragmentLen", indent + 1, value.maxFragmentLen); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'LocationDescriptorLastEdit'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'MaxFragmentLen'"); return err; } } { - CHIP_ERROR err = LogValue("FabricIndex", indent + 1, value.fabricIndex); + CHIP_ERROR err = LogValue("ReferenceCount", indent + 1, value.referenceCount); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'FabricIndex'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'ReferenceCount'"); return err; } } @@ -5244,79 +5301,72 @@ DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } -CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const chip::app::Clusters::UnitTesting::Structs::SimpleStruct::DecodableType & value) +CHIP_ERROR +DataModelLogger::LogValue(const char * label, size_t indent, + const chip::app::Clusters::CameraAvStreamManagement::Structs::SnapshotStreamStruct::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = LogValue("A", indent + 1, value.a); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'A'"); - return err; - } - } - { - CHIP_ERROR err = LogValue("B", indent + 1, value.b); + CHIP_ERROR err = LogValue("SnapshotStreamID", indent + 1, value.snapshotStreamID); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'B'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'SnapshotStreamID'"); return err; } } { - CHIP_ERROR err = LogValue("C", indent + 1, value.c); + CHIP_ERROR err = LogValue("ImageCodec", indent + 1, value.imageCodec); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'C'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'ImageCodec'"); return err; } } { - CHIP_ERROR err = LogValue("D", indent + 1, value.d); + CHIP_ERROR err = LogValue("FrameRate", indent + 1, value.frameRate); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'D'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'FrameRate'"); return err; } } { - CHIP_ERROR err = LogValue("E", indent + 1, value.e); + CHIP_ERROR err = LogValue("BitRate", indent + 1, value.bitRate); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'E'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'BitRate'"); return err; } } { - CHIP_ERROR err = LogValue("F", indent + 1, value.f); + CHIP_ERROR err = LogValue("MinResolution", indent + 1, value.minResolution); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'F'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'MinResolution'"); return err; } } { - CHIP_ERROR err = LogValue("G", indent + 1, value.g); + CHIP_ERROR err = LogValue("MaxResolution", indent + 1, value.maxResolution); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'G'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'MaxResolution'"); return err; } } { - CHIP_ERROR err = LogValue("H", indent + 1, value.h); + CHIP_ERROR err = LogValue("Quality", indent + 1, value.quality); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'H'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Quality'"); return err; } } { - CHIP_ERROR err = LogValue("I", indent + 1, value.i); + CHIP_ERROR err = LogValue("ReferenceCount", indent + 1, value.referenceCount); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'I'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'ReferenceCount'"); return err; } } @@ -5325,72 +5375,66 @@ 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 chip::app::Clusters::UnitTesting::Structs::TestFabricScoped::DecodableType & value) +CHIP_ERROR +DataModelLogger::LogValue(const char * label, size_t indent, + const chip::app::Clusters::CameraAvStreamManagement::Structs::SnapshotParamsStruct::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = LogValue("FabricSensitiveInt8u", indent + 1, value.fabricSensitiveInt8u); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'FabricSensitiveInt8u'"); - return err; - } - } - { - CHIP_ERROR err = LogValue("OptionalFabricSensitiveInt8u", indent + 1, value.optionalFabricSensitiveInt8u); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'OptionalFabricSensitiveInt8u'"); - return err; - } - } - { - CHIP_ERROR err = LogValue("NullableFabricSensitiveInt8u", indent + 1, value.nullableFabricSensitiveInt8u); + CHIP_ERROR err = LogValue("Resolution", indent + 1, value.resolution); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'NullableFabricSensitiveInt8u'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Resolution'"); return err; } } { - CHIP_ERROR err = LogValue("NullableOptionalFabricSensitiveInt8u", indent + 1, value.nullableOptionalFabricSensitiveInt8u); + CHIP_ERROR err = LogValue("MaxFrameRate", indent + 1, value.maxFrameRate); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, - "Struct truncated due to invalid value for 'NullableOptionalFabricSensitiveInt8u'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'MaxFrameRate'"); return err; } } { - CHIP_ERROR err = LogValue("FabricSensitiveCharString", indent + 1, value.fabricSensitiveCharString); + CHIP_ERROR err = LogValue("ImageCodec", indent + 1, value.imageCodec); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'FabricSensitiveCharString'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'ImageCodec'"); return err; } } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} + +CHIP_ERROR DataModelLogger::LogValue( + const char * label, size_t indent, + const chip::app::Clusters::CameraAvStreamManagement::Structs::RateDistortionTradeOffPointsStruct::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = LogValue("FabricSensitiveStruct", indent + 1, value.fabricSensitiveStruct); + CHIP_ERROR err = LogValue("Codec", indent + 1, value.codec); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'FabricSensitiveStruct'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Codec'"); return err; } } { - CHIP_ERROR err = LogValue("FabricSensitiveInt8uList", indent + 1, value.fabricSensitiveInt8uList); + CHIP_ERROR err = LogValue("Resolution", indent + 1, value.resolution); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'FabricSensitiveInt8uList'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Resolution'"); return err; } } { - CHIP_ERROR err = LogValue("FabricIndex", indent + 1, value.fabricIndex); + CHIP_ERROR err = LogValue("MinBitRate", indent + 1, value.minBitRate); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'FabricIndex'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'MinBitRate'"); return err; } } @@ -5399,104 +5443,114 @@ 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 chip::app::Clusters::UnitTesting::Structs::NullablesAndOptionalsStruct::DecodableType & value) +CHIP_ERROR DataModelLogger::LogValue( + const char * label, size_t indent, + const chip::app::Clusters::CameraAvStreamManagement::Structs::AudioCapabilitiesStruct::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = LogValue("NullableInt", indent + 1, value.nullableInt); + CHIP_ERROR err = LogValue("MaxNumberOfChannels", indent + 1, value.maxNumberOfChannels); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'NullableInt'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'MaxNumberOfChannels'"); return err; } } { - CHIP_ERROR err = LogValue("OptionalInt", indent + 1, value.optionalInt); + CHIP_ERROR err = LogValue("SupportedCodecs", indent + 1, value.supportedCodecs); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'OptionalInt'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'SupportedCodecs'"); return err; } } { - CHIP_ERROR err = LogValue("NullableOptionalInt", indent + 1, value.nullableOptionalInt); + CHIP_ERROR err = LogValue("SupportedSampleRates", indent + 1, value.supportedSampleRates); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'NullableOptionalInt'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'SupportedSampleRates'"); return err; } } { - CHIP_ERROR err = LogValue("NullableString", indent + 1, value.nullableString); + CHIP_ERROR err = LogValue("SupportedBitDepths", indent + 1, value.supportedBitDepths); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'NullableString'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'SupportedBitDepths'"); return err; } } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} + +CHIP_ERROR +DataModelLogger::LogValue(const char * label, size_t indent, + const chip::app::Clusters::CameraAvStreamManagement::Structs::AudioStreamStruct::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = LogValue("OptionalString", indent + 1, value.optionalString); + 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 'OptionalString'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'AudioStreamID'"); return err; } } { - CHIP_ERROR err = LogValue("NullableOptionalString", indent + 1, value.nullableOptionalString); + 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 'NullableOptionalString'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'StreamType'"); return err; } } { - CHIP_ERROR err = LogValue("NullableStruct", indent + 1, value.nullableStruct); + CHIP_ERROR err = LogValue("AudioCodec", indent + 1, value.audioCodec); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'NullableStruct'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'AudioCodec'"); return err; } } { - CHIP_ERROR err = LogValue("OptionalStruct", indent + 1, value.optionalStruct); + CHIP_ERROR err = LogValue("ChannelCount", indent + 1, value.channelCount); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'OptionalStruct'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'ChannelCount'"); return err; } } { - CHIP_ERROR err = LogValue("NullableOptionalStruct", indent + 1, value.nullableOptionalStruct); + CHIP_ERROR err = LogValue("SampleRate", indent + 1, value.sampleRate); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'NullableOptionalStruct'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'SampleRate'"); return err; } } { - CHIP_ERROR err = LogValue("NullableList", indent + 1, value.nullableList); + CHIP_ERROR err = LogValue("BitRate", indent + 1, value.bitRate); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'NullableList'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'BitRate'"); return err; } } { - CHIP_ERROR err = LogValue("OptionalList", indent + 1, value.optionalList); + CHIP_ERROR err = LogValue("BitDepth", indent + 1, value.bitDepth); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'OptionalList'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'BitDepth'"); return err; } } { - CHIP_ERROR err = LogValue("NullableOptionalList", indent + 1, value.nullableOptionalList); + CHIP_ERROR err = LogValue("ReferenceCount", indent + 1, value.referenceCount); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'NullableOptionalList'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'ReferenceCount'"); return err; } } @@ -5505,39 +5559,48 @@ DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } -CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const chip::app::Clusters::UnitTesting::Structs::NestedStruct::DecodableType & value) +CHIP_ERROR DataModelLogger::LogValue( + const char * label, size_t indent, + const chip::app::Clusters::CameraAvStreamManagement::Structs::VideoSensorParamsStruct::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = LogValue("A", indent + 1, value.a); + CHIP_ERROR err = LogValue("SensorWidth", indent + 1, value.sensorWidth); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'A'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'SensorWidth'"); return err; } } { - CHIP_ERROR err = LogValue("B", indent + 1, value.b); + CHIP_ERROR err = LogValue("SensorHeight", indent + 1, value.sensorHeight); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'B'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'SensorHeight'"); return err; } } { - CHIP_ERROR err = LogValue("C", indent + 1, value.c); + CHIP_ERROR err = LogValue("HDRCapable", indent + 1, value.HDRCapable); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'C'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'HDRCapable'"); return err; } } { - CHIP_ERROR err = LogValue("D", indent + 1, value.d); + CHIP_ERROR err = LogValue("MaxFPS", indent + 1, value.maxFPS); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'D'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'MaxFPS'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("MaxHDRFPS", indent + 1, value.maxHDRFPS); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'MaxHDRFPS'"); return err; } } @@ -5547,30 +5610,473 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, } CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const chip::app::Clusters::UnitTesting::Structs::NestedStructList::DecodableType & value) + const chip::app::Clusters::Chime::Structs::ChimeSoundStruct::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = LogValue("A", indent + 1, value.a); + CHIP_ERROR err = LogValue("ChimeID", indent + 1, value.chimeID); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'A'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'ChimeID'"); return err; } } { - CHIP_ERROR err = LogValue("B", indent + 1, value.b); + CHIP_ERROR err = LogValue("Name", indent + 1, value.name); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'B'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Name'"); return err; } } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} + +CHIP_ERROR +DataModelLogger::LogValue(const char * label, size_t indent, + const chip::app::Clusters::EcosystemInformation::Structs::EcosystemDeviceStruct::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = LogValue("C", indent + 1, value.c); + CHIP_ERROR err = LogValue("DeviceName", indent + 1, value.deviceName); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'C'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'DeviceName'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("DeviceNameLastEdit", indent + 1, value.deviceNameLastEdit); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'DeviceNameLastEdit'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("BridgedEndpoint", indent + 1, value.bridgedEndpoint); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'BridgedEndpoint'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("OriginalEndpoint", indent + 1, value.originalEndpoint); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'OriginalEndpoint'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("DeviceTypes", indent + 1, value.deviceTypes); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'DeviceTypes'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("UniqueLocationIDs", indent + 1, value.uniqueLocationIDs); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'UniqueLocationIDs'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("UniqueLocationIDsLastEdit", indent + 1, value.uniqueLocationIDsLastEdit); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'UniqueLocationIDsLastEdit'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("FabricIndex", indent + 1, value.fabricIndex); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'FabricIndex'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} + +CHIP_ERROR +DataModelLogger::LogValue(const char * label, size_t indent, + const chip::app::Clusters::EcosystemInformation::Structs::EcosystemLocationStruct::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = LogValue("UniqueLocationID", indent + 1, value.uniqueLocationID); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'UniqueLocationID'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("LocationDescriptor", indent + 1, value.locationDescriptor); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'LocationDescriptor'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("LocationDescriptorLastEdit", indent + 1, value.locationDescriptorLastEdit); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'LocationDescriptorLastEdit'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("FabricIndex", indent + 1, value.fabricIndex); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'FabricIndex'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} + +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const chip::app::Clusters::UnitTesting::Structs::SimpleStruct::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = LogValue("A", indent + 1, value.a); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'A'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("B", indent + 1, value.b); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'B'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("C", indent + 1, value.c); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'C'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("D", indent + 1, value.d); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'D'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("E", indent + 1, value.e); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'E'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("F", indent + 1, value.f); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'F'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("G", indent + 1, value.g); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'G'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("H", indent + 1, value.h); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'H'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("I", indent + 1, value.i); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'I'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} + +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const chip::app::Clusters::UnitTesting::Structs::TestFabricScoped::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = LogValue("FabricSensitiveInt8u", indent + 1, value.fabricSensitiveInt8u); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'FabricSensitiveInt8u'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("OptionalFabricSensitiveInt8u", indent + 1, value.optionalFabricSensitiveInt8u); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'OptionalFabricSensitiveInt8u'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("NullableFabricSensitiveInt8u", indent + 1, value.nullableFabricSensitiveInt8u); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'NullableFabricSensitiveInt8u'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("NullableOptionalFabricSensitiveInt8u", indent + 1, value.nullableOptionalFabricSensitiveInt8u); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, + "Struct truncated due to invalid value for 'NullableOptionalFabricSensitiveInt8u'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("FabricSensitiveCharString", indent + 1, value.fabricSensitiveCharString); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'FabricSensitiveCharString'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("FabricSensitiveStruct", indent + 1, value.fabricSensitiveStruct); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'FabricSensitiveStruct'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("FabricSensitiveInt8uList", indent + 1, value.fabricSensitiveInt8uList); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'FabricSensitiveInt8uList'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("FabricIndex", indent + 1, value.fabricIndex); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'FabricIndex'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} + +CHIP_ERROR +DataModelLogger::LogValue(const char * label, size_t indent, + const chip::app::Clusters::UnitTesting::Structs::NullablesAndOptionalsStruct::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = LogValue("NullableInt", indent + 1, value.nullableInt); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'NullableInt'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("OptionalInt", indent + 1, value.optionalInt); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'OptionalInt'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("NullableOptionalInt", indent + 1, value.nullableOptionalInt); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'NullableOptionalInt'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("NullableString", indent + 1, value.nullableString); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'NullableString'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("OptionalString", indent + 1, value.optionalString); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'OptionalString'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("NullableOptionalString", indent + 1, value.nullableOptionalString); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'NullableOptionalString'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("NullableStruct", indent + 1, value.nullableStruct); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'NullableStruct'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("OptionalStruct", indent + 1, value.optionalStruct); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'OptionalStruct'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("NullableOptionalStruct", indent + 1, value.nullableOptionalStruct); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'NullableOptionalStruct'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("NullableList", indent + 1, value.nullableList); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'NullableList'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("OptionalList", indent + 1, value.optionalList); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'OptionalList'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("NullableOptionalList", indent + 1, value.nullableOptionalList); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'NullableOptionalList'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} + +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const chip::app::Clusters::UnitTesting::Structs::NestedStruct::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = LogValue("A", indent + 1, value.a); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'A'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("B", indent + 1, value.b); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'B'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("C", indent + 1, value.c); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'C'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("D", indent + 1, value.d); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'D'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} + +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const chip::app::Clusters::UnitTesting::Structs::NestedStructList::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = LogValue("A", indent + 1, value.a); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'A'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("B", indent + 1, value.b); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'B'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("C", indent + 1, value.c); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'C'"); return err; } } @@ -7952,66 +8458,298 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, } } { - CHIP_ERROR err = DataModelLogger::LogValue("SampledPosition", indent + 1, value.sampledPosition); + CHIP_ERROR err = DataModelLogger::LogValue("SampledPosition", indent + 1, value.sampledPosition); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'SampledPosition'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("PlaybackSpeed", indent + 1, value.playbackSpeed); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'PlaybackSpeed'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("SeekRangeEnd", indent + 1, value.seekRangeEnd); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'SeekRangeEnd'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("SeekRangeStart", indent + 1, value.seekRangeStart); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'SeekRangeStart'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("Data", indent + 1, value.data); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Data'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("AudioAdvanceUnmuted", indent + 1, value.audioAdvanceUnmuted); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'AudioAdvanceUnmuted'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const AccountLogin::Events::LoggedOut::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = DataModelLogger::LogValue("Node", indent + 1, value.node); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Node'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const ContentControl::Events::RemainingScreenTimeExpired::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const CameraAvStreamManagement::Events::VideoStreamChanged::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = DataModelLogger::LogValue("VideoStreamID", indent + 1, value.videoStreamID); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'VideoStreamID'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("StreamType", indent + 1, value.streamType); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'StreamType'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("VideoCodec", indent + 1, value.videoCodec); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'VideoCodec'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("MinFrameRate", indent + 1, value.minFrameRate); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'MinFrameRate'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("MaxFrameRate", indent + 1, value.maxFrameRate); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'MaxFrameRate'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("MinResolution", indent + 1, value.minResolution); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'MinResolution'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("MaxResolution", indent + 1, value.maxResolution); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'MaxResolution'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("MinBitRate", indent + 1, value.minBitRate); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'MinBitRate'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("MaxBitRate", indent + 1, value.maxBitRate); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'MaxBitRate'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("MinFragmentLen", indent + 1, value.minFragmentLen); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'MinFragmentLen'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("MaxFragmentLen", indent + 1, value.maxFragmentLen); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'MaxFragmentLen'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const CameraAvStreamManagement::Events::AudioStreamChanged::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = DataModelLogger::LogValue("AudioStreamID", indent + 1, value.audioStreamID); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'AudioStreamID'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("StreamType", indent + 1, value.streamType); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'StreamType'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("AudioCodec", indent + 1, value.audioCodec); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'AudioCodec'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("ChannelCount", indent + 1, value.channelCount); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'ChannelCount'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("SampleRate", indent + 1, value.sampleRate); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'SampleRate'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("BitRate", indent + 1, value.bitRate); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'BitRate'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("BitDepth", indent + 1, value.bitDepth); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'BitDepth'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const CameraAvStreamManagement::Events::SnapshotStreamChanged::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = DataModelLogger::LogValue("SnapshotStreamID", indent + 1, value.snapshotStreamID); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'SampledPosition'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'SnapshotStreamID'"); return err; } } { - CHIP_ERROR err = DataModelLogger::LogValue("PlaybackSpeed", indent + 1, value.playbackSpeed); + CHIP_ERROR err = DataModelLogger::LogValue("ImageCodec", indent + 1, value.imageCodec); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'PlaybackSpeed'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'ImageCodec'"); return err; } } { - CHIP_ERROR err = DataModelLogger::LogValue("SeekRangeEnd", indent + 1, value.seekRangeEnd); + CHIP_ERROR err = DataModelLogger::LogValue("FrameRate", indent + 1, value.frameRate); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'SeekRangeEnd'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'FrameRate'"); return err; } } { - CHIP_ERROR err = DataModelLogger::LogValue("SeekRangeStart", indent + 1, value.seekRangeStart); + CHIP_ERROR err = DataModelLogger::LogValue("BitRate", indent + 1, value.bitRate); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'SeekRangeStart'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'BitRate'"); return err; } } { - CHIP_ERROR err = DataModelLogger::LogValue("Data", indent + 1, value.data); + CHIP_ERROR err = DataModelLogger::LogValue("MinResolution", indent + 1, value.minResolution); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Data'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'MinResolution'"); return err; } } { - CHIP_ERROR err = DataModelLogger::LogValue("AudioAdvanceUnmuted", indent + 1, value.audioAdvanceUnmuted); + CHIP_ERROR err = DataModelLogger::LogValue("MaxResolution", indent + 1, value.maxResolution); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'AudioAdvanceUnmuted'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'MaxResolution'"); return err; } } - DataModelLogger::LogString(indent, "}"); - - return CHIP_NO_ERROR; -} -CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const AccountLogin::Events::LoggedOut::DecodableType & value) -{ - DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("Node", indent + 1, value.node); + CHIP_ERROR err = DataModelLogger::LogValue("Quality", indent + 1, value.quality); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Node'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Quality'"); return err; } } @@ -8019,14 +8757,6 @@ 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 ContentControl::Events::RemainingScreenTimeExpired::DecodableType & value) -{ - DataModelLogger::LogString(label, indent, "{"); - DataModelLogger::LogString(indent, "}"); - - return CHIP_NO_ERROR; -} CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const CommissionerControl::Events::CommissioningRequestResult::DecodableType & value) { @@ -8847,6 +9577,41 @@ 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 CameraAvStreamManagement::Commands::AudioStreamAllocateResponse::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + ReturnErrorOnFailure(DataModelLogger::LogValue("audioStreamID", indent + 1, value.audioStreamID)); + DataModelLogger::LogString(indent, "}"); + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const CameraAvStreamManagement::Commands::VideoStreamAllocateResponse::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + ReturnErrorOnFailure(DataModelLogger::LogValue("videoStreamID", indent + 1, value.videoStreamID)); + DataModelLogger::LogString(indent, "}"); + return CHIP_NO_ERROR; +} +CHIP_ERROR +DataModelLogger::LogValue(const char * label, size_t indent, + const CameraAvStreamManagement::Commands::SnapshotStreamAllocateResponse::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + ReturnErrorOnFailure(DataModelLogger::LogValue("snapshotStreamID", indent + 1, value.snapshotStreamID)); + DataModelLogger::LogString(indent, "}"); + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const CameraAvStreamManagement::Commands::CaptureSnapshotResponse::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + ReturnErrorOnFailure(DataModelLogger::LogValue("data", indent + 1, value.data)); + ReturnErrorOnFailure(DataModelLogger::LogValue("imageCodec", indent + 1, value.imageCodec)); + ReturnErrorOnFailure(DataModelLogger::LogValue("resolution", indent + 1, value.resolution)); + DataModelLogger::LogString(indent, "}"); + return CHIP_NO_ERROR; +} CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const WebRTCTransportProvider::Commands::SolicitOfferResponse::DecodableType & value) { @@ -18075,6 +18840,313 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP } break; } + case CameraAvStreamManagement::Id: { + switch (path.mAttributeId) + { + case CameraAvStreamManagement::Attributes::MaxConcurrentVideoEncoders::Id: { + uint8_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("MaxConcurrentVideoEncoders", 1, value); + } + case CameraAvStreamManagement::Attributes::MaxEncodedPixelRate::Id: { + uint32_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("MaxEncodedPixelRate", 1, value); + } + case CameraAvStreamManagement::Attributes::VideoSensorParams::Id: { + chip::app::Clusters::CameraAvStreamManagement::Structs::VideoSensorParamsStruct::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("VideoSensorParams", 1, value); + } + case CameraAvStreamManagement::Attributes::NightVisionCapable::Id: { + bool value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("NightVisionCapable", 1, value); + } + case CameraAvStreamManagement::Attributes::MinViewPortWidth::Id: { + chip::app::Clusters::CameraAvStreamManagement::Structs::VideoResolutionStruct::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("MinViewPortWidth", 1, value); + } + case CameraAvStreamManagement::Attributes::MinViewPortHeight::Id: { + chip::app::Clusters::CameraAvStreamManagement::Structs::VideoResolutionStruct::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("MinViewPortHeight", 1, value); + } + case CameraAvStreamManagement::Attributes::RateDistortionTradeOffPoints::Id: { + chip::app::DataModel::DecodableList< + chip::app::Clusters::CameraAvStreamManagement::Structs::RateDistortionTradeOffPointsStruct::DecodableType> + value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("RateDistortionTradeOffPoints", 1, value); + } + case CameraAvStreamManagement::Attributes::MaxPreRollBufferSize::Id: { + uint32_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("MaxPreRollBufferSize", 1, value); + } + case CameraAvStreamManagement::Attributes::MicrophoneCapabilities::Id: { + chip::app::Clusters::CameraAvStreamManagement::Structs::AudioCapabilitiesStruct::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("MicrophoneCapabilities", 1, value); + } + case CameraAvStreamManagement::Attributes::SpeakerCapabilities::Id: { + chip::app::DataModel::Nullable< + chip::app::Clusters::CameraAvStreamManagement::Structs::AudioCapabilitiesStruct::DecodableType> + value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("SpeakerCapabilities", 1, value); + } + case CameraAvStreamManagement::Attributes::TwoWayTalkSupport::Id: { + chip::app::Clusters::CameraAvStreamManagement::TwoWayTalkSupportTypeEnum value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("TwoWayTalkSupport", 1, value); + } + case CameraAvStreamManagement::Attributes::SupportedSnapshotParams::Id: { + chip::app::DataModel::DecodableList< + chip::app::Clusters::CameraAvStreamManagement::Structs::SnapshotParamsStruct::DecodableType> + value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("SupportedSnapshotParams", 1, value); + } + case CameraAvStreamManagement::Attributes::HDRCapable::Id: { + bool value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("HDRCapable", 1, value); + } + case CameraAvStreamManagement::Attributes::MaxNetworkBandwidth::Id: { + uint32_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("MaxNetworkBandwidth", 1, value); + } + case CameraAvStreamManagement::Attributes::CurrentFrameRate::Id: { + uint16_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("CurrentFrameRate", 1, value); + } + case CameraAvStreamManagement::Attributes::HDRMode::Id: { + bool value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("HDRMode", 1, value); + } + case CameraAvStreamManagement::Attributes::CurrentVideoCodecs::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("CurrentVideoCodecs", 1, value); + } + case CameraAvStreamManagement::Attributes::CurrentSnapshotConfig::Id: { + chip::app::Clusters::CameraAvStreamManagement::Structs::SnapshotParamsStruct::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("CurrentSnapshotConfig", 1, value); + } + case CameraAvStreamManagement::Attributes::FabricsUsingCamera::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("FabricsUsingCamera", 1, value); + } + case CameraAvStreamManagement::Attributes::AllocatedVideoStreams::Id: { + chip::app::DataModel::DecodableList< + chip::app::Clusters::CameraAvStreamManagement::Structs::VideoStreamStruct::DecodableType> + value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("AllocatedVideoStreams", 1, value); + } + case CameraAvStreamManagement::Attributes::AllocatedAudioStreams::Id: { + chip::app::DataModel::DecodableList< + chip::app::Clusters::CameraAvStreamManagement::Structs::AudioStreamStruct::DecodableType> + value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("AllocatedAudioStreams", 1, value); + } + case CameraAvStreamManagement::Attributes::AllocatedSnapshotStreams::Id: { + chip::app::DataModel::DecodableList< + chip::app::Clusters::CameraAvStreamManagement::Structs::SnapshotStreamStruct::DecodableType> + value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("AllocatedSnapshotStreams", 1, value); + } + case CameraAvStreamManagement::Attributes::RankedVideoStreamPrioritiesList::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("RankedVideoStreamPrioritiesList", 1, value); + } + case CameraAvStreamManagement::Attributes::SoftRecordingPrivacyModeSetting::Id: { + bool value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("SoftRecordingPrivacyModeSetting", 1, value); + } + case CameraAvStreamManagement::Attributes::SoftLivestreamPrivacyModeSetting::Id: { + bool value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("SoftLivestreamPrivacyModeSetting", 1, value); + } + case CameraAvStreamManagement::Attributes::HardPrivacyMode::Id: { + bool value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("HardPrivacyMode", 1, value); + } + case CameraAvStreamManagement::Attributes::NightVision::Id: { + chip::app::Clusters::CameraAvStreamManagement::TriStateAutoEnum value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("NightVision", 1, value); + } + case CameraAvStreamManagement::Attributes::NightVisionIllum::Id: { + chip::app::Clusters::CameraAvStreamManagement::TriStateAutoEnum value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("NightVisionIllum", 1, value); + } + case CameraAvStreamManagement::Attributes::Awb::Id: { + bool value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("AWB", 1, value); + } + case CameraAvStreamManagement::Attributes::ShutterSpeed::Id: { + bool value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("ShutterSpeed", 1, value); + } + case CameraAvStreamManagement::Attributes::Iso::Id: { + bool value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("ISO", 1, value); + } + case CameraAvStreamManagement::Attributes::Viewport::Id: { + chip::app::Clusters::CameraAvStreamManagement::Structs::ViewportStruct::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("Viewport", 1, value); + } + case CameraAvStreamManagement::Attributes::SpeakerEnabled::Id: { + bool value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("SpeakerEnabled", 1, value); + } + case CameraAvStreamManagement::Attributes::SpeakerVolumeLevel::Id: { + uint8_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("SpeakerVolumeLevel", 1, value); + } + case CameraAvStreamManagement::Attributes::SpeakerMaxLevel::Id: { + uint8_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("SpeakerMaxLevel", 1, value); + } + case CameraAvStreamManagement::Attributes::SpeakerMinLevel::Id: { + uint8_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("SpeakerMinLevel", 1, value); + } + case CameraAvStreamManagement::Attributes::MicStatus::Id: { + bool value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("MicStatus", 1, value); + } + case CameraAvStreamManagement::Attributes::MicVolumeLevel::Id: { + uint8_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("MicVolumeLevel", 1, value); + } + case CameraAvStreamManagement::Attributes::MicMaxLevel::Id: { + uint8_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("MicMaxLevel", 1, value); + } + case CameraAvStreamManagement::Attributes::MicMinLevel::Id: { + uint8_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("MicMinLevel", 1, value); + } + case CameraAvStreamManagement::Attributes::MicAGCEnabled::Id: { + bool value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("MicAGCEnabled", 1, value); + } + case CameraAvStreamManagement::Attributes::ImageRotation::Id: { + uint16_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("ImageRotation", 1, value); + } + case CameraAvStreamManagement::Attributes::ImageFlipHorizontal::Id: { + bool value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("ImageFlipHorizontal", 1, value); + } + case CameraAvStreamManagement::Attributes::ImageFlipVertical::Id: { + bool value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("ImageFlipVertical", 1, value); + } + case CameraAvStreamManagement::Attributes::LocalVideoRecordingEnabled::Id: { + bool value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("LocalVideoRecordingEnabled", 1, value); + } + case CameraAvStreamManagement::Attributes::LocalSnapshotRecordingEnabled::Id: { + bool value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("LocalSnapshotRecordingEnabled", 1, value); + } + case CameraAvStreamManagement::Attributes::StatusLight::Id: { + bool value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("StatusLight", 1, value); + } + case CameraAvStreamManagement::Attributes::StatusLightBrightness::Id: { + chip::app::Clusters::Globals::ThreeLevelAutoEnum value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("StatusLightBrightness", 1, value); + } + case CameraAvStreamManagement::Attributes::DepthSensorStatus::Id: { + chip::app::Clusters::CameraAvStreamManagement::TriStateAutoEnum value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("DepthSensorStatus", 1, value); + } + case CameraAvStreamManagement::Attributes::WatermarkEnabled::Id: { + chip::app::DataModel::DecodableList< + chip::app::Clusters::CameraAvStreamManagement::Structs::PerStreamStruct::DecodableType> + value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("WatermarkEnabled", 1, value); + } + case CameraAvStreamManagement::Attributes::OSDEnabled::Id: { + chip::app::DataModel::DecodableList< + chip::app::Clusters::CameraAvStreamManagement::Structs::PerStreamStruct::DecodableType> + value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("OSDEnabled", 1, value); + } + case CameraAvStreamManagement::Attributes::GeneratedCommandList::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, CameraAvStreamManagement::Id); + } + case CameraAvStreamManagement::Attributes::AcceptedCommandList::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, CameraAvStreamManagement::Id); + } + case CameraAvStreamManagement::Attributes::EventList::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("EventList", 1, value); + } + case CameraAvStreamManagement::Attributes::AttributeList::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, CameraAvStreamManagement::Id); + } + case CameraAvStreamManagement::Attributes::FeatureMap::Id: { + uint32_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("FeatureMap", 1, value); + } + case CameraAvStreamManagement::Attributes::ClusterRevision::Id: { + uint16_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("ClusterRevision", 1, value); + } + } + break; + } case WebRTCTransportProvider::Id: { switch (path.mAttributeId) { @@ -19468,6 +20540,32 @@ CHIP_ERROR DataModelLogger::LogCommand(const chip::app::ConcreteCommandPath & pa } break; } + case CameraAvStreamManagement::Id: { + switch (path.mCommandId) + { + case CameraAvStreamManagement::Commands::AudioStreamAllocateResponse::Id: { + CameraAvStreamManagement::Commands::AudioStreamAllocateResponse::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("AudioStreamAllocateResponse", 1, value); + } + case CameraAvStreamManagement::Commands::VideoStreamAllocateResponse::Id: { + CameraAvStreamManagement::Commands::VideoStreamAllocateResponse::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("VideoStreamAllocateResponse", 1, value); + } + case CameraAvStreamManagement::Commands::SnapshotStreamAllocateResponse::Id: { + CameraAvStreamManagement::Commands::SnapshotStreamAllocateResponse::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("SnapshotStreamAllocateResponse", 1, value); + } + case CameraAvStreamManagement::Commands::CaptureSnapshotResponse::Id: { + CameraAvStreamManagement::Commands::CaptureSnapshotResponse::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("CaptureSnapshotResponse", 1, value); + } + } + break; + } case WebRTCTransportProvider::Id: { switch (path.mCommandId) { @@ -20397,6 +21495,27 @@ CHIP_ERROR DataModelLogger::LogEvent(const chip::app::EventHeader & header, chip } break; } + case CameraAvStreamManagement::Id: { + switch (header.mPath.mEventId) + { + case CameraAvStreamManagement::Events::VideoStreamChanged::Id: { + chip::app::Clusters::CameraAvStreamManagement::Events::VideoStreamChanged::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("VideoStreamChanged", 1, value); + } + case CameraAvStreamManagement::Events::AudioStreamChanged::Id: { + chip::app::Clusters::CameraAvStreamManagement::Events::AudioStreamChanged::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("AudioStreamChanged", 1, value); + } + case CameraAvStreamManagement::Events::SnapshotStreamChanged::Id: { + chip::app::Clusters::CameraAvStreamManagement::Events::SnapshotStreamChanged::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("SnapshotStreamChanged", 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 05432564bf6f70..b8fa79cdc7b875 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h @@ -59,6 +59,12 @@ static CHIP_ERROR LogValue(const char * label, size_t indent, static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::detail::Structs::OperationalStateStruct::DecodableType & value); +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::detail::Structs::PerStreamStruct::DecodableType & value); + +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::detail::Structs::ViewportStruct::DecodableType & value); + static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::detail::Structs::WebRTCSessionStruct::DecodableType & value); @@ -410,6 +416,36 @@ static CHIP_ERROR LogValue(const char * label, size_t indent, static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::ContentControl::Structs::RatingNameStruct::DecodableType & value); +static CHIP_ERROR +LogValue(const char * label, size_t indent, + const chip::app::Clusters::CameraAvStreamManagement::Structs::VideoResolutionStruct::DecodableType & value); + +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::CameraAvStreamManagement::Structs::VideoStreamStruct::DecodableType & value); + +static CHIP_ERROR +LogValue(const char * label, size_t indent, + const chip::app::Clusters::CameraAvStreamManagement::Structs::SnapshotStreamStruct::DecodableType & value); + +static CHIP_ERROR +LogValue(const char * label, size_t indent, + const chip::app::Clusters::CameraAvStreamManagement::Structs::SnapshotParamsStruct::DecodableType & value); + +static CHIP_ERROR +LogValue(const char * label, size_t indent, + const chip::app::Clusters::CameraAvStreamManagement::Structs::RateDistortionTradeOffPointsStruct::DecodableType & value); + +static CHIP_ERROR +LogValue(const char * label, size_t indent, + const chip::app::Clusters::CameraAvStreamManagement::Structs::AudioCapabilitiesStruct::DecodableType & value); + +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::CameraAvStreamManagement::Structs::AudioStreamStruct::DecodableType & value); + +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::Chime::Structs::ChimeSoundStruct::DecodableType & value); @@ -681,6 +717,13 @@ static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::AccountLogin::Events::LoggedOut::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::ContentControl::Events::RemainingScreenTimeExpired::DecodableType & value); +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::CameraAvStreamManagement::Events::VideoStreamChanged::DecodableType & value); +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::CameraAvStreamManagement::Events::AudioStreamChanged::DecodableType & value); +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::CommissionerControl::Events::CommissioningRequestResult::DecodableType & value); @@ -854,6 +897,18 @@ static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::ContentAppObserver::Commands::ContentAppMessageResponse::DecodableType & value); static CHIP_ERROR +LogValue(const char * label, size_t indent, + const chip::app::Clusters::CameraAvStreamManagement::Commands::AudioStreamAllocateResponse::DecodableType & value); +static CHIP_ERROR +LogValue(const char * label, size_t indent, + const chip::app::Clusters::CameraAvStreamManagement::Commands::VideoStreamAllocateResponse::DecodableType & value); +static CHIP_ERROR +LogValue(const char * label, size_t indent, + const chip::app::Clusters::CameraAvStreamManagement::Commands::SnapshotStreamAllocateResponse::DecodableType & value); +static CHIP_ERROR +LogValue(const char * label, size_t indent, + const chip::app::Clusters::CameraAvStreamManagement::Commands::CaptureSnapshotResponse::DecodableType & value); +static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::WebRTCTransportProvider::Commands::SolicitOfferResponse::DecodableType & value); static CHIP_ERROR 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 1ff61d2e84c63b..0e566d3775b015 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.cpp @@ -259,6 +259,8 @@ char const * ClusterIdToText(chip::ClusterId id) return "ContentControl"; case chip::app::Clusters::ContentAppObserver::Id: return "ContentAppObserver"; + case chip::app::Clusters::CameraAvStreamManagement::Id: + return "CameraAvStreamManagement"; case chip::app::Clusters::WebRTCTransportProvider::Id: return "WebRTCTransportProvider"; case chip::app::Clusters::WebRTCTransportRequestor::Id: @@ -4383,6 +4385,127 @@ char const * AttributeIdToText(chip::ClusterId cluster, chip::AttributeId id) return "Unknown"; } } + case chip::app::Clusters::CameraAvStreamManagement::Id: { + switch (id) + { + case chip::app::Clusters::CameraAvStreamManagement::Attributes::MaxConcurrentVideoEncoders::Id: + return "MaxConcurrentVideoEncoders"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::MaxEncodedPixelRate::Id: + return "MaxEncodedPixelRate"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::VideoSensorParams::Id: + return "VideoSensorParams"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::NightVisionCapable::Id: + return "NightVisionCapable"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::MinViewPortWidth::Id: + return "MinViewPortWidth"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::MinViewPortHeight::Id: + return "MinViewPortHeight"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::RateDistortionTradeOffPoints::Id: + return "RateDistortionTradeOffPoints"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::MaxPreRollBufferSize::Id: + return "MaxPreRollBufferSize"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::MicrophoneCapabilities::Id: + return "MicrophoneCapabilities"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::SpeakerCapabilities::Id: + return "SpeakerCapabilities"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::TwoWayTalkSupport::Id: + return "TwoWayTalkSupport"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::SupportedSnapshotParams::Id: + return "SupportedSnapshotParams"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::HDRCapable::Id: + return "HDRCapable"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::MaxNetworkBandwidth::Id: + return "MaxNetworkBandwidth"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::CurrentFrameRate::Id: + return "CurrentFrameRate"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::HDRMode::Id: + return "HDRMode"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::CurrentVideoCodecs::Id: + return "CurrentVideoCodecs"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::CurrentSnapshotConfig::Id: + return "CurrentSnapshotConfig"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::FabricsUsingCamera::Id: + return "FabricsUsingCamera"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::AllocatedVideoStreams::Id: + return "AllocatedVideoStreams"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::AllocatedAudioStreams::Id: + return "AllocatedAudioStreams"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::AllocatedSnapshotStreams::Id: + return "AllocatedSnapshotStreams"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::RankedVideoStreamPrioritiesList::Id: + return "RankedVideoStreamPrioritiesList"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::SoftRecordingPrivacyModeSetting::Id: + return "SoftRecordingPrivacyModeSetting"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::SoftLivestreamPrivacyModeSetting::Id: + return "SoftLivestreamPrivacyModeSetting"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::HardPrivacyMode::Id: + return "HardPrivacyMode"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::NightVision::Id: + return "NightVision"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::NightVisionIllum::Id: + return "NightVisionIllum"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::Awb::Id: + return "Awb"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::ShutterSpeed::Id: + return "ShutterSpeed"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::Iso::Id: + return "Iso"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::Viewport::Id: + return "Viewport"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::SpeakerEnabled::Id: + return "SpeakerEnabled"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::SpeakerVolumeLevel::Id: + return "SpeakerVolumeLevel"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::SpeakerMaxLevel::Id: + return "SpeakerMaxLevel"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::SpeakerMinLevel::Id: + return "SpeakerMinLevel"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::MicStatus::Id: + return "MicStatus"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::MicVolumeLevel::Id: + return "MicVolumeLevel"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::MicMaxLevel::Id: + return "MicMaxLevel"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::MicMinLevel::Id: + return "MicMinLevel"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::MicAGCEnabled::Id: + return "MicAGCEnabled"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::ImageRotation::Id: + return "ImageRotation"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::ImageFlipHorizontal::Id: + return "ImageFlipHorizontal"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::ImageFlipVertical::Id: + return "ImageFlipVertical"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::LocalVideoRecordingEnabled::Id: + return "LocalVideoRecordingEnabled"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::LocalSnapshotRecordingEnabled::Id: + return "LocalSnapshotRecordingEnabled"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::StatusLight::Id: + return "StatusLight"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::StatusLightBrightness::Id: + return "StatusLightBrightness"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::DepthSensorStatus::Id: + return "DepthSensorStatus"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::WatermarkEnabled::Id: + return "WatermarkEnabled"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::OSDEnabled::Id: + return "OSDEnabled"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } case chip::app::Clusters::WebRTCTransportProvider::Id: { switch (id) { @@ -5776,6 +5899,43 @@ char const * AcceptedCommandIdToText(chip::ClusterId cluster, chip::CommandId id return "Unknown"; } } + case chip::app::Clusters::CameraAvStreamManagement::Id: { + switch (id) + { + case chip::app::Clusters::CameraAvStreamManagement::Commands::AudioStreamAllocate::Id: + return "AudioStreamAllocate"; + case chip::app::Clusters::CameraAvStreamManagement::Commands::AudioStreamDeallocate::Id: + return "AudioStreamDeallocate"; + case chip::app::Clusters::CameraAvStreamManagement::Commands::VideoStreamAllocate::Id: + return "VideoStreamAllocate"; + case chip::app::Clusters::CameraAvStreamManagement::Commands::VideoStreamModify::Id: + return "VideoStreamModify"; + case chip::app::Clusters::CameraAvStreamManagement::Commands::VideoStreamDeallocate::Id: + return "VideoStreamDeallocate"; + case chip::app::Clusters::CameraAvStreamManagement::Commands::SnapshotStreamAllocate::Id: + return "SnapshotStreamAllocate"; + case chip::app::Clusters::CameraAvStreamManagement::Commands::SnapshotStreamDeallocate::Id: + return "SnapshotStreamDeallocate"; + case chip::app::Clusters::CameraAvStreamManagement::Commands::SetStreamPriority::Id: + return "SetStreamPriority"; + case chip::app::Clusters::CameraAvStreamManagement::Commands::CaptureSnapshot::Id: + return "CaptureSnapshot"; + case chip::app::Clusters::CameraAvStreamManagement::Commands::SetViewport::Id: + return "SetViewport"; + case chip::app::Clusters::CameraAvStreamManagement::Commands::SetImageRotation::Id: + return "SetImageRotation"; + case chip::app::Clusters::CameraAvStreamManagement::Commands::SetImageFlipHorizontal::Id: + return "SetImageFlipHorizontal"; + case chip::app::Clusters::CameraAvStreamManagement::Commands::SetImageFlipVertical::Id: + return "SetImageFlipVertical"; + case chip::app::Clusters::CameraAvStreamManagement::Commands::SetWatermark::Id: + return "SetWatermark"; + case chip::app::Clusters::CameraAvStreamManagement::Commands::SetOSD::Id: + return "SetOSD"; + default: + return "Unknown"; + } + } case chip::app::Clusters::WebRTCTransportProvider::Id: { switch (id) { @@ -6340,6 +6500,21 @@ char const * GeneratedCommandIdToText(chip::ClusterId cluster, chip::CommandId i return "Unknown"; } } + case chip::app::Clusters::CameraAvStreamManagement::Id: { + switch (id) + { + case chip::app::Clusters::CameraAvStreamManagement::Commands::AudioStreamAllocateResponse::Id: + return "AudioStreamAllocateResponse"; + case chip::app::Clusters::CameraAvStreamManagement::Commands::VideoStreamAllocateResponse::Id: + return "VideoStreamAllocateResponse"; + case chip::app::Clusters::CameraAvStreamManagement::Commands::SnapshotStreamAllocateResponse::Id: + return "SnapshotStreamAllocateResponse"; + case chip::app::Clusters::CameraAvStreamManagement::Commands::CaptureSnapshotResponse::Id: + return "CaptureSnapshotResponse"; + default: + return "Unknown"; + } + } case chip::app::Clusters::WebRTCTransportProvider::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 29dc7b342ae764..c8da79648f6865 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h @@ -154,6 +154,7 @@ | AccountLogin | 0x050E | | ContentControl | 0x050F | | ContentAppObserver | 0x0510 | +| CameraAvStreamManagement | 0x0551 | | WebRTCTransportProvider | 0x0553 | | WebRTCTransportRequestor | 0x0554 | | Chime | 0x0556 | @@ -160117,6 +160118,6867 @@ class SubscribeAttributeContentAppObserverClusterRevision : public SubscribeAttr } }; +#endif // MTR_ENABLE_PROVISIONAL +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL +/*----------------------------------------------------------------------------*\ +| Cluster CameraAvStreamManagement | 0x0551 | +|------------------------------------------------------------------------------| +| Commands: | | +| * AudioStreamAllocate | 0x00 | +| * AudioStreamDeallocate | 0x02 | +| * VideoStreamAllocate | 0x03 | +| * VideoStreamModify | 0x05 | +| * VideoStreamDeallocate | 0x06 | +| * SnapshotStreamAllocate | 0x07 | +| * SnapshotStreamDeallocate | 0x09 | +| * SetStreamPriority | 0x0A | +| * CaptureSnapshot | 0x0B | +| * SetViewport | 0x0D | +| * SetImageRotation | 0x0E | +| * SetImageFlipHorizontal | 0x0F | +| * SetImageFlipVertical | 0x10 | +| * SetWatermark | 0x11 | +| * SetOSD | 0x12 | +|------------------------------------------------------------------------------| +| Attributes: | | +| * MaxConcurrentVideoEncoders | 0x0000 | +| * MaxEncodedPixelRate | 0x0001 | +| * VideoSensorParams | 0x0002 | +| * NightVisionCapable | 0x0003 | +| * MinViewPortWidth | 0x0004 | +| * MinViewPortHeight | 0x0005 | +| * RateDistortionTradeOffPoints | 0x0006 | +| * MaxPreRollBufferSize | 0x0007 | +| * MicrophoneCapabilities | 0x0008 | +| * SpeakerCapabilities | 0x0009 | +| * TwoWayTalkSupport | 0x000A | +| * SupportedSnapshotParams | 0x000B | +| * HDRCapable | 0x000C | +| * MaxNetworkBandwidth | 0x000D | +| * CurrentFrameRate | 0x000E | +| * HDRMode | 0x000F | +| * CurrentVideoCodecs | 0x0010 | +| * CurrentSnapshotConfig | 0x0011 | +| * FabricsUsingCamera | 0x0012 | +| * AllocatedVideoStreams | 0x0013 | +| * AllocatedAudioStreams | 0x0014 | +| * AllocatedSnapshotStreams | 0x0015 | +| * RankedVideoStreamPrioritiesList | 0x0016 | +| * SoftRecordingPrivacyModeSetting | 0x0017 | +| * SoftLivestreamPrivacyModeSetting | 0x0018 | +| * HardPrivacyMode | 0x0019 | +| * NightVision | 0x001A | +| * NightVisionIllum | 0x001B | +| * Awb | 0x001C | +| * ShutterSpeed | 0x001D | +| * Iso | 0x001E | +| * Viewport | 0x001F | +| * SpeakerEnabled | 0x0020 | +| * SpeakerVolumeLevel | 0x0021 | +| * SpeakerMaxLevel | 0x0022 | +| * SpeakerMinLevel | 0x0023 | +| * MicStatus | 0x0024 | +| * MicVolumeLevel | 0x0025 | +| * MicMaxLevel | 0x0026 | +| * MicMinLevel | 0x0027 | +| * MicAGCEnabled | 0x0028 | +| * ImageRotation | 0x0029 | +| * ImageFlipHorizontal | 0x002A | +| * ImageFlipVertical | 0x002B | +| * LocalVideoRecordingEnabled | 0x002C | +| * LocalSnapshotRecordingEnabled | 0x002D | +| * StatusLight | 0x002E | +| * StatusLightBrightness | 0x002F | +| * DepthSensorStatus | 0x0030 | +| * WatermarkEnabled | 0x0031 | +| * OSDEnabled | 0x0032 | +| * GeneratedCommandList | 0xFFF8 | +| * AcceptedCommandList | 0xFFF9 | +| * EventList | 0xFFFA | +| * AttributeList | 0xFFFB | +| * FeatureMap | 0xFFFC | +| * ClusterRevision | 0xFFFD | +|------------------------------------------------------------------------------| +| Events: | | +| * VideoStreamChanged | 0x0000 | +| * AudioStreamChanged | 0x0001 | +| * SnapshotStreamChanged | 0x0002 | +\*----------------------------------------------------------------------------*/ + +#if MTR_ENABLE_PROVISIONAL +/* + * Command AudioStreamAllocate + */ +class CameraAvStreamManagementAudioStreamAllocate : public ClusterCommand { +public: + CameraAvStreamManagementAudioStreamAllocate() + : ClusterCommand("audio-stream-allocate") + { +#if MTR_ENABLE_PROVISIONAL + AddArgument("StreamType", 0, UINT8_MAX, &mRequest.streamType); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("AudioCodec", 0, UINT8_MAX, &mRequest.audioCodec); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("ChannelCount", 0, UINT8_MAX, &mRequest.channelCount); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("SampleRate", 0, UINT32_MAX, &mRequest.sampleRate); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("BitRate", 0, UINT32_MAX, &mRequest.bitRate); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("BitDepth", 0, UINT8_MAX, &mRequest.bitDepth); +#endif // MTR_ENABLE_PROVISIONAL + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::CameraAvStreamManagement::Commands::AudioStreamAllocate::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 = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRCameraAVStreamManagementClusterAudioStreamAllocateParams alloc] init]; + params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; +#if MTR_ENABLE_PROVISIONAL + params.streamType = [NSNumber numberWithUnsignedChar:chip::to_underlying(mRequest.streamType)]; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + params.audioCodec = [NSNumber numberWithUnsignedChar:chip::to_underlying(mRequest.audioCodec)]; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + params.channelCount = [NSNumber numberWithUnsignedChar:mRequest.channelCount]; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + params.sampleRate = [NSNumber numberWithUnsignedInt:mRequest.sampleRate]; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + params.bitRate = [NSNumber numberWithUnsignedInt:mRequest.bitRate]; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + params.bitDepth = [NSNumber numberWithUnsignedChar:mRequest.bitDepth]; +#endif // MTR_ENABLE_PROVISIONAL + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster audioStreamAllocateWithParams:params completion: + ^(MTRCameraAVStreamManagementClusterAudioStreamAllocateResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId = chip::app::Clusters::CameraAvStreamManagement::Commands::AudioStreamAllocateResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + constexpr chip::CommandId responseId = chip::app::Clusters::CameraAvStreamManagement::Commands::AudioStreamAllocateResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return CHIP_NO_ERROR; + } + +private: + chip::app::Clusters::CameraAvStreamManagement::Commands::AudioStreamAllocate::Type mRequest; +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL +/* + * Command AudioStreamDeallocate + */ +class CameraAvStreamManagementAudioStreamDeallocate : public ClusterCommand { +public: + CameraAvStreamManagementAudioStreamDeallocate() + : ClusterCommand("audio-stream-deallocate") + { +#if MTR_ENABLE_PROVISIONAL + AddArgument("AudioStreamID", 0, UINT16_MAX, &mRequest.audioStreamID); +#endif // MTR_ENABLE_PROVISIONAL + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::CameraAvStreamManagement::Commands::AudioStreamDeallocate::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 = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRCameraAVStreamManagementClusterAudioStreamDeallocateParams alloc] init]; + params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; +#if MTR_ENABLE_PROVISIONAL + params.audioStreamID = [NSNumber numberWithUnsignedShort:mRequest.audioStreamID]; +#endif // MTR_ENABLE_PROVISIONAL + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster audioStreamDeallocateWithParams: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::CameraAvStreamManagement::Commands::AudioStreamDeallocate::Type mRequest; +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL +/* + * Command VideoStreamAllocate + */ +class CameraAvStreamManagementVideoStreamAllocate : public ClusterCommand { +public: + CameraAvStreamManagementVideoStreamAllocate() + : ClusterCommand("video-stream-allocate") + , mComplex_MinResolution(&mRequest.minResolution) + , mComplex_MaxResolution(&mRequest.maxResolution) + { +#if MTR_ENABLE_PROVISIONAL + AddArgument("StreamType", 0, UINT8_MAX, &mRequest.streamType); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("VideoCodec", 0, UINT8_MAX, &mRequest.videoCodec); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("MinFrameRate", 0, UINT16_MAX, &mRequest.minFrameRate); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("MaxFrameRate", 0, UINT16_MAX, &mRequest.maxFrameRate); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("MinResolution", &mComplex_MinResolution); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("MaxResolution", &mComplex_MaxResolution); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("MinBitRate", 0, UINT32_MAX, &mRequest.minBitRate); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("MaxBitRate", 0, UINT32_MAX, &mRequest.maxBitRate); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("MinFragmentLen", 0, UINT16_MAX, &mRequest.minFragmentLen); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("MaxFragmentLen", 0, UINT16_MAX, &mRequest.maxFragmentLen); +#endif // MTR_ENABLE_PROVISIONAL + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::CameraAvStreamManagement::Commands::VideoStreamAllocate::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 = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRCameraAVStreamManagementClusterVideoStreamAllocateParams alloc] init]; + params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; +#if MTR_ENABLE_PROVISIONAL + params.streamType = [NSNumber numberWithUnsignedChar:chip::to_underlying(mRequest.streamType)]; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + params.videoCodec = [NSNumber numberWithUnsignedChar:chip::to_underlying(mRequest.videoCodec)]; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + params.minFrameRate = [NSNumber numberWithUnsignedShort:mRequest.minFrameRate]; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + params.maxFrameRate = [NSNumber numberWithUnsignedShort:mRequest.maxFrameRate]; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + params.minResolution = [MTRCameraAVStreamManagementClusterVideoResolutionStruct new]; + params.minResolution.width = [NSNumber numberWithUnsignedShort:mRequest.minResolution.width]; + params.minResolution.height = [NSNumber numberWithUnsignedShort:mRequest.minResolution.height]; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + params.maxResolution = [MTRCameraAVStreamManagementClusterVideoResolutionStruct new]; + params.maxResolution.width = [NSNumber numberWithUnsignedShort:mRequest.maxResolution.width]; + params.maxResolution.height = [NSNumber numberWithUnsignedShort:mRequest.maxResolution.height]; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + params.minBitRate = [NSNumber numberWithUnsignedInt:mRequest.minBitRate]; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + params.maxBitRate = [NSNumber numberWithUnsignedInt:mRequest.maxBitRate]; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + params.minFragmentLen = [NSNumber numberWithUnsignedShort:mRequest.minFragmentLen]; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + params.maxFragmentLen = [NSNumber numberWithUnsignedShort:mRequest.maxFragmentLen]; +#endif // MTR_ENABLE_PROVISIONAL + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster videoStreamAllocateWithParams:params completion: + ^(MTRCameraAVStreamManagementClusterVideoStreamAllocateResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId = chip::app::Clusters::CameraAvStreamManagement::Commands::VideoStreamAllocateResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + constexpr chip::CommandId responseId = chip::app::Clusters::CameraAvStreamManagement::Commands::VideoStreamAllocateResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return CHIP_NO_ERROR; + } + +private: + chip::app::Clusters::CameraAvStreamManagement::Commands::VideoStreamAllocate::Type mRequest; + TypedComplexArgument mComplex_MinResolution; + TypedComplexArgument mComplex_MaxResolution; +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL +/* + * Command VideoStreamModify + */ +class CameraAvStreamManagementVideoStreamModify : public ClusterCommand { +public: + CameraAvStreamManagementVideoStreamModify() + : ClusterCommand("video-stream-modify") + , mComplex_Resolution(&mRequest.resolution) + { +#if MTR_ENABLE_PROVISIONAL + AddArgument("VideoStreamID", 0, UINT16_MAX, &mRequest.videoStreamID); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("Resolution", &mComplex_Resolution); +#endif // MTR_ENABLE_PROVISIONAL + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::CameraAvStreamManagement::Commands::VideoStreamModify::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 = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRCameraAVStreamManagementClusterVideoStreamModifyParams alloc] init]; + params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; +#if MTR_ENABLE_PROVISIONAL + params.videoStreamID = [NSNumber numberWithUnsignedShort:mRequest.videoStreamID]; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + params.resolution = [MTRCameraAVStreamManagementClusterVideoResolutionStruct new]; + params.resolution.width = [NSNumber numberWithUnsignedShort:mRequest.resolution.width]; + params.resolution.height = [NSNumber numberWithUnsignedShort:mRequest.resolution.height]; +#endif // MTR_ENABLE_PROVISIONAL + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster videoStreamModifyWithParams: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::CameraAvStreamManagement::Commands::VideoStreamModify::Type mRequest; + TypedComplexArgument mComplex_Resolution; +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL +/* + * Command VideoStreamDeallocate + */ +class CameraAvStreamManagementVideoStreamDeallocate : public ClusterCommand { +public: + CameraAvStreamManagementVideoStreamDeallocate() + : ClusterCommand("video-stream-deallocate") + { +#if MTR_ENABLE_PROVISIONAL + AddArgument("VideoStreamID", 0, UINT16_MAX, &mRequest.videoStreamID); +#endif // MTR_ENABLE_PROVISIONAL + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::CameraAvStreamManagement::Commands::VideoStreamDeallocate::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 = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRCameraAVStreamManagementClusterVideoStreamDeallocateParams alloc] init]; + params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; +#if MTR_ENABLE_PROVISIONAL + params.videoStreamID = [NSNumber numberWithUnsignedShort:mRequest.videoStreamID]; +#endif // MTR_ENABLE_PROVISIONAL + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster videoStreamDeallocateWithParams: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::CameraAvStreamManagement::Commands::VideoStreamDeallocate::Type mRequest; +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL +/* + * Command SnapshotStreamAllocate + */ +class CameraAvStreamManagementSnapshotStreamAllocate : public ClusterCommand { +public: + CameraAvStreamManagementSnapshotStreamAllocate() + : ClusterCommand("snapshot-stream-allocate") + , mComplex_MinResolution(&mRequest.minResolution) + , mComplex_MaxResolution(&mRequest.maxResolution) + { +#if MTR_ENABLE_PROVISIONAL + AddArgument("ImageCodec", 0, UINT8_MAX, &mRequest.imageCodec); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("FrameRate", 0, UINT16_MAX, &mRequest.frameRate); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("BitRate", 0, UINT32_MAX, &mRequest.bitRate); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("MinResolution", &mComplex_MinResolution); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("MaxResolution", &mComplex_MaxResolution); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("Quality", 0, UINT8_MAX, &mRequest.quality); +#endif // MTR_ENABLE_PROVISIONAL + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::CameraAvStreamManagement::Commands::SnapshotStreamAllocate::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 = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRCameraAVStreamManagementClusterSnapshotStreamAllocateParams alloc] init]; + params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; +#if MTR_ENABLE_PROVISIONAL + params.imageCodec = [NSNumber numberWithUnsignedChar:chip::to_underlying(mRequest.imageCodec)]; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + params.frameRate = [NSNumber numberWithUnsignedShort:mRequest.frameRate]; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + params.bitRate = [NSNumber numberWithUnsignedInt:mRequest.bitRate]; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + params.minResolution = [MTRCameraAVStreamManagementClusterVideoResolutionStruct new]; + params.minResolution.width = [NSNumber numberWithUnsignedShort:mRequest.minResolution.width]; + params.minResolution.height = [NSNumber numberWithUnsignedShort:mRequest.minResolution.height]; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + params.maxResolution = [MTRCameraAVStreamManagementClusterVideoResolutionStruct new]; + params.maxResolution.width = [NSNumber numberWithUnsignedShort:mRequest.maxResolution.width]; + params.maxResolution.height = [NSNumber numberWithUnsignedShort:mRequest.maxResolution.height]; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + params.quality = [NSNumber numberWithUnsignedChar:mRequest.quality]; +#endif // MTR_ENABLE_PROVISIONAL + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster snapshotStreamAllocateWithParams:params completion: + ^(MTRCameraAVStreamManagementClusterSnapshotStreamAllocateResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId = chip::app::Clusters::CameraAvStreamManagement::Commands::SnapshotStreamAllocateResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + constexpr chip::CommandId responseId = chip::app::Clusters::CameraAvStreamManagement::Commands::SnapshotStreamAllocateResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return CHIP_NO_ERROR; + } + +private: + chip::app::Clusters::CameraAvStreamManagement::Commands::SnapshotStreamAllocate::Type mRequest; + TypedComplexArgument mComplex_MinResolution; + TypedComplexArgument mComplex_MaxResolution; +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL +/* + * Command SnapshotStreamDeallocate + */ +class CameraAvStreamManagementSnapshotStreamDeallocate : public ClusterCommand { +public: + CameraAvStreamManagementSnapshotStreamDeallocate() + : ClusterCommand("snapshot-stream-deallocate") + { +#if MTR_ENABLE_PROVISIONAL + AddArgument("SnapshotStreamID", 0, UINT16_MAX, &mRequest.snapshotStreamID); +#endif // MTR_ENABLE_PROVISIONAL + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::CameraAvStreamManagement::Commands::SnapshotStreamDeallocate::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 = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRCameraAVStreamManagementClusterSnapshotStreamDeallocateParams alloc] init]; + params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; +#if MTR_ENABLE_PROVISIONAL + params.snapshotStreamID = [NSNumber numberWithUnsignedShort:mRequest.snapshotStreamID]; +#endif // MTR_ENABLE_PROVISIONAL + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster snapshotStreamDeallocateWithParams: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::CameraAvStreamManagement::Commands::SnapshotStreamDeallocate::Type mRequest; +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL +/* + * Command SetStreamPriority + */ +class CameraAvStreamManagementSetStreamPriority : public ClusterCommand { +public: + CameraAvStreamManagementSetStreamPriority() + : ClusterCommand("set-stream-priority") + { + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::CameraAvStreamManagement::Commands::SetStreamPriority::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 = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRCameraAVStreamManagementClusterSetStreamPriorityParams alloc] init]; + params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster setStreamPriorityWithParams: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: +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL +/* + * Command CaptureSnapshot + */ +class CameraAvStreamManagementCaptureSnapshot : public ClusterCommand { +public: + CameraAvStreamManagementCaptureSnapshot() + : ClusterCommand("capture-snapshot") + , mComplex_RequestedResolution(&mRequest.requestedResolution) + { +#if MTR_ENABLE_PROVISIONAL + AddArgument("SnapshotStreamID", 0, UINT16_MAX, &mRequest.snapshotStreamID); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("RequestedResolution", &mComplex_RequestedResolution); +#endif // MTR_ENABLE_PROVISIONAL + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::CameraAvStreamManagement::Commands::CaptureSnapshot::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 = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRCameraAVStreamManagementClusterCaptureSnapshotParams alloc] init]; + params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; +#if MTR_ENABLE_PROVISIONAL + params.snapshotStreamID = [NSNumber numberWithUnsignedShort:mRequest.snapshotStreamID]; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + params.requestedResolution = [MTRCameraAVStreamManagementClusterVideoResolutionStruct new]; + params.requestedResolution.width = [NSNumber numberWithUnsignedShort:mRequest.requestedResolution.width]; + params.requestedResolution.height = [NSNumber numberWithUnsignedShort:mRequest.requestedResolution.height]; +#endif // MTR_ENABLE_PROVISIONAL + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster captureSnapshotWithParams: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::CameraAvStreamManagement::Commands::CaptureSnapshot::Type mRequest; + TypedComplexArgument mComplex_RequestedResolution; +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL +/* + * Command SetViewport + */ +class CameraAvStreamManagementSetViewport : public ClusterCommand { +public: + CameraAvStreamManagementSetViewport() + : ClusterCommand("set-viewport") + , mComplex_Viewport(&mRequest.viewport) + { +#if MTR_ENABLE_PROVISIONAL + AddArgument("Viewport", &mComplex_Viewport); +#endif // MTR_ENABLE_PROVISIONAL + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::CameraAvStreamManagement::Commands::SetViewport::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 = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRCameraAVStreamManagementClusterSetViewportParams alloc] init]; + params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; +#if MTR_ENABLE_PROVISIONAL + params.viewport = [MTRCameraAVStreamManagementClusterViewportStruct new]; + params.viewport.x1 = [NSNumber numberWithUnsignedShort:mRequest.viewport.x1]; + params.viewport.y1 = [NSNumber numberWithUnsignedShort:mRequest.viewport.y1]; + params.viewport.x2 = [NSNumber numberWithUnsignedShort:mRequest.viewport.x2]; + params.viewport.y2 = [NSNumber numberWithUnsignedShort:mRequest.viewport.y2]; +#endif // MTR_ENABLE_PROVISIONAL + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster setViewportWithParams: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::CameraAvStreamManagement::Commands::SetViewport::Type mRequest; + TypedComplexArgument mComplex_Viewport; +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL +/* + * Command SetImageRotation + */ +class CameraAvStreamManagementSetImageRotation : public ClusterCommand { +public: + CameraAvStreamManagementSetImageRotation() + : ClusterCommand("set-image-rotation") + { +#if MTR_ENABLE_PROVISIONAL + AddArgument("Angle", 0, UINT16_MAX, &mRequest.angle); +#endif // MTR_ENABLE_PROVISIONAL + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::CameraAvStreamManagement::Commands::SetImageRotation::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 = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRCameraAVStreamManagementClusterSetImageRotationParams alloc] init]; + params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; +#if MTR_ENABLE_PROVISIONAL + params.angle = [NSNumber numberWithUnsignedShort:mRequest.angle]; +#endif // MTR_ENABLE_PROVISIONAL + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster setImageRotationWithParams: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::CameraAvStreamManagement::Commands::SetImageRotation::Type mRequest; +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL +/* + * Command SetImageFlipHorizontal + */ +class CameraAvStreamManagementSetImageFlipHorizontal : public ClusterCommand { +public: + CameraAvStreamManagementSetImageFlipHorizontal() + : ClusterCommand("set-image-flip-horizontal") + { +#if MTR_ENABLE_PROVISIONAL + AddArgument("Enabled", 0, 1, &mRequest.enabled); +#endif // MTR_ENABLE_PROVISIONAL + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::CameraAvStreamManagement::Commands::SetImageFlipHorizontal::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 = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRCameraAVStreamManagementClusterSetImageFlipHorizontalParams alloc] init]; + params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; +#if MTR_ENABLE_PROVISIONAL + params.enabled = [NSNumber numberWithBool:mRequest.enabled]; +#endif // MTR_ENABLE_PROVISIONAL + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster setImageFlipHorizontalWithParams: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::CameraAvStreamManagement::Commands::SetImageFlipHorizontal::Type mRequest; +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL +/* + * Command SetImageFlipVertical + */ +class CameraAvStreamManagementSetImageFlipVertical : public ClusterCommand { +public: + CameraAvStreamManagementSetImageFlipVertical() + : ClusterCommand("set-image-flip-vertical") + { +#if MTR_ENABLE_PROVISIONAL + AddArgument("Enabled", 0, 1, &mRequest.enabled); +#endif // MTR_ENABLE_PROVISIONAL + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::CameraAvStreamManagement::Commands::SetImageFlipVertical::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 = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRCameraAVStreamManagementClusterSetImageFlipVerticalParams alloc] init]; + params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; +#if MTR_ENABLE_PROVISIONAL + params.enabled = [NSNumber numberWithBool:mRequest.enabled]; +#endif // MTR_ENABLE_PROVISIONAL + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster setImageFlipVerticalWithParams: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::CameraAvStreamManagement::Commands::SetImageFlipVertical::Type mRequest; +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL +/* + * Command SetWatermark + */ +class CameraAvStreamManagementSetWatermark : public ClusterCommand { +public: + CameraAvStreamManagementSetWatermark() + : ClusterCommand("set-watermark") + { +#if MTR_ENABLE_PROVISIONAL + AddArgument("VideoStreamID", 0, UINT16_MAX, &mRequest.videoStreamID); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("Enabled", 0, 1, &mRequest.enabled); +#endif // MTR_ENABLE_PROVISIONAL + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::CameraAvStreamManagement::Commands::SetWatermark::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 = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRCameraAVStreamManagementClusterSetWatermarkParams alloc] init]; + params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; +#if MTR_ENABLE_PROVISIONAL + params.videoStreamID = [NSNumber numberWithUnsignedShort:mRequest.videoStreamID]; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + params.enabled = [NSNumber numberWithBool:mRequest.enabled]; +#endif // MTR_ENABLE_PROVISIONAL + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster setWatermarkWithParams: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::CameraAvStreamManagement::Commands::SetWatermark::Type mRequest; +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL +/* + * Command SetOSD + */ +class CameraAvStreamManagementSetOSD : public ClusterCommand { +public: + CameraAvStreamManagementSetOSD() + : ClusterCommand("set-osd") + { +#if MTR_ENABLE_PROVISIONAL + AddArgument("VideoStreamID", 0, UINT16_MAX, &mRequest.videoStreamID); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("Enabled", 0, 1, &mRequest.enabled); +#endif // MTR_ENABLE_PROVISIONAL + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::CameraAvStreamManagement::Commands::SetOSD::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 = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRCameraAVStreamManagementClusterSetOSDParams alloc] init]; + params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; +#if MTR_ENABLE_PROVISIONAL + params.videoStreamID = [NSNumber numberWithUnsignedShort:mRequest.videoStreamID]; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + params.enabled = [NSNumber numberWithBool:mRequest.enabled]; +#endif // MTR_ENABLE_PROVISIONAL + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster setOSDWithParams: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::CameraAvStreamManagement::Commands::SetOSD::Type mRequest; +}; + +#endif // MTR_ENABLE_PROVISIONAL + +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute MaxConcurrentVideoEncoders + */ +class ReadCameraAvStreamManagementMaxConcurrentVideoEncoders : public ReadAttribute { +public: + ReadCameraAvStreamManagementMaxConcurrentVideoEncoders() + : ReadAttribute("max-concurrent-video-encoders") + { + } + + ~ReadCameraAvStreamManagementMaxConcurrentVideoEncoders() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::MaxConcurrentVideoEncoders::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 = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeMaxConcurrentVideoEncodersWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.MaxConcurrentVideoEncoders response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement MaxConcurrentVideoEncoders read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeCameraAvStreamManagementMaxConcurrentVideoEncoders : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementMaxConcurrentVideoEncoders() + : SubscribeAttribute("max-concurrent-video-encoders") + { + } + + ~SubscribeAttributeCameraAvStreamManagementMaxConcurrentVideoEncoders() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::MaxConcurrentVideoEncoders::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 = [[MTRBaseClusterCameraAVStreamManagement 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 subscribeAttributeMaxConcurrentVideoEncodersWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.MaxConcurrentVideoEncoders 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 MaxEncodedPixelRate + */ +class ReadCameraAvStreamManagementMaxEncodedPixelRate : public ReadAttribute { +public: + ReadCameraAvStreamManagementMaxEncodedPixelRate() + : ReadAttribute("max-encoded-pixel-rate") + { + } + + ~ReadCameraAvStreamManagementMaxEncodedPixelRate() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::MaxEncodedPixelRate::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 = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeMaxEncodedPixelRateWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.MaxEncodedPixelRate response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement MaxEncodedPixelRate read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeCameraAvStreamManagementMaxEncodedPixelRate : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementMaxEncodedPixelRate() + : SubscribeAttribute("max-encoded-pixel-rate") + { + } + + ~SubscribeAttributeCameraAvStreamManagementMaxEncodedPixelRate() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::MaxEncodedPixelRate::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 = [[MTRBaseClusterCameraAVStreamManagement 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 subscribeAttributeMaxEncodedPixelRateWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.MaxEncodedPixelRate 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 VideoSensorParams + */ +class ReadCameraAvStreamManagementVideoSensorParams : public ReadAttribute { +public: + ReadCameraAvStreamManagementVideoSensorParams() + : ReadAttribute("video-sensor-params") + { + } + + ~ReadCameraAvStreamManagementVideoSensorParams() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::VideoSensorParams::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 = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeVideoSensorParamsWithCompletion:^(MTRCameraAVStreamManagementClusterVideoSensorParamsStruct * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.VideoSensorParams response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement VideoSensorParams read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeCameraAvStreamManagementVideoSensorParams : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementVideoSensorParams() + : SubscribeAttribute("video-sensor-params") + { + } + + ~SubscribeAttributeCameraAvStreamManagementVideoSensorParams() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::VideoSensorParams::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 = [[MTRBaseClusterCameraAVStreamManagement 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 subscribeAttributeVideoSensorParamsWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(MTRCameraAVStreamManagementClusterVideoSensorParamsStruct * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.VideoSensorParams 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 NightVisionCapable + */ +class ReadCameraAvStreamManagementNightVisionCapable : public ReadAttribute { +public: + ReadCameraAvStreamManagementNightVisionCapable() + : ReadAttribute("night-vision-capable") + { + } + + ~ReadCameraAvStreamManagementNightVisionCapable() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::NightVisionCapable::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 = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeNightVisionCapableWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.NightVisionCapable response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement NightVisionCapable read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeCameraAvStreamManagementNightVisionCapable : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementNightVisionCapable() + : SubscribeAttribute("night-vision-capable") + { + } + + ~SubscribeAttributeCameraAvStreamManagementNightVisionCapable() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::NightVisionCapable::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 = [[MTRBaseClusterCameraAVStreamManagement 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 subscribeAttributeNightVisionCapableWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.NightVisionCapable 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 MinViewPortWidth + */ +class ReadCameraAvStreamManagementMinViewPortWidth : public ReadAttribute { +public: + ReadCameraAvStreamManagementMinViewPortWidth() + : ReadAttribute("min-view-port-width") + { + } + + ~ReadCameraAvStreamManagementMinViewPortWidth() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::MinViewPortWidth::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 = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeMinViewPortWidthWithCompletion:^(MTRCameraAVStreamManagementClusterVideoResolutionStruct * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.MinViewPortWidth response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement MinViewPortWidth read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeCameraAvStreamManagementMinViewPortWidth : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementMinViewPortWidth() + : SubscribeAttribute("min-view-port-width") + { + } + + ~SubscribeAttributeCameraAvStreamManagementMinViewPortWidth() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::MinViewPortWidth::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 = [[MTRBaseClusterCameraAVStreamManagement 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 subscribeAttributeMinViewPortWidthWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(MTRCameraAVStreamManagementClusterVideoResolutionStruct * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.MinViewPortWidth 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 MinViewPortHeight + */ +class ReadCameraAvStreamManagementMinViewPortHeight : public ReadAttribute { +public: + ReadCameraAvStreamManagementMinViewPortHeight() + : ReadAttribute("min-view-port-height") + { + } + + ~ReadCameraAvStreamManagementMinViewPortHeight() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::MinViewPortHeight::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 = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeMinViewPortHeightWithCompletion:^(MTRCameraAVStreamManagementClusterVideoResolutionStruct * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.MinViewPortHeight response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement MinViewPortHeight read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeCameraAvStreamManagementMinViewPortHeight : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementMinViewPortHeight() + : SubscribeAttribute("min-view-port-height") + { + } + + ~SubscribeAttributeCameraAvStreamManagementMinViewPortHeight() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::MinViewPortHeight::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 = [[MTRBaseClusterCameraAVStreamManagement 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 subscribeAttributeMinViewPortHeightWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(MTRCameraAVStreamManagementClusterVideoResolutionStruct * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.MinViewPortHeight 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 RateDistortionTradeOffPoints + */ +class ReadCameraAvStreamManagementRateDistortionTradeOffPoints : public ReadAttribute { +public: + ReadCameraAvStreamManagementRateDistortionTradeOffPoints() + : ReadAttribute("rate-distortion-trade-off-points") + { + } + + ~ReadCameraAvStreamManagementRateDistortionTradeOffPoints() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::RateDistortionTradeOffPoints::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 = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeRateDistortionTradeOffPointsWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.RateDistortionTradeOffPoints response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement RateDistortionTradeOffPoints read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeCameraAvStreamManagementRateDistortionTradeOffPoints : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementRateDistortionTradeOffPoints() + : SubscribeAttribute("rate-distortion-trade-off-points") + { + } + + ~SubscribeAttributeCameraAvStreamManagementRateDistortionTradeOffPoints() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::RateDistortionTradeOffPoints::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 = [[MTRBaseClusterCameraAVStreamManagement 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 subscribeAttributeRateDistortionTradeOffPointsWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.RateDistortionTradeOffPoints 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 MaxPreRollBufferSize + */ +class ReadCameraAvStreamManagementMaxPreRollBufferSize : public ReadAttribute { +public: + ReadCameraAvStreamManagementMaxPreRollBufferSize() + : ReadAttribute("max-pre-roll-buffer-size") + { + } + + ~ReadCameraAvStreamManagementMaxPreRollBufferSize() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::MaxPreRollBufferSize::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 = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeMaxPreRollBufferSizeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.MaxPreRollBufferSize response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement MaxPreRollBufferSize read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeCameraAvStreamManagementMaxPreRollBufferSize : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementMaxPreRollBufferSize() + : SubscribeAttribute("max-pre-roll-buffer-size") + { + } + + ~SubscribeAttributeCameraAvStreamManagementMaxPreRollBufferSize() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::MaxPreRollBufferSize::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 = [[MTRBaseClusterCameraAVStreamManagement 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 subscribeAttributeMaxPreRollBufferSizeWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.MaxPreRollBufferSize 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 MicrophoneCapabilities + */ +class ReadCameraAvStreamManagementMicrophoneCapabilities : public ReadAttribute { +public: + ReadCameraAvStreamManagementMicrophoneCapabilities() + : ReadAttribute("microphone-capabilities") + { + } + + ~ReadCameraAvStreamManagementMicrophoneCapabilities() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::MicrophoneCapabilities::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 = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeMicrophoneCapabilitiesWithCompletion:^(MTRCameraAVStreamManagementClusterAudioCapabilitiesStruct * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.MicrophoneCapabilities response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement MicrophoneCapabilities read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeCameraAvStreamManagementMicrophoneCapabilities : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementMicrophoneCapabilities() + : SubscribeAttribute("microphone-capabilities") + { + } + + ~SubscribeAttributeCameraAvStreamManagementMicrophoneCapabilities() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::MicrophoneCapabilities::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 = [[MTRBaseClusterCameraAVStreamManagement 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 subscribeAttributeMicrophoneCapabilitiesWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(MTRCameraAVStreamManagementClusterAudioCapabilitiesStruct * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.MicrophoneCapabilities 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 SpeakerCapabilities + */ +class ReadCameraAvStreamManagementSpeakerCapabilities : public ReadAttribute { +public: + ReadCameraAvStreamManagementSpeakerCapabilities() + : ReadAttribute("speaker-capabilities") + { + } + + ~ReadCameraAvStreamManagementSpeakerCapabilities() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::SpeakerCapabilities::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 = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeSpeakerCapabilitiesWithCompletion:^(MTRCameraAVStreamManagementClusterAudioCapabilitiesStruct * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.SpeakerCapabilities response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement SpeakerCapabilities read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeCameraAvStreamManagementSpeakerCapabilities : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementSpeakerCapabilities() + : SubscribeAttribute("speaker-capabilities") + { + } + + ~SubscribeAttributeCameraAvStreamManagementSpeakerCapabilities() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::SpeakerCapabilities::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 = [[MTRBaseClusterCameraAVStreamManagement 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 subscribeAttributeSpeakerCapabilitiesWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(MTRCameraAVStreamManagementClusterAudioCapabilitiesStruct * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.SpeakerCapabilities 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 TwoWayTalkSupport + */ +class ReadCameraAvStreamManagementTwoWayTalkSupport : public ReadAttribute { +public: + ReadCameraAvStreamManagementTwoWayTalkSupport() + : ReadAttribute("two-way-talk-support") + { + } + + ~ReadCameraAvStreamManagementTwoWayTalkSupport() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::TwoWayTalkSupport::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 = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeTwoWayTalkSupportWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.TwoWayTalkSupport response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement TwoWayTalkSupport read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeCameraAvStreamManagementTwoWayTalkSupport : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementTwoWayTalkSupport() + : SubscribeAttribute("two-way-talk-support") + { + } + + ~SubscribeAttributeCameraAvStreamManagementTwoWayTalkSupport() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::TwoWayTalkSupport::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 = [[MTRBaseClusterCameraAVStreamManagement 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 subscribeAttributeTwoWayTalkSupportWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.TwoWayTalkSupport 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 SupportedSnapshotParams + */ +class ReadCameraAvStreamManagementSupportedSnapshotParams : public ReadAttribute { +public: + ReadCameraAvStreamManagementSupportedSnapshotParams() + : ReadAttribute("supported-snapshot-params") + { + } + + ~ReadCameraAvStreamManagementSupportedSnapshotParams() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::SupportedSnapshotParams::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 = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeSupportedSnapshotParamsWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.SupportedSnapshotParams response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement SupportedSnapshotParams read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeCameraAvStreamManagementSupportedSnapshotParams : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementSupportedSnapshotParams() + : SubscribeAttribute("supported-snapshot-params") + { + } + + ~SubscribeAttributeCameraAvStreamManagementSupportedSnapshotParams() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::SupportedSnapshotParams::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 = [[MTRBaseClusterCameraAVStreamManagement 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 subscribeAttributeSupportedSnapshotParamsWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.SupportedSnapshotParams 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 HDRCapable + */ +class ReadCameraAvStreamManagementHDRCapable : public ReadAttribute { +public: + ReadCameraAvStreamManagementHDRCapable() + : ReadAttribute("hdrcapable") + { + } + + ~ReadCameraAvStreamManagementHDRCapable() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::HDRCapable::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 = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeHDRCapableWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.HDRCapable response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement HDRCapable read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeCameraAvStreamManagementHDRCapable : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementHDRCapable() + : SubscribeAttribute("hdrcapable") + { + } + + ~SubscribeAttributeCameraAvStreamManagementHDRCapable() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::HDRCapable::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 = [[MTRBaseClusterCameraAVStreamManagement 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 subscribeAttributeHDRCapableWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.HDRCapable 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 MaxNetworkBandwidth + */ +class ReadCameraAvStreamManagementMaxNetworkBandwidth : public ReadAttribute { +public: + ReadCameraAvStreamManagementMaxNetworkBandwidth() + : ReadAttribute("max-network-bandwidth") + { + } + + ~ReadCameraAvStreamManagementMaxNetworkBandwidth() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::MaxNetworkBandwidth::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 = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeMaxNetworkBandwidthWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.MaxNetworkBandwidth response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement MaxNetworkBandwidth read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeCameraAvStreamManagementMaxNetworkBandwidth : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementMaxNetworkBandwidth() + : SubscribeAttribute("max-network-bandwidth") + { + } + + ~SubscribeAttributeCameraAvStreamManagementMaxNetworkBandwidth() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::MaxNetworkBandwidth::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 = [[MTRBaseClusterCameraAVStreamManagement 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 subscribeAttributeMaxNetworkBandwidthWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.MaxNetworkBandwidth 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 CurrentFrameRate + */ +class ReadCameraAvStreamManagementCurrentFrameRate : public ReadAttribute { +public: + ReadCameraAvStreamManagementCurrentFrameRate() + : ReadAttribute("current-frame-rate") + { + } + + ~ReadCameraAvStreamManagementCurrentFrameRate() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::CurrentFrameRate::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 = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeCurrentFrameRateWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.CurrentFrameRate response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement CurrentFrameRate read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeCameraAvStreamManagementCurrentFrameRate : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementCurrentFrameRate() + : SubscribeAttribute("current-frame-rate") + { + } + + ~SubscribeAttributeCameraAvStreamManagementCurrentFrameRate() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::CurrentFrameRate::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 = [[MTRBaseClusterCameraAVStreamManagement 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 subscribeAttributeCurrentFrameRateWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.CurrentFrameRate 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 HDRMode + */ +class ReadCameraAvStreamManagementHDRMode : public ReadAttribute { +public: + ReadCameraAvStreamManagementHDRMode() + : ReadAttribute("hdrmode") + { + } + + ~ReadCameraAvStreamManagementHDRMode() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::HDRMode::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 = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeHDRModeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.HDRMode response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement HDRMode read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class WriteCameraAvStreamManagementHDRMode : public WriteAttribute { +public: + WriteCameraAvStreamManagementHDRMode() + : WriteAttribute("hdrmode") + { + AddArgument("attr-name", "hdrmode"); + AddArgument("attr-value", 0, 1, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteCameraAvStreamManagementHDRMode() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::HDRMode::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") WriteAttribute (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 = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRWriteParams alloc] init]; + params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithBool:mValue]; + + [cluster writeAttributeHDRModeWithValue:value params:params completion:^(NSError * _Nullable error) { + if (error != nil) { + LogNSError("CameraAVStreamManagement HDRMode write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } + +private: + bool mValue; +}; + +class SubscribeAttributeCameraAvStreamManagementHDRMode : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementHDRMode() + : SubscribeAttribute("hdrmode") + { + } + + ~SubscribeAttributeCameraAvStreamManagementHDRMode() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::HDRMode::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 = [[MTRBaseClusterCameraAVStreamManagement 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 subscribeAttributeHDRModeWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.HDRMode 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 CurrentVideoCodecs + */ +class ReadCameraAvStreamManagementCurrentVideoCodecs : public ReadAttribute { +public: + ReadCameraAvStreamManagementCurrentVideoCodecs() + : ReadAttribute("current-video-codecs") + { + } + + ~ReadCameraAvStreamManagementCurrentVideoCodecs() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::CurrentVideoCodecs::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 = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeCurrentVideoCodecsWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.CurrentVideoCodecs response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement CurrentVideoCodecs read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeCameraAvStreamManagementCurrentVideoCodecs : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementCurrentVideoCodecs() + : SubscribeAttribute("current-video-codecs") + { + } + + ~SubscribeAttributeCameraAvStreamManagementCurrentVideoCodecs() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::CurrentVideoCodecs::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 = [[MTRBaseClusterCameraAVStreamManagement 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 subscribeAttributeCurrentVideoCodecsWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.CurrentVideoCodecs 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 CurrentSnapshotConfig + */ +class ReadCameraAvStreamManagementCurrentSnapshotConfig : public ReadAttribute { +public: + ReadCameraAvStreamManagementCurrentSnapshotConfig() + : ReadAttribute("current-snapshot-config") + { + } + + ~ReadCameraAvStreamManagementCurrentSnapshotConfig() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::CurrentSnapshotConfig::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 = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeCurrentSnapshotConfigWithCompletion:^(MTRCameraAVStreamManagementClusterSnapshotParamsStruct * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.CurrentSnapshotConfig response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement CurrentSnapshotConfig read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeCameraAvStreamManagementCurrentSnapshotConfig : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementCurrentSnapshotConfig() + : SubscribeAttribute("current-snapshot-config") + { + } + + ~SubscribeAttributeCameraAvStreamManagementCurrentSnapshotConfig() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::CurrentSnapshotConfig::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 = [[MTRBaseClusterCameraAVStreamManagement 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 subscribeAttributeCurrentSnapshotConfigWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(MTRCameraAVStreamManagementClusterSnapshotParamsStruct * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.CurrentSnapshotConfig 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 FabricsUsingCamera + */ +class ReadCameraAvStreamManagementFabricsUsingCamera : public ReadAttribute { +public: + ReadCameraAvStreamManagementFabricsUsingCamera() + : ReadAttribute("fabrics-using-camera") + { + } + + ~ReadCameraAvStreamManagementFabricsUsingCamera() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::FabricsUsingCamera::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 = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeFabricsUsingCameraWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.FabricsUsingCamera response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement FabricsUsingCamera read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeCameraAvStreamManagementFabricsUsingCamera : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementFabricsUsingCamera() + : SubscribeAttribute("fabrics-using-camera") + { + } + + ~SubscribeAttributeCameraAvStreamManagementFabricsUsingCamera() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::FabricsUsingCamera::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 = [[MTRBaseClusterCameraAVStreamManagement 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 subscribeAttributeFabricsUsingCameraWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.FabricsUsingCamera 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 AllocatedVideoStreams + */ +class ReadCameraAvStreamManagementAllocatedVideoStreams : public ReadAttribute { +public: + ReadCameraAvStreamManagementAllocatedVideoStreams() + : ReadAttribute("allocated-video-streams") + { + } + + ~ReadCameraAvStreamManagementAllocatedVideoStreams() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::AllocatedVideoStreams::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 = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeAllocatedVideoStreamsWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.AllocatedVideoStreams response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement AllocatedVideoStreams read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeCameraAvStreamManagementAllocatedVideoStreams : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementAllocatedVideoStreams() + : SubscribeAttribute("allocated-video-streams") + { + } + + ~SubscribeAttributeCameraAvStreamManagementAllocatedVideoStreams() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::AllocatedVideoStreams::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 = [[MTRBaseClusterCameraAVStreamManagement 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 subscribeAttributeAllocatedVideoStreamsWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.AllocatedVideoStreams 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 AllocatedAudioStreams + */ +class ReadCameraAvStreamManagementAllocatedAudioStreams : public ReadAttribute { +public: + ReadCameraAvStreamManagementAllocatedAudioStreams() + : ReadAttribute("allocated-audio-streams") + { + } + + ~ReadCameraAvStreamManagementAllocatedAudioStreams() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::AllocatedAudioStreams::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 = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeAllocatedAudioStreamsWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.AllocatedAudioStreams response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement AllocatedAudioStreams read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeCameraAvStreamManagementAllocatedAudioStreams : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementAllocatedAudioStreams() + : SubscribeAttribute("allocated-audio-streams") + { + } + + ~SubscribeAttributeCameraAvStreamManagementAllocatedAudioStreams() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::AllocatedAudioStreams::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 = [[MTRBaseClusterCameraAVStreamManagement 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 subscribeAttributeAllocatedAudioStreamsWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.AllocatedAudioStreams 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 AllocatedSnapshotStreams + */ +class ReadCameraAvStreamManagementAllocatedSnapshotStreams : public ReadAttribute { +public: + ReadCameraAvStreamManagementAllocatedSnapshotStreams() + : ReadAttribute("allocated-snapshot-streams") + { + } + + ~ReadCameraAvStreamManagementAllocatedSnapshotStreams() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::AllocatedSnapshotStreams::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 = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeAllocatedSnapshotStreamsWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.AllocatedSnapshotStreams response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement AllocatedSnapshotStreams read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeCameraAvStreamManagementAllocatedSnapshotStreams : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementAllocatedSnapshotStreams() + : SubscribeAttribute("allocated-snapshot-streams") + { + } + + ~SubscribeAttributeCameraAvStreamManagementAllocatedSnapshotStreams() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::AllocatedSnapshotStreams::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 = [[MTRBaseClusterCameraAVStreamManagement 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 subscribeAttributeAllocatedSnapshotStreamsWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.AllocatedSnapshotStreams 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 RankedVideoStreamPrioritiesList + */ +class ReadCameraAvStreamManagementRankedVideoStreamPrioritiesList : public ReadAttribute { +public: + ReadCameraAvStreamManagementRankedVideoStreamPrioritiesList() + : ReadAttribute("ranked-video-stream-priorities-list") + { + } + + ~ReadCameraAvStreamManagementRankedVideoStreamPrioritiesList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::RankedVideoStreamPrioritiesList::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 = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeRankedVideoStreamPrioritiesListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.RankedVideoStreamPrioritiesList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement RankedVideoStreamPrioritiesList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class WriteCameraAvStreamManagementRankedVideoStreamPrioritiesList : public WriteAttribute { +public: + WriteCameraAvStreamManagementRankedVideoStreamPrioritiesList() + : WriteAttribute("ranked-video-stream-priorities-list") + , mComplex(&mValue) + { + AddArgument("attr-name", "ranked-video-stream-priorities-list"); + AddArgument("attr-value", &mComplex); + WriteAttribute::AddArguments(); + } + + ~WriteCameraAvStreamManagementRankedVideoStreamPrioritiesList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::RankedVideoStreamPrioritiesList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") WriteAttribute (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 = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRWriteParams alloc] init]; + params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + for (auto & entry_0 : mValue) { + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0)]; + [array_0 addObject:newElement_0]; + } + value = array_0; + } + + [cluster writeAttributeRankedVideoStreamPrioritiesListWithValue:value params:params completion:^(NSError * _Nullable error) { + if (error != nil) { + LogNSError("CameraAVStreamManagement RankedVideoStreamPrioritiesList write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } + +private: + chip::app::DataModel::List mValue; + TypedComplexArgument> mComplex; +}; + +class SubscribeAttributeCameraAvStreamManagementRankedVideoStreamPrioritiesList : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementRankedVideoStreamPrioritiesList() + : SubscribeAttribute("ranked-video-stream-priorities-list") + { + } + + ~SubscribeAttributeCameraAvStreamManagementRankedVideoStreamPrioritiesList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::RankedVideoStreamPrioritiesList::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 = [[MTRBaseClusterCameraAVStreamManagement 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 subscribeAttributeRankedVideoStreamPrioritiesListWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.RankedVideoStreamPrioritiesList 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 SoftRecordingPrivacyModeSetting + */ +class ReadCameraAvStreamManagementSoftRecordingPrivacyModeSetting : public ReadAttribute { +public: + ReadCameraAvStreamManagementSoftRecordingPrivacyModeSetting() + : ReadAttribute("soft-recording-privacy-mode-setting") + { + } + + ~ReadCameraAvStreamManagementSoftRecordingPrivacyModeSetting() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::SoftRecordingPrivacyModeSetting::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 = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeSoftRecordingPrivacyModeSettingWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.SoftRecordingPrivacyModeSetting response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement SoftRecordingPrivacyModeSetting read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class WriteCameraAvStreamManagementSoftRecordingPrivacyModeSetting : public WriteAttribute { +public: + WriteCameraAvStreamManagementSoftRecordingPrivacyModeSetting() + : WriteAttribute("soft-recording-privacy-mode-setting") + { + AddArgument("attr-name", "soft-recording-privacy-mode-setting"); + AddArgument("attr-value", 0, 1, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteCameraAvStreamManagementSoftRecordingPrivacyModeSetting() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::SoftRecordingPrivacyModeSetting::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") WriteAttribute (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 = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRWriteParams alloc] init]; + params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithBool:mValue]; + + [cluster writeAttributeSoftRecordingPrivacyModeSettingWithValue:value params:params completion:^(NSError * _Nullable error) { + if (error != nil) { + LogNSError("CameraAVStreamManagement SoftRecordingPrivacyModeSetting write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } + +private: + bool mValue; +}; + +class SubscribeAttributeCameraAvStreamManagementSoftRecordingPrivacyModeSetting : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementSoftRecordingPrivacyModeSetting() + : SubscribeAttribute("soft-recording-privacy-mode-setting") + { + } + + ~SubscribeAttributeCameraAvStreamManagementSoftRecordingPrivacyModeSetting() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::SoftRecordingPrivacyModeSetting::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 = [[MTRBaseClusterCameraAVStreamManagement 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 subscribeAttributeSoftRecordingPrivacyModeSettingWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.SoftRecordingPrivacyModeSetting 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 SoftLivestreamPrivacyModeSetting + */ +class ReadCameraAvStreamManagementSoftLivestreamPrivacyModeSetting : public ReadAttribute { +public: + ReadCameraAvStreamManagementSoftLivestreamPrivacyModeSetting() + : ReadAttribute("soft-livestream-privacy-mode-setting") + { + } + + ~ReadCameraAvStreamManagementSoftLivestreamPrivacyModeSetting() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::SoftLivestreamPrivacyModeSetting::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 = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeSoftLivestreamPrivacyModeSettingWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.SoftLivestreamPrivacyModeSetting response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement SoftLivestreamPrivacyModeSetting read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class WriteCameraAvStreamManagementSoftLivestreamPrivacyModeSetting : public WriteAttribute { +public: + WriteCameraAvStreamManagementSoftLivestreamPrivacyModeSetting() + : WriteAttribute("soft-livestream-privacy-mode-setting") + { + AddArgument("attr-name", "soft-livestream-privacy-mode-setting"); + AddArgument("attr-value", 0, 1, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteCameraAvStreamManagementSoftLivestreamPrivacyModeSetting() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::SoftLivestreamPrivacyModeSetting::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") WriteAttribute (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 = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRWriteParams alloc] init]; + params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithBool:mValue]; + + [cluster writeAttributeSoftLivestreamPrivacyModeSettingWithValue:value params:params completion:^(NSError * _Nullable error) { + if (error != nil) { + LogNSError("CameraAVStreamManagement SoftLivestreamPrivacyModeSetting write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } + +private: + bool mValue; +}; + +class SubscribeAttributeCameraAvStreamManagementSoftLivestreamPrivacyModeSetting : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementSoftLivestreamPrivacyModeSetting() + : SubscribeAttribute("soft-livestream-privacy-mode-setting") + { + } + + ~SubscribeAttributeCameraAvStreamManagementSoftLivestreamPrivacyModeSetting() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::SoftLivestreamPrivacyModeSetting::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 = [[MTRBaseClusterCameraAVStreamManagement 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 subscribeAttributeSoftLivestreamPrivacyModeSettingWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.SoftLivestreamPrivacyModeSetting 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 HardPrivacyMode + */ +class ReadCameraAvStreamManagementHardPrivacyMode : public ReadAttribute { +public: + ReadCameraAvStreamManagementHardPrivacyMode() + : ReadAttribute("hard-privacy-mode") + { + } + + ~ReadCameraAvStreamManagementHardPrivacyMode() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::HardPrivacyMode::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 = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeHardPrivacyModeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.HardPrivacyMode response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement HardPrivacyMode read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeCameraAvStreamManagementHardPrivacyMode : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementHardPrivacyMode() + : SubscribeAttribute("hard-privacy-mode") + { + } + + ~SubscribeAttributeCameraAvStreamManagementHardPrivacyMode() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::HardPrivacyMode::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 = [[MTRBaseClusterCameraAVStreamManagement 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 subscribeAttributeHardPrivacyModeWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.HardPrivacyMode 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 NightVision + */ +class ReadCameraAvStreamManagementNightVision : public ReadAttribute { +public: + ReadCameraAvStreamManagementNightVision() + : ReadAttribute("night-vision") + { + } + + ~ReadCameraAvStreamManagementNightVision() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::NightVision::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 = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeNightVisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.NightVision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement NightVision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class WriteCameraAvStreamManagementNightVision : public WriteAttribute { +public: + WriteCameraAvStreamManagementNightVision() + : WriteAttribute("night-vision") + { + AddArgument("attr-name", "night-vision"); + AddArgument("attr-value", 0, UINT8_MAX, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteCameraAvStreamManagementNightVision() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::NightVision::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") WriteAttribute (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 = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRWriteParams alloc] init]; + params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; + + [cluster writeAttributeNightVisionWithValue:value params:params completion:^(NSError * _Nullable error) { + if (error != nil) { + LogNSError("CameraAVStreamManagement NightVision write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } + +private: + uint8_t mValue; +}; + +class SubscribeAttributeCameraAvStreamManagementNightVision : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementNightVision() + : SubscribeAttribute("night-vision") + { + } + + ~SubscribeAttributeCameraAvStreamManagementNightVision() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::NightVision::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 = [[MTRBaseClusterCameraAVStreamManagement 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 subscribeAttributeNightVisionWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.NightVision 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 NightVisionIllum + */ +class ReadCameraAvStreamManagementNightVisionIllum : public ReadAttribute { +public: + ReadCameraAvStreamManagementNightVisionIllum() + : ReadAttribute("night-vision-illum") + { + } + + ~ReadCameraAvStreamManagementNightVisionIllum() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::NightVisionIllum::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 = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeNightVisionIllumWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.NightVisionIllum response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement NightVisionIllum read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class WriteCameraAvStreamManagementNightVisionIllum : public WriteAttribute { +public: + WriteCameraAvStreamManagementNightVisionIllum() + : WriteAttribute("night-vision-illum") + { + AddArgument("attr-name", "night-vision-illum"); + AddArgument("attr-value", 0, UINT8_MAX, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteCameraAvStreamManagementNightVisionIllum() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::NightVisionIllum::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") WriteAttribute (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 = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRWriteParams alloc] init]; + params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; + + [cluster writeAttributeNightVisionIllumWithValue:value params:params completion:^(NSError * _Nullable error) { + if (error != nil) { + LogNSError("CameraAVStreamManagement NightVisionIllum write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } + +private: + uint8_t mValue; +}; + +class SubscribeAttributeCameraAvStreamManagementNightVisionIllum : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementNightVisionIllum() + : SubscribeAttribute("night-vision-illum") + { + } + + ~SubscribeAttributeCameraAvStreamManagementNightVisionIllum() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::NightVisionIllum::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 = [[MTRBaseClusterCameraAVStreamManagement 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 subscribeAttributeNightVisionIllumWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.NightVisionIllum 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 Awb + */ +class ReadCameraAvStreamManagementAwb : public ReadAttribute { +public: + ReadCameraAvStreamManagementAwb() + : ReadAttribute("awb") + { + } + + ~ReadCameraAvStreamManagementAwb() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::Awb::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 = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeAWBWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.AWB response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement AWB read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class WriteCameraAvStreamManagementAwb : public WriteAttribute { +public: + WriteCameraAvStreamManagementAwb() + : WriteAttribute("awb") + { + AddArgument("attr-name", "awb"); + AddArgument("attr-value", 0, 1, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteCameraAvStreamManagementAwb() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::Awb::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") WriteAttribute (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 = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRWriteParams alloc] init]; + params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithBool:mValue]; + + [cluster writeAttributeAWBWithValue:value params:params completion:^(NSError * _Nullable error) { + if (error != nil) { + LogNSError("CameraAVStreamManagement AWB write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } + +private: + bool mValue; +}; + +class SubscribeAttributeCameraAvStreamManagementAwb : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementAwb() + : SubscribeAttribute("awb") + { + } + + ~SubscribeAttributeCameraAvStreamManagementAwb() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::Awb::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 = [[MTRBaseClusterCameraAVStreamManagement 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 subscribeAttributeAWBWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.AWB 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 ShutterSpeed + */ +class ReadCameraAvStreamManagementShutterSpeed : public ReadAttribute { +public: + ReadCameraAvStreamManagementShutterSpeed() + : ReadAttribute("shutter-speed") + { + } + + ~ReadCameraAvStreamManagementShutterSpeed() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::ShutterSpeed::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 = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeShutterSpeedWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.ShutterSpeed response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement ShutterSpeed read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class WriteCameraAvStreamManagementShutterSpeed : public WriteAttribute { +public: + WriteCameraAvStreamManagementShutterSpeed() + : WriteAttribute("shutter-speed") + { + AddArgument("attr-name", "shutter-speed"); + AddArgument("attr-value", 0, 1, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteCameraAvStreamManagementShutterSpeed() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::ShutterSpeed::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") WriteAttribute (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 = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRWriteParams alloc] init]; + params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithBool:mValue]; + + [cluster writeAttributeShutterSpeedWithValue:value params:params completion:^(NSError * _Nullable error) { + if (error != nil) { + LogNSError("CameraAVStreamManagement ShutterSpeed write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } + +private: + bool mValue; +}; + +class SubscribeAttributeCameraAvStreamManagementShutterSpeed : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementShutterSpeed() + : SubscribeAttribute("shutter-speed") + { + } + + ~SubscribeAttributeCameraAvStreamManagementShutterSpeed() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::ShutterSpeed::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 = [[MTRBaseClusterCameraAVStreamManagement 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 subscribeAttributeShutterSpeedWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.ShutterSpeed 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 Iso + */ +class ReadCameraAvStreamManagementIso : public ReadAttribute { +public: + ReadCameraAvStreamManagementIso() + : ReadAttribute("iso") + { + } + + ~ReadCameraAvStreamManagementIso() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::Iso::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 = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeISOWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.ISO response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement ISO read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class WriteCameraAvStreamManagementIso : public WriteAttribute { +public: + WriteCameraAvStreamManagementIso() + : WriteAttribute("iso") + { + AddArgument("attr-name", "iso"); + AddArgument("attr-value", 0, 1, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteCameraAvStreamManagementIso() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::Iso::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") WriteAttribute (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 = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRWriteParams alloc] init]; + params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithBool:mValue]; + + [cluster writeAttributeISOWithValue:value params:params completion:^(NSError * _Nullable error) { + if (error != nil) { + LogNSError("CameraAVStreamManagement ISO write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } + +private: + bool mValue; +}; + +class SubscribeAttributeCameraAvStreamManagementIso : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementIso() + : SubscribeAttribute("iso") + { + } + + ~SubscribeAttributeCameraAvStreamManagementIso() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::Iso::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 = [[MTRBaseClusterCameraAVStreamManagement 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 subscribeAttributeISOWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.ISO 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 Viewport + */ +class ReadCameraAvStreamManagementViewport : public ReadAttribute { +public: + ReadCameraAvStreamManagementViewport() + : ReadAttribute("viewport") + { + } + + ~ReadCameraAvStreamManagementViewport() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::Viewport::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 = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeViewportWithCompletion:^(MTRCameraAVStreamManagementClusterViewportStruct * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.Viewport response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement Viewport read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeCameraAvStreamManagementViewport : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementViewport() + : SubscribeAttribute("viewport") + { + } + + ~SubscribeAttributeCameraAvStreamManagementViewport() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::Viewport::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 = [[MTRBaseClusterCameraAVStreamManagement 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 subscribeAttributeViewportWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(MTRCameraAVStreamManagementClusterViewportStruct * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.Viewport 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 SpeakerEnabled + */ +class ReadCameraAvStreamManagementSpeakerEnabled : public ReadAttribute { +public: + ReadCameraAvStreamManagementSpeakerEnabled() + : ReadAttribute("speaker-enabled") + { + } + + ~ReadCameraAvStreamManagementSpeakerEnabled() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::SpeakerEnabled::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 = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeSpeakerEnabledWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.SpeakerEnabled response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement SpeakerEnabled read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class WriteCameraAvStreamManagementSpeakerEnabled : public WriteAttribute { +public: + WriteCameraAvStreamManagementSpeakerEnabled() + : WriteAttribute("speaker-enabled") + { + AddArgument("attr-name", "speaker-enabled"); + AddArgument("attr-value", 0, 1, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteCameraAvStreamManagementSpeakerEnabled() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::SpeakerEnabled::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") WriteAttribute (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 = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRWriteParams alloc] init]; + params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithBool:mValue]; + + [cluster writeAttributeSpeakerEnabledWithValue:value params:params completion:^(NSError * _Nullable error) { + if (error != nil) { + LogNSError("CameraAVStreamManagement SpeakerEnabled write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } + +private: + bool mValue; +}; + +class SubscribeAttributeCameraAvStreamManagementSpeakerEnabled : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementSpeakerEnabled() + : SubscribeAttribute("speaker-enabled") + { + } + + ~SubscribeAttributeCameraAvStreamManagementSpeakerEnabled() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::SpeakerEnabled::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 = [[MTRBaseClusterCameraAVStreamManagement 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 subscribeAttributeSpeakerEnabledWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.SpeakerEnabled 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 SpeakerVolumeLevel + */ +class ReadCameraAvStreamManagementSpeakerVolumeLevel : public ReadAttribute { +public: + ReadCameraAvStreamManagementSpeakerVolumeLevel() + : ReadAttribute("speaker-volume-level") + { + } + + ~ReadCameraAvStreamManagementSpeakerVolumeLevel() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::SpeakerVolumeLevel::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 = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeSpeakerVolumeLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.SpeakerVolumeLevel response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement SpeakerVolumeLevel read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class WriteCameraAvStreamManagementSpeakerVolumeLevel : public WriteAttribute { +public: + WriteCameraAvStreamManagementSpeakerVolumeLevel() + : WriteAttribute("speaker-volume-level") + { + AddArgument("attr-name", "speaker-volume-level"); + AddArgument("attr-value", 0, UINT8_MAX, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteCameraAvStreamManagementSpeakerVolumeLevel() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::SpeakerVolumeLevel::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") WriteAttribute (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 = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRWriteParams alloc] init]; + params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; + + [cluster writeAttributeSpeakerVolumeLevelWithValue:value params:params completion:^(NSError * _Nullable error) { + if (error != nil) { + LogNSError("CameraAVStreamManagement SpeakerVolumeLevel write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } + +private: + uint8_t mValue; +}; + +class SubscribeAttributeCameraAvStreamManagementSpeakerVolumeLevel : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementSpeakerVolumeLevel() + : SubscribeAttribute("speaker-volume-level") + { + } + + ~SubscribeAttributeCameraAvStreamManagementSpeakerVolumeLevel() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::SpeakerVolumeLevel::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 = [[MTRBaseClusterCameraAVStreamManagement 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 subscribeAttributeSpeakerVolumeLevelWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.SpeakerVolumeLevel 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 SpeakerMaxLevel + */ +class ReadCameraAvStreamManagementSpeakerMaxLevel : public ReadAttribute { +public: + ReadCameraAvStreamManagementSpeakerMaxLevel() + : ReadAttribute("speaker-max-level") + { + } + + ~ReadCameraAvStreamManagementSpeakerMaxLevel() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::SpeakerMaxLevel::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 = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeSpeakerMaxLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.SpeakerMaxLevel response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement SpeakerMaxLevel read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class WriteCameraAvStreamManagementSpeakerMaxLevel : public WriteAttribute { +public: + WriteCameraAvStreamManagementSpeakerMaxLevel() + : WriteAttribute("speaker-max-level") + { + AddArgument("attr-name", "speaker-max-level"); + AddArgument("attr-value", 0, UINT8_MAX, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteCameraAvStreamManagementSpeakerMaxLevel() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::SpeakerMaxLevel::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") WriteAttribute (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 = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRWriteParams alloc] init]; + params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; + + [cluster writeAttributeSpeakerMaxLevelWithValue:value params:params completion:^(NSError * _Nullable error) { + if (error != nil) { + LogNSError("CameraAVStreamManagement SpeakerMaxLevel write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } + +private: + uint8_t mValue; +}; + +class SubscribeAttributeCameraAvStreamManagementSpeakerMaxLevel : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementSpeakerMaxLevel() + : SubscribeAttribute("speaker-max-level") + { + } + + ~SubscribeAttributeCameraAvStreamManagementSpeakerMaxLevel() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::SpeakerMaxLevel::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 = [[MTRBaseClusterCameraAVStreamManagement 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 subscribeAttributeSpeakerMaxLevelWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.SpeakerMaxLevel 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 SpeakerMinLevel + */ +class ReadCameraAvStreamManagementSpeakerMinLevel : public ReadAttribute { +public: + ReadCameraAvStreamManagementSpeakerMinLevel() + : ReadAttribute("speaker-min-level") + { + } + + ~ReadCameraAvStreamManagementSpeakerMinLevel() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::SpeakerMinLevel::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 = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeSpeakerMinLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.SpeakerMinLevel response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement SpeakerMinLevel read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class WriteCameraAvStreamManagementSpeakerMinLevel : public WriteAttribute { +public: + WriteCameraAvStreamManagementSpeakerMinLevel() + : WriteAttribute("speaker-min-level") + { + AddArgument("attr-name", "speaker-min-level"); + AddArgument("attr-value", 0, UINT8_MAX, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteCameraAvStreamManagementSpeakerMinLevel() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::SpeakerMinLevel::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") WriteAttribute (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 = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRWriteParams alloc] init]; + params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; + + [cluster writeAttributeSpeakerMinLevelWithValue:value params:params completion:^(NSError * _Nullable error) { + if (error != nil) { + LogNSError("CameraAVStreamManagement SpeakerMinLevel write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } + +private: + uint8_t mValue; +}; + +class SubscribeAttributeCameraAvStreamManagementSpeakerMinLevel : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementSpeakerMinLevel() + : SubscribeAttribute("speaker-min-level") + { + } + + ~SubscribeAttributeCameraAvStreamManagementSpeakerMinLevel() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::SpeakerMinLevel::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 = [[MTRBaseClusterCameraAVStreamManagement 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 subscribeAttributeSpeakerMinLevelWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.SpeakerMinLevel 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 MicStatus + */ +class ReadCameraAvStreamManagementMicStatus : public ReadAttribute { +public: + ReadCameraAvStreamManagementMicStatus() + : ReadAttribute("mic-status") + { + } + + ~ReadCameraAvStreamManagementMicStatus() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::MicStatus::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 = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeMicStatusWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.MicStatus response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement MicStatus read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class WriteCameraAvStreamManagementMicStatus : public WriteAttribute { +public: + WriteCameraAvStreamManagementMicStatus() + : WriteAttribute("mic-status") + { + AddArgument("attr-name", "mic-status"); + AddArgument("attr-value", 0, 1, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteCameraAvStreamManagementMicStatus() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::MicStatus::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") WriteAttribute (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 = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRWriteParams alloc] init]; + params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithBool:mValue]; + + [cluster writeAttributeMicStatusWithValue:value params:params completion:^(NSError * _Nullable error) { + if (error != nil) { + LogNSError("CameraAVStreamManagement MicStatus write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } + +private: + bool mValue; +}; + +class SubscribeAttributeCameraAvStreamManagementMicStatus : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementMicStatus() + : SubscribeAttribute("mic-status") + { + } + + ~SubscribeAttributeCameraAvStreamManagementMicStatus() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::MicStatus::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 = [[MTRBaseClusterCameraAVStreamManagement 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 subscribeAttributeMicStatusWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.MicStatus 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 MicVolumeLevel + */ +class ReadCameraAvStreamManagementMicVolumeLevel : public ReadAttribute { +public: + ReadCameraAvStreamManagementMicVolumeLevel() + : ReadAttribute("mic-volume-level") + { + } + + ~ReadCameraAvStreamManagementMicVolumeLevel() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::MicVolumeLevel::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 = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeMicVolumeLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.MicVolumeLevel response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement MicVolumeLevel read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class WriteCameraAvStreamManagementMicVolumeLevel : public WriteAttribute { +public: + WriteCameraAvStreamManagementMicVolumeLevel() + : WriteAttribute("mic-volume-level") + { + AddArgument("attr-name", "mic-volume-level"); + AddArgument("attr-value", 0, UINT8_MAX, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteCameraAvStreamManagementMicVolumeLevel() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::MicVolumeLevel::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") WriteAttribute (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 = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRWriteParams alloc] init]; + params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; + + [cluster writeAttributeMicVolumeLevelWithValue:value params:params completion:^(NSError * _Nullable error) { + if (error != nil) { + LogNSError("CameraAVStreamManagement MicVolumeLevel write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } + +private: + uint8_t mValue; +}; + +class SubscribeAttributeCameraAvStreamManagementMicVolumeLevel : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementMicVolumeLevel() + : SubscribeAttribute("mic-volume-level") + { + } + + ~SubscribeAttributeCameraAvStreamManagementMicVolumeLevel() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::MicVolumeLevel::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 = [[MTRBaseClusterCameraAVStreamManagement 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 subscribeAttributeMicVolumeLevelWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.MicVolumeLevel 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 MicMaxLevel + */ +class ReadCameraAvStreamManagementMicMaxLevel : public ReadAttribute { +public: + ReadCameraAvStreamManagementMicMaxLevel() + : ReadAttribute("mic-max-level") + { + } + + ~ReadCameraAvStreamManagementMicMaxLevel() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::MicMaxLevel::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 = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeMicMaxLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.MicMaxLevel response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement MicMaxLevel read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class WriteCameraAvStreamManagementMicMaxLevel : public WriteAttribute { +public: + WriteCameraAvStreamManagementMicMaxLevel() + : WriteAttribute("mic-max-level") + { + AddArgument("attr-name", "mic-max-level"); + AddArgument("attr-value", 0, UINT8_MAX, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteCameraAvStreamManagementMicMaxLevel() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::MicMaxLevel::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") WriteAttribute (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 = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRWriteParams alloc] init]; + params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; + + [cluster writeAttributeMicMaxLevelWithValue:value params:params completion:^(NSError * _Nullable error) { + if (error != nil) { + LogNSError("CameraAVStreamManagement MicMaxLevel write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } + +private: + uint8_t mValue; +}; + +class SubscribeAttributeCameraAvStreamManagementMicMaxLevel : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementMicMaxLevel() + : SubscribeAttribute("mic-max-level") + { + } + + ~SubscribeAttributeCameraAvStreamManagementMicMaxLevel() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::MicMaxLevel::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 = [[MTRBaseClusterCameraAVStreamManagement 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 subscribeAttributeMicMaxLevelWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.MicMaxLevel 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 MicMinLevel + */ +class ReadCameraAvStreamManagementMicMinLevel : public ReadAttribute { +public: + ReadCameraAvStreamManagementMicMinLevel() + : ReadAttribute("mic-min-level") + { + } + + ~ReadCameraAvStreamManagementMicMinLevel() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::MicMinLevel::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 = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeMicMinLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.MicMinLevel response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement MicMinLevel read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class WriteCameraAvStreamManagementMicMinLevel : public WriteAttribute { +public: + WriteCameraAvStreamManagementMicMinLevel() + : WriteAttribute("mic-min-level") + { + AddArgument("attr-name", "mic-min-level"); + AddArgument("attr-value", 0, UINT8_MAX, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteCameraAvStreamManagementMicMinLevel() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::MicMinLevel::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") WriteAttribute (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 = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRWriteParams alloc] init]; + params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; + + [cluster writeAttributeMicMinLevelWithValue:value params:params completion:^(NSError * _Nullable error) { + if (error != nil) { + LogNSError("CameraAVStreamManagement MicMinLevel write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } + +private: + uint8_t mValue; +}; + +class SubscribeAttributeCameraAvStreamManagementMicMinLevel : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementMicMinLevel() + : SubscribeAttribute("mic-min-level") + { + } + + ~SubscribeAttributeCameraAvStreamManagementMicMinLevel() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::MicMinLevel::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 = [[MTRBaseClusterCameraAVStreamManagement 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 subscribeAttributeMicMinLevelWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.MicMinLevel 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 MicAGCEnabled + */ +class ReadCameraAvStreamManagementMicAGCEnabled : public ReadAttribute { +public: + ReadCameraAvStreamManagementMicAGCEnabled() + : ReadAttribute("mic-agcenabled") + { + } + + ~ReadCameraAvStreamManagementMicAGCEnabled() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::MicAGCEnabled::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 = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeMicAGCEnabledWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.MicAGCEnabled response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement MicAGCEnabled read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class WriteCameraAvStreamManagementMicAGCEnabled : public WriteAttribute { +public: + WriteCameraAvStreamManagementMicAGCEnabled() + : WriteAttribute("mic-agcenabled") + { + AddArgument("attr-name", "mic-agcenabled"); + AddArgument("attr-value", 0, 1, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteCameraAvStreamManagementMicAGCEnabled() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::MicAGCEnabled::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") WriteAttribute (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 = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRWriteParams alloc] init]; + params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithBool:mValue]; + + [cluster writeAttributeMicAGCEnabledWithValue:value params:params completion:^(NSError * _Nullable error) { + if (error != nil) { + LogNSError("CameraAVStreamManagement MicAGCEnabled write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } + +private: + bool mValue; +}; + +class SubscribeAttributeCameraAvStreamManagementMicAGCEnabled : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementMicAGCEnabled() + : SubscribeAttribute("mic-agcenabled") + { + } + + ~SubscribeAttributeCameraAvStreamManagementMicAGCEnabled() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::MicAGCEnabled::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 = [[MTRBaseClusterCameraAVStreamManagement 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 subscribeAttributeMicAGCEnabledWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.MicAGCEnabled 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 ImageRotation + */ +class ReadCameraAvStreamManagementImageRotation : public ReadAttribute { +public: + ReadCameraAvStreamManagementImageRotation() + : ReadAttribute("image-rotation") + { + } + + ~ReadCameraAvStreamManagementImageRotation() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::ImageRotation::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 = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeImageRotationWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.ImageRotation response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement ImageRotation read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeCameraAvStreamManagementImageRotation : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementImageRotation() + : SubscribeAttribute("image-rotation") + { + } + + ~SubscribeAttributeCameraAvStreamManagementImageRotation() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::ImageRotation::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 = [[MTRBaseClusterCameraAVStreamManagement 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 subscribeAttributeImageRotationWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.ImageRotation 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 ImageFlipHorizontal + */ +class ReadCameraAvStreamManagementImageFlipHorizontal : public ReadAttribute { +public: + ReadCameraAvStreamManagementImageFlipHorizontal() + : ReadAttribute("image-flip-horizontal") + { + } + + ~ReadCameraAvStreamManagementImageFlipHorizontal() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::ImageFlipHorizontal::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 = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeImageFlipHorizontalWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.ImageFlipHorizontal response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement ImageFlipHorizontal read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeCameraAvStreamManagementImageFlipHorizontal : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementImageFlipHorizontal() + : SubscribeAttribute("image-flip-horizontal") + { + } + + ~SubscribeAttributeCameraAvStreamManagementImageFlipHorizontal() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::ImageFlipHorizontal::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 = [[MTRBaseClusterCameraAVStreamManagement 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 subscribeAttributeImageFlipHorizontalWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.ImageFlipHorizontal 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 ImageFlipVertical + */ +class ReadCameraAvStreamManagementImageFlipVertical : public ReadAttribute { +public: + ReadCameraAvStreamManagementImageFlipVertical() + : ReadAttribute("image-flip-vertical") + { + } + + ~ReadCameraAvStreamManagementImageFlipVertical() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::ImageFlipVertical::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 = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeImageFlipVerticalWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.ImageFlipVertical response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement ImageFlipVertical read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeCameraAvStreamManagementImageFlipVertical : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementImageFlipVertical() + : SubscribeAttribute("image-flip-vertical") + { + } + + ~SubscribeAttributeCameraAvStreamManagementImageFlipVertical() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::ImageFlipVertical::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 = [[MTRBaseClusterCameraAVStreamManagement 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 subscribeAttributeImageFlipVerticalWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.ImageFlipVertical 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 LocalVideoRecordingEnabled + */ +class ReadCameraAvStreamManagementLocalVideoRecordingEnabled : public ReadAttribute { +public: + ReadCameraAvStreamManagementLocalVideoRecordingEnabled() + : ReadAttribute("local-video-recording-enabled") + { + } + + ~ReadCameraAvStreamManagementLocalVideoRecordingEnabled() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::LocalVideoRecordingEnabled::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 = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeLocalVideoRecordingEnabledWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.LocalVideoRecordingEnabled response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement LocalVideoRecordingEnabled read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class WriteCameraAvStreamManagementLocalVideoRecordingEnabled : public WriteAttribute { +public: + WriteCameraAvStreamManagementLocalVideoRecordingEnabled() + : WriteAttribute("local-video-recording-enabled") + { + AddArgument("attr-name", "local-video-recording-enabled"); + AddArgument("attr-value", 0, 1, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteCameraAvStreamManagementLocalVideoRecordingEnabled() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::LocalVideoRecordingEnabled::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") WriteAttribute (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 = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRWriteParams alloc] init]; + params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithBool:mValue]; + + [cluster writeAttributeLocalVideoRecordingEnabledWithValue:value params:params completion:^(NSError * _Nullable error) { + if (error != nil) { + LogNSError("CameraAVStreamManagement LocalVideoRecordingEnabled write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } + +private: + bool mValue; +}; + +class SubscribeAttributeCameraAvStreamManagementLocalVideoRecordingEnabled : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementLocalVideoRecordingEnabled() + : SubscribeAttribute("local-video-recording-enabled") + { + } + + ~SubscribeAttributeCameraAvStreamManagementLocalVideoRecordingEnabled() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::LocalVideoRecordingEnabled::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 = [[MTRBaseClusterCameraAVStreamManagement 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 subscribeAttributeLocalVideoRecordingEnabledWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.LocalVideoRecordingEnabled 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 LocalSnapshotRecordingEnabled + */ +class ReadCameraAvStreamManagementLocalSnapshotRecordingEnabled : public ReadAttribute { +public: + ReadCameraAvStreamManagementLocalSnapshotRecordingEnabled() + : ReadAttribute("local-snapshot-recording-enabled") + { + } + + ~ReadCameraAvStreamManagementLocalSnapshotRecordingEnabled() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::LocalSnapshotRecordingEnabled::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 = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeLocalSnapshotRecordingEnabledWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.LocalSnapshotRecordingEnabled response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement LocalSnapshotRecordingEnabled read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class WriteCameraAvStreamManagementLocalSnapshotRecordingEnabled : public WriteAttribute { +public: + WriteCameraAvStreamManagementLocalSnapshotRecordingEnabled() + : WriteAttribute("local-snapshot-recording-enabled") + { + AddArgument("attr-name", "local-snapshot-recording-enabled"); + AddArgument("attr-value", 0, 1, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteCameraAvStreamManagementLocalSnapshotRecordingEnabled() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::LocalSnapshotRecordingEnabled::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") WriteAttribute (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 = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRWriteParams alloc] init]; + params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithBool:mValue]; + + [cluster writeAttributeLocalSnapshotRecordingEnabledWithValue:value params:params completion:^(NSError * _Nullable error) { + if (error != nil) { + LogNSError("CameraAVStreamManagement LocalSnapshotRecordingEnabled write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } + +private: + bool mValue; +}; + +class SubscribeAttributeCameraAvStreamManagementLocalSnapshotRecordingEnabled : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementLocalSnapshotRecordingEnabled() + : SubscribeAttribute("local-snapshot-recording-enabled") + { + } + + ~SubscribeAttributeCameraAvStreamManagementLocalSnapshotRecordingEnabled() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::LocalSnapshotRecordingEnabled::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 = [[MTRBaseClusterCameraAVStreamManagement 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 subscribeAttributeLocalSnapshotRecordingEnabledWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.LocalSnapshotRecordingEnabled 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 StatusLight + */ +class ReadCameraAvStreamManagementStatusLight : public ReadAttribute { +public: + ReadCameraAvStreamManagementStatusLight() + : ReadAttribute("status-light") + { + } + + ~ReadCameraAvStreamManagementStatusLight() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::StatusLight::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 = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeStatusLightWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.StatusLight response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement StatusLight read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class WriteCameraAvStreamManagementStatusLight : public WriteAttribute { +public: + WriteCameraAvStreamManagementStatusLight() + : WriteAttribute("status-light") + { + AddArgument("attr-name", "status-light"); + AddArgument("attr-value", 0, 1, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteCameraAvStreamManagementStatusLight() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::StatusLight::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") WriteAttribute (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 = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRWriteParams alloc] init]; + params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithBool:mValue]; + + [cluster writeAttributeStatusLightWithValue:value params:params completion:^(NSError * _Nullable error) { + if (error != nil) { + LogNSError("CameraAVStreamManagement StatusLight write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } + +private: + bool mValue; +}; + +class SubscribeAttributeCameraAvStreamManagementStatusLight : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementStatusLight() + : SubscribeAttribute("status-light") + { + } + + ~SubscribeAttributeCameraAvStreamManagementStatusLight() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::StatusLight::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 = [[MTRBaseClusterCameraAVStreamManagement 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 subscribeAttributeStatusLightWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.StatusLight 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 StatusLightBrightness + */ +class ReadCameraAvStreamManagementStatusLightBrightness : public ReadAttribute { +public: + ReadCameraAvStreamManagementStatusLightBrightness() + : ReadAttribute("status-light-brightness") + { + } + + ~ReadCameraAvStreamManagementStatusLightBrightness() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::StatusLightBrightness::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 = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeStatusLightBrightnessWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.StatusLightBrightness response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement StatusLightBrightness read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class WriteCameraAvStreamManagementStatusLightBrightness : public WriteAttribute { +public: + WriteCameraAvStreamManagementStatusLightBrightness() + : WriteAttribute("status-light-brightness") + { + AddArgument("attr-name", "status-light-brightness"); + AddArgument("attr-value", 0, UINT8_MAX, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteCameraAvStreamManagementStatusLightBrightness() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::StatusLightBrightness::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") WriteAttribute (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 = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRWriteParams alloc] init]; + params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; + + [cluster writeAttributeStatusLightBrightnessWithValue:value params:params completion:^(NSError * _Nullable error) { + if (error != nil) { + LogNSError("CameraAVStreamManagement StatusLightBrightness write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } + +private: + uint8_t mValue; +}; + +class SubscribeAttributeCameraAvStreamManagementStatusLightBrightness : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementStatusLightBrightness() + : SubscribeAttribute("status-light-brightness") + { + } + + ~SubscribeAttributeCameraAvStreamManagementStatusLightBrightness() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::StatusLightBrightness::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 = [[MTRBaseClusterCameraAVStreamManagement 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 subscribeAttributeStatusLightBrightnessWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.StatusLightBrightness 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 DepthSensorStatus + */ +class ReadCameraAvStreamManagementDepthSensorStatus : public ReadAttribute { +public: + ReadCameraAvStreamManagementDepthSensorStatus() + : ReadAttribute("depth-sensor-status") + { + } + + ~ReadCameraAvStreamManagementDepthSensorStatus() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::DepthSensorStatus::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 = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeDepthSensorStatusWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.DepthSensorStatus response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement DepthSensorStatus read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class WriteCameraAvStreamManagementDepthSensorStatus : public WriteAttribute { +public: + WriteCameraAvStreamManagementDepthSensorStatus() + : WriteAttribute("depth-sensor-status") + { + AddArgument("attr-name", "depth-sensor-status"); + AddArgument("attr-value", 0, UINT8_MAX, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteCameraAvStreamManagementDepthSensorStatus() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::DepthSensorStatus::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") WriteAttribute (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 = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRWriteParams alloc] init]; + params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; + + [cluster writeAttributeDepthSensorStatusWithValue:value params:params completion:^(NSError * _Nullable error) { + if (error != nil) { + LogNSError("CameraAVStreamManagement DepthSensorStatus write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } + +private: + uint8_t mValue; +}; + +class SubscribeAttributeCameraAvStreamManagementDepthSensorStatus : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementDepthSensorStatus() + : SubscribeAttribute("depth-sensor-status") + { + } + + ~SubscribeAttributeCameraAvStreamManagementDepthSensorStatus() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::DepthSensorStatus::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 = [[MTRBaseClusterCameraAVStreamManagement 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 subscribeAttributeDepthSensorStatusWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.DepthSensorStatus 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 WatermarkEnabled + */ +class ReadCameraAvStreamManagementWatermarkEnabled : public ReadAttribute { +public: + ReadCameraAvStreamManagementWatermarkEnabled() + : ReadAttribute("watermark-enabled") + { + } + + ~ReadCameraAvStreamManagementWatermarkEnabled() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::WatermarkEnabled::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 = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeWatermarkEnabledWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.WatermarkEnabled response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement WatermarkEnabled read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeCameraAvStreamManagementWatermarkEnabled : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementWatermarkEnabled() + : SubscribeAttribute("watermark-enabled") + { + } + + ~SubscribeAttributeCameraAvStreamManagementWatermarkEnabled() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::WatermarkEnabled::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 = [[MTRBaseClusterCameraAVStreamManagement 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 subscribeAttributeWatermarkEnabledWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.WatermarkEnabled 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 OSDEnabled + */ +class ReadCameraAvStreamManagementOSDEnabled : public ReadAttribute { +public: + ReadCameraAvStreamManagementOSDEnabled() + : ReadAttribute("osdenabled") + { + } + + ~ReadCameraAvStreamManagementOSDEnabled() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::OSDEnabled::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 = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeOSDEnabledWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.OSDEnabled response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement OSDEnabled read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeCameraAvStreamManagementOSDEnabled : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementOSDEnabled() + : SubscribeAttribute("osdenabled") + { + } + + ~SubscribeAttributeCameraAvStreamManagementOSDEnabled() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::OSDEnabled::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 = [[MTRBaseClusterCameraAVStreamManagement 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 subscribeAttributeOSDEnabledWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.OSDEnabled 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 ReadCameraAvStreamManagementGeneratedCommandList : public ReadAttribute { +public: + ReadCameraAvStreamManagementGeneratedCommandList() + : ReadAttribute("generated-command-list") + { + } + + ~ReadCameraAvStreamManagementGeneratedCommandList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::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 = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeCameraAvStreamManagementGeneratedCommandList : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementGeneratedCommandList() + : SubscribeAttribute("generated-command-list") + { + } + + ~SubscribeAttributeCameraAvStreamManagementGeneratedCommandList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::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 = [[MTRBaseClusterCameraAVStreamManagement 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(@"CameraAVStreamManagement.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 ReadCameraAvStreamManagementAcceptedCommandList : public ReadAttribute { +public: + ReadCameraAvStreamManagementAcceptedCommandList() + : ReadAttribute("accepted-command-list") + { + } + + ~ReadCameraAvStreamManagementAcceptedCommandList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::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 = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeCameraAvStreamManagementAcceptedCommandList : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementAcceptedCommandList() + : SubscribeAttribute("accepted-command-list") + { + } + + ~SubscribeAttributeCameraAvStreamManagementAcceptedCommandList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::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 = [[MTRBaseClusterCameraAVStreamManagement 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(@"CameraAVStreamManagement.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 EventList + */ +class ReadCameraAvStreamManagementEventList : public ReadAttribute { +public: + ReadCameraAvStreamManagementEventList() + : ReadAttribute("event-list") + { + } + + ~ReadCameraAvStreamManagementEventList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::EventList::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 = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeCameraAvStreamManagementEventList : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementEventList() + : SubscribeAttribute("event-list") + { + } + + ~SubscribeAttributeCameraAvStreamManagementEventList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::EventList::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 = [[MTRBaseClusterCameraAVStreamManagement 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 subscribeAttributeEventListWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.EventList 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 ReadCameraAvStreamManagementAttributeList : public ReadAttribute { +public: + ReadCameraAvStreamManagementAttributeList() + : ReadAttribute("attribute-list") + { + } + + ~ReadCameraAvStreamManagementAttributeList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::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 = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeCameraAvStreamManagementAttributeList : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementAttributeList() + : SubscribeAttribute("attribute-list") + { + } + + ~SubscribeAttributeCameraAvStreamManagementAttributeList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::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 = [[MTRBaseClusterCameraAVStreamManagement 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(@"CameraAVStreamManagement.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 ReadCameraAvStreamManagementFeatureMap : public ReadAttribute { +public: + ReadCameraAvStreamManagementFeatureMap() + : ReadAttribute("feature-map") + { + } + + ~ReadCameraAvStreamManagementFeatureMap() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::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 = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeCameraAvStreamManagementFeatureMap : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementFeatureMap() + : SubscribeAttribute("feature-map") + { + } + + ~SubscribeAttributeCameraAvStreamManagementFeatureMap() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::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 = [[MTRBaseClusterCameraAVStreamManagement 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(@"CameraAVStreamManagement.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 ReadCameraAvStreamManagementClusterRevision : public ReadAttribute { +public: + ReadCameraAvStreamManagementClusterRevision() + : ReadAttribute("cluster-revision") + { + } + + ~ReadCameraAvStreamManagementClusterRevision() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::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 = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeCameraAvStreamManagementClusterRevision : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementClusterRevision() + : SubscribeAttribute("cluster-revision") + { + } + + ~SubscribeAttributeCameraAvStreamManagementClusterRevision() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::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 = [[MTRBaseClusterCameraAVStreamManagement 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(@"CameraAVStreamManagement.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 @@ -186051,6 +192913,321 @@ void registerClusterContentAppObserver(Commands & commands) commands.RegisterCluster(clusterName, clusterCommands); #endif // MTR_ENABLE_PROVISIONAL } +void registerClusterCameraAvStreamManagement(Commands & commands) +{ +#if MTR_ENABLE_PROVISIONAL + using namespace chip::app::Clusters::CameraAvStreamManagement; + + const char * clusterName = "CameraAvStreamManagement"; + + 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 +#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 +#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 +#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(), // + 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(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + 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(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + 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(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + 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(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + 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 +#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 registerClusterWebRTCTransportProvider(Commands & commands) { #if MTR_ENABLE_PROVISIONAL @@ -186866,6 +194043,7 @@ void registerClusters(Commands & commands) registerClusterAccountLogin(commands); registerClusterContentControl(commands); registerClusterContentAppObserver(commands); + registerClusterCameraAvStreamManagement(commands); registerClusterWebRTCTransportProvider(commands); registerClusterWebRTCTransportRequestor(commands); registerClusterChime(commands);