diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 38811c423a9ced..1ed2a01bdbc018 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -111,6 +111,7 @@ jobs: src/app/zap-templates/zcl/data-model/chip/boolean-state-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/actions-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/bridged-device-basic-information.xml \ + src/app/zap-templates/zcl/data-model/chip/camera-av-settings-user-level-management-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/camera-av-stream-management-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/chip-ota.xml \ src/app/zap-templates/zcl/data-model/chip/chip-types.xml \ diff --git a/docs/ids_and_codes/zap_clusters.md b/docs/ids_and_codes/zap_clusters.md index b37e8b2b8b7781..a805a9436c29dd 100644 --- a/docs/ids_and_codes/zap_clusters.md +++ b/docs/ids_and_codes/zap_clusters.md @@ -131,6 +131,7 @@ Generally regenerate using one of: | 1296 | 0x510 | ContentAppObserver | | 1360 | 0x550 | ZoneManagement | | 1361 | 0x551 | CameraAvStreamManagement | +| 1362 | 0x552 | CameraAvSettingsUserLevelManagement | | 1363 | 0x553 | WebRTCTransportProvider | | 1364 | 0x554 | WebRTCTransportRequestor | | 1366 | 0x556 | Chime | diff --git a/scripts/rules.matterlint b/scripts/rules.matterlint index 4f61d26be73b5e..4be932fffa2ccd 100644 --- a/scripts/rules.matterlint +++ b/scripts/rules.matterlint @@ -14,6 +14,7 @@ load "../src/app/zap-templates/zcl/data-model/chip/binding-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/boolean-state-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/actions-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/bridged-device-basic-information.xml"; +load "../src/app/zap-templates/zcl/data-model/chip/camera-av-settings-user-level-management-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/camera-av-stream-management-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/channel-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/chime-cluster.xml"; diff --git a/src/app/zap-templates/zcl/data-model/chip/camera-av-settings-user-level-management-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/camera-av-settings-user-level-management-cluster.xml new file mode 100644 index 00000000000000..660c2dfb58378b --- /dev/null +++ b/src/app/zap-templates/zcl/data-model/chip/camera-av-settings-user-level-management-cluster.xml @@ -0,0 +1,203 @@ + + + + + + + + + + + + + + + + + + + + + Cameras + Camera AV Settings User Level Management + 0x0552 + CAMERA_AV_SETTINGS_USER_LEVEL_MANAGEMENT_CLUSTER + This cluster provides an interface into controls associated with the operation of a device that provides pan, tilt, and zoom functions, either mechanically, or against a digital image. + true + + + + + + + + + + + + + + + + + + + + + + + + true + + + MPTZPosition + + + + + + + + + + MaxPresets + + + + + + MPTZPresets + + + + + + DPTZRelativeMove + + + + + + ZoomMax + + + + + + TiltMin + + + + + + TiltMax + + + + + + PanMin + + + + + + PanMax + + + + + + This command SHALL set the values for the pan, tilt, and zoom in the mechanical PTZ. + + + + + + + + + + + + + + This command SHALL move the device by the delta values relative to the currently defined position. + + + + + + + + + + + + + + This command SHALL move the camera to the positions specified by the Preset passed. + + + + + + + + This command allows creating a new preset or updating the values of an existing one. + + + + + + + + + This command SHALL remove a preset entry from the PresetMptzTable. + + + + + + + + This command allows for setting the digital viewport for a specific Video Stream. + + + + + + + + + This command SHALL change the viewports location by the amount specified in a relative fashion. + + + + + + + + + + + diff --git a/src/app/zap-templates/zcl/zcl-with-test-extensions.json b/src/app/zap-templates/zcl/zcl-with-test-extensions.json index 14179bb5566bfc..6aa9408f715c53 100644 --- a/src/app/zap-templates/zcl/zcl-with-test-extensions.json +++ b/src/app/zap-templates/zcl/zcl-with-test-extensions.json @@ -27,6 +27,7 @@ "boolean-state-configuration-cluster.xml", "actions-cluster.xml", "bridged-device-basic-information.xml", + "camera-av-settings-user-level-management-cluster.xml", "camera-av-stream-management-cluster.xml", "chime-cluster.xml", "chip-ota.xml", @@ -685,7 +686,8 @@ "MicrophoneCapabilities", "SpeakerCapabilities", "Viewport" - ] + ], + "Camera AV Settings User Level Management": ["MPTZPosition"] }, "mandatoryDeviceTypes": "0x0016", "defaultReportingPolicy": "mandatory", diff --git a/src/app/zap-templates/zcl/zcl.json b/src/app/zap-templates/zcl/zcl.json index 728d3acdad1f06..836126d877426f 100644 --- a/src/app/zap-templates/zcl/zcl.json +++ b/src/app/zap-templates/zcl/zcl.json @@ -22,6 +22,7 @@ "boolean-state-configuration-cluster.xml", "actions-cluster.xml", "bridged-device-basic-information.xml", + "camera-av-settings-user-level-management-cluster.xml", "camera-av-stream-management-cluster.xml", "chime-cluster.xml", "chip-ota.xml", @@ -679,7 +680,8 @@ "MicrophoneCapabilities", "SpeakerCapabilities", "Viewport" - ] + ], + "Camera AV Settings User Level Management": ["MPTZPosition"] }, "mandatoryDeviceTypes": "0x0016", "defaultReportingPolicy": "mandatory", diff --git a/src/app/zap_cluster_list.json b/src/app/zap_cluster_list.json index 4de99f1b7aaf3d..7f9fe4a7dcd25f 100644 --- a/src/app/zap_cluster_list.json +++ b/src/app/zap_cluster_list.json @@ -16,6 +16,7 @@ "BOOLEAN_STATE_CLUSTER": [], "BOOLEAN_STATE_CONFIGURATION_CLUSTER": [], "BRIDGED_DEVICE_BASIC_INFORMATION_CLUSTER": [], + "CAMERA_AV_SETTINGS_USER_LEVEL_MANAGEMENT_CLUSTER": [], "CAMERA_AV_STREAM_MANAGEMENT_CLUSTER": [], "CARBON_DIOXIDE_CONCENTRATION_MEASUREMENT_CLUSTER": [], "CARBON_MONOXIDE_CONCENTRATION_MEASUREMENT_CLUSTER": [], @@ -163,6 +164,7 @@ "BRIDGED_DEVICE_BASIC_INFORMATION_CLUSTER": [ "bridged-device-basic-information-server" ], + "CAMERA_AV_SETTINGS_USER_LEVEL_MANAGEMENT_CLUSTER": [], "CAMERA_AV_STREAM_MANAGEMENT_CLUSTER": [], "CARBON_DIOXIDE_CONCENTRATION_MEASUREMENT_CLUSTER": [ "concentration-measurement-server" diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index c798e39e965450..492c4c50b706c8 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -9837,6 +9837,106 @@ provisional cluster CameraAvStreamManagement = 1361 { command CaptureSnapshot(CaptureSnapshotRequest): CaptureSnapshotResponse = 11; } +/** This cluster provides an interface into controls associated with the operation of a device that provides pan, tilt, and zoom functions, either mechanically, or against a digital image. */ +provisional cluster CameraAvSettingsUserLevelManagement = 1362 { + revision 1; + + bitmap Feature : bitmap32 { + kDigitalPTZ = 0x1; + kMechanicalPan = 0x2; + kMechanicalTilt = 0x4; + kMechanicalZoom = 0x8; + kMechanicalPresets = 0x10; + } + + struct MPTZStruct { + optional int16s pan = 0; + optional int16s tilt = 1; + optional int8u zoom = 2; + } + + struct MPTZPresetStruct { + int8u presetID = 0; + char_string<32> name = 1; + MPTZStruct settings = 2; + } + + struct ViewportStruct { + int16u x1 = 0; + int16u y1 = 1; + int16u x2 = 2; + int16u y2 = 3; + } + + readonly attribute optional MPTZStruct MPTZPosition = 0; + readonly attribute optional int8u maxPresets = 1; + readonly attribute optional MPTZPresetStruct MPTZPresets[] = 2; + readonly attribute optional int16u DPTZRelativeMove[] = 3; + readonly attribute optional int8u zoomMax = 4; + readonly attribute optional int16s tiltMin = 5; + readonly attribute optional int16s tiltMax = 6; + readonly attribute optional int16s panMin = 7; + readonly attribute optional int16s panMax = 8; + 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 MPTZSetPositionRequest { + optional int16s pan = 0; + optional int16s tilt = 1; + optional int8u zoom = 2; + } + + request struct MPTZRelativeMoveRequest { + optional int16s panDelta = 0; + optional int16s tiltDelta = 1; + optional int8s zoomDelta = 2; + } + + request struct MPTZMoveToPresetRequest { + int8u presetID = 0; + } + + request struct MPTZSavePresetRequest { + optional int8u presetID = 0; + char_string<32> name = 1; + } + + request struct MPTZRemovePresetRequest { + int8u presetID = 0; + } + + request struct DPTZSetViewportRequest { + int16u videoStreamID = 0; + ViewportStruct viewport = 1; + } + + request struct DPTZRelativeMoveRequest { + int16u videoStreamID = 0; + optional int16s deltaX = 1; + optional int16s deltaY = 2; + optional int8s zoomDelta = 3; + } + + /** This command SHALL set the values for the pan, tilt, and zoom in the mechanical PTZ. */ + command MPTZSetPosition(MPTZSetPositionRequest): DefaultSuccess = 0; + /** This command SHALL move the device by the delta values relative to the currently defined position. */ + command MPTZRelativeMove(MPTZRelativeMoveRequest): DefaultSuccess = 1; + /** This command SHALL move the camera to the positions specified by the Preset passed. */ + command MPTZMoveToPreset(MPTZMoveToPresetRequest): DefaultSuccess = 2; + /** This command allows creating a new preset or updating the values of an existing one. */ + command MPTZSavePreset(MPTZSavePresetRequest): DefaultSuccess = 3; + /** This command SHALL remove a preset entry from the PresetMptzTable. */ + command MPTZRemovePreset(MPTZRemovePresetRequest): DefaultSuccess = 4; + /** This command allows for setting the digital viewport for a specific Video Stream. */ + command DPTZSetViewport(DPTZSetViewportRequest): DefaultSuccess = 5; + /** This command SHALL change the viewports location by the amount specified in a relative fashion. */ + command DPTZRelativeMove(DPTZRelativeMoveRequest): DefaultSuccess = 6; +} + /** 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 5711531c9c5a17..d8326291377418 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java @@ -61577,6 +61577,630 @@ public void onSuccess(byte[] tlv) { } } + public static class CameraAvSettingsUserLevelManagementCluster extends BaseChipCluster { + public static final long CLUSTER_ID = 1362L; + + private static final long MPTZ_POSITION_ATTRIBUTE_ID = 0L; + private static final long MAX_PRESETS_ATTRIBUTE_ID = 1L; + private static final long MPTZ_PRESETS_ATTRIBUTE_ID = 2L; + private static final long DPTZ_RELATIVE_MOVE_ATTRIBUTE_ID = 3L; + private static final long ZOOM_MAX_ATTRIBUTE_ID = 4L; + private static final long TILT_MIN_ATTRIBUTE_ID = 5L; + private static final long TILT_MAX_ATTRIBUTE_ID = 6L; + private static final long PAN_MIN_ATTRIBUTE_ID = 7L; + private static final long PAN_MAX_ATTRIBUTE_ID = 8L; + 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 CameraAvSettingsUserLevelManagementCluster(long devicePtr, int endpointId) { + super(devicePtr, endpointId, CLUSTER_ID); + } + + @Override + @Deprecated + public long initWithDevice(long devicePtr, int endpointId) { + return 0L; + } + + public void MPTZSetPosition(DefaultClusterCallback callback, Optional pan, Optional tilt, Optional zoom) { + MPTZSetPosition(callback, pan, tilt, zoom, 0); + } + + public void MPTZSetPosition(DefaultClusterCallback callback, Optional pan, Optional tilt, Optional zoom, int timedInvokeTimeoutMs) { + final long commandId = 0L; + + ArrayList elements = new ArrayList<>(); + final long panFieldID = 0L; + BaseTLVType pantlvValue = pan.map((nonOptionalpan) -> new IntType(nonOptionalpan)).orElse(new EmptyType()); + elements.add(new StructElement(panFieldID, pantlvValue)); + + final long tiltFieldID = 1L; + BaseTLVType tilttlvValue = tilt.map((nonOptionaltilt) -> new IntType(nonOptionaltilt)).orElse(new EmptyType()); + elements.add(new StructElement(tiltFieldID, tilttlvValue)); + + final long zoomFieldID = 2L; + BaseTLVType zoomtlvValue = zoom.map((nonOptionalzoom) -> new UIntType(nonOptionalzoom)).orElse(new EmptyType()); + elements.add(new StructElement(zoomFieldID, zoomtlvValue)); + + StructType commandArgs = new StructType(elements); + invoke(new InvokeCallbackImpl(callback) { + @Override + public void onResponse(StructType invokeStructValue) { + callback.onSuccess(); + }}, commandId, commandArgs, timedInvokeTimeoutMs); + } + + public void MPTZRelativeMove(DefaultClusterCallback callback, Optional panDelta, Optional tiltDelta, Optional zoomDelta) { + MPTZRelativeMove(callback, panDelta, tiltDelta, zoomDelta, 0); + } + + public void MPTZRelativeMove(DefaultClusterCallback callback, Optional panDelta, Optional tiltDelta, Optional zoomDelta, int timedInvokeTimeoutMs) { + final long commandId = 1L; + + ArrayList elements = new ArrayList<>(); + final long panDeltaFieldID = 0L; + BaseTLVType panDeltatlvValue = panDelta.map((nonOptionalpanDelta) -> new IntType(nonOptionalpanDelta)).orElse(new EmptyType()); + elements.add(new StructElement(panDeltaFieldID, panDeltatlvValue)); + + final long tiltDeltaFieldID = 1L; + BaseTLVType tiltDeltatlvValue = tiltDelta.map((nonOptionaltiltDelta) -> new IntType(nonOptionaltiltDelta)).orElse(new EmptyType()); + elements.add(new StructElement(tiltDeltaFieldID, tiltDeltatlvValue)); + + final long zoomDeltaFieldID = 2L; + BaseTLVType zoomDeltatlvValue = zoomDelta.map((nonOptionalzoomDelta) -> new IntType(nonOptionalzoomDelta)).orElse(new EmptyType()); + elements.add(new StructElement(zoomDeltaFieldID, zoomDeltatlvValue)); + + StructType commandArgs = new StructType(elements); + invoke(new InvokeCallbackImpl(callback) { + @Override + public void onResponse(StructType invokeStructValue) { + callback.onSuccess(); + }}, commandId, commandArgs, timedInvokeTimeoutMs); + } + + public void MPTZMoveToPreset(DefaultClusterCallback callback, Integer presetID) { + MPTZMoveToPreset(callback, presetID, 0); + } + + public void MPTZMoveToPreset(DefaultClusterCallback callback, Integer presetID, int timedInvokeTimeoutMs) { + final long commandId = 2L; + + ArrayList elements = new ArrayList<>(); + final long presetIDFieldID = 0L; + BaseTLVType presetIDtlvValue = new UIntType(presetID); + elements.add(new StructElement(presetIDFieldID, presetIDtlvValue)); + + StructType commandArgs = new StructType(elements); + invoke(new InvokeCallbackImpl(callback) { + @Override + public void onResponse(StructType invokeStructValue) { + callback.onSuccess(); + }}, commandId, commandArgs, timedInvokeTimeoutMs); + } + + public void MPTZSavePreset(DefaultClusterCallback callback, Optional presetID, String name) { + MPTZSavePreset(callback, presetID, name, 0); + } + + public void MPTZSavePreset(DefaultClusterCallback callback, Optional presetID, String name, int timedInvokeTimeoutMs) { + final long commandId = 3L; + + ArrayList elements = new ArrayList<>(); + final long presetIDFieldID = 0L; + BaseTLVType presetIDtlvValue = presetID.map((nonOptionalpresetID) -> new UIntType(nonOptionalpresetID)).orElse(new EmptyType()); + elements.add(new StructElement(presetIDFieldID, presetIDtlvValue)); + + final long nameFieldID = 1L; + BaseTLVType nametlvValue = new StringType(name); + elements.add(new StructElement(nameFieldID, nametlvValue)); + + StructType commandArgs = new StructType(elements); + invoke(new InvokeCallbackImpl(callback) { + @Override + public void onResponse(StructType invokeStructValue) { + callback.onSuccess(); + }}, commandId, commandArgs, timedInvokeTimeoutMs); + } + + public void MPTZRemovePreset(DefaultClusterCallback callback, Integer presetID) { + MPTZRemovePreset(callback, presetID, 0); + } + + public void MPTZRemovePreset(DefaultClusterCallback callback, Integer presetID, int timedInvokeTimeoutMs) { + final long commandId = 4L; + + ArrayList elements = new ArrayList<>(); + final long presetIDFieldID = 0L; + BaseTLVType presetIDtlvValue = new UIntType(presetID); + elements.add(new StructElement(presetIDFieldID, presetIDtlvValue)); + + StructType commandArgs = new StructType(elements); + invoke(new InvokeCallbackImpl(callback) { + @Override + public void onResponse(StructType invokeStructValue) { + callback.onSuccess(); + }}, commandId, commandArgs, timedInvokeTimeoutMs); + } + + public void DPTZSetViewport(DefaultClusterCallback callback, Integer videoStreamID, ChipStructs.CameraAvSettingsUserLevelManagementClusterViewportStruct viewport) { + DPTZSetViewport(callback, videoStreamID, viewport, 0); + } + + public void DPTZSetViewport(DefaultClusterCallback callback, Integer videoStreamID, ChipStructs.CameraAvSettingsUserLevelManagementClusterViewportStruct viewport, 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 viewportFieldID = 1L; + 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 DPTZRelativeMove(DefaultClusterCallback callback, Integer videoStreamID, Optional deltaX, Optional deltaY, Optional zoomDelta) { + DPTZRelativeMove(callback, videoStreamID, deltaX, deltaY, zoomDelta, 0); + } + + public void DPTZRelativeMove(DefaultClusterCallback callback, Integer videoStreamID, Optional deltaX, Optional deltaY, Optional zoomDelta, 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)); + + final long deltaXFieldID = 1L; + BaseTLVType deltaXtlvValue = deltaX.map((nonOptionaldeltaX) -> new IntType(nonOptionaldeltaX)).orElse(new EmptyType()); + elements.add(new StructElement(deltaXFieldID, deltaXtlvValue)); + + final long deltaYFieldID = 2L; + BaseTLVType deltaYtlvValue = deltaY.map((nonOptionaldeltaY) -> new IntType(nonOptionaldeltaY)).orElse(new EmptyType()); + elements.add(new StructElement(deltaYFieldID, deltaYtlvValue)); + + final long zoomDeltaFieldID = 3L; + BaseTLVType zoomDeltatlvValue = zoomDelta.map((nonOptionalzoomDelta) -> new IntType(nonOptionalzoomDelta)).orElse(new EmptyType()); + elements.add(new StructElement(zoomDeltaFieldID, zoomDeltatlvValue)); + + StructType commandArgs = new StructType(elements); + invoke(new InvokeCallbackImpl(callback) { + @Override + public void onResponse(StructType invokeStructValue) { + callback.onSuccess(); + }}, commandId, commandArgs, timedInvokeTimeoutMs); + } + + public interface MPTZPositionAttributeCallback extends BaseAttributeCallback { + void onSuccess(ChipStructs.CameraAvSettingsUserLevelManagementClusterMPTZStruct value); + } + + public interface MPTZPresetsAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); + } + + public interface DPTZRelativeMoveAttributeCallback 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 readMPTZPositionAttribute( + MPTZPositionAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MPTZ_POSITION_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + ChipStructs.CameraAvSettingsUserLevelManagementClusterMPTZStruct value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, MPTZ_POSITION_ATTRIBUTE_ID, true); + } + + public void subscribeMPTZPositionAttribute( + MPTZPositionAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MPTZ_POSITION_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + ChipStructs.CameraAvSettingsUserLevelManagementClusterMPTZStruct value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, MPTZ_POSITION_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readMaxPresetsAttribute( + IntegerAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MAX_PRESETS_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, MAX_PRESETS_ATTRIBUTE_ID, true); + } + + public void subscribeMaxPresetsAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MAX_PRESETS_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, MAX_PRESETS_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readMPTZPresetsAttribute( + MPTZPresetsAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MPTZ_PRESETS_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, MPTZ_PRESETS_ATTRIBUTE_ID, true); + } + + public void subscribeMPTZPresetsAttribute( + MPTZPresetsAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MPTZ_PRESETS_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, MPTZ_PRESETS_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readDPTZRelativeMoveAttribute( + DPTZRelativeMoveAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, DPTZ_RELATIVE_MOVE_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, DPTZ_RELATIVE_MOVE_ATTRIBUTE_ID, true); + } + + public void subscribeDPTZRelativeMoveAttribute( + DPTZRelativeMoveAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, DPTZ_RELATIVE_MOVE_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, DPTZ_RELATIVE_MOVE_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readZoomMaxAttribute( + IntegerAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ZOOM_MAX_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, ZOOM_MAX_ATTRIBUTE_ID, true); + } + + public void subscribeZoomMaxAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ZOOM_MAX_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, ZOOM_MAX_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readTiltMinAttribute( + IntegerAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, TILT_MIN_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, TILT_MIN_ATTRIBUTE_ID, true); + } + + public void subscribeTiltMinAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, TILT_MIN_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, TILT_MIN_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readTiltMaxAttribute( + IntegerAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, TILT_MAX_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, TILT_MAX_ATTRIBUTE_ID, true); + } + + public void subscribeTiltMaxAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, TILT_MAX_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, TILT_MAX_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readPanMinAttribute( + IntegerAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, PAN_MIN_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, PAN_MIN_ATTRIBUTE_ID, true); + } + + public void subscribePanMinAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, PAN_MIN_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, PAN_MIN_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readPanMaxAttribute( + IntegerAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, PAN_MAX_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, PAN_MAX_ATTRIBUTE_ID, true); + } + + public void subscribePanMaxAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, PAN_MAX_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, PAN_MAX_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/ChipStructs.java b/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java index 5583a303a48d46..5e2b078982f0bb 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java @@ -14102,6 +14102,249 @@ public String toString() { return output.toString(); } } +public static class CameraAvSettingsUserLevelManagementClusterMPTZStruct { + public Optional pan; + public Optional tilt; + public Optional zoom; + private static final long PAN_ID = 0L; + private static final long TILT_ID = 1L; + private static final long ZOOM_ID = 2L; + + public CameraAvSettingsUserLevelManagementClusterMPTZStruct( + Optional pan, + Optional tilt, + Optional zoom + ) { + this.pan = pan; + this.tilt = tilt; + this.zoom = zoom; + } + + public StructType encodeTlv() { + ArrayList values = new ArrayList<>(); + values.add(new StructElement(PAN_ID, pan.map((nonOptionalpan) -> new IntType(nonOptionalpan)).orElse(new EmptyType()))); + values.add(new StructElement(TILT_ID, tilt.map((nonOptionaltilt) -> new IntType(nonOptionaltilt)).orElse(new EmptyType()))); + values.add(new StructElement(ZOOM_ID, zoom.map((nonOptionalzoom) -> new UIntType(nonOptionalzoom)).orElse(new EmptyType()))); + + return new StructType(values); + } + + public static CameraAvSettingsUserLevelManagementClusterMPTZStruct decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + Optional pan = Optional.empty(); + Optional tilt = Optional.empty(); + Optional zoom = Optional.empty(); + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == PAN_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Int) { + IntType castingValue = element.value(IntType.class); + pan = Optional.of(castingValue.value(Integer.class)); + } + } else if (element.contextTagNum() == TILT_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Int) { + IntType castingValue = element.value(IntType.class); + tilt = Optional.of(castingValue.value(Integer.class)); + } + } else if (element.contextTagNum() == ZOOM_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + zoom = Optional.of(castingValue.value(Integer.class)); + } + } + } + return new CameraAvSettingsUserLevelManagementClusterMPTZStruct( + pan, + tilt, + zoom + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("CameraAvSettingsUserLevelManagementClusterMPTZStruct {\n"); + output.append("\tpan: "); + output.append(pan); + output.append("\n"); + output.append("\ttilt: "); + output.append(tilt); + output.append("\n"); + output.append("\tzoom: "); + output.append(zoom); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} +public static class CameraAvSettingsUserLevelManagementClusterMPTZPresetStruct { + public Integer presetID; + public String name; + public ChipStructs.CameraAvSettingsUserLevelManagementClusterMPTZStruct settings; + private static final long PRESET_ID_ID = 0L; + private static final long NAME_ID = 1L; + private static final long SETTINGS_ID = 2L; + + public CameraAvSettingsUserLevelManagementClusterMPTZPresetStruct( + Integer presetID, + String name, + ChipStructs.CameraAvSettingsUserLevelManagementClusterMPTZStruct settings + ) { + this.presetID = presetID; + this.name = name; + this.settings = settings; + } + + public StructType encodeTlv() { + ArrayList values = new ArrayList<>(); + values.add(new StructElement(PRESET_ID_ID, new UIntType(presetID))); + values.add(new StructElement(NAME_ID, new StringType(name))); + values.add(new StructElement(SETTINGS_ID, settings.encodeTlv())); + + return new StructType(values); + } + + public static CameraAvSettingsUserLevelManagementClusterMPTZPresetStruct decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + Integer presetID = null; + String name = null; + ChipStructs.CameraAvSettingsUserLevelManagementClusterMPTZStruct settings = null; + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == PRESET_ID_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + presetID = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == NAME_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.String) { + StringType castingValue = element.value(StringType.class); + name = castingValue.value(String.class); + } + } else if (element.contextTagNum() == SETTINGS_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Struct) { + StructType castingValue = element.value(StructType.class); + settings = ChipStructs.CameraAvSettingsUserLevelManagementClusterMPTZStruct.decodeTlv(castingValue); + } + } + } + return new CameraAvSettingsUserLevelManagementClusterMPTZPresetStruct( + presetID, + name, + settings + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("CameraAvSettingsUserLevelManagementClusterMPTZPresetStruct {\n"); + output.append("\tpresetID: "); + output.append(presetID); + output.append("\n"); + output.append("\tname: "); + output.append(name); + output.append("\n"); + output.append("\tsettings: "); + output.append(settings); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} +public static class CameraAvSettingsUserLevelManagementClusterViewportStruct { + 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 CameraAvSettingsUserLevelManagementClusterViewportStruct( + 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 CameraAvSettingsUserLevelManagementClusterViewportStruct 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 CameraAvSettingsUserLevelManagementClusterViewportStruct( + x1, + y1, + x2, + y2 + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("CameraAvSettingsUserLevelManagementClusterViewportStruct {\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 f8dec7781b032c..e8440163d37360 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java @@ -385,6 +385,9 @@ public static BaseCluster getCluster(long clusterId) { if (clusterId == CameraAvStreamManagement.ID) { return new CameraAvStreamManagement(); } + if (clusterId == CameraAvSettingsUserLevelManagement.ID) { + return new CameraAvSettingsUserLevelManagement(); + } if (clusterId == WebRTCTransportProvider.ID) { return new WebRTCTransportProvider(); } @@ -17372,6 +17375,241 @@ public long getCommandID(String name) throws IllegalArgumentException { return Command.valueOf(name).getID(); } } + public static class CameraAvSettingsUserLevelManagement implements BaseCluster { + public static final long ID = 1362L; + public long getID() { + return ID; + } + + public enum Attribute { + MPTZPosition(0L), + MaxPresets(1L), + MPTZPresets(2L), + DPTZRelativeMove(3L), + ZoomMax(4L), + TiltMin(5L), + TiltMax(6L), + PanMin(7L), + PanMax(8L), + 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 {; + 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 { + MPTZSetPosition(0L), + MPTZRelativeMove(1L), + MPTZMoveToPreset(2L), + MPTZSavePreset(3L), + MPTZRemovePreset(4L), + DPTZSetViewport(5L), + DPTZRelativeMove(6L),; + private final long id; + Command(long id) { + this.id = id; + } + + public long getID() { + return id; + } + + public static Command value(long id) throws NoSuchFieldError { + for (Command command : Command.values()) { + if (command.getID() == id) { + return command; + } + } + throw new NoSuchFieldError(); + } + }public enum MPTZSetPositionCommandField {Pan(0),Tilt(1),Zoom(2),; + private final int id; + MPTZSetPositionCommandField(int id) { + this.id = id; + } + + public int getID() { + return id; + } + public static MPTZSetPositionCommandField value(int id) throws NoSuchFieldError { + for (MPTZSetPositionCommandField field : MPTZSetPositionCommandField.values()) { + if (field.getID() == id) { + return field; + } + } + throw new NoSuchFieldError(); + } + }public enum MPTZRelativeMoveCommandField {PanDelta(0),TiltDelta(1),ZoomDelta(2),; + private final int id; + MPTZRelativeMoveCommandField(int id) { + this.id = id; + } + + public int getID() { + return id; + } + public static MPTZRelativeMoveCommandField value(int id) throws NoSuchFieldError { + for (MPTZRelativeMoveCommandField field : MPTZRelativeMoveCommandField.values()) { + if (field.getID() == id) { + return field; + } + } + throw new NoSuchFieldError(); + } + }public enum MPTZMoveToPresetCommandField {PresetID(0),; + private final int id; + MPTZMoveToPresetCommandField(int id) { + this.id = id; + } + + public int getID() { + return id; + } + public static MPTZMoveToPresetCommandField value(int id) throws NoSuchFieldError { + for (MPTZMoveToPresetCommandField field : MPTZMoveToPresetCommandField.values()) { + if (field.getID() == id) { + return field; + } + } + throw new NoSuchFieldError(); + } + }public enum MPTZSavePresetCommandField {PresetID(0),Name(1),; + private final int id; + MPTZSavePresetCommandField(int id) { + this.id = id; + } + + public int getID() { + return id; + } + public static MPTZSavePresetCommandField value(int id) throws NoSuchFieldError { + for (MPTZSavePresetCommandField field : MPTZSavePresetCommandField.values()) { + if (field.getID() == id) { + return field; + } + } + throw new NoSuchFieldError(); + } + }public enum MPTZRemovePresetCommandField {PresetID(0),; + private final int id; + MPTZRemovePresetCommandField(int id) { + this.id = id; + } + + public int getID() { + return id; + } + public static MPTZRemovePresetCommandField value(int id) throws NoSuchFieldError { + for (MPTZRemovePresetCommandField field : MPTZRemovePresetCommandField.values()) { + if (field.getID() == id) { + return field; + } + } + throw new NoSuchFieldError(); + } + }public enum DPTZSetViewportCommandField {VideoStreamID(0),Viewport(1),; + private final int id; + DPTZSetViewportCommandField(int id) { + this.id = id; + } + + public int getID() { + return id; + } + public static DPTZSetViewportCommandField value(int id) throws NoSuchFieldError { + for (DPTZSetViewportCommandField field : DPTZSetViewportCommandField.values()) { + if (field.getID() == id) { + return field; + } + } + throw new NoSuchFieldError(); + } + }public enum DPTZRelativeMoveCommandField {VideoStreamID(0),DeltaX(1),DeltaY(2),ZoomDelta(3),; + private final int id; + DPTZRelativeMoveCommandField(int id) { + this.id = id; + } + + public int getID() { + return id; + } + public static DPTZRelativeMoveCommandField value(int id) throws NoSuchFieldError { + for (DPTZRelativeMoveCommandField field : DPTZRelativeMoveCommandField.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 966a553a8eca97..f36a31e142d695 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java @@ -20488,6 +20488,153 @@ public void onError(Exception ex) { } } + public static class DelegatedCameraAvSettingsUserLevelManagementClusterMPTZPositionAttributeCallback implements ChipClusters.CameraAvSettingsUserLevelManagementCluster.MPTZPositionAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(ChipStructs.CameraAvSettingsUserLevelManagementClusterMPTZStruct value) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "ChipStructs.CameraAvSettingsUserLevelManagementClusterMPTZStruct"); + responseValues.put(commandResponseInfo, value); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedCameraAvSettingsUserLevelManagementClusterMPTZPresetsAttributeCallback implements ChipClusters.CameraAvSettingsUserLevelManagementCluster.MPTZPresetsAttributeCallback, 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 DelegatedCameraAvSettingsUserLevelManagementClusterDPTZRelativeMoveAttributeCallback implements ChipClusters.CameraAvSettingsUserLevelManagementCluster.DPTZRelativeMoveAttributeCallback, 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 DelegatedCameraAvSettingsUserLevelManagementClusterGeneratedCommandListAttributeCallback implements ChipClusters.CameraAvSettingsUserLevelManagementCluster.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 DelegatedCameraAvSettingsUserLevelManagementClusterAcceptedCommandListAttributeCallback implements ChipClusters.CameraAvSettingsUserLevelManagementCluster.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 DelegatedCameraAvSettingsUserLevelManagementClusterEventListAttributeCallback implements ChipClusters.CameraAvSettingsUserLevelManagementCluster.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 DelegatedCameraAvSettingsUserLevelManagementClusterAttributeListAttributeCallback implements ChipClusters.CameraAvSettingsUserLevelManagementCluster.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; @@ -23201,6 +23348,10 @@ public Map initializeClusterMap() { (ptr, endpointId) -> new ChipClusters.CameraAvStreamManagementCluster(ptr, endpointId), new HashMap<>()); clusterMap.put("cameraAvStreamManagement", cameraAvStreamManagementClusterInfo); + ClusterInfo cameraAvSettingsUserLevelManagementClusterInfo = new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.CameraAvSettingsUserLevelManagementCluster(ptr, endpointId), new HashMap<>()); + clusterMap.put("cameraAvSettingsUserLevelManagement", cameraAvSettingsUserLevelManagementClusterInfo); + ClusterInfo webRTCTransportProviderClusterInfo = new ClusterInfo( (ptr, endpointId) -> new ChipClusters.WebRTCTransportProviderCluster(ptr, endpointId), new HashMap<>()); clusterMap.put("webRTCTransportProvider", webRTCTransportProviderClusterInfo); @@ -23356,6 +23507,7 @@ public void combineCommand(Map destination, Map> getCommandMap() { commandMap.put("cameraAvStreamManagement", cameraAvStreamManagementClusterInteractionInfoMap); + Map cameraAvSettingsUserLevelManagementClusterInteractionInfoMap = new LinkedHashMap<>(); + + Map cameraAvSettingsUserLevelManagementMPTZSetPositionCommandParams = new LinkedHashMap(); + + CommandParameterInfo cameraAvSettingsUserLevelManagementMPTZSetPositionpanCommandParameterInfo = new CommandParameterInfo("pan", Optional.class, Integer.class); + cameraAvSettingsUserLevelManagementMPTZSetPositionCommandParams.put("pan",cameraAvSettingsUserLevelManagementMPTZSetPositionpanCommandParameterInfo); + + CommandParameterInfo cameraAvSettingsUserLevelManagementMPTZSetPositiontiltCommandParameterInfo = new CommandParameterInfo("tilt", Optional.class, Integer.class); + cameraAvSettingsUserLevelManagementMPTZSetPositionCommandParams.put("tilt",cameraAvSettingsUserLevelManagementMPTZSetPositiontiltCommandParameterInfo); + + CommandParameterInfo cameraAvSettingsUserLevelManagementMPTZSetPositionzoomCommandParameterInfo = new CommandParameterInfo("zoom", Optional.class, Integer.class); + cameraAvSettingsUserLevelManagementMPTZSetPositionCommandParams.put("zoom",cameraAvSettingsUserLevelManagementMPTZSetPositionzoomCommandParameterInfo); + InteractionInfo cameraAvSettingsUserLevelManagementMPTZSetPositionInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvSettingsUserLevelManagementCluster) cluster) + .MPTZSetPosition((DefaultClusterCallback) callback + , (Optional) + commandArguments.get("pan") + , (Optional) + commandArguments.get("tilt") + , (Optional) + commandArguments.get("zoom") + ); + }, + () -> new DelegatedDefaultClusterCallback(), + cameraAvSettingsUserLevelManagementMPTZSetPositionCommandParams + ); + cameraAvSettingsUserLevelManagementClusterInteractionInfoMap.put("MPTZSetPosition", cameraAvSettingsUserLevelManagementMPTZSetPositionInteractionInfo); + + Map cameraAvSettingsUserLevelManagementMPTZRelativeMoveCommandParams = new LinkedHashMap(); + + CommandParameterInfo cameraAvSettingsUserLevelManagementMPTZRelativeMovepanDeltaCommandParameterInfo = new CommandParameterInfo("panDelta", Optional.class, Integer.class); + cameraAvSettingsUserLevelManagementMPTZRelativeMoveCommandParams.put("panDelta",cameraAvSettingsUserLevelManagementMPTZRelativeMovepanDeltaCommandParameterInfo); + + CommandParameterInfo cameraAvSettingsUserLevelManagementMPTZRelativeMovetiltDeltaCommandParameterInfo = new CommandParameterInfo("tiltDelta", Optional.class, Integer.class); + cameraAvSettingsUserLevelManagementMPTZRelativeMoveCommandParams.put("tiltDelta",cameraAvSettingsUserLevelManagementMPTZRelativeMovetiltDeltaCommandParameterInfo); + + CommandParameterInfo cameraAvSettingsUserLevelManagementMPTZRelativeMovezoomDeltaCommandParameterInfo = new CommandParameterInfo("zoomDelta", Optional.class, Integer.class); + cameraAvSettingsUserLevelManagementMPTZRelativeMoveCommandParams.put("zoomDelta",cameraAvSettingsUserLevelManagementMPTZRelativeMovezoomDeltaCommandParameterInfo); + InteractionInfo cameraAvSettingsUserLevelManagementMPTZRelativeMoveInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvSettingsUserLevelManagementCluster) cluster) + .MPTZRelativeMove((DefaultClusterCallback) callback + , (Optional) + commandArguments.get("panDelta") + , (Optional) + commandArguments.get("tiltDelta") + , (Optional) + commandArguments.get("zoomDelta") + ); + }, + () -> new DelegatedDefaultClusterCallback(), + cameraAvSettingsUserLevelManagementMPTZRelativeMoveCommandParams + ); + cameraAvSettingsUserLevelManagementClusterInteractionInfoMap.put("MPTZRelativeMove", cameraAvSettingsUserLevelManagementMPTZRelativeMoveInteractionInfo); + + Map cameraAvSettingsUserLevelManagementMPTZMoveToPresetCommandParams = new LinkedHashMap(); + + CommandParameterInfo cameraAvSettingsUserLevelManagementMPTZMoveToPresetpresetIDCommandParameterInfo = new CommandParameterInfo("presetID", Integer.class, Integer.class); + cameraAvSettingsUserLevelManagementMPTZMoveToPresetCommandParams.put("presetID",cameraAvSettingsUserLevelManagementMPTZMoveToPresetpresetIDCommandParameterInfo); + InteractionInfo cameraAvSettingsUserLevelManagementMPTZMoveToPresetInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvSettingsUserLevelManagementCluster) cluster) + .MPTZMoveToPreset((DefaultClusterCallback) callback + , (Integer) + commandArguments.get("presetID") + ); + }, + () -> new DelegatedDefaultClusterCallback(), + cameraAvSettingsUserLevelManagementMPTZMoveToPresetCommandParams + ); + cameraAvSettingsUserLevelManagementClusterInteractionInfoMap.put("MPTZMoveToPreset", cameraAvSettingsUserLevelManagementMPTZMoveToPresetInteractionInfo); + + Map cameraAvSettingsUserLevelManagementMPTZSavePresetCommandParams = new LinkedHashMap(); + + CommandParameterInfo cameraAvSettingsUserLevelManagementMPTZSavePresetpresetIDCommandParameterInfo = new CommandParameterInfo("presetID", Optional.class, Integer.class); + cameraAvSettingsUserLevelManagementMPTZSavePresetCommandParams.put("presetID",cameraAvSettingsUserLevelManagementMPTZSavePresetpresetIDCommandParameterInfo); + + CommandParameterInfo cameraAvSettingsUserLevelManagementMPTZSavePresetnameCommandParameterInfo = new CommandParameterInfo("name", String.class, String.class); + cameraAvSettingsUserLevelManagementMPTZSavePresetCommandParams.put("name",cameraAvSettingsUserLevelManagementMPTZSavePresetnameCommandParameterInfo); + InteractionInfo cameraAvSettingsUserLevelManagementMPTZSavePresetInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvSettingsUserLevelManagementCluster) cluster) + .MPTZSavePreset((DefaultClusterCallback) callback + , (Optional) + commandArguments.get("presetID") + , (String) + commandArguments.get("name") + ); + }, + () -> new DelegatedDefaultClusterCallback(), + cameraAvSettingsUserLevelManagementMPTZSavePresetCommandParams + ); + cameraAvSettingsUserLevelManagementClusterInteractionInfoMap.put("MPTZSavePreset", cameraAvSettingsUserLevelManagementMPTZSavePresetInteractionInfo); + + Map cameraAvSettingsUserLevelManagementMPTZRemovePresetCommandParams = new LinkedHashMap(); + + CommandParameterInfo cameraAvSettingsUserLevelManagementMPTZRemovePresetpresetIDCommandParameterInfo = new CommandParameterInfo("presetID", Integer.class, Integer.class); + cameraAvSettingsUserLevelManagementMPTZRemovePresetCommandParams.put("presetID",cameraAvSettingsUserLevelManagementMPTZRemovePresetpresetIDCommandParameterInfo); + InteractionInfo cameraAvSettingsUserLevelManagementMPTZRemovePresetInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvSettingsUserLevelManagementCluster) cluster) + .MPTZRemovePreset((DefaultClusterCallback) callback + , (Integer) + commandArguments.get("presetID") + ); + }, + () -> new DelegatedDefaultClusterCallback(), + cameraAvSettingsUserLevelManagementMPTZRemovePresetCommandParams + ); + cameraAvSettingsUserLevelManagementClusterInteractionInfoMap.put("MPTZRemovePreset", cameraAvSettingsUserLevelManagementMPTZRemovePresetInteractionInfo); + + Map cameraAvSettingsUserLevelManagementDPTZSetViewportCommandParams = new LinkedHashMap(); + + CommandParameterInfo cameraAvSettingsUserLevelManagementDPTZSetViewportvideoStreamIDCommandParameterInfo = new CommandParameterInfo("videoStreamID", Integer.class, Integer.class); + cameraAvSettingsUserLevelManagementDPTZSetViewportCommandParams.put("videoStreamID",cameraAvSettingsUserLevelManagementDPTZSetViewportvideoStreamIDCommandParameterInfo); + + InteractionInfo cameraAvSettingsUserLevelManagementDPTZSetViewportInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvSettingsUserLevelManagementCluster) cluster) + .DPTZSetViewport((DefaultClusterCallback) callback + , (Integer) + commandArguments.get("videoStreamID") + , (ChipStructs.CameraAvSettingsUserLevelManagementClusterViewportStruct) + commandArguments.get("viewport") + ); + }, + () -> new DelegatedDefaultClusterCallback(), + cameraAvSettingsUserLevelManagementDPTZSetViewportCommandParams + ); + cameraAvSettingsUserLevelManagementClusterInteractionInfoMap.put("DPTZSetViewport", cameraAvSettingsUserLevelManagementDPTZSetViewportInteractionInfo); + + Map cameraAvSettingsUserLevelManagementDPTZRelativeMoveCommandParams = new LinkedHashMap(); + + CommandParameterInfo cameraAvSettingsUserLevelManagementDPTZRelativeMovevideoStreamIDCommandParameterInfo = new CommandParameterInfo("videoStreamID", Integer.class, Integer.class); + cameraAvSettingsUserLevelManagementDPTZRelativeMoveCommandParams.put("videoStreamID",cameraAvSettingsUserLevelManagementDPTZRelativeMovevideoStreamIDCommandParameterInfo); + + CommandParameterInfo cameraAvSettingsUserLevelManagementDPTZRelativeMovedeltaXCommandParameterInfo = new CommandParameterInfo("deltaX", Optional.class, Integer.class); + cameraAvSettingsUserLevelManagementDPTZRelativeMoveCommandParams.put("deltaX",cameraAvSettingsUserLevelManagementDPTZRelativeMovedeltaXCommandParameterInfo); + + CommandParameterInfo cameraAvSettingsUserLevelManagementDPTZRelativeMovedeltaYCommandParameterInfo = new CommandParameterInfo("deltaY", Optional.class, Integer.class); + cameraAvSettingsUserLevelManagementDPTZRelativeMoveCommandParams.put("deltaY",cameraAvSettingsUserLevelManagementDPTZRelativeMovedeltaYCommandParameterInfo); + + CommandParameterInfo cameraAvSettingsUserLevelManagementDPTZRelativeMovezoomDeltaCommandParameterInfo = new CommandParameterInfo("zoomDelta", Optional.class, Integer.class); + cameraAvSettingsUserLevelManagementDPTZRelativeMoveCommandParams.put("zoomDelta",cameraAvSettingsUserLevelManagementDPTZRelativeMovezoomDeltaCommandParameterInfo); + InteractionInfo cameraAvSettingsUserLevelManagementDPTZRelativeMoveInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvSettingsUserLevelManagementCluster) cluster) + .DPTZRelativeMove((DefaultClusterCallback) callback + , (Integer) + commandArguments.get("videoStreamID") + , (Optional) + commandArguments.get("deltaX") + , (Optional) + commandArguments.get("deltaY") + , (Optional) + commandArguments.get("zoomDelta") + ); + }, + () -> new DelegatedDefaultClusterCallback(), + cameraAvSettingsUserLevelManagementDPTZRelativeMoveCommandParams + ); + cameraAvSettingsUserLevelManagementClusterInteractionInfoMap.put("DPTZRelativeMove", cameraAvSettingsUserLevelManagementDPTZRelativeMoveInteractionInfo); + + commandMap.put("cameraAvSettingsUserLevelManagement", cameraAvSettingsUserLevelManagementClusterInteractionInfoMap); + 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 85d8c246765215..3323ad5632be1d 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java @@ -18761,6 +18761,164 @@ private static Map readCameraAvStreamManagementInteract return result; } + private static Map readCameraAvSettingsUserLevelManagementInteractionInfo() { + Map result = new LinkedHashMap<>();Map readCameraAvSettingsUserLevelManagementMaxPresetsCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvSettingsUserLevelManagementMaxPresetsAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvSettingsUserLevelManagementCluster) cluster).readMaxPresetsAttribute( + (ChipClusters.IntegerAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readCameraAvSettingsUserLevelManagementMaxPresetsCommandParams + ); + result.put("readMaxPresetsAttribute", readCameraAvSettingsUserLevelManagementMaxPresetsAttributeInteractionInfo); + Map readCameraAvSettingsUserLevelManagementMPTZPresetsCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvSettingsUserLevelManagementMPTZPresetsAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvSettingsUserLevelManagementCluster) cluster).readMPTZPresetsAttribute( + (ChipClusters.CameraAvSettingsUserLevelManagementCluster.MPTZPresetsAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedCameraAvSettingsUserLevelManagementClusterMPTZPresetsAttributeCallback(), + readCameraAvSettingsUserLevelManagementMPTZPresetsCommandParams + ); + result.put("readMPTZPresetsAttribute", readCameraAvSettingsUserLevelManagementMPTZPresetsAttributeInteractionInfo); + Map readCameraAvSettingsUserLevelManagementDPTZRelativeMoveCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvSettingsUserLevelManagementDPTZRelativeMoveAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvSettingsUserLevelManagementCluster) cluster).readDPTZRelativeMoveAttribute( + (ChipClusters.CameraAvSettingsUserLevelManagementCluster.DPTZRelativeMoveAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedCameraAvSettingsUserLevelManagementClusterDPTZRelativeMoveAttributeCallback(), + readCameraAvSettingsUserLevelManagementDPTZRelativeMoveCommandParams + ); + result.put("readDPTZRelativeMoveAttribute", readCameraAvSettingsUserLevelManagementDPTZRelativeMoveAttributeInteractionInfo); + Map readCameraAvSettingsUserLevelManagementZoomMaxCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvSettingsUserLevelManagementZoomMaxAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvSettingsUserLevelManagementCluster) cluster).readZoomMaxAttribute( + (ChipClusters.IntegerAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readCameraAvSettingsUserLevelManagementZoomMaxCommandParams + ); + result.put("readZoomMaxAttribute", readCameraAvSettingsUserLevelManagementZoomMaxAttributeInteractionInfo); + Map readCameraAvSettingsUserLevelManagementTiltMinCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvSettingsUserLevelManagementTiltMinAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvSettingsUserLevelManagementCluster) cluster).readTiltMinAttribute( + (ChipClusters.IntegerAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readCameraAvSettingsUserLevelManagementTiltMinCommandParams + ); + result.put("readTiltMinAttribute", readCameraAvSettingsUserLevelManagementTiltMinAttributeInteractionInfo); + Map readCameraAvSettingsUserLevelManagementTiltMaxCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvSettingsUserLevelManagementTiltMaxAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvSettingsUserLevelManagementCluster) cluster).readTiltMaxAttribute( + (ChipClusters.IntegerAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readCameraAvSettingsUserLevelManagementTiltMaxCommandParams + ); + result.put("readTiltMaxAttribute", readCameraAvSettingsUserLevelManagementTiltMaxAttributeInteractionInfo); + Map readCameraAvSettingsUserLevelManagementPanMinCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvSettingsUserLevelManagementPanMinAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvSettingsUserLevelManagementCluster) cluster).readPanMinAttribute( + (ChipClusters.IntegerAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readCameraAvSettingsUserLevelManagementPanMinCommandParams + ); + result.put("readPanMinAttribute", readCameraAvSettingsUserLevelManagementPanMinAttributeInteractionInfo); + Map readCameraAvSettingsUserLevelManagementPanMaxCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvSettingsUserLevelManagementPanMaxAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvSettingsUserLevelManagementCluster) cluster).readPanMaxAttribute( + (ChipClusters.IntegerAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readCameraAvSettingsUserLevelManagementPanMaxCommandParams + ); + result.put("readPanMaxAttribute", readCameraAvSettingsUserLevelManagementPanMaxAttributeInteractionInfo); + Map readCameraAvSettingsUserLevelManagementGeneratedCommandListCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvSettingsUserLevelManagementGeneratedCommandListAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvSettingsUserLevelManagementCluster) cluster).readGeneratedCommandListAttribute( + (ChipClusters.CameraAvSettingsUserLevelManagementCluster.GeneratedCommandListAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedCameraAvSettingsUserLevelManagementClusterGeneratedCommandListAttributeCallback(), + readCameraAvSettingsUserLevelManagementGeneratedCommandListCommandParams + ); + result.put("readGeneratedCommandListAttribute", readCameraAvSettingsUserLevelManagementGeneratedCommandListAttributeInteractionInfo); + Map readCameraAvSettingsUserLevelManagementAcceptedCommandListCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvSettingsUserLevelManagementAcceptedCommandListAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvSettingsUserLevelManagementCluster) cluster).readAcceptedCommandListAttribute( + (ChipClusters.CameraAvSettingsUserLevelManagementCluster.AcceptedCommandListAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedCameraAvSettingsUserLevelManagementClusterAcceptedCommandListAttributeCallback(), + readCameraAvSettingsUserLevelManagementAcceptedCommandListCommandParams + ); + result.put("readAcceptedCommandListAttribute", readCameraAvSettingsUserLevelManagementAcceptedCommandListAttributeInteractionInfo); + Map readCameraAvSettingsUserLevelManagementEventListCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvSettingsUserLevelManagementEventListAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvSettingsUserLevelManagementCluster) cluster).readEventListAttribute( + (ChipClusters.CameraAvSettingsUserLevelManagementCluster.EventListAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedCameraAvSettingsUserLevelManagementClusterEventListAttributeCallback(), + readCameraAvSettingsUserLevelManagementEventListCommandParams + ); + result.put("readEventListAttribute", readCameraAvSettingsUserLevelManagementEventListAttributeInteractionInfo); + Map readCameraAvSettingsUserLevelManagementAttributeListCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvSettingsUserLevelManagementAttributeListAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvSettingsUserLevelManagementCluster) cluster).readAttributeListAttribute( + (ChipClusters.CameraAvSettingsUserLevelManagementCluster.AttributeListAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedCameraAvSettingsUserLevelManagementClusterAttributeListAttributeCallback(), + readCameraAvSettingsUserLevelManagementAttributeListCommandParams + ); + result.put("readAttributeListAttribute", readCameraAvSettingsUserLevelManagementAttributeListAttributeInteractionInfo); + Map readCameraAvSettingsUserLevelManagementFeatureMapCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvSettingsUserLevelManagementFeatureMapAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvSettingsUserLevelManagementCluster) cluster).readFeatureMapAttribute( + (ChipClusters.LongAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readCameraAvSettingsUserLevelManagementFeatureMapCommandParams + ); + result.put("readFeatureMapAttribute", readCameraAvSettingsUserLevelManagementFeatureMapAttributeInteractionInfo); + Map readCameraAvSettingsUserLevelManagementClusterRevisionCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvSettingsUserLevelManagementClusterRevisionAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvSettingsUserLevelManagementCluster) cluster).readClusterRevisionAttribute( + (ChipClusters.IntegerAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readCameraAvSettingsUserLevelManagementClusterRevisionCommandParams + ); + result.put("readClusterRevisionAttribute", readCameraAvSettingsUserLevelManagementClusterRevisionAttributeInteractionInfo); + + return result; + } private static Map readWebRTCTransportProviderInteractionInfo() { Map result = new LinkedHashMap<>();Map readWebRTCTransportProviderCurrentSessionsCommandParams = new LinkedHashMap(); InteractionInfo readWebRTCTransportProviderCurrentSessionsAttributeInteractionInfo = new InteractionInfo( @@ -20478,6 +20636,7 @@ public Map> getReadAttributeMap() { put("contentAppObserver", readContentAppObserverInteractionInfo()); put("zoneManagement", readZoneManagementInteractionInfo()); put("cameraAvStreamManagement", readCameraAvStreamManagementInteractionInfo()); + put("cameraAvSettingsUserLevelManagement", readCameraAvSettingsUserLevelManagementInteractionInfo()); 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 68d1f3792157cc..6df2ad6b8104e9 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java @@ -3740,6 +3740,8 @@ public Map> getWriteAttributeMap() { ); writeCameraAvStreamManagementInteractionInfo.put("writeStatusLightBrightnessAttribute", writeCameraAvStreamManagementStatusLightBrightnessAttributeInteractionInfo); writeAttributeMap.put("cameraAvStreamManagement", writeCameraAvStreamManagementInteractionInfo); + Map writeCameraAvSettingsUserLevelManagementInteractionInfo = new LinkedHashMap<>(); + writeAttributeMap.put("cameraAvSettingsUserLevelManagement", writeCameraAvSettingsUserLevelManagementInteractionInfo); Map writeWebRTCTransportProviderInteractionInfo = new LinkedHashMap<>(); writeAttributeMap.put("webRTCTransportProvider", writeWebRTCTransportProviderInteractionInfo); Map writeWebRTCTransportRequestorInteractionInfo = new LinkedHashMap<>(); diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/files.gni b/src/controller/java/generated/java/chip/devicecontroller/cluster/files.gni index a4fcda9f9bfcc0..142702d10eca43 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,9 @@ 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/CameraAvSettingsUserLevelManagementClusterMPTZPresetStruct.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/CameraAvSettingsUserLevelManagementClusterMPTZStruct.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/CameraAvSettingsUserLevelManagementClusterViewportStruct.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/CameraAvStreamManagementClusterRateDistortionTradeOffPointsStruct.kt", diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/CameraAvSettingsUserLevelManagementClusterMPTZPresetStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/CameraAvSettingsUserLevelManagementClusterMPTZPresetStruct.kt new file mode 100644 index 00000000000000..a4c276576836d0 --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/CameraAvSettingsUserLevelManagementClusterMPTZPresetStruct.kt @@ -0,0 +1,71 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package chip.devicecontroller.cluster.structs + +import chip.devicecontroller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class CameraAvSettingsUserLevelManagementClusterMPTZPresetStruct( + val presetID: UInt, + val name: String, + val settings: CameraAvSettingsUserLevelManagementClusterMPTZStruct, +) { + override fun toString(): String = buildString { + append("CameraAvSettingsUserLevelManagementClusterMPTZPresetStruct {\n") + append("\tpresetID : $presetID\n") + append("\tname : $name\n") + append("\tsettings : $settings\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_PRESET_ID), presetID) + put(ContextSpecificTag(TAG_NAME), name) + settings.toTlv(ContextSpecificTag(TAG_SETTINGS), this) + endStructure() + } + } + + companion object { + private const val TAG_PRESET_ID = 0 + private const val TAG_NAME = 1 + private const val TAG_SETTINGS = 2 + + fun fromTlv( + tlvTag: Tag, + tlvReader: TlvReader, + ): CameraAvSettingsUserLevelManagementClusterMPTZPresetStruct { + tlvReader.enterStructure(tlvTag) + val presetID = tlvReader.getUInt(ContextSpecificTag(TAG_PRESET_ID)) + val name = tlvReader.getString(ContextSpecificTag(TAG_NAME)) + val settings = + CameraAvSettingsUserLevelManagementClusterMPTZStruct.fromTlv( + ContextSpecificTag(TAG_SETTINGS), + tlvReader, + ) + + tlvReader.exitContainer() + + return CameraAvSettingsUserLevelManagementClusterMPTZPresetStruct(presetID, name, settings) + } + } +} diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/CameraAvSettingsUserLevelManagementClusterMPTZStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/CameraAvSettingsUserLevelManagementClusterMPTZStruct.kt new file mode 100644 index 00000000000000..e2ae92699af96b --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/CameraAvSettingsUserLevelManagementClusterMPTZStruct.kt @@ -0,0 +1,92 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package chip.devicecontroller.cluster.structs + +import chip.devicecontroller.cluster.* +import java.util.Optional +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class CameraAvSettingsUserLevelManagementClusterMPTZStruct( + val pan: Optional, + val tilt: Optional, + val zoom: Optional, +) { + override fun toString(): String = buildString { + append("CameraAvSettingsUserLevelManagementClusterMPTZStruct {\n") + append("\tpan : $pan\n") + append("\ttilt : $tilt\n") + append("\tzoom : $zoom\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + if (pan.isPresent) { + val optpan = pan.get() + put(ContextSpecificTag(TAG_PAN), optpan) + } + if (tilt.isPresent) { + val opttilt = tilt.get() + put(ContextSpecificTag(TAG_TILT), opttilt) + } + if (zoom.isPresent) { + val optzoom = zoom.get() + put(ContextSpecificTag(TAG_ZOOM), optzoom) + } + endStructure() + } + } + + companion object { + private const val TAG_PAN = 0 + private const val TAG_TILT = 1 + private const val TAG_ZOOM = 2 + + fun fromTlv( + tlvTag: Tag, + tlvReader: TlvReader, + ): CameraAvSettingsUserLevelManagementClusterMPTZStruct { + tlvReader.enterStructure(tlvTag) + val pan = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_PAN))) { + Optional.of(tlvReader.getInt(ContextSpecificTag(TAG_PAN))) + } else { + Optional.empty() + } + val tilt = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_TILT))) { + Optional.of(tlvReader.getInt(ContextSpecificTag(TAG_TILT))) + } else { + Optional.empty() + } + val zoom = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_ZOOM))) { + Optional.of(tlvReader.getUInt(ContextSpecificTag(TAG_ZOOM))) + } else { + Optional.empty() + } + + tlvReader.exitContainer() + + return CameraAvSettingsUserLevelManagementClusterMPTZStruct(pan, tilt, zoom) + } + } +} diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/CameraAvSettingsUserLevelManagementClusterViewportStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/CameraAvSettingsUserLevelManagementClusterViewportStruct.kt new file mode 100644 index 00000000000000..c781d0f8f01a5c --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/CameraAvSettingsUserLevelManagementClusterViewportStruct.kt @@ -0,0 +1,72 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package chip.devicecontroller.cluster.structs + +import chip.devicecontroller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class CameraAvSettingsUserLevelManagementClusterViewportStruct( + val x1: UInt, + val y1: UInt, + val x2: UInt, + val y2: UInt, +) { + override fun toString(): String = buildString { + append("CameraAvSettingsUserLevelManagementClusterViewportStruct {\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, + ): CameraAvSettingsUserLevelManagementClusterViewportStruct { + 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 CameraAvSettingsUserLevelManagementClusterViewportStruct(x1, y1, x2, y2) + } + } +} diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/CameraAvSettingsUserLevelManagementCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/CameraAvSettingsUserLevelManagementCluster.kt new file mode 100644 index 00000000000000..fd33f9ae8fd592 --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/CameraAvSettingsUserLevelManagementCluster.kt @@ -0,0 +1,1725 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package matter.controller.cluster.clusters + +import java.time.Duration +import java.util.logging.Level +import java.util.logging.Logger +import kotlinx.coroutines.flow.Flow +import kotlinx.coroutines.flow.transform +import matter.controller.InvokeRequest +import matter.controller.InvokeResponse +import matter.controller.MatterController +import matter.controller.ReadData +import matter.controller.ReadRequest +import matter.controller.ShortSubscriptionState +import matter.controller.SubscribeRequest +import matter.controller.SubscriptionState +import matter.controller.UByteSubscriptionState +import matter.controller.UIntSubscriptionState +import matter.controller.UShortSubscriptionState +import matter.controller.cluster.structs.* +import matter.controller.model.AttributePath +import matter.controller.model.CommandPath +import matter.tlv.AnonymousTag +import matter.tlv.ContextSpecificTag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class CameraAvSettingsUserLevelManagementCluster( + private val controller: MatterController, + private val endpointId: UShort, +) { + class MPTZPositionAttribute(val value: CameraAvSettingsUserLevelManagementClusterMPTZStruct?) + + sealed class MPTZPositionAttributeSubscriptionState { + data class Success(val value: CameraAvSettingsUserLevelManagementClusterMPTZStruct?) : + MPTZPositionAttributeSubscriptionState() + + data class Error(val exception: Exception) : MPTZPositionAttributeSubscriptionState() + + object SubscriptionEstablished : MPTZPositionAttributeSubscriptionState() + } + + class MPTZPresetsAttribute( + val value: List? + ) + + sealed class MPTZPresetsAttributeSubscriptionState { + data class Success( + val value: List? + ) : MPTZPresetsAttributeSubscriptionState() + + data class Error(val exception: Exception) : MPTZPresetsAttributeSubscriptionState() + + object SubscriptionEstablished : MPTZPresetsAttributeSubscriptionState() + } + + class DPTZRelativeMoveAttribute(val value: List?) + + sealed class DPTZRelativeMoveAttributeSubscriptionState { + data class Success(val value: List?) : DPTZRelativeMoveAttributeSubscriptionState() + + data class Error(val exception: Exception) : DPTZRelativeMoveAttributeSubscriptionState() + + object SubscriptionEstablished : DPTZRelativeMoveAttributeSubscriptionState() + } + + 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 MPTZSetPosition( + pan: Short?, + tilt: Short?, + zoom: UByte?, + timedInvokeTimeout: Duration? = null, + ) { + val commandId: UInt = 0u + + val tlvWriter = TlvWriter() + tlvWriter.startStructure(AnonymousTag) + + val TAG_PAN_REQ: Int = 0 + pan?.let { tlvWriter.put(ContextSpecificTag(TAG_PAN_REQ), pan) } + + val TAG_TILT_REQ: Int = 1 + tilt?.let { tlvWriter.put(ContextSpecificTag(TAG_TILT_REQ), tilt) } + + val TAG_ZOOM_REQ: Int = 2 + zoom?.let { tlvWriter.put(ContextSpecificTag(TAG_ZOOM_REQ), zoom) } + 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 MPTZRelativeMove( + panDelta: Short?, + tiltDelta: Short?, + zoomDelta: Byte?, + timedInvokeTimeout: Duration? = null, + ) { + val commandId: UInt = 1u + + val tlvWriter = TlvWriter() + tlvWriter.startStructure(AnonymousTag) + + val TAG_PAN_DELTA_REQ: Int = 0 + panDelta?.let { tlvWriter.put(ContextSpecificTag(TAG_PAN_DELTA_REQ), panDelta) } + + val TAG_TILT_DELTA_REQ: Int = 1 + tiltDelta?.let { tlvWriter.put(ContextSpecificTag(TAG_TILT_DELTA_REQ), tiltDelta) } + + val TAG_ZOOM_DELTA_REQ: Int = 2 + zoomDelta?.let { tlvWriter.put(ContextSpecificTag(TAG_ZOOM_DELTA_REQ), zoomDelta) } + 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 MPTZMoveToPreset(presetID: UByte, timedInvokeTimeout: Duration? = null) { + val commandId: UInt = 2u + + val tlvWriter = TlvWriter() + tlvWriter.startStructure(AnonymousTag) + + val TAG_PRESET_ID_REQ: Int = 0 + tlvWriter.put(ContextSpecificTag(TAG_PRESET_ID_REQ), presetID) + 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 MPTZSavePreset(presetID: UByte?, name: String, timedInvokeTimeout: Duration? = null) { + val commandId: UInt = 3u + + val tlvWriter = TlvWriter() + tlvWriter.startStructure(AnonymousTag) + + val TAG_PRESET_ID_REQ: Int = 0 + presetID?.let { tlvWriter.put(ContextSpecificTag(TAG_PRESET_ID_REQ), presetID) } + + val TAG_NAME_REQ: Int = 1 + tlvWriter.put(ContextSpecificTag(TAG_NAME_REQ), name) + 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 MPTZRemovePreset(presetID: UByte, timedInvokeTimeout: Duration? = null) { + val commandId: UInt = 4u + + val tlvWriter = TlvWriter() + tlvWriter.startStructure(AnonymousTag) + + val TAG_PRESET_ID_REQ: Int = 0 + tlvWriter.put(ContextSpecificTag(TAG_PRESET_ID_REQ), presetID) + 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 DPTZSetViewport( + videoStreamID: UShort, + viewport: CameraAvSettingsUserLevelManagementClusterViewportStruct, + 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_VIEWPORT_REQ: Int = 1 + 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 DPTZRelativeMove( + videoStreamID: UShort, + deltaX: Short?, + deltaY: Short?, + zoomDelta: Byte?, + 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) + + val TAG_DELTA_X_REQ: Int = 1 + deltaX?.let { tlvWriter.put(ContextSpecificTag(TAG_DELTA_X_REQ), deltaX) } + + val TAG_DELTA_Y_REQ: Int = 2 + deltaY?.let { tlvWriter.put(ContextSpecificTag(TAG_DELTA_Y_REQ), deltaY) } + + val TAG_ZOOM_DELTA_REQ: Int = 3 + zoomDelta?.let { tlvWriter.put(ContextSpecificTag(TAG_ZOOM_DELTA_REQ), zoomDelta) } + 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 readMPTZPositionAttribute(): MPTZPositionAttribute { + 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) { "Mptzposition attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: CameraAvSettingsUserLevelManagementClusterMPTZStruct? = + if (tlvReader.isNextTag(AnonymousTag)) { + CameraAvSettingsUserLevelManagementClusterMPTZStruct.fromTlv(AnonymousTag, tlvReader) + } else { + null + } + + return MPTZPositionAttribute(decodedValue) + } + + suspend fun subscribeMPTZPositionAttribute( + 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( + MPTZPositionAttributeSubscriptionState.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) { "Mptzposition attribute not found in Node State update" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: CameraAvSettingsUserLevelManagementClusterMPTZStruct? = + if (tlvReader.isNextTag(AnonymousTag)) { + CameraAvSettingsUserLevelManagementClusterMPTZStruct.fromTlv(AnonymousTag, tlvReader) + } else { + null + } + + decodedValue?.let { emit(MPTZPositionAttributeSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(MPTZPositionAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readMaxPresetsAttribute(): UByte? { + val ATTRIBUTE_ID: UInt = 1u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Maxpresets 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 subscribeMaxPresetsAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 1u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + UByteSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { "Maxpresets 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 readMPTZPresetsAttribute(): MPTZPresetsAttribute { + 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) { "Mptzpresets 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( + CameraAvSettingsUserLevelManagementClusterMPTZPresetStruct.fromTlv( + AnonymousTag, + tlvReader, + ) + ) + } + tlvReader.exitContainer() + } + } else { + null + } + + return MPTZPresetsAttribute(decodedValue) + } + + suspend fun subscribeMPTZPresetsAttribute( + 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( + MPTZPresetsAttributeSubscriptionState.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) { "Mptzpresets 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( + CameraAvSettingsUserLevelManagementClusterMPTZPresetStruct.fromTlv( + AnonymousTag, + tlvReader, + ) + ) + } + tlvReader.exitContainer() + } + } else { + null + } + + decodedValue?.let { emit(MPTZPresetsAttributeSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(MPTZPresetsAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readDPTZRelativeMoveAttribute(): DPTZRelativeMoveAttribute { + 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) { "Dptzrelativemove 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.getUShort(AnonymousTag)) + } + tlvReader.exitContainer() + } + } else { + null + } + + return DPTZRelativeMoveAttribute(decodedValue) + } + + suspend fun subscribeDPTZRelativeMoveAttribute( + 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( + DPTZRelativeMoveAttributeSubscriptionState.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) { + "Dptzrelativemove 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.getUShort(AnonymousTag)) + } + tlvReader.exitContainer() + } + } else { + null + } + + decodedValue?.let { emit(DPTZRelativeMoveAttributeSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(DPTZRelativeMoveAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readZoomMaxAttribute(): UByte? { + 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) { "Zoommax 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 subscribeZoomMaxAttribute( + 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( + 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) { "Zoommax 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 readTiltMinAttribute(): Short? { + 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) { "Tiltmin attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: Short? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getShort(AnonymousTag) + } else { + null + } + + return decodedValue + } + + suspend fun subscribeTiltMinAttribute( + 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( + ShortSubscriptionState.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) { "Tiltmin attribute not found in Node State update" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: Short? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getShort(AnonymousTag) + } else { + null + } + + decodedValue?.let { emit(ShortSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(ShortSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readTiltMaxAttribute(): Short? { + 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) { "Tiltmax attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: Short? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getShort(AnonymousTag) + } else { + null + } + + return decodedValue + } + + suspend fun subscribeTiltMaxAttribute( + 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( + ShortSubscriptionState.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) { "Tiltmax attribute not found in Node State update" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: Short? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getShort(AnonymousTag) + } else { + null + } + + decodedValue?.let { emit(ShortSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(ShortSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readPanMinAttribute(): Short? { + 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) { "Panmin attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: Short? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getShort(AnonymousTag) + } else { + null + } + + return decodedValue + } + + suspend fun subscribePanMinAttribute( + 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( + ShortSubscriptionState.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) { "Panmin attribute not found in Node State update" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: Short? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getShort(AnonymousTag) + } else { + null + } + + decodedValue?.let { emit(ShortSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(ShortSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readPanMaxAttribute(): Short? { + 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) { "Panmax attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: Short? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getShort(AnonymousTag) + } else { + null + } + + return decodedValue + } + + suspend fun subscribePanMaxAttribute( + 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( + ShortSubscriptionState.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) { "Panmax attribute not found in Node State update" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: Short? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getShort(AnonymousTag) + } else { + null + } + + decodedValue?.let { emit(ShortSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(ShortSubscriptionState.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(CameraAvSettingsUserLevelManagementCluster::class.java.name) + const val CLUSTER_ID: UInt = 1362u + } +} diff --git a/src/controller/java/generated/java/matter/controller/cluster/files.gni b/src/controller/java/generated/java/matter/controller/cluster/files.gni index b09fc7b799e316..700f257e643888 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,9 @@ 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/CameraAvSettingsUserLevelManagementClusterMPTZPresetStruct.kt", + "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/CameraAvSettingsUserLevelManagementClusterMPTZStruct.kt", + "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/CameraAvSettingsUserLevelManagementClusterViewportStruct.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/CameraAvStreamManagementClusterRateDistortionTradeOffPointsStruct.kt", @@ -287,6 +290,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/CameraAvSettingsUserLevelManagementCluster.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", diff --git a/src/controller/java/generated/java/matter/controller/cluster/structs/CameraAvSettingsUserLevelManagementClusterMPTZPresetStruct.kt b/src/controller/java/generated/java/matter/controller/cluster/structs/CameraAvSettingsUserLevelManagementClusterMPTZPresetStruct.kt new file mode 100644 index 00000000000000..20d67ca5c4c51a --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/structs/CameraAvSettingsUserLevelManagementClusterMPTZPresetStruct.kt @@ -0,0 +1,71 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package matter.controller.cluster.structs + +import matter.controller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class CameraAvSettingsUserLevelManagementClusterMPTZPresetStruct( + val presetID: UByte, + val name: String, + val settings: CameraAvSettingsUserLevelManagementClusterMPTZStruct, +) { + override fun toString(): String = buildString { + append("CameraAvSettingsUserLevelManagementClusterMPTZPresetStruct {\n") + append("\tpresetID : $presetID\n") + append("\tname : $name\n") + append("\tsettings : $settings\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_PRESET_ID), presetID) + put(ContextSpecificTag(TAG_NAME), name) + settings.toTlv(ContextSpecificTag(TAG_SETTINGS), this) + endStructure() + } + } + + companion object { + private const val TAG_PRESET_ID = 0 + private const val TAG_NAME = 1 + private const val TAG_SETTINGS = 2 + + fun fromTlv( + tlvTag: Tag, + tlvReader: TlvReader, + ): CameraAvSettingsUserLevelManagementClusterMPTZPresetStruct { + tlvReader.enterStructure(tlvTag) + val presetID = tlvReader.getUByte(ContextSpecificTag(TAG_PRESET_ID)) + val name = tlvReader.getString(ContextSpecificTag(TAG_NAME)) + val settings = + CameraAvSettingsUserLevelManagementClusterMPTZStruct.fromTlv( + ContextSpecificTag(TAG_SETTINGS), + tlvReader, + ) + + tlvReader.exitContainer() + + return CameraAvSettingsUserLevelManagementClusterMPTZPresetStruct(presetID, name, settings) + } + } +} diff --git a/src/controller/java/generated/java/matter/controller/cluster/structs/CameraAvSettingsUserLevelManagementClusterMPTZStruct.kt b/src/controller/java/generated/java/matter/controller/cluster/structs/CameraAvSettingsUserLevelManagementClusterMPTZStruct.kt new file mode 100644 index 00000000000000..ebc6dd12822dc5 --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/structs/CameraAvSettingsUserLevelManagementClusterMPTZStruct.kt @@ -0,0 +1,92 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package matter.controller.cluster.structs + +import java.util.Optional +import matter.controller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class CameraAvSettingsUserLevelManagementClusterMPTZStruct( + val pan: Optional, + val tilt: Optional, + val zoom: Optional, +) { + override fun toString(): String = buildString { + append("CameraAvSettingsUserLevelManagementClusterMPTZStruct {\n") + append("\tpan : $pan\n") + append("\ttilt : $tilt\n") + append("\tzoom : $zoom\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + if (pan.isPresent) { + val optpan = pan.get() + put(ContextSpecificTag(TAG_PAN), optpan) + } + if (tilt.isPresent) { + val opttilt = tilt.get() + put(ContextSpecificTag(TAG_TILT), opttilt) + } + if (zoom.isPresent) { + val optzoom = zoom.get() + put(ContextSpecificTag(TAG_ZOOM), optzoom) + } + endStructure() + } + } + + companion object { + private const val TAG_PAN = 0 + private const val TAG_TILT = 1 + private const val TAG_ZOOM = 2 + + fun fromTlv( + tlvTag: Tag, + tlvReader: TlvReader, + ): CameraAvSettingsUserLevelManagementClusterMPTZStruct { + tlvReader.enterStructure(tlvTag) + val pan = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_PAN))) { + Optional.of(tlvReader.getShort(ContextSpecificTag(TAG_PAN))) + } else { + Optional.empty() + } + val tilt = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_TILT))) { + Optional.of(tlvReader.getShort(ContextSpecificTag(TAG_TILT))) + } else { + Optional.empty() + } + val zoom = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_ZOOM))) { + Optional.of(tlvReader.getUByte(ContextSpecificTag(TAG_ZOOM))) + } else { + Optional.empty() + } + + tlvReader.exitContainer() + + return CameraAvSettingsUserLevelManagementClusterMPTZStruct(pan, tilt, zoom) + } + } +} diff --git a/src/controller/java/generated/java/matter/controller/cluster/structs/CameraAvSettingsUserLevelManagementClusterViewportStruct.kt b/src/controller/java/generated/java/matter/controller/cluster/structs/CameraAvSettingsUserLevelManagementClusterViewportStruct.kt new file mode 100644 index 00000000000000..983f73d46b88bb --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/structs/CameraAvSettingsUserLevelManagementClusterViewportStruct.kt @@ -0,0 +1,72 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package matter.controller.cluster.structs + +import matter.controller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class CameraAvSettingsUserLevelManagementClusterViewportStruct( + val x1: UShort, + val y1: UShort, + val x2: UShort, + val y2: UShort, +) { + override fun toString(): String = buildString { + append("CameraAvSettingsUserLevelManagementClusterViewportStruct {\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, + ): CameraAvSettingsUserLevelManagementClusterViewportStruct { + 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 CameraAvSettingsUserLevelManagementClusterViewportStruct(x1, y1, x2, y2) + } + } +} diff --git a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp index 137e2afeb3d0bc..1c959aa8fc3c15 100644 --- a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp @@ -41580,6 +41580,469 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR } break; } + case app::Clusters::CameraAvSettingsUserLevelManagement::Id: { + using namespace app::Clusters::CameraAvSettingsUserLevelManagement; + switch (aPath.mAttributeId) + { + case Attributes::MPTZPosition::Id: { + using TypeInfo = Attributes::MPTZPosition::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + jobject value_pan; + if (!cppValue.pan.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_pan); + } + else + { + jobject value_panInsideOptional; + std::string value_panInsideOptionalClassName = "java/lang/Integer"; + std::string value_panInsideOptionalCtorSignature = "(I)V"; + jint jnivalue_panInsideOptional = static_cast(cppValue.pan.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject(value_panInsideOptionalClassName.c_str(), + value_panInsideOptionalCtorSignature.c_str(), + jnivalue_panInsideOptional, value_panInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(value_panInsideOptional, value_pan); + } + jobject value_tilt; + if (!cppValue.tilt.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_tilt); + } + else + { + jobject value_tiltInsideOptional; + std::string value_tiltInsideOptionalClassName = "java/lang/Integer"; + std::string value_tiltInsideOptionalCtorSignature = "(I)V"; + jint jnivalue_tiltInsideOptional = static_cast(cppValue.tilt.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject(value_tiltInsideOptionalClassName.c_str(), + value_tiltInsideOptionalCtorSignature.c_str(), + jnivalue_tiltInsideOptional, value_tiltInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(value_tiltInsideOptional, value_tilt); + } + jobject value_zoom; + if (!cppValue.zoom.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_zoom); + } + else + { + jobject value_zoomInsideOptional; + std::string value_zoomInsideOptionalClassName = "java/lang/Integer"; + std::string value_zoomInsideOptionalCtorSignature = "(I)V"; + jint jnivalue_zoomInsideOptional = static_cast(cppValue.zoom.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject(value_zoomInsideOptionalClassName.c_str(), + value_zoomInsideOptionalCtorSignature.c_str(), + jnivalue_zoomInsideOptional, value_zoomInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(value_zoomInsideOptional, value_zoom); + } + + { + jclass MPTZStructStructClass_0; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$CameraAvSettingsUserLevelManagementClusterMPTZStruct", + MPTZStructStructClass_0); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$CameraAvSettingsUserLevelManagementClusterMPTZStruct"); + return nullptr; + } + + jmethodID MPTZStructStructCtor_0; + err = chip::JniReferences::GetInstance().FindMethod( + env, MPTZStructStructClass_0, "", "(Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;)V", + &MPTZStructStructCtor_0); + if (err != CHIP_NO_ERROR || MPTZStructStructCtor_0 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$CameraAvSettingsUserLevelManagementClusterMPTZStruct constructor"); + return nullptr; + } + + value = env->NewObject(MPTZStructStructClass_0, MPTZStructStructCtor_0, value_pan, value_tilt, value_zoom); + } + return value; + } + case Attributes::MaxPresets::Id: { + using TypeInfo = Attributes::MaxPresets::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::MPTZPresets::Id: { + using TypeInfo = Attributes::MPTZPresets::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_presetID; + std::string newElement_0_presetIDClassName = "java/lang/Integer"; + std::string newElement_0_presetIDCtorSignature = "(I)V"; + jint jninewElement_0_presetID = static_cast(entry_0.presetID); + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_presetIDClassName.c_str(), + newElement_0_presetIDCtorSignature.c_str(), + jninewElement_0_presetID, newElement_0_presetID); + jobject newElement_0_name; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.name, newElement_0_name)); + jobject newElement_0_settings; + jobject newElement_0_settings_pan; + if (!entry_0.settings.pan.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_0_settings_pan); + } + else + { + jobject newElement_0_settings_panInsideOptional; + std::string newElement_0_settings_panInsideOptionalClassName = "java/lang/Integer"; + std::string newElement_0_settings_panInsideOptionalCtorSignature = "(I)V"; + jint jninewElement_0_settings_panInsideOptional = static_cast(entry_0.settings.pan.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_settings_panInsideOptionalClassName.c_str(), + newElement_0_settings_panInsideOptionalCtorSignature.c_str(), jninewElement_0_settings_panInsideOptional, + newElement_0_settings_panInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(newElement_0_settings_panInsideOptional, + newElement_0_settings_pan); + } + jobject newElement_0_settings_tilt; + if (!entry_0.settings.tilt.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_0_settings_tilt); + } + else + { + jobject newElement_0_settings_tiltInsideOptional; + std::string newElement_0_settings_tiltInsideOptionalClassName = "java/lang/Integer"; + std::string newElement_0_settings_tiltInsideOptionalCtorSignature = "(I)V"; + jint jninewElement_0_settings_tiltInsideOptional = static_cast(entry_0.settings.tilt.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_settings_tiltInsideOptionalClassName.c_str(), + newElement_0_settings_tiltInsideOptionalCtorSignature.c_str(), jninewElement_0_settings_tiltInsideOptional, + newElement_0_settings_tiltInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(newElement_0_settings_tiltInsideOptional, + newElement_0_settings_tilt); + } + jobject newElement_0_settings_zoom; + if (!entry_0.settings.zoom.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_0_settings_zoom); + } + else + { + jobject newElement_0_settings_zoomInsideOptional; + std::string newElement_0_settings_zoomInsideOptionalClassName = "java/lang/Integer"; + std::string newElement_0_settings_zoomInsideOptionalCtorSignature = "(I)V"; + jint jninewElement_0_settings_zoomInsideOptional = static_cast(entry_0.settings.zoom.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_settings_zoomInsideOptionalClassName.c_str(), + newElement_0_settings_zoomInsideOptionalCtorSignature.c_str(), jninewElement_0_settings_zoomInsideOptional, + newElement_0_settings_zoomInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(newElement_0_settings_zoomInsideOptional, + newElement_0_settings_zoom); + } + + { + jclass MPTZStructStructClass_2; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$CameraAvSettingsUserLevelManagementClusterMPTZStruct", + MPTZStructStructClass_2); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$CameraAvSettingsUserLevelManagementClusterMPTZStruct"); + return nullptr; + } + + jmethodID MPTZStructStructCtor_2; + err = chip::JniReferences::GetInstance().FindMethod( + env, MPTZStructStructClass_2, "", "(Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;)V", + &MPTZStructStructCtor_2); + if (err != CHIP_NO_ERROR || MPTZStructStructCtor_2 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$CameraAvSettingsUserLevelManagementClusterMPTZStruct constructor"); + return nullptr; + } + + newElement_0_settings = + env->NewObject(MPTZStructStructClass_2, MPTZStructStructCtor_2, newElement_0_settings_pan, + newElement_0_settings_tilt, newElement_0_settings_zoom); + } + + { + jclass MPTZPresetStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$CameraAvSettingsUserLevelManagementClusterMPTZPresetStruct", + MPTZPresetStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, + "Could not find class ChipStructs$CameraAvSettingsUserLevelManagementClusterMPTZPresetStruct"); + return nullptr; + } + + jmethodID MPTZPresetStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, MPTZPresetStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/lang/String;Lchip/devicecontroller/" + "ChipStructs$CameraAvSettingsUserLevelManagementClusterMPTZStruct;)V", + &MPTZPresetStructStructCtor_1); + if (err != CHIP_NO_ERROR || MPTZPresetStructStructCtor_1 == nullptr) + { + ChipLogError( + Zcl, + "Could not find ChipStructs$CameraAvSettingsUserLevelManagementClusterMPTZPresetStruct constructor"); + return nullptr; + } + + newElement_0 = env->NewObject(MPTZPresetStructStructClass_1, MPTZPresetStructStructCtor_1, + newElement_0_presetID, newElement_0_name, newElement_0_settings); + } + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::DPTZRelativeMove::Id: { + using TypeInfo = Attributes::DPTZRelativeMove::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::ZoomMax::Id: { + using TypeInfo = Attributes::ZoomMax::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::TiltMin::Id: { + using TypeInfo = Attributes::TiltMin::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::TiltMax::Id: { + using TypeInfo = Attributes::TiltMax::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::PanMin::Id: { + using TypeInfo = Attributes::PanMin::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::PanMax::Id: { + using TypeInfo = Attributes::PanMax::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::GeneratedCommandList::Id: { + using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + jlong jninewElement_0 = static_cast(entry_0); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::AcceptedCommandList::Id: { + using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + jlong jninewElement_0 = static_cast(entry_0); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::AttributeList::Id: { + using TypeInfo = Attributes::AttributeList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + jlong jninewElement_0 = static_cast(entry_0); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::FeatureMap::Id: { + using TypeInfo = Attributes::FeatureMap::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Long"; + std::string valueCtorSignature = "(J)V"; + jlong jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + jnivalue, value); + return value; + } + case Attributes::ClusterRevision::Id: { + using TypeInfo = Attributes::ClusterRevision::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + jint jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, + value); + return value; + } + default: + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + break; + } + break; + } case app::Clusters::WebRTCTransportProvider::Id: { using namespace app::Clusters::WebRTCTransportProvider; switch (aPath.mAttributeId) diff --git a/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp index 1a28bfdffae10c..91d5466f759665 100644 --- a/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp @@ -9089,6 +9089,16 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & } break; } + case app::Clusters::CameraAvSettingsUserLevelManagement::Id: { + using namespace app::Clusters::CameraAvSettingsUserLevelManagement; + switch (aPath.mEventId) + { + default: + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; + break; + } + break; + } case app::Clusters::WebRTCTransportProvider::Id: { using namespace app::Clusters::WebRTCTransportProvider; switch (aPath.mEventId) diff --git a/src/controller/python/chip/clusters/CHIPClusters.py b/src/controller/python/chip/clusters/CHIPClusters.py index 253edc506414b9..60e9236bfe38f6 100644 --- a/src/controller/python/chip/clusters/CHIPClusters.py +++ b/src/controller/python/chip/clusters/CHIPClusters.py @@ -12773,6 +12773,156 @@ class ChipClusters: }, }, } + _CAMERA_AV_SETTINGS_USER_LEVEL_MANAGEMENT_CLUSTER_INFO = { + "clusterName": "CameraAvSettingsUserLevelManagement", + "clusterId": 0x00000552, + "commands": { + 0x00000000: { + "commandId": 0x00000000, + "commandName": "MPTZSetPosition", + "args": { + "pan": "int", + "tilt": "int", + "zoom": "int", + }, + }, + 0x00000001: { + "commandId": 0x00000001, + "commandName": "MPTZRelativeMove", + "args": { + "panDelta": "int", + "tiltDelta": "int", + "zoomDelta": "int", + }, + }, + 0x00000002: { + "commandId": 0x00000002, + "commandName": "MPTZMoveToPreset", + "args": { + "presetID": "int", + }, + }, + 0x00000003: { + "commandId": 0x00000003, + "commandName": "MPTZSavePreset", + "args": { + "presetID": "int", + "name": "str", + }, + }, + 0x00000004: { + "commandId": 0x00000004, + "commandName": "MPTZRemovePreset", + "args": { + "presetID": "int", + }, + }, + 0x00000005: { + "commandId": 0x00000005, + "commandName": "DPTZSetViewport", + "args": { + "videoStreamID": "int", + "viewport": "ViewportStruct", + }, + }, + 0x00000006: { + "commandId": 0x00000006, + "commandName": "DPTZRelativeMove", + "args": { + "videoStreamID": "int", + "deltaX": "int", + "deltaY": "int", + "zoomDelta": "int", + }, + }, + }, + "attributes": { + 0x00000000: { + "attributeName": "MPTZPosition", + "attributeId": 0x00000000, + "type": "", + "reportable": True, + }, + 0x00000001: { + "attributeName": "MaxPresets", + "attributeId": 0x00000001, + "type": "int", + "reportable": True, + }, + 0x00000002: { + "attributeName": "MPTZPresets", + "attributeId": 0x00000002, + "type": "", + "reportable": True, + }, + 0x00000003: { + "attributeName": "DPTZRelativeMove", + "attributeId": 0x00000003, + "type": "int", + "reportable": True, + }, + 0x00000004: { + "attributeName": "ZoomMax", + "attributeId": 0x00000004, + "type": "int", + "reportable": True, + }, + 0x00000005: { + "attributeName": "TiltMin", + "attributeId": 0x00000005, + "type": "int", + "reportable": True, + }, + 0x00000006: { + "attributeName": "TiltMax", + "attributeId": 0x00000006, + "type": "int", + "reportable": True, + }, + 0x00000007: { + "attributeName": "PanMin", + "attributeId": 0x00000007, + "type": "int", + "reportable": True, + }, + 0x00000008: { + "attributeName": "PanMax", + "attributeId": 0x00000008, + "type": "int", + "reportable": True, + }, + 0x0000FFF8: { + "attributeName": "GeneratedCommandList", + "attributeId": 0x0000FFF8, + "type": "int", + "reportable": True, + }, + 0x0000FFF9: { + "attributeName": "AcceptedCommandList", + "attributeId": 0x0000FFF9, + "type": "int", + "reportable": True, + }, + 0x0000FFFB: { + "attributeName": "AttributeList", + "attributeId": 0x0000FFFB, + "type": "int", + "reportable": True, + }, + 0x0000FFFC: { + "attributeName": "FeatureMap", + "attributeId": 0x0000FFFC, + "type": "int", + "reportable": True, + }, + 0x0000FFFD: { + "attributeName": "ClusterRevision", + "attributeId": 0x0000FFFD, + "type": "int", + "reportable": True, + }, + }, + } _WEB_RTC_TRANSPORT_PROVIDER_CLUSTER_INFO = { "clusterName": "WebRTCTransportProvider", "clusterId": 0x00000553, @@ -14229,6 +14379,7 @@ class ChipClusters: 0x00000510: _CONTENT_APP_OBSERVER_CLUSTER_INFO, 0x00000550: _ZONE_MANAGEMENT_CLUSTER_INFO, 0x00000551: _CAMERA_AV_STREAM_MANAGEMENT_CLUSTER_INFO, + 0x00000552: _CAMERA_AV_SETTINGS_USER_LEVEL_MANAGEMENT_CLUSTER_INFO, 0x00000553: _WEB_RTC_TRANSPORT_PROVIDER_CLUSTER_INFO, 0x00000554: _WEB_RTC_TRANSPORT_REQUESTOR_CLUSTER_INFO, 0x00000556: _CHIME_CLUSTER_INFO, @@ -14359,6 +14510,7 @@ class ChipClusters: "ContentAppObserver": _CONTENT_APP_OBSERVER_CLUSTER_INFO, "ZoneManagement": _ZONE_MANAGEMENT_CLUSTER_INFO, "CameraAvStreamManagement": _CAMERA_AV_STREAM_MANAGEMENT_CLUSTER_INFO, + "CameraAvSettingsUserLevelManagement": _CAMERA_AV_SETTINGS_USER_LEVEL_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 727610a72c3aeb..dc6aea8c321eda 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -159,6 +159,7 @@ "ContentAppObserver", "ZoneManagement", "CameraAvStreamManagement", + "CameraAvSettingsUserLevelManagement", "WebRTCTransportProvider", "WebRTCTransportRequestor", "Chime", @@ -46228,6 +46229,458 @@ def descriptor(cls) -> ClusterObjectDescriptor: quality: typing.Optional[uint] = None +@dataclass +class CameraAvSettingsUserLevelManagement(Cluster): + id: typing.ClassVar[int] = 0x00000552 + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="MPTZPosition", Tag=0x00000000, Type=typing.Optional[CameraAvSettingsUserLevelManagement.Structs.MPTZStruct]), + ClusterObjectFieldDescriptor(Label="maxPresets", Tag=0x00000001, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="MPTZPresets", Tag=0x00000002, Type=typing.Optional[typing.List[CameraAvSettingsUserLevelManagement.Structs.MPTZPresetStruct]]), + ClusterObjectFieldDescriptor(Label="DPTZRelativeMove", Tag=0x00000003, Type=typing.Optional[typing.List[uint]]), + ClusterObjectFieldDescriptor(Label="zoomMax", Tag=0x00000004, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="tiltMin", Tag=0x00000005, Type=typing.Optional[int]), + ClusterObjectFieldDescriptor(Label="tiltMax", Tag=0x00000006, Type=typing.Optional[int]), + ClusterObjectFieldDescriptor(Label="panMin", Tag=0x00000007, Type=typing.Optional[int]), + ClusterObjectFieldDescriptor(Label="panMax", Tag=0x00000008, Type=typing.Optional[int]), + ClusterObjectFieldDescriptor(Label="generatedCommandList", Tag=0x0000FFF8, Type=typing.List[uint]), + ClusterObjectFieldDescriptor(Label="acceptedCommandList", Tag=0x0000FFF9, Type=typing.List[uint]), + ClusterObjectFieldDescriptor(Label="attributeList", Tag=0x0000FFFB, Type=typing.List[uint]), + ClusterObjectFieldDescriptor(Label="featureMap", Tag=0x0000FFFC, Type=uint), + ClusterObjectFieldDescriptor(Label="clusterRevision", Tag=0x0000FFFD, Type=uint), + ]) + + MPTZPosition: typing.Optional[CameraAvSettingsUserLevelManagement.Structs.MPTZStruct] = None + maxPresets: typing.Optional[uint] = None + MPTZPresets: typing.Optional[typing.List[CameraAvSettingsUserLevelManagement.Structs.MPTZPresetStruct]] = None + DPTZRelativeMove: typing.Optional[typing.List[uint]] = None + zoomMax: typing.Optional[uint] = None + tiltMin: typing.Optional[int] = None + tiltMax: typing.Optional[int] = None + panMin: typing.Optional[int] = None + panMax: typing.Optional[int] = None + generatedCommandList: typing.List[uint] = field(default_factory=lambda: []) + acceptedCommandList: typing.List[uint] = field(default_factory=lambda: []) + attributeList: typing.List[uint] = field(default_factory=lambda: []) + featureMap: uint = 0 + clusterRevision: uint = 0 + + class Bitmaps: + class Feature(IntFlag): + kDigitalPTZ = 0x1 + kMechanicalPan = 0x2 + kMechanicalTilt = 0x4 + kMechanicalZoom = 0x8 + kMechanicalPresets = 0x10 + + class Structs: + @dataclass + class MPTZStruct(ClusterObject): + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="pan", Tag=0, Type=typing.Optional[int]), + ClusterObjectFieldDescriptor(Label="tilt", Tag=1, Type=typing.Optional[int]), + ClusterObjectFieldDescriptor(Label="zoom", Tag=2, Type=typing.Optional[uint]), + ]) + + pan: 'typing.Optional[int]' = None + tilt: 'typing.Optional[int]' = None + zoom: 'typing.Optional[uint]' = None + + @dataclass + class MPTZPresetStruct(ClusterObject): + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="presetID", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="name", Tag=1, Type=str), + ClusterObjectFieldDescriptor(Label="settings", Tag=2, Type=CameraAvSettingsUserLevelManagement.Structs.MPTZStruct), + ]) + + presetID: 'uint' = 0 + name: 'str' = "" + settings: 'CameraAvSettingsUserLevelManagement.Structs.MPTZStruct' = field(default_factory=lambda: CameraAvSettingsUserLevelManagement.Structs.MPTZStruct()) + + @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 MPTZSetPosition(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000552 + command_id: typing.ClassVar[int] = 0x00000000 + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[typing.Optional[str]] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="pan", Tag=0, Type=typing.Optional[int]), + ClusterObjectFieldDescriptor(Label="tilt", Tag=1, Type=typing.Optional[int]), + ClusterObjectFieldDescriptor(Label="zoom", Tag=2, Type=typing.Optional[uint]), + ]) + + pan: typing.Optional[int] = None + tilt: typing.Optional[int] = None + zoom: typing.Optional[uint] = None + + @dataclass + class MPTZRelativeMove(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000552 + command_id: typing.ClassVar[int] = 0x00000001 + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[typing.Optional[str]] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="panDelta", Tag=0, Type=typing.Optional[int]), + ClusterObjectFieldDescriptor(Label="tiltDelta", Tag=1, Type=typing.Optional[int]), + ClusterObjectFieldDescriptor(Label="zoomDelta", Tag=2, Type=typing.Optional[int]), + ]) + + panDelta: typing.Optional[int] = None + tiltDelta: typing.Optional[int] = None + zoomDelta: typing.Optional[int] = None + + @dataclass + class MPTZMoveToPreset(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000552 + command_id: typing.ClassVar[int] = 0x00000002 + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[typing.Optional[str]] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="presetID", Tag=0, Type=uint), + ]) + + presetID: uint = 0 + + @dataclass + class MPTZSavePreset(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000552 + command_id: typing.ClassVar[int] = 0x00000003 + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[typing.Optional[str]] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="presetID", Tag=0, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="name", Tag=1, Type=str), + ]) + + presetID: typing.Optional[uint] = None + name: str = "" + + @dataclass + class MPTZRemovePreset(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000552 + command_id: typing.ClassVar[int] = 0x00000004 + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[typing.Optional[str]] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="presetID", Tag=0, Type=uint), + ]) + + presetID: uint = 0 + + @dataclass + class DPTZSetViewport(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000552 + command_id: typing.ClassVar[int] = 0x00000005 + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[typing.Optional[str]] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="videoStreamID", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="viewport", Tag=1, Type=CameraAvSettingsUserLevelManagement.Structs.ViewportStruct), + ]) + + videoStreamID: uint = 0 + viewport: CameraAvSettingsUserLevelManagement.Structs.ViewportStruct = field(default_factory=lambda: CameraAvSettingsUserLevelManagement.Structs.ViewportStruct()) + + @dataclass + class DPTZRelativeMove(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000552 + command_id: typing.ClassVar[int] = 0x00000006 + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[typing.Optional[str]] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="videoStreamID", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="deltaX", Tag=1, Type=typing.Optional[int]), + ClusterObjectFieldDescriptor(Label="deltaY", Tag=2, Type=typing.Optional[int]), + ClusterObjectFieldDescriptor(Label="zoomDelta", Tag=3, Type=typing.Optional[int]), + ]) + + videoStreamID: uint = 0 + deltaX: typing.Optional[int] = None + deltaY: typing.Optional[int] = None + zoomDelta: typing.Optional[int] = None + + class Attributes: + @dataclass + class MPTZPosition(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000552 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000000 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[CameraAvSettingsUserLevelManagement.Structs.MPTZStruct]) + + value: typing.Optional[CameraAvSettingsUserLevelManagement.Structs.MPTZStruct] = None + + @dataclass + class MaxPresets(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000552 + + @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 MPTZPresets(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000552 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000002 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[typing.List[CameraAvSettingsUserLevelManagement.Structs.MPTZPresetStruct]]) + + value: typing.Optional[typing.List[CameraAvSettingsUserLevelManagement.Structs.MPTZPresetStruct]] = None + + @dataclass + class DPTZRelativeMove(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000552 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000003 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[typing.List[uint]]) + + value: typing.Optional[typing.List[uint]] = None + + @dataclass + class ZoomMax(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000552 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000004 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) + + value: typing.Optional[uint] = None + + @dataclass + class TiltMin(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000552 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000005 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[int]) + + value: typing.Optional[int] = None + + @dataclass + class TiltMax(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000552 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000006 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[int]) + + value: typing.Optional[int] = None + + @dataclass + class PanMin(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000552 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000007 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[int]) + + value: typing.Optional[int] = None + + @dataclass + class PanMax(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000552 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000008 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[int]) + + value: typing.Optional[int] = None + + @dataclass + class GeneratedCommandList(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000552 + + @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 0x00000552 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFF9 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.List[uint]) + + value: typing.List[uint] = field(default_factory=lambda: []) + + @dataclass + class AttributeList(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000552 + + @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 0x00000552 + + @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 0x00000552 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFFD + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=uint) + + value: uint = 0 + + @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 947877c053205c..53ab30c0991eb8 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm @@ -5714,6 +5714,57 @@ static BOOL AttributeIsSpecifiedInCameraAVStreamManagementCluster(AttributeId aA } } } +static BOOL AttributeIsSpecifiedInCameraAVSettingsUserLevelManagementCluster(AttributeId aAttributeId) +{ + using namespace Clusters::CameraAvSettingsUserLevelManagement; + switch (aAttributeId) { + case Attributes::MPTZPosition::Id: { + return YES; + } + case Attributes::MaxPresets::Id: { + return YES; + } + case Attributes::MPTZPresets::Id: { + return YES; + } + case Attributes::DPTZRelativeMove::Id: { + return YES; + } + case Attributes::ZoomMax::Id: { + return YES; + } + case Attributes::TiltMin::Id: { + return YES; + } + case Attributes::TiltMax::Id: { + return YES; + } + case Attributes::PanMin::Id: { + return YES; + } + case Attributes::PanMax::Id: { + return YES; + } + case Attributes::GeneratedCommandList::Id: { + return YES; + } + case Attributes::AcceptedCommandList::Id: { + return YES; + } + case Attributes::AttributeList::Id: { + return YES; + } + case Attributes::FeatureMap::Id: { + return YES; + } + case Attributes::ClusterRevision::Id: { + return YES; + } + default: { + return NO; + } + } +} static BOOL AttributeIsSpecifiedInWebRTCTransportProviderCluster(AttributeId aAttributeId) { using namespace Clusters::WebRTCTransportProvider; @@ -6528,6 +6579,9 @@ BOOL MTRAttributeIsSpecified(ClusterId aClusterId, AttributeId aAttributeId) case Clusters::CameraAvStreamManagement::Id: { return AttributeIsSpecifiedInCameraAVStreamManagementCluster(aAttributeId); } + case Clusters::CameraAvSettingsUserLevelManagement::Id: { + return AttributeIsSpecifiedInCameraAVSettingsUserLevelManagementCluster(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 7d0e323174b64f..adcc11e7beef7a 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm @@ -17520,6 +17520,185 @@ static id _Nullable DecodeAttributeValueForCameraAVStreamManagementCluster(Attri *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; return nil; } +static id _Nullable DecodeAttributeValueForCameraAVSettingsUserLevelManagementCluster(AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::CameraAvSettingsUserLevelManagement; + switch (aAttributeId) { + case Attributes::MPTZPosition::Id: { + using TypeInfo = Attributes::MPTZPosition::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + MTRCameraAVSettingsUserLevelManagementClusterMPTZStruct * _Nonnull value; + value = [MTRCameraAVSettingsUserLevelManagementClusterMPTZStruct new]; + if (cppValue.pan.HasValue()) { + value.pan = [NSNumber numberWithShort:cppValue.pan.Value()]; + } else { + value.pan = nil; + } + if (cppValue.tilt.HasValue()) { + value.tilt = [NSNumber numberWithShort:cppValue.tilt.Value()]; + } else { + value.tilt = nil; + } + if (cppValue.zoom.HasValue()) { + value.zoom = [NSNumber numberWithUnsignedChar:cppValue.zoom.Value()]; + } else { + value.zoom = nil; + } + return value; + } + case Attributes::MaxPresets::Id: { + using TypeInfo = Attributes::MaxPresets::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::MPTZPresets::Id: { + using TypeInfo = Attributes::MPTZPresets::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(); + MTRCameraAVSettingsUserLevelManagementClusterMPTZPresetStruct * newElement_0; + newElement_0 = [MTRCameraAVSettingsUserLevelManagementClusterMPTZPresetStruct new]; + newElement_0.presetID = [NSNumber numberWithUnsignedChar:entry_0.presetID]; + newElement_0.name = AsString(entry_0.name); + if (newElement_0.name == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + newElement_0.settings = [MTRCameraAVSettingsUserLevelManagementClusterMPTZStruct new]; + if (entry_0.settings.pan.HasValue()) { + newElement_0.settings.pan = [NSNumber numberWithShort:entry_0.settings.pan.Value()]; + } else { + newElement_0.settings.pan = nil; + } + if (entry_0.settings.tilt.HasValue()) { + newElement_0.settings.tilt = [NSNumber numberWithShort:entry_0.settings.tilt.Value()]; + } else { + newElement_0.settings.tilt = nil; + } + if (entry_0.settings.zoom.HasValue()) { + newElement_0.settings.zoom = [NSNumber numberWithUnsignedChar:entry_0.settings.zoom.Value()]; + } else { + newElement_0.settings.zoom = nil; + } + [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::DPTZRelativeMove::Id: { + using TypeInfo = Attributes::DPTZRelativeMove::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithUnsignedShort:entry_0]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; + } + return value; + } + case Attributes::ZoomMax::Id: { + using TypeInfo = Attributes::ZoomMax::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::TiltMin::Id: { + using TypeInfo = Attributes::TiltMin::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithShort:cppValue]; + return value; + } + case Attributes::TiltMax::Id: { + using TypeInfo = Attributes::TiltMax::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithShort:cppValue]; + return value; + } + case Attributes::PanMin::Id: { + using TypeInfo = Attributes::PanMin::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithShort:cppValue]; + return value; + } + case Attributes::PanMax::Id: { + using TypeInfo = Attributes::PanMax::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithShort:cppValue]; + 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; @@ -19808,6 +19987,9 @@ id _Nullable MTRDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::T case Clusters::CameraAvStreamManagement::Id: { return DecodeAttributeValueForCameraAVStreamManagementCluster(aPath.mAttributeId, aReader, aError); } + case Clusters::CameraAvSettingsUserLevelManagement::Id: { + return DecodeAttributeValueForCameraAVSettingsUserLevelManagementCluster(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 0b3222cb70dce9..887015ba107a8c 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h @@ -14449,6 +14449,162 @@ MTR_PROVISIONALLY_AVAILABLE @end +/** + * Cluster Camera AV Settings User Level Management + * + * This cluster provides an interface into controls associated with the operation of a device that provides pan, tilt, and zoom functions, either mechanically, or against a digital image. + */ +MTR_PROVISIONALLY_AVAILABLE +@interface MTRBaseClusterCameraAVSettingsUserLevelManagement : MTRGenericBaseCluster + +/** + * Command MPTZSetPosition + * + * This command SHALL set the values for the pan, tilt, and zoom in the mechanical PTZ. + */ +- (void)MPTZSetPositionWithParams:(MTRCameraAVSettingsUserLevelManagementClusterMPTZSetPositionParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)MPTZSetPositionWithCompletion:(MTRStatusCompletion)completion + MTR_PROVISIONALLY_AVAILABLE; +/** + * Command MPTZRelativeMove + * + * This command SHALL move the device by the delta values relative to the currently defined position. + */ +- (void)MPTZRelativeMoveWithParams:(MTRCameraAVSettingsUserLevelManagementClusterMPTZRelativeMoveParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)MPTZRelativeMoveWithCompletion:(MTRStatusCompletion)completion + MTR_PROVISIONALLY_AVAILABLE; +/** + * Command MPTZMoveToPreset + * + * This command SHALL move the camera to the positions specified by the Preset passed. + */ +- (void)MPTZMoveToPresetWithParams:(MTRCameraAVSettingsUserLevelManagementClusterMPTZMoveToPresetParams *)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +/** + * Command MPTZSavePreset + * + * This command allows creating a new preset or updating the values of an existing one. + */ +- (void)MPTZSavePresetWithParams:(MTRCameraAVSettingsUserLevelManagementClusterMPTZSavePresetParams *)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +/** + * Command MPTZRemovePreset + * + * This command SHALL remove a preset entry from the PresetMptzTable. + */ +- (void)MPTZRemovePresetWithParams:(MTRCameraAVSettingsUserLevelManagementClusterMPTZRemovePresetParams *)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +/** + * Command DPTZSetViewport + * + * This command allows for setting the digital viewport for a specific Video Stream. + */ +- (void)DPTZSetViewportWithParams:(MTRCameraAVSettingsUserLevelManagementClusterDPTZSetViewportParams *)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +/** + * Command DPTZRelativeMove + * + * This command SHALL change the viewports location by the amount specified in a relative fashion. + */ +- (void)DPTZRelativeMoveWithParams:(MTRCameraAVSettingsUserLevelManagementClusterDPTZRelativeMoveParams *)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeMPTZPositionWithCompletion:(void (^)(MTRCameraAVSettingsUserLevelManagementClusterMPTZStruct * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeMPTZPositionWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(MTRCameraAVSettingsUserLevelManagementClusterMPTZStruct * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeMPTZPositionWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(MTRCameraAVSettingsUserLevelManagementClusterMPTZStruct * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeMaxPresetsWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeMaxPresetsWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeMaxPresetsWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeMPTZPresetsWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeMPTZPresetsWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeMPTZPresetsWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeDPTZRelativeMoveWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeDPTZRelativeMoveWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeDPTZRelativeMoveWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeZoomMaxWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeZoomMaxWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeZoomMaxWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeTiltMinWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeTiltMinWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeTiltMinWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeTiltMaxWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeTiltMaxWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeTiltMaxWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributePanMinWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributePanMinWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributePanMinWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributePanMaxWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributePanMaxWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributePanMaxWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeGeneratedCommandListWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeAcceptedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeAcceptedCommandListWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeAttributeListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeAttributeListWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeFeatureMapWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeFeatureMapWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeClusterRevisionWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + +@interface MTRBaseClusterCameraAVSettingsUserLevelManagement (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 * @@ -20026,6 +20182,14 @@ typedef NS_OPTIONS(uint32_t, MTRCameraAVStreamManagementFeature) { MTRCameraAVStreamManagementFeatureLocalStorage MTR_PROVISIONALLY_AVAILABLE = 0x100, } MTR_PROVISIONALLY_AVAILABLE; +typedef NS_OPTIONS(uint32_t, MTRCameraAVSettingsUserLevelManagementFeature) { + MTRCameraAVSettingsUserLevelManagementFeatureDigitalPTZ MTR_PROVISIONALLY_AVAILABLE = 0x1, + MTRCameraAVSettingsUserLevelManagementFeatureMechanicalPan MTR_PROVISIONALLY_AVAILABLE = 0x2, + MTRCameraAVSettingsUserLevelManagementFeatureMechanicalTilt MTR_PROVISIONALLY_AVAILABLE = 0x4, + MTRCameraAVSettingsUserLevelManagementFeatureMechanicalZoom MTR_PROVISIONALLY_AVAILABLE = 0x8, + MTRCameraAVSettingsUserLevelManagementFeatureMechanicalPresets MTR_PROVISIONALLY_AVAILABLE = 0x10, +} MTR_PROVISIONALLY_AVAILABLE; + typedef NS_ENUM(uint8_t, MTRWebRTCTransportProviderStreamUsage) { MTRWebRTCTransportProviderStreamUsageInternal MTR_PROVISIONALLY_AVAILABLE = 0x00, MTRWebRTCTransportProviderStreamUsageRecording 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 67641bfe64d0a8..e8a309f9d15454 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm @@ -99905,6 +99905,691 @@ + (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheC @end +@implementation MTRBaseClusterCameraAVSettingsUserLevelManagement + +- (void)MPTZSetPositionWithCompletion:(MTRStatusCompletion)completion +{ + [self MPTZSetPositionWithParams:nil completion:completion]; +} +- (void)MPTZSetPositionWithParams:(MTRCameraAVSettingsUserLevelManagementClusterMPTZSetPositionParams * _Nullable)params completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRCameraAVSettingsUserLevelManagementClusterMPTZSetPositionParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = CameraAvSettingsUserLevelManagement::Commands::MPTZSetPosition::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)MPTZRelativeMoveWithCompletion:(MTRStatusCompletion)completion +{ + [self MPTZRelativeMoveWithParams:nil completion:completion]; +} +- (void)MPTZRelativeMoveWithParams:(MTRCameraAVSettingsUserLevelManagementClusterMPTZRelativeMoveParams * _Nullable)params completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRCameraAVSettingsUserLevelManagementClusterMPTZRelativeMoveParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = CameraAvSettingsUserLevelManagement::Commands::MPTZRelativeMove::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)MPTZMoveToPresetWithParams:(MTRCameraAVSettingsUserLevelManagementClusterMPTZMoveToPresetParams *)params completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRCameraAVSettingsUserLevelManagementClusterMPTZMoveToPresetParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = CameraAvSettingsUserLevelManagement::Commands::MPTZMoveToPreset::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)MPTZSavePresetWithParams:(MTRCameraAVSettingsUserLevelManagementClusterMPTZSavePresetParams *)params completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRCameraAVSettingsUserLevelManagementClusterMPTZSavePresetParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = CameraAvSettingsUserLevelManagement::Commands::MPTZSavePreset::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)MPTZRemovePresetWithParams:(MTRCameraAVSettingsUserLevelManagementClusterMPTZRemovePresetParams *)params completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRCameraAVSettingsUserLevelManagementClusterMPTZRemovePresetParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = CameraAvSettingsUserLevelManagement::Commands::MPTZRemovePreset::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)DPTZSetViewportWithParams:(MTRCameraAVSettingsUserLevelManagementClusterDPTZSetViewportParams *)params completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRCameraAVSettingsUserLevelManagementClusterDPTZSetViewportParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = CameraAvSettingsUserLevelManagement::Commands::DPTZSetViewport::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)DPTZRelativeMoveWithParams:(MTRCameraAVSettingsUserLevelManagementClusterDPTZRelativeMoveParams *)params completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRCameraAVSettingsUserLevelManagementClusterDPTZRelativeMoveParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = CameraAvSettingsUserLevelManagement::Commands::DPTZRelativeMove::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)readAttributeMPTZPositionWithCompletion:(void (^)(MTRCameraAVSettingsUserLevelManagementClusterMPTZStruct * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvSettingsUserLevelManagement::Attributes::MPTZPosition::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeMPTZPositionWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(MTRCameraAVSettingsUserLevelManagementClusterMPTZStruct * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvSettingsUserLevelManagement::Attributes::MPTZPosition::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeMPTZPositionWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(MTRCameraAVSettingsUserLevelManagementClusterMPTZStruct * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvSettingsUserLevelManagement::Attributes::MPTZPosition::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeMaxPresetsWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvSettingsUserLevelManagement::Attributes::MaxPresets::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeMaxPresetsWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvSettingsUserLevelManagement::Attributes::MaxPresets::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeMaxPresetsWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvSettingsUserLevelManagement::Attributes::MaxPresets::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeMPTZPresetsWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvSettingsUserLevelManagement::Attributes::MPTZPresets::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeMPTZPresetsWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvSettingsUserLevelManagement::Attributes::MPTZPresets::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeMPTZPresetsWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvSettingsUserLevelManagement::Attributes::MPTZPresets::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeDPTZRelativeMoveWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvSettingsUserLevelManagement::Attributes::DPTZRelativeMove::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeDPTZRelativeMoveWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvSettingsUserLevelManagement::Attributes::DPTZRelativeMove::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeDPTZRelativeMoveWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvSettingsUserLevelManagement::Attributes::DPTZRelativeMove::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeZoomMaxWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvSettingsUserLevelManagement::Attributes::ZoomMax::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeZoomMaxWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvSettingsUserLevelManagement::Attributes::ZoomMax::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeZoomMaxWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvSettingsUserLevelManagement::Attributes::ZoomMax::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeTiltMinWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvSettingsUserLevelManagement::Attributes::TiltMin::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeTiltMinWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvSettingsUserLevelManagement::Attributes::TiltMin::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeTiltMinWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvSettingsUserLevelManagement::Attributes::TiltMin::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeTiltMaxWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvSettingsUserLevelManagement::Attributes::TiltMax::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeTiltMaxWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvSettingsUserLevelManagement::Attributes::TiltMax::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeTiltMaxWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvSettingsUserLevelManagement::Attributes::TiltMax::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributePanMinWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvSettingsUserLevelManagement::Attributes::PanMin::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributePanMinWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvSettingsUserLevelManagement::Attributes::PanMin::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributePanMinWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvSettingsUserLevelManagement::Attributes::PanMin::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributePanMaxWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvSettingsUserLevelManagement::Attributes::PanMax::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributePanMaxWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvSettingsUserLevelManagement::Attributes::PanMax::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributePanMaxWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvSettingsUserLevelManagement::Attributes::PanMax::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 = CameraAvSettingsUserLevelManagement::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 = CameraAvSettingsUserLevelManagement::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 = CameraAvSettingsUserLevelManagement::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 = CameraAvSettingsUserLevelManagement::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 = CameraAvSettingsUserLevelManagement::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 = CameraAvSettingsUserLevelManagement::Attributes::AcceptedCommandList::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeAttributeListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvSettingsUserLevelManagement::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 = CameraAvSettingsUserLevelManagement::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 = CameraAvSettingsUserLevelManagement::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 = CameraAvSettingsUserLevelManagement::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 = CameraAvSettingsUserLevelManagement::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 = CameraAvSettingsUserLevelManagement::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 = CameraAvSettingsUserLevelManagement::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 = CameraAvSettingsUserLevelManagement::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 = CameraAvSettingsUserLevelManagement::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 c61f62c7f38bdb..3081901bc1d25b 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h @@ -199,6 +199,7 @@ typedef NS_ENUM(uint32_t, MTRClusterIDType) { MTRClusterIDTypeContentAppObserverID MTR_PROVISIONALLY_AVAILABLE = 0x00000510, MTRClusterIDTypeZoneManagementID MTR_PROVISIONALLY_AVAILABLE = 0x00000550, MTRClusterIDTypeCameraAVStreamManagementID MTR_PROVISIONALLY_AVAILABLE = 0x00000551, + MTRClusterIDTypeCameraAVSettingsUserLevelManagementID MTR_PROVISIONALLY_AVAILABLE = 0x00000552, MTRClusterIDTypeWebRTCTransportProviderID MTR_PROVISIONALLY_AVAILABLE = 0x00000553, MTRClusterIDTypeWebRTCTransportRequestorID MTR_PROVISIONALLY_AVAILABLE = 0x00000554, MTRClusterIDTypeChimeID MTR_PROVISIONALLY_AVAILABLE = 0x00000556, @@ -4674,6 +4675,22 @@ typedef NS_ENUM(uint32_t, MTRAttributeIDType) { MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeFeatureMapID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeFeatureMapID, MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeClusterRevisionID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeClusterRevisionID, + // Cluster CameraAVSettingsUserLevelManagement attributes + MTRAttributeIDTypeClusterCameraAVSettingsUserLevelManagementAttributeMPTZPositionID MTR_PROVISIONALLY_AVAILABLE = 0x00000000, + MTRAttributeIDTypeClusterCameraAVSettingsUserLevelManagementAttributeMaxPresetsID MTR_PROVISIONALLY_AVAILABLE = 0x00000001, + MTRAttributeIDTypeClusterCameraAVSettingsUserLevelManagementAttributeMPTZPresetsID MTR_PROVISIONALLY_AVAILABLE = 0x00000002, + MTRAttributeIDTypeClusterCameraAVSettingsUserLevelManagementAttributeDPTZRelativeMoveID MTR_PROVISIONALLY_AVAILABLE = 0x00000003, + MTRAttributeIDTypeClusterCameraAVSettingsUserLevelManagementAttributeZoomMaxID MTR_PROVISIONALLY_AVAILABLE = 0x00000004, + MTRAttributeIDTypeClusterCameraAVSettingsUserLevelManagementAttributeTiltMinID MTR_PROVISIONALLY_AVAILABLE = 0x00000005, + MTRAttributeIDTypeClusterCameraAVSettingsUserLevelManagementAttributeTiltMaxID MTR_PROVISIONALLY_AVAILABLE = 0x00000006, + MTRAttributeIDTypeClusterCameraAVSettingsUserLevelManagementAttributePanMinID MTR_PROVISIONALLY_AVAILABLE = 0x00000007, + MTRAttributeIDTypeClusterCameraAVSettingsUserLevelManagementAttributePanMaxID MTR_PROVISIONALLY_AVAILABLE = 0x00000008, + MTRAttributeIDTypeClusterCameraAVSettingsUserLevelManagementAttributeGeneratedCommandListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeGeneratedCommandListID, + MTRAttributeIDTypeClusterCameraAVSettingsUserLevelManagementAttributeAcceptedCommandListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeAcceptedCommandListID, + MTRAttributeIDTypeClusterCameraAVSettingsUserLevelManagementAttributeAttributeListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeAttributeListID, + MTRAttributeIDTypeClusterCameraAVSettingsUserLevelManagementAttributeFeatureMapID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeFeatureMapID, + MTRAttributeIDTypeClusterCameraAVSettingsUserLevelManagementAttributeClusterRevisionID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeClusterRevisionID, + // Cluster WebRTCTransportProvider attributes MTRAttributeIDTypeClusterWebRTCTransportProviderAttributeCurrentSessionsID MTR_PROVISIONALLY_AVAILABLE = 0x00000000, MTRAttributeIDTypeClusterWebRTCTransportProviderAttributeGeneratedCommandListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeGeneratedCommandListID, @@ -6910,6 +6927,15 @@ typedef NS_ENUM(uint32_t, MTRCommandIDType) { MTRCommandIDTypeClusterCameraAVStreamManagementCommandCaptureSnapshotID MTR_PROVISIONALLY_AVAILABLE = 0x0000000B, MTRCommandIDTypeClusterCameraAVStreamManagementCommandCaptureSnapshotResponseID MTR_PROVISIONALLY_AVAILABLE = 0x0000000C, + // Cluster CameraAVSettingsUserLevelManagement commands + MTRCommandIDTypeClusterCameraAVSettingsUserLevelManagementCommandMPTZSetPositionID MTR_PROVISIONALLY_AVAILABLE = 0x00000000, + MTRCommandIDTypeClusterCameraAVSettingsUserLevelManagementCommandMPTZRelativeMoveID MTR_PROVISIONALLY_AVAILABLE = 0x00000001, + MTRCommandIDTypeClusterCameraAVSettingsUserLevelManagementCommandMPTZMoveToPresetID MTR_PROVISIONALLY_AVAILABLE = 0x00000002, + MTRCommandIDTypeClusterCameraAVSettingsUserLevelManagementCommandMPTZSavePresetID MTR_PROVISIONALLY_AVAILABLE = 0x00000003, + MTRCommandIDTypeClusterCameraAVSettingsUserLevelManagementCommandMPTZRemovePresetID MTR_PROVISIONALLY_AVAILABLE = 0x00000004, + MTRCommandIDTypeClusterCameraAVSettingsUserLevelManagementCommandDPTZSetViewportID MTR_PROVISIONALLY_AVAILABLE = 0x00000005, + MTRCommandIDTypeClusterCameraAVSettingsUserLevelManagementCommandDPTZRelativeMoveID MTR_PROVISIONALLY_AVAILABLE = 0x00000006, + // Cluster WebRTCTransportProvider commands MTRCommandIDTypeClusterWebRTCTransportProviderCommandSolicitOfferID MTR_PROVISIONALLY_AVAILABLE = 0x00000001, MTRCommandIDTypeClusterWebRTCTransportProviderCommandSolicitOfferResponseID MTR_PROVISIONALLY_AVAILABLE = 0x00000002, diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm b/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm index 9f8206f2e04d8f..33c0e2d31eb079 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm @@ -375,6 +375,9 @@ case MTRClusterIDTypeCameraAVStreamManagementID: result = @"CameraAVStreamManagement"; break; + case MTRClusterIDTypeCameraAVSettingsUserLevelManagementID: + result = @"CameraAVSettingsUserLevelManagement"; + break; case MTRClusterIDTypeWebRTCTransportProviderID: result = @"WebRTCTransportProvider"; break; @@ -7885,6 +7888,73 @@ } break; + case MTRClusterIDTypeCameraAVSettingsUserLevelManagementID: + + switch (attributeID) { + + // Cluster CameraAVSettingsUserLevelManagement attributes + case MTRAttributeIDTypeClusterCameraAVSettingsUserLevelManagementAttributeMPTZPositionID: + result = @"MPTZPosition"; + break; + + case MTRAttributeIDTypeClusterCameraAVSettingsUserLevelManagementAttributeMaxPresetsID: + result = @"MaxPresets"; + break; + + case MTRAttributeIDTypeClusterCameraAVSettingsUserLevelManagementAttributeMPTZPresetsID: + result = @"MPTZPresets"; + break; + + case MTRAttributeIDTypeClusterCameraAVSettingsUserLevelManagementAttributeDPTZRelativeMoveID: + result = @"DPTZRelativeMove"; + break; + + case MTRAttributeIDTypeClusterCameraAVSettingsUserLevelManagementAttributeZoomMaxID: + result = @"ZoomMax"; + break; + + case MTRAttributeIDTypeClusterCameraAVSettingsUserLevelManagementAttributeTiltMinID: + result = @"TiltMin"; + break; + + case MTRAttributeIDTypeClusterCameraAVSettingsUserLevelManagementAttributeTiltMaxID: + result = @"TiltMax"; + break; + + case MTRAttributeIDTypeClusterCameraAVSettingsUserLevelManagementAttributePanMinID: + result = @"PanMin"; + break; + + case MTRAttributeIDTypeClusterCameraAVSettingsUserLevelManagementAttributePanMaxID: + result = @"PanMax"; + break; + + case MTRAttributeIDTypeClusterCameraAVSettingsUserLevelManagementAttributeGeneratedCommandListID: + result = @"GeneratedCommandList"; + break; + + case MTRAttributeIDTypeClusterCameraAVSettingsUserLevelManagementAttributeAcceptedCommandListID: + result = @"AcceptedCommandList"; + break; + + case MTRAttributeIDTypeClusterCameraAVSettingsUserLevelManagementAttributeAttributeListID: + result = @"AttributeList"; + break; + + case MTRAttributeIDTypeClusterCameraAVSettingsUserLevelManagementAttributeFeatureMapID: + result = @"FeatureMap"; + break; + + case MTRAttributeIDTypeClusterCameraAVSettingsUserLevelManagementAttributeClusterRevisionID: + result = @"ClusterRevision"; + break; + + default: + result = [NSString stringWithFormat:@"", attributeID]; + break; + } + break; + case MTRClusterIDTypeWebRTCTransportProviderID: switch (attributeID) { @@ -10774,6 +10844,44 @@ } break; + case MTRClusterIDTypeCameraAVSettingsUserLevelManagementID: + + switch (commandID) { + + case MTRCommandIDTypeClusterCameraAVSettingsUserLevelManagementCommandMPTZSetPositionID: + result = @"MPTZSetPosition"; + break; + + case MTRCommandIDTypeClusterCameraAVSettingsUserLevelManagementCommandMPTZRelativeMoveID: + result = @"MPTZRelativeMove"; + break; + + case MTRCommandIDTypeClusterCameraAVSettingsUserLevelManagementCommandMPTZMoveToPresetID: + result = @"MPTZMoveToPreset"; + break; + + case MTRCommandIDTypeClusterCameraAVSettingsUserLevelManagementCommandMPTZSavePresetID: + result = @"MPTZSavePreset"; + break; + + case MTRCommandIDTypeClusterCameraAVSettingsUserLevelManagementCommandMPTZRemovePresetID: + result = @"MPTZRemovePreset"; + break; + + case MTRCommandIDTypeClusterCameraAVSettingsUserLevelManagementCommandDPTZSetViewportID: + result = @"DPTZSetViewport"; + break; + + case MTRCommandIDTypeClusterCameraAVSettingsUserLevelManagementCommandDPTZRelativeMoveID: + result = @"DPTZRelativeMove"; + break; + + default: + result = [NSString stringWithFormat:@"", commandID]; + break; + } + break; + case MTRClusterIDTypeWebRTCTransportProviderID: switch (commandID) { @@ -12486,6 +12594,16 @@ } break; + case MTRClusterIDTypeCameraAVSettingsUserLevelManagementID: + + switch (commandID) { + + default: + result = [NSString stringWithFormat:@"", commandID]; + break; + } + break; + case MTRClusterIDTypeWebRTCTransportProviderID: switch (commandID) { @@ -14317,6 +14435,16 @@ } break; + case MTRClusterIDTypeCameraAVSettingsUserLevelManagementID: + + switch (eventID) { + + 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 7ed71648699866..56423696e3dfeb 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h @@ -6751,6 +6751,70 @@ MTR_PROVISIONALLY_AVAILABLE @end +/** + * Cluster Camera AV Settings User Level Management + * This cluster provides an interface into controls associated with the operation of a device that provides pan, tilt, and zoom functions, either mechanically, or against a digital image. + */ +MTR_PROVISIONALLY_AVAILABLE +@interface MTRClusterCameraAVSettingsUserLevelManagement : MTRGenericCluster + +- (void)MPTZSetPositionWithParams:(MTRCameraAVSettingsUserLevelManagementClusterMPTZSetPositionParams * _Nullable)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)MPTZSetPositionWithExpectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion + MTR_PROVISIONALLY_AVAILABLE; +- (void)MPTZRelativeMoveWithParams:(MTRCameraAVSettingsUserLevelManagementClusterMPTZRelativeMoveParams * _Nullable)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)MPTZRelativeMoveWithExpectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion + MTR_PROVISIONALLY_AVAILABLE; +- (void)MPTZMoveToPresetWithParams:(MTRCameraAVSettingsUserLevelManagementClusterMPTZMoveToPresetParams *)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)MPTZSavePresetWithParams:(MTRCameraAVSettingsUserLevelManagementClusterMPTZSavePresetParams *)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)MPTZRemovePresetWithParams:(MTRCameraAVSettingsUserLevelManagementClusterMPTZRemovePresetParams *)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)DPTZSetViewportWithParams:(MTRCameraAVSettingsUserLevelManagementClusterDPTZSetViewportParams *)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)DPTZRelativeMoveWithParams:(MTRCameraAVSettingsUserLevelManagementClusterDPTZRelativeMoveParams *)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeMPTZPositionWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeMaxPresetsWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeMPTZPresetsWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeDPTZRelativeMoveWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeZoomMaxWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeTiltMinWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeTiltMaxWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributePanMinWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributePanMaxWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + +@interface MTRClusterCameraAVSettingsUserLevelManagement (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 f5e926500a54d0..908d6b385fd4bf 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm @@ -19556,6 +19556,277 @@ - (void)writeAttributeStatusLightBrightnessWithValue:(NSDictionary *> *)expectedValues expectedValueInterval:(NSNumber *)expectedValueIntervalMs completion:(MTRStatusCompletion)completion +{ + [self MPTZSetPositionWithParams:nil expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs completion:completion]; +} +- (void)MPTZSetPositionWithParams:(MTRCameraAVSettingsUserLevelManagementClusterMPTZSetPositionParams * _Nullable)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRCameraAVSettingsUserLevelManagementClusterMPTZSetPositionParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = CameraAvSettingsUserLevelManagement::Commands::MPTZSetPosition::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)MPTZRelativeMoveWithExpectedValues:(NSArray *> *)expectedValues expectedValueInterval:(NSNumber *)expectedValueIntervalMs completion:(MTRStatusCompletion)completion +{ + [self MPTZRelativeMoveWithParams:nil expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs completion:completion]; +} +- (void)MPTZRelativeMoveWithParams:(MTRCameraAVSettingsUserLevelManagementClusterMPTZRelativeMoveParams * _Nullable)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRCameraAVSettingsUserLevelManagementClusterMPTZRelativeMoveParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = CameraAvSettingsUserLevelManagement::Commands::MPTZRelativeMove::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)MPTZMoveToPresetWithParams:(MTRCameraAVSettingsUserLevelManagementClusterMPTZMoveToPresetParams *)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRCameraAVSettingsUserLevelManagementClusterMPTZMoveToPresetParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = CameraAvSettingsUserLevelManagement::Commands::MPTZMoveToPreset::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)MPTZSavePresetWithParams:(MTRCameraAVSettingsUserLevelManagementClusterMPTZSavePresetParams *)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRCameraAVSettingsUserLevelManagementClusterMPTZSavePresetParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = CameraAvSettingsUserLevelManagement::Commands::MPTZSavePreset::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)MPTZRemovePresetWithParams:(MTRCameraAVSettingsUserLevelManagementClusterMPTZRemovePresetParams *)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRCameraAVSettingsUserLevelManagementClusterMPTZRemovePresetParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = CameraAvSettingsUserLevelManagement::Commands::MPTZRemovePreset::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)DPTZSetViewportWithParams:(MTRCameraAVSettingsUserLevelManagementClusterDPTZSetViewportParams *)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRCameraAVSettingsUserLevelManagementClusterDPTZSetViewportParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = CameraAvSettingsUserLevelManagement::Commands::DPTZSetViewport::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)DPTZRelativeMoveWithParams:(MTRCameraAVSettingsUserLevelManagementClusterDPTZRelativeMoveParams *)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRCameraAVSettingsUserLevelManagementClusterDPTZRelativeMoveParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = CameraAvSettingsUserLevelManagement::Commands::DPTZRelativeMove::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)readAttributeMPTZPositionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVSettingsUserLevelManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVSettingsUserLevelManagementAttributeMPTZPositionID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeMaxPresetsWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVSettingsUserLevelManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVSettingsUserLevelManagementAttributeMaxPresetsID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeMPTZPresetsWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVSettingsUserLevelManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVSettingsUserLevelManagementAttributeMPTZPresetsID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeDPTZRelativeMoveWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVSettingsUserLevelManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVSettingsUserLevelManagementAttributeDPTZRelativeMoveID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeZoomMaxWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVSettingsUserLevelManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVSettingsUserLevelManagementAttributeZoomMaxID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeTiltMinWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVSettingsUserLevelManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVSettingsUserLevelManagementAttributeTiltMinID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeTiltMaxWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVSettingsUserLevelManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVSettingsUserLevelManagementAttributeTiltMaxID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributePanMinWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVSettingsUserLevelManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVSettingsUserLevelManagementAttributePanMinID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributePanMaxWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVSettingsUserLevelManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVSettingsUserLevelManagementAttributePanMaxID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVSettingsUserLevelManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVSettingsUserLevelManagementAttributeGeneratedCommandListID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVSettingsUserLevelManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVSettingsUserLevelManagementAttributeAcceptedCommandListID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVSettingsUserLevelManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVSettingsUserLevelManagementAttributeAttributeListID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVSettingsUserLevelManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVSettingsUserLevelManagementAttributeFeatureMapID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVSettingsUserLevelManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVSettingsUserLevelManagementAttributeClusterRevisionID) 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 3a85b9e455f115..2677a33dedbcd7 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h @@ -11337,6 +11337,234 @@ MTR_PROVISIONALLY_AVAILABLE error:(NSError * __autoreleasing *)error MTR_PROVISIONALLY_AVAILABLE; @end +MTR_PROVISIONALLY_AVAILABLE +@interface MTRCameraAVSettingsUserLevelManagementClusterMPTZSetPositionParams : NSObject + +@property (nonatomic, copy) NSNumber * _Nullable pan MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) NSNumber * _Nullable tilt MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) NSNumber * _Nullable zoom 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 MTRCameraAVSettingsUserLevelManagementClusterMPTZRelativeMoveParams : NSObject + +@property (nonatomic, copy) NSNumber * _Nullable panDelta MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) NSNumber * _Nullable tiltDelta MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) NSNumber * _Nullable zoomDelta 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 MTRCameraAVSettingsUserLevelManagementClusterMPTZMoveToPresetParams : NSObject + +@property (nonatomic, copy) NSNumber * _Nonnull presetID 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 MTRCameraAVSettingsUserLevelManagementClusterMPTZSavePresetParams : NSObject + +@property (nonatomic, copy) NSNumber * _Nullable presetID MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) NSString * _Nonnull name 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 MTRCameraAVSettingsUserLevelManagementClusterMPTZRemovePresetParams : NSObject + +@property (nonatomic, copy) NSNumber * _Nonnull presetID 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 MTRCameraAVSettingsUserLevelManagementClusterDPTZSetViewportParams : NSObject + +@property (nonatomic, copy) NSNumber * _Nonnull videoStreamID MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) MTRCameraAVSettingsUserLevelManagementClusterViewportStruct * _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 MTRCameraAVSettingsUserLevelManagementClusterDPTZRelativeMoveParams : NSObject + +@property (nonatomic, copy) NSNumber * _Nonnull videoStreamID MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) NSNumber * _Nullable deltaX MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) NSNumber * _Nullable deltaY MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) NSNumber * _Nullable zoomDelta 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 e6146942f58257..b56e51e21d1b06 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm @@ -33035,6 +33035,646 @@ - (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::CameraAv @end +@implementation MTRCameraAVSettingsUserLevelManagementClusterMPTZSetPositionParams +- (instancetype)init +{ + if (self = [super init]) { + + _pan = nil; + + _tilt = nil; + + _zoom = nil; + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRCameraAVSettingsUserLevelManagementClusterMPTZSetPositionParams alloc] init]; + + other.pan = self.pan; + other.tilt = self.tilt; + other.zoom = self.zoom; + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: pan:%@; tilt:%@; zoom:%@; >", NSStringFromClass([self class]), _pan, _tilt, _zoom]; + return descriptionString; +} + +@end + +@implementation MTRCameraAVSettingsUserLevelManagementClusterMPTZSetPositionParams (InternalMethods) + +- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader +{ + chip::app::Clusters::CameraAvSettingsUserLevelManagement::Commands::MPTZSetPosition::Type encodableStruct; + ListFreer listFreer; + { + if (self.pan != nil) { + auto & definedValue_0 = encodableStruct.pan.Emplace(); + definedValue_0 = self.pan.shortValue; + } + } + { + if (self.tilt != nil) { + auto & definedValue_0 = encodableStruct.tilt.Emplace(); + definedValue_0 = self.tilt.shortValue; + } + } + { + if (self.zoom != nil) { + auto & definedValue_0 = encodableStruct.zoom.Emplace(); + definedValue_0 = self.zoom.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 MTRCameraAVSettingsUserLevelManagementClusterMPTZRelativeMoveParams +- (instancetype)init +{ + if (self = [super init]) { + + _panDelta = nil; + + _tiltDelta = nil; + + _zoomDelta = nil; + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRCameraAVSettingsUserLevelManagementClusterMPTZRelativeMoveParams alloc] init]; + + other.panDelta = self.panDelta; + other.tiltDelta = self.tiltDelta; + other.zoomDelta = self.zoomDelta; + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: panDelta:%@; tiltDelta:%@; zoomDelta:%@; >", NSStringFromClass([self class]), _panDelta, _tiltDelta, _zoomDelta]; + return descriptionString; +} + +@end + +@implementation MTRCameraAVSettingsUserLevelManagementClusterMPTZRelativeMoveParams (InternalMethods) + +- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader +{ + chip::app::Clusters::CameraAvSettingsUserLevelManagement::Commands::MPTZRelativeMove::Type encodableStruct; + ListFreer listFreer; + { + if (self.panDelta != nil) { + auto & definedValue_0 = encodableStruct.panDelta.Emplace(); + definedValue_0 = self.panDelta.shortValue; + } + } + { + if (self.tiltDelta != nil) { + auto & definedValue_0 = encodableStruct.tiltDelta.Emplace(); + definedValue_0 = self.tiltDelta.shortValue; + } + } + { + if (self.zoomDelta != nil) { + auto & definedValue_0 = encodableStruct.zoomDelta.Emplace(); + definedValue_0 = self.zoomDelta.charValue; + } + } + + 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 MTRCameraAVSettingsUserLevelManagementClusterMPTZMoveToPresetParams +- (instancetype)init +{ + if (self = [super init]) { + + _presetID = @(0); + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRCameraAVSettingsUserLevelManagementClusterMPTZMoveToPresetParams alloc] init]; + + other.presetID = self.presetID; + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: presetID:%@; >", NSStringFromClass([self class]), _presetID]; + return descriptionString; +} + +@end + +@implementation MTRCameraAVSettingsUserLevelManagementClusterMPTZMoveToPresetParams (InternalMethods) + +- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader +{ + chip::app::Clusters::CameraAvSettingsUserLevelManagement::Commands::MPTZMoveToPreset::Type encodableStruct; + ListFreer listFreer; + { + encodableStruct.presetID = self.presetID.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 MTRCameraAVSettingsUserLevelManagementClusterMPTZSavePresetParams +- (instancetype)init +{ + if (self = [super init]) { + + _presetID = nil; + + _name = @""; + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRCameraAVSettingsUserLevelManagementClusterMPTZSavePresetParams alloc] init]; + + other.presetID = self.presetID; + other.name = self.name; + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: presetID:%@; name:%@; >", NSStringFromClass([self class]), _presetID, _name]; + return descriptionString; +} + +@end + +@implementation MTRCameraAVSettingsUserLevelManagementClusterMPTZSavePresetParams (InternalMethods) + +- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader +{ + chip::app::Clusters::CameraAvSettingsUserLevelManagement::Commands::MPTZSavePreset::Type encodableStruct; + ListFreer listFreer; + { + if (self.presetID != nil) { + auto & definedValue_0 = encodableStruct.presetID.Emplace(); + definedValue_0 = self.presetID.unsignedCharValue; + } + } + { + encodableStruct.name = AsCharSpan(self.name); + } + + 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 MTRCameraAVSettingsUserLevelManagementClusterMPTZRemovePresetParams +- (instancetype)init +{ + if (self = [super init]) { + + _presetID = @(0); + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRCameraAVSettingsUserLevelManagementClusterMPTZRemovePresetParams alloc] init]; + + other.presetID = self.presetID; + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: presetID:%@; >", NSStringFromClass([self class]), _presetID]; + return descriptionString; +} + +@end + +@implementation MTRCameraAVSettingsUserLevelManagementClusterMPTZRemovePresetParams (InternalMethods) + +- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader +{ + chip::app::Clusters::CameraAvSettingsUserLevelManagement::Commands::MPTZRemovePreset::Type encodableStruct; + ListFreer listFreer; + { + encodableStruct.presetID = self.presetID.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 MTRCameraAVSettingsUserLevelManagementClusterDPTZSetViewportParams +- (instancetype)init +{ + if (self = [super init]) { + + _videoStreamID = @(0); + + _viewport = [MTRCameraAVSettingsUserLevelManagementClusterViewportStruct new]; + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRCameraAVSettingsUserLevelManagementClusterDPTZSetViewportParams alloc] init]; + + other.videoStreamID = self.videoStreamID; + other.viewport = self.viewport; + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: videoStreamID:%@; viewport:%@; >", NSStringFromClass([self class]), _videoStreamID, _viewport]; + return descriptionString; +} + +@end + +@implementation MTRCameraAVSettingsUserLevelManagementClusterDPTZSetViewportParams (InternalMethods) + +- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader +{ + chip::app::Clusters::CameraAvSettingsUserLevelManagement::Commands::DPTZSetViewport::Type encodableStruct; + ListFreer listFreer; + { + encodableStruct.videoStreamID = self.videoStreamID.unsignedShortValue; + } + { + 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 MTRCameraAVSettingsUserLevelManagementClusterDPTZRelativeMoveParams +- (instancetype)init +{ + if (self = [super init]) { + + _videoStreamID = @(0); + + _deltaX = nil; + + _deltaY = nil; + + _zoomDelta = nil; + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRCameraAVSettingsUserLevelManagementClusterDPTZRelativeMoveParams alloc] init]; + + other.videoStreamID = self.videoStreamID; + other.deltaX = self.deltaX; + other.deltaY = self.deltaY; + other.zoomDelta = self.zoomDelta; + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: videoStreamID:%@; deltaX:%@; deltaY:%@; zoomDelta:%@; >", NSStringFromClass([self class]), _videoStreamID, _deltaX, _deltaY, _zoomDelta]; + return descriptionString; +} + +@end + +@implementation MTRCameraAVSettingsUserLevelManagementClusterDPTZRelativeMoveParams (InternalMethods) + +- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader +{ + chip::app::Clusters::CameraAvSettingsUserLevelManagement::Commands::DPTZRelativeMove::Type encodableStruct; + ListFreer listFreer; + { + encodableStruct.videoStreamID = self.videoStreamID.unsignedShortValue; + } + { + if (self.deltaX != nil) { + auto & definedValue_0 = encodableStruct.deltaX.Emplace(); + definedValue_0 = self.deltaX.shortValue; + } + } + { + if (self.deltaY != nil) { + auto & definedValue_0 = encodableStruct.deltaY.Emplace(); + definedValue_0 = self.deltaY.shortValue; + } + } + { + if (self.zoomDelta != nil) { + auto & definedValue_0 = encodableStruct.zoomDelta.Emplace(); + definedValue_0 = self.zoomDelta.charValue; + } + } + + 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 a1fd2d1dc80a2e..5ebfd4fc86cd5b 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h @@ -2134,6 +2134,48 @@ NS_ASSUME_NONNULL_BEGIN @end +@interface MTRCameraAVSettingsUserLevelManagementClusterMPTZSetPositionParams (InternalMethods) + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; + +@end + +@interface MTRCameraAVSettingsUserLevelManagementClusterMPTZRelativeMoveParams (InternalMethods) + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; + +@end + +@interface MTRCameraAVSettingsUserLevelManagementClusterMPTZMoveToPresetParams (InternalMethods) + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; + +@end + +@interface MTRCameraAVSettingsUserLevelManagementClusterMPTZSavePresetParams (InternalMethods) + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; + +@end + +@interface MTRCameraAVSettingsUserLevelManagementClusterMPTZRemovePresetParams (InternalMethods) + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; + +@end + +@interface MTRCameraAVSettingsUserLevelManagementClusterDPTZSetViewportParams (InternalMethods) + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; + +@end + +@interface MTRCameraAVSettingsUserLevelManagementClusterDPTZRelativeMoveParams (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 f45fd6f3ccdccb..08eaa8c4de9058 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandTimedCheck.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandTimedCheck.mm @@ -1142,6 +1142,15 @@ static BOOL CommandNeedsTimedInvokeInCameraAVStreamManagementCluster(AttributeId } } } +static BOOL CommandNeedsTimedInvokeInCameraAVSettingsUserLevelManagementCluster(AttributeId aAttributeId) +{ + using namespace Clusters::CameraAvSettingsUserLevelManagement; + switch (aAttributeId) { + default: { + return NO; + } + } +} static BOOL CommandNeedsTimedInvokeInWebRTCTransportProviderCluster(AttributeId aAttributeId) { using namespace Clusters::WebRTCTransportProvider; @@ -1563,6 +1572,9 @@ BOOL MTRCommandNeedsTimedInvoke(NSNumber * _Nonnull aClusterID, NSNumber * _Nonn case Clusters::CameraAvStreamManagement::Id: { return CommandNeedsTimedInvokeInCameraAVStreamManagementCluster(commandID); } + case Clusters::CameraAvSettingsUserLevelManagement::Id: { + return CommandNeedsTimedInvokeInCameraAVSettingsUserLevelManagementCluster(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 797ffcbe7a1b1d..ce51877b7b99bd 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm @@ -4898,6 +4898,18 @@ static id _Nullable DecodeEventPayloadForCameraAVStreamManagementCluster(EventId *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; return nil; } +static id _Nullable DecodeEventPayloadForCameraAVSettingsUserLevelManagementCluster(EventId aEventId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::CameraAvSettingsUserLevelManagement; + switch (aEventId) { + 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; @@ -5530,6 +5542,9 @@ id _Nullable MTRDecodeEventPayload(const ConcreteEventPath & aPath, TLV::TLVRead case Clusters::CameraAvStreamManagement::Id: { return DecodeEventPayloadForCameraAVStreamManagementCluster(aPath.mEventId, aReader, aError); } + case Clusters::CameraAvSettingsUserLevelManagement::Id: { + return DecodeEventPayloadForCameraAVSettingsUserLevelManagementCluster(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 c2bb0804fb7237..412864bc77ea89 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h @@ -2283,6 +2283,28 @@ MTR_PROVISIONALLY_AVAILABLE @property (nonatomic, copy) NSNumber * _Nullable quality MTR_PROVISIONALLY_AVAILABLE; @end +MTR_PROVISIONALLY_AVAILABLE +@interface MTRCameraAVSettingsUserLevelManagementClusterMPTZStruct : NSObject +@property (nonatomic, copy) NSNumber * _Nullable pan MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable tilt MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable zoom MTR_PROVISIONALLY_AVAILABLE; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRCameraAVSettingsUserLevelManagementClusterMPTZPresetStruct : NSObject +@property (nonatomic, copy) NSNumber * _Nonnull presetID MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSString * _Nonnull name MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) MTRCameraAVSettingsUserLevelManagementClusterMPTZStruct * _Nonnull settings MTR_PROVISIONALLY_AVAILABLE; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRCameraAVSettingsUserLevelManagementClusterViewportStruct : 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 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 fb99592f46b3c5..903a3077814cdc 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm @@ -9482,6 +9482,108 @@ - (NSString *)description @end +@implementation MTRCameraAVSettingsUserLevelManagementClusterMPTZStruct +- (instancetype)init +{ + if (self = [super init]) { + + _pan = nil; + + _tilt = nil; + + _zoom = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRCameraAVSettingsUserLevelManagementClusterMPTZStruct alloc] init]; + + other.pan = self.pan; + other.tilt = self.tilt; + other.zoom = self.zoom; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: pan:%@; tilt:%@; zoom:%@; >", NSStringFromClass([self class]), _pan, _tilt, _zoom]; + return descriptionString; +} + +@end + +@implementation MTRCameraAVSettingsUserLevelManagementClusterMPTZPresetStruct +- (instancetype)init +{ + if (self = [super init]) { + + _presetID = @(0); + + _name = @""; + + _settings = [MTRCameraAVSettingsUserLevelManagementClusterMPTZStruct new]; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRCameraAVSettingsUserLevelManagementClusterMPTZPresetStruct alloc] init]; + + other.presetID = self.presetID; + other.name = self.name; + other.settings = self.settings; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: presetID:%@; name:%@; settings:%@; >", NSStringFromClass([self class]), _presetID, _name, _settings]; + return descriptionString; +} + +@end + +@implementation MTRCameraAVSettingsUserLevelManagementClusterViewportStruct +- (instancetype)init +{ + if (self = [super init]) { + + _x1 = @(0); + + _y1 = @(0); + + _x2 = @(0); + + _y2 = @(0); + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRCameraAVSettingsUserLevelManagementClusterViewportStruct 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 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 10f67cad3ffd77..acb1d4e6381227 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 @@ -38196,6 +38196,396 @@ Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) } // namespace Attributes } // namespace CameraAvStreamManagement +namespace CameraAvSettingsUserLevelManagement { +namespace Attributes { + +namespace MaxPresets { + +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::CameraAvSettingsUserLevelManagement::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::CameraAvSettingsUserLevelManagement::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::CameraAvSettingsUserLevelManagement::Id, Id, writable, + ZCL_INT8U_ATTRIBUTE_TYPE); +} + +} // namespace MaxPresets + +namespace ZoomMax { + +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::CameraAvSettingsUserLevelManagement::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::CameraAvSettingsUserLevelManagement::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::CameraAvSettingsUserLevelManagement::Id, Id, writable, + ZCL_INT8U_ATTRIBUTE_TYPE); +} + +} // namespace ZoomMax + +namespace TiltMin { + +Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = + emberAfReadAttribute(endpoint, Clusters::CameraAvSettingsUserLevelManagement::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, int16_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::CameraAvSettingsUserLevelManagement::Id, Id), + EmberAfWriteDataInput(writable, ZCL_INT16S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_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::CameraAvSettingsUserLevelManagement::Id, Id, writable, + ZCL_INT16S_ATTRIBUTE_TYPE); +} + +} // namespace TiltMin + +namespace TiltMax { + +Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = + emberAfReadAttribute(endpoint, Clusters::CameraAvSettingsUserLevelManagement::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, int16_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::CameraAvSettingsUserLevelManagement::Id, Id), + EmberAfWriteDataInput(writable, ZCL_INT16S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_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::CameraAvSettingsUserLevelManagement::Id, Id, writable, + ZCL_INT16S_ATTRIBUTE_TYPE); +} + +} // namespace TiltMax + +namespace PanMin { + +Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = + emberAfReadAttribute(endpoint, Clusters::CameraAvSettingsUserLevelManagement::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, int16_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::CameraAvSettingsUserLevelManagement::Id, Id), + EmberAfWriteDataInput(writable, ZCL_INT16S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_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::CameraAvSettingsUserLevelManagement::Id, Id, writable, + ZCL_INT16S_ATTRIBUTE_TYPE); +} + +} // namespace PanMin + +namespace PanMax { + +Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = + emberAfReadAttribute(endpoint, Clusters::CameraAvSettingsUserLevelManagement::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, int16_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::CameraAvSettingsUserLevelManagement::Id, Id), + EmberAfWriteDataInput(writable, ZCL_INT16S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_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::CameraAvSettingsUserLevelManagement::Id, Id, writable, + ZCL_INT16S_ATTRIBUTE_TYPE); +} + +} // namespace PanMax + +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::CameraAvSettingsUserLevelManagement::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::CameraAvSettingsUserLevelManagement::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::CameraAvSettingsUserLevelManagement::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::CameraAvSettingsUserLevelManagement::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::CameraAvSettingsUserLevelManagement::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::CameraAvSettingsUserLevelManagement::Id, Id, writable, + ZCL_INT16U_ATTRIBUTE_TYPE); +} + +} // namespace ClusterRevision + +} // namespace Attributes +} // namespace CameraAvSettingsUserLevelManagement + 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 d77633d6d72bbc..861229005612ea 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 @@ -5778,6 +5778,60 @@ Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, Mar } // namespace Attributes } // namespace CameraAvStreamManagement +namespace CameraAvSettingsUserLevelManagement { +namespace Attributes { + +namespace MaxPresets { +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 MaxPresets + +namespace ZoomMax { +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 ZoomMax + +namespace TiltMin { +Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value); // int16s +Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value); +Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty); +} // namespace TiltMin + +namespace TiltMax { +Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value); // int16s +Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value); +Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty); +} // namespace TiltMax + +namespace PanMin { +Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value); // int16s +Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value); +Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty); +} // namespace PanMin + +namespace PanMax { +Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value); // int16s +Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value); +Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty); +} // namespace PanMax + +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 CameraAvSettingsUserLevelManagement + 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 7e0673285b52bf..35c7efe18b98cf 100644 --- a/zzz_generated/app-common/app-common/zap-generated/callback.h +++ b/zzz_generated/app-common/app-common/zap-generated/callback.h @@ -628,6 +628,11 @@ void emberAfZoneManagementClusterInitCallback(chip::EndpointId endpoint); */ void emberAfCameraAvStreamManagementClusterInitCallback(chip::EndpointId endpoint); +/** + * @param endpoint Endpoint that is being initialized + */ +void emberAfCameraAvSettingsUserLevelManagementClusterInitCallback(chip::EndpointId endpoint); + /** * @param endpoint Endpoint that is being initialized */ @@ -5269,6 +5274,45 @@ chip::Protocols::InteractionModel::Status MatterCameraAvStreamManagementClusterS */ void emberAfCameraAvStreamManagementClusterServerTickCallback(chip::EndpointId endpoint); +// +// Camera AV Settings User Level Management Cluster +// + +/** + * @param endpoint Endpoint that is being initialized + */ +void emberAfCameraAvSettingsUserLevelManagementClusterServerInitCallback(chip::EndpointId endpoint); + +/** + * @param endpoint Endpoint that is being shutdown + */ +void MatterCameraAvSettingsUserLevelManagementClusterServerShutdownCallback(chip::EndpointId endpoint); + +/** + * @param endpoint Endpoint that is being initialized + */ +void emberAfCameraAvSettingsUserLevelManagementClusterClientInitCallback(chip::EndpointId endpoint); + +/** + * @param attributePath Concrete attribute path that changed + */ +void MatterCameraAvSettingsUserLevelManagementClusterServerAttributeChangedCallback( + 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 MatterCameraAvSettingsUserLevelManagementClusterServerPreAttributeChangedCallback( + const chip::app::ConcreteAttributePath & attributePath, EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); + +/** + * @param endpoint Endpoint that is being served + */ +void emberAfCameraAvSettingsUserLevelManagementClusterServerTickCallback(chip::EndpointId endpoint); + // // WebRTC Transport Provider Cluster // @@ -6822,6 +6866,48 @@ bool emberAfCameraAvStreamManagementClusterSetStreamPrioritiesCallback( bool emberAfCameraAvStreamManagementClusterCaptureSnapshotCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, const chip::app::Clusters::CameraAvStreamManagement::Commands::CaptureSnapshot::DecodableType & commandData); +/** + * @brief Camera AV Settings User Level Management Cluster MPTZSetPosition Command callback (from client) + */ +bool emberAfCameraAvSettingsUserLevelManagementClusterMPTZSetPositionCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::CameraAvSettingsUserLevelManagement::Commands::MPTZSetPosition::DecodableType & commandData); +/** + * @brief Camera AV Settings User Level Management Cluster MPTZRelativeMove Command callback (from client) + */ +bool emberAfCameraAvSettingsUserLevelManagementClusterMPTZRelativeMoveCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::CameraAvSettingsUserLevelManagement::Commands::MPTZRelativeMove::DecodableType & commandData); +/** + * @brief Camera AV Settings User Level Management Cluster MPTZMoveToPreset Command callback (from client) + */ +bool emberAfCameraAvSettingsUserLevelManagementClusterMPTZMoveToPresetCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::CameraAvSettingsUserLevelManagement::Commands::MPTZMoveToPreset::DecodableType & commandData); +/** + * @brief Camera AV Settings User Level Management Cluster MPTZSavePreset Command callback (from client) + */ +bool emberAfCameraAvSettingsUserLevelManagementClusterMPTZSavePresetCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::CameraAvSettingsUserLevelManagement::Commands::MPTZSavePreset::DecodableType & commandData); +/** + * @brief Camera AV Settings User Level Management Cluster MPTZRemovePreset Command callback (from client) + */ +bool emberAfCameraAvSettingsUserLevelManagementClusterMPTZRemovePresetCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::CameraAvSettingsUserLevelManagement::Commands::MPTZRemovePreset::DecodableType & commandData); +/** + * @brief Camera AV Settings User Level Management Cluster DPTZSetViewport Command callback (from client) + */ +bool emberAfCameraAvSettingsUserLevelManagementClusterDPTZSetViewportCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::CameraAvSettingsUserLevelManagement::Commands::DPTZSetViewport::DecodableType & commandData); +/** + * @brief Camera AV Settings User Level Management Cluster DPTZRelativeMove Command callback (from client) + */ +bool emberAfCameraAvSettingsUserLevelManagementClusterDPTZRelativeMoveCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::CameraAvSettingsUserLevelManagement::Commands::DPTZRelativeMove::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.h b/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h index 9d20b7e2d4bae7..9158953177e6cc 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 @@ -5612,6 +5612,19 @@ enum class Feature : uint32_t }; } // namespace CameraAvStreamManagement +namespace CameraAvSettingsUserLevelManagement { + +// Bitmap for Feature +enum class Feature : uint32_t +{ + kDigitalPTZ = 0x1, + kMechanicalPan = 0x2, + kMechanicalTilt = 0x4, + kMechanicalZoom = 0x8, + kMechanicalPresets = 0x10, +}; +} // namespace CameraAvSettingsUserLevelManagement + namespace WebRTCTransportProvider { using StreamUsageEnum = Clusters::detail::StreamUsageEnum; 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 edd93fb1fd0ede..ccc6e6041a7de4 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 @@ -30307,6 +30307,430 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) } // namespace Events } // namespace CameraAvStreamManagement +namespace CameraAvSettingsUserLevelManagement { +namespace Structs { + +namespace MPTZStruct { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kPan), pan); + encoder.Encode(to_underlying(Fields::kTilt), tilt); + encoder.Encode(to_underlying(Fields::kZoom), zoom); + 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::kPan)) + { + err = DataModel::Decode(reader, pan); + } + else if (__context_tag == to_underlying(Fields::kTilt)) + { + err = DataModel::Decode(reader, tilt); + } + else if (__context_tag == to_underlying(Fields::kZoom)) + { + err = DataModel::Decode(reader, zoom); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} + +} // namespace MPTZStruct + +namespace MPTZPresetStruct { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kPresetID), presetID); + encoder.Encode(to_underlying(Fields::kName), name); + encoder.Encode(to_underlying(Fields::kSettings), settings); + 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::kPresetID)) + { + err = DataModel::Decode(reader, presetID); + } + else if (__context_tag == to_underlying(Fields::kName)) + { + err = DataModel::Decode(reader, name); + } + else if (__context_tag == to_underlying(Fields::kSettings)) + { + err = DataModel::Decode(reader, settings); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} + +} // namespace MPTZPresetStruct +} // namespace Structs + +namespace Commands { +namespace MPTZSetPosition { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kPan), pan); + encoder.Encode(to_underlying(Fields::kTilt), tilt); + encoder.Encode(to_underlying(Fields::kZoom), zoom); + 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::kPan)) + { + err = DataModel::Decode(reader, pan); + } + else if (__context_tag == to_underlying(Fields::kTilt)) + { + err = DataModel::Decode(reader, tilt); + } + else if (__context_tag == to_underlying(Fields::kZoom)) + { + err = DataModel::Decode(reader, zoom); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace MPTZSetPosition. +namespace MPTZRelativeMove { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kPanDelta), panDelta); + encoder.Encode(to_underlying(Fields::kTiltDelta), tiltDelta); + encoder.Encode(to_underlying(Fields::kZoomDelta), zoomDelta); + 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::kPanDelta)) + { + err = DataModel::Decode(reader, panDelta); + } + else if (__context_tag == to_underlying(Fields::kTiltDelta)) + { + err = DataModel::Decode(reader, tiltDelta); + } + else if (__context_tag == to_underlying(Fields::kZoomDelta)) + { + err = DataModel::Decode(reader, zoomDelta); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace MPTZRelativeMove. +namespace MPTZMoveToPreset { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kPresetID), presetID); + 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::kPresetID)) + { + err = DataModel::Decode(reader, presetID); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace MPTZMoveToPreset. +namespace MPTZSavePreset { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kPresetID), presetID); + encoder.Encode(to_underlying(Fields::kName), name); + 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::kPresetID)) + { + err = DataModel::Decode(reader, presetID); + } + else if (__context_tag == to_underlying(Fields::kName)) + { + err = DataModel::Decode(reader, name); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace MPTZSavePreset. +namespace MPTZRemovePreset { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kPresetID), presetID); + 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::kPresetID)) + { + err = DataModel::Decode(reader, presetID); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace MPTZRemovePreset. +namespace DPTZSetViewport { +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::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::kVideoStreamID)) + { + err = DataModel::Decode(reader, videoStreamID); + } + else if (__context_tag == to_underlying(Fields::kViewport)) + { + err = DataModel::Decode(reader, viewport); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace DPTZSetViewport. +namespace DPTZRelativeMove { +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::kDeltaX), deltaX); + encoder.Encode(to_underlying(Fields::kDeltaY), deltaY); + encoder.Encode(to_underlying(Fields::kZoomDelta), zoomDelta); + 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::kDeltaX)) + { + err = DataModel::Decode(reader, deltaX); + } + else if (__context_tag == to_underlying(Fields::kDeltaY)) + { + err = DataModel::Decode(reader, deltaY); + } + else if (__context_tag == to_underlying(Fields::kZoomDelta)) + { + err = DataModel::Decode(reader, zoomDelta); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace DPTZRelativeMove. +} // namespace Commands + +namespace Attributes { +CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path) +{ + switch (path.mAttributeId) + { + case Attributes::MPTZPosition::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, MPTZPosition); + case Attributes::MaxPresets::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, maxPresets); + case Attributes::MPTZPresets::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, MPTZPresets); + case Attributes::DPTZRelativeMove::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, DPTZRelativeMove); + case Attributes::ZoomMax::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, zoomMax); + case Attributes::TiltMin::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, tiltMin); + case Attributes::TiltMax::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, tiltMax); + case Attributes::PanMin::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, panMin); + case Attributes::PanMax::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, panMax); + case Attributes::GeneratedCommandList::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, generatedCommandList); + case Attributes::AcceptedCommandList::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, acceptedCommandList); + case Attributes::AttributeList::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, attributeList); + case Attributes::FeatureMap::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, featureMap); + case Attributes::ClusterRevision::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, clusterRevision); + default: + return CHIP_NO_ERROR; + } +} +} // namespace Attributes + +namespace Events {} // namespace Events + +} // namespace CameraAvSettingsUserLevelManagement namespace WebRTCTransportProvider { namespace Structs {} // namespace Structs @@ -34900,6 +35324,13 @@ bool CommandIsFabricScoped(ClusterId aCluster, CommandId aCommand) return false; } } + case Clusters::CameraAvSettingsUserLevelManagement::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 d83f7dd3469508..8eaa141995b304 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 @@ -42522,6 +42522,525 @@ struct DecodableType } // namespace SnapshotStreamChanged } // namespace Events } // namespace CameraAvStreamManagement +namespace CameraAvSettingsUserLevelManagement { +namespace Structs { +namespace MPTZStruct { +enum class Fields : uint8_t +{ + kPan = 0, + kTilt = 1, + kZoom = 2, +}; + +struct Type +{ +public: + Optional pan; + Optional tilt; + Optional zoom; + + 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 MPTZStruct +namespace MPTZPresetStruct { +enum class Fields : uint8_t +{ + kPresetID = 0, + kName = 1, + kSettings = 2, +}; + +struct Type +{ +public: + uint8_t presetID = static_cast(0); + chip::CharSpan name; + Structs::MPTZStruct::Type settings; + + 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 MPTZPresetStruct +namespace ViewportStruct = Clusters::detail::Structs::ViewportStruct; +} // namespace Structs + +namespace Commands { +// Forward-declarations so we can reference these later. + +namespace MPTZSetPosition { +struct Type; +struct DecodableType; +} // namespace MPTZSetPosition + +namespace MPTZRelativeMove { +struct Type; +struct DecodableType; +} // namespace MPTZRelativeMove + +namespace MPTZMoveToPreset { +struct Type; +struct DecodableType; +} // namespace MPTZMoveToPreset + +namespace MPTZSavePreset { +struct Type; +struct DecodableType; +} // namespace MPTZSavePreset + +namespace MPTZRemovePreset { +struct Type; +struct DecodableType; +} // namespace MPTZRemovePreset + +namespace DPTZSetViewport { +struct Type; +struct DecodableType; +} // namespace DPTZSetViewport + +namespace DPTZRelativeMove { +struct Type; +struct DecodableType; +} // namespace DPTZRelativeMove + +} // namespace Commands + +namespace Commands { +namespace MPTZSetPosition { +enum class Fields : uint8_t +{ + kPan = 0, + kTilt = 1, + kZoom = 2, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::MPTZSetPosition::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvSettingsUserLevelManagement::Id; } + + Optional pan; + Optional tilt; + Optional zoom; + + 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::MPTZSetPosition::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvSettingsUserLevelManagement::Id; } + + Optional pan; + Optional tilt; + Optional zoom; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace MPTZSetPosition +namespace MPTZRelativeMove { +enum class Fields : uint8_t +{ + kPanDelta = 0, + kTiltDelta = 1, + kZoomDelta = 2, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::MPTZRelativeMove::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvSettingsUserLevelManagement::Id; } + + Optional panDelta; + Optional tiltDelta; + Optional zoomDelta; + + 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::MPTZRelativeMove::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvSettingsUserLevelManagement::Id; } + + Optional panDelta; + Optional tiltDelta; + Optional zoomDelta; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace MPTZRelativeMove +namespace MPTZMoveToPreset { +enum class Fields : uint8_t +{ + kPresetID = 0, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::MPTZMoveToPreset::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvSettingsUserLevelManagement::Id; } + + uint8_t presetID = 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::MPTZMoveToPreset::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvSettingsUserLevelManagement::Id; } + + uint8_t presetID = static_cast(0); + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace MPTZMoveToPreset +namespace MPTZSavePreset { +enum class Fields : uint8_t +{ + kPresetID = 0, + kName = 1, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::MPTZSavePreset::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvSettingsUserLevelManagement::Id; } + + Optional presetID; + chip::CharSpan name; + + 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::MPTZSavePreset::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvSettingsUserLevelManagement::Id; } + + Optional presetID; + chip::CharSpan name; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace MPTZSavePreset +namespace MPTZRemovePreset { +enum class Fields : uint8_t +{ + kPresetID = 0, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::MPTZRemovePreset::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvSettingsUserLevelManagement::Id; } + + uint8_t presetID = 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::MPTZRemovePreset::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvSettingsUserLevelManagement::Id; } + + uint8_t presetID = static_cast(0); + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace MPTZRemovePreset +namespace DPTZSetViewport { +enum class Fields : uint8_t +{ + kVideoStreamID = 0, + kViewport = 1, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::DPTZSetViewport::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvSettingsUserLevelManagement::Id; } + + uint16_t videoStreamID = static_cast(0); + 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::DPTZSetViewport::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvSettingsUserLevelManagement::Id; } + + uint16_t videoStreamID = static_cast(0); + Structs::ViewportStruct::DecodableType viewport; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace DPTZSetViewport +namespace DPTZRelativeMove { +enum class Fields : uint8_t +{ + kVideoStreamID = 0, + kDeltaX = 1, + kDeltaY = 2, + kZoomDelta = 3, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::DPTZRelativeMove::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvSettingsUserLevelManagement::Id; } + + uint16_t videoStreamID = static_cast(0); + Optional deltaX; + Optional deltaY; + Optional zoomDelta; + + 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::DPTZRelativeMove::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvSettingsUserLevelManagement::Id; } + + uint16_t videoStreamID = static_cast(0); + Optional deltaX; + Optional deltaY; + Optional zoomDelta; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace DPTZRelativeMove +} // namespace Commands + +namespace Attributes { + +namespace MPTZPosition { +struct TypeInfo +{ + using Type = chip::app::Clusters::CameraAvSettingsUserLevelManagement::Structs::MPTZStruct::Type; + using DecodableType = chip::app::Clusters::CameraAvSettingsUserLevelManagement::Structs::MPTZStruct::DecodableType; + using DecodableArgType = const chip::app::Clusters::CameraAvSettingsUserLevelManagement::Structs::MPTZStruct::DecodableType &; + + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvSettingsUserLevelManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::MPTZPosition::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace MPTZPosition +namespace MaxPresets { +struct TypeInfo +{ + using Type = uint8_t; + using DecodableType = uint8_t; + using DecodableArgType = uint8_t; + + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvSettingsUserLevelManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::MaxPresets::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace MaxPresets +namespace MPTZPresets { +struct TypeInfo +{ + using Type = + chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList< + chip::app::Clusters::CameraAvSettingsUserLevelManagement::Structs::MPTZPresetStruct::DecodableType>; + using DecodableArgType = const chip::app::DataModel::DecodableList< + chip::app::Clusters::CameraAvSettingsUserLevelManagement::Structs::MPTZPresetStruct::DecodableType> &; + + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvSettingsUserLevelManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::MPTZPresets::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace MPTZPresets +namespace DPTZRelativeMove { +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::CameraAvSettingsUserLevelManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::DPTZRelativeMove::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace DPTZRelativeMove +namespace ZoomMax { +struct TypeInfo +{ + using Type = uint8_t; + using DecodableType = uint8_t; + using DecodableArgType = uint8_t; + + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvSettingsUserLevelManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::ZoomMax::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace ZoomMax +namespace TiltMin { +struct TypeInfo +{ + using Type = int16_t; + using DecodableType = int16_t; + using DecodableArgType = int16_t; + + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvSettingsUserLevelManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::TiltMin::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace TiltMin +namespace TiltMax { +struct TypeInfo +{ + using Type = int16_t; + using DecodableType = int16_t; + using DecodableArgType = int16_t; + + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvSettingsUserLevelManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::TiltMax::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace TiltMax +namespace PanMin { +struct TypeInfo +{ + using Type = int16_t; + using DecodableType = int16_t; + using DecodableArgType = int16_t; + + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvSettingsUserLevelManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::PanMin::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace PanMin +namespace PanMax { +struct TypeInfo +{ + using Type = int16_t; + using DecodableType = int16_t; + using DecodableArgType = int16_t; + + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvSettingsUserLevelManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::PanMax::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace PanMax +namespace GeneratedCommandList { +struct TypeInfo : public Clusters::Globals::Attributes::GeneratedCommandList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvSettingsUserLevelManagement::Id; } +}; +} // namespace GeneratedCommandList +namespace AcceptedCommandList { +struct TypeInfo : public Clusters::Globals::Attributes::AcceptedCommandList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvSettingsUserLevelManagement::Id; } +}; +} // namespace AcceptedCommandList +namespace AttributeList { +struct TypeInfo : public Clusters::Globals::Attributes::AttributeList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvSettingsUserLevelManagement::Id; } +}; +} // namespace AttributeList +namespace FeatureMap { +struct TypeInfo : public Clusters::Globals::Attributes::FeatureMap::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvSettingsUserLevelManagement::Id; } +}; +} // namespace FeatureMap +namespace ClusterRevision { +struct TypeInfo : public Clusters::Globals::Attributes::ClusterRevision::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvSettingsUserLevelManagement::Id; } +}; +} // namespace ClusterRevision + +struct TypeInfo +{ + struct DecodableType + { + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvSettingsUserLevelManagement::Id; } + + CHIP_ERROR Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path); + + Attributes::MPTZPosition::TypeInfo::DecodableType MPTZPosition; + Attributes::MaxPresets::TypeInfo::DecodableType maxPresets = static_cast(0); + Attributes::MPTZPresets::TypeInfo::DecodableType MPTZPresets; + Attributes::DPTZRelativeMove::TypeInfo::DecodableType DPTZRelativeMove; + Attributes::ZoomMax::TypeInfo::DecodableType zoomMax = static_cast(0); + Attributes::TiltMin::TypeInfo::DecodableType tiltMin = static_cast(0); + Attributes::TiltMax::TypeInfo::DecodableType tiltMax = static_cast(0); + Attributes::PanMin::TypeInfo::DecodableType panMin = static_cast(0); + Attributes::PanMax::TypeInfo::DecodableType panMax = static_cast(0); + Attributes::GeneratedCommandList::TypeInfo::DecodableType generatedCommandList; + Attributes::AcceptedCommandList::TypeInfo::DecodableType acceptedCommandList; + Attributes::AttributeList::TypeInfo::DecodableType attributeList; + Attributes::FeatureMap::TypeInfo::DecodableType featureMap = static_cast(0); + Attributes::ClusterRevision::TypeInfo::DecodableType clusterRevision = static_cast(0); + }; +}; +} // namespace Attributes +} // namespace CameraAvSettingsUserLevelManagement 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 5d12daa8564976..ca4444aa83cee5 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 @@ -7053,6 +7053,68 @@ static constexpr AttributeId Id = Globals::Attributes::ClusterRevision::Id; } // namespace Attributes } // namespace CameraAvStreamManagement +namespace CameraAvSettingsUserLevelManagement { +namespace Attributes { + +namespace MPTZPosition { +static constexpr AttributeId Id = 0x00000000; +} // namespace MPTZPosition + +namespace MaxPresets { +static constexpr AttributeId Id = 0x00000001; +} // namespace MaxPresets + +namespace MPTZPresets { +static constexpr AttributeId Id = 0x00000002; +} // namespace MPTZPresets + +namespace DPTZRelativeMove { +static constexpr AttributeId Id = 0x00000003; +} // namespace DPTZRelativeMove + +namespace ZoomMax { +static constexpr AttributeId Id = 0x00000004; +} // namespace ZoomMax + +namespace TiltMin { +static constexpr AttributeId Id = 0x00000005; +} // namespace TiltMin + +namespace TiltMax { +static constexpr AttributeId Id = 0x00000006; +} // namespace TiltMax + +namespace PanMin { +static constexpr AttributeId Id = 0x00000007; +} // namespace PanMin + +namespace PanMax { +static constexpr AttributeId Id = 0x00000008; +} // namespace PanMax + +namespace GeneratedCommandList { +static constexpr AttributeId Id = Globals::Attributes::GeneratedCommandList::Id; +} // namespace GeneratedCommandList + +namespace AcceptedCommandList { +static constexpr AttributeId Id = Globals::Attributes::AcceptedCommandList::Id; +} // namespace AcceptedCommandList + +namespace AttributeList { +static constexpr AttributeId Id = Globals::Attributes::AttributeList::Id; +} // namespace AttributeList + +namespace FeatureMap { +static constexpr AttributeId Id = Globals::Attributes::FeatureMap::Id; +} // namespace FeatureMap + +namespace ClusterRevision { +static constexpr AttributeId Id = Globals::Attributes::ClusterRevision::Id; +} // namespace ClusterRevision + +} // namespace Attributes +} // namespace CameraAvSettingsUserLevelManagement + 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 e492255152c333..a9e3fad362a4ae 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 @@ -382,6 +382,9 @@ static constexpr ClusterId Id = 0x00000550; namespace CameraAvStreamManagement { static constexpr ClusterId Id = 0x00000551; } // namespace CameraAvStreamManagement +namespace CameraAvSettingsUserLevelManagement { +static constexpr ClusterId Id = 0x00000552; +} // namespace CameraAvSettingsUserLevelManagement 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 d46b8ae0765467..40954ab0ea5f29 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 @@ -1891,6 +1891,40 @@ static constexpr CommandId Id = 0x0000000C; } // namespace Commands } // namespace CameraAvStreamManagement +namespace CameraAvSettingsUserLevelManagement { +namespace Commands { + +namespace MPTZSetPosition { +static constexpr CommandId Id = 0x00000000; +} // namespace MPTZSetPosition + +namespace MPTZRelativeMove { +static constexpr CommandId Id = 0x00000001; +} // namespace MPTZRelativeMove + +namespace MPTZMoveToPreset { +static constexpr CommandId Id = 0x00000002; +} // namespace MPTZMoveToPreset + +namespace MPTZSavePreset { +static constexpr CommandId Id = 0x00000003; +} // namespace MPTZSavePreset + +namespace MPTZRemovePreset { +static constexpr CommandId Id = 0x00000004; +} // namespace MPTZRemovePreset + +namespace DPTZSetViewport { +static constexpr CommandId Id = 0x00000005; +} // namespace DPTZSetViewport + +namespace DPTZRelativeMove { +static constexpr CommandId Id = 0x00000006; +} // namespace DPTZRelativeMove + +} // namespace Commands +} // namespace CameraAvSettingsUserLevelManagement + namespace WebRTCTransportProvider { namespace Commands { diff --git a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h index d9da5b5fdea625..c2df08e2957dfc 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h @@ -154,6 +154,7 @@ | ContentAppObserver | 0x0510 | | ZoneManagement | 0x0550 | | CameraAvStreamManagement | 0x0551 | +| CameraAvSettingsUserLevelManagement | 0x0552 | | WebRTCTransportProvider | 0x0553 | | WebRTCTransportRequestor | 0x0554 | | Chime | 0x0556 | @@ -14155,6 +14156,327 @@ class CameraAvStreamManagementCaptureSnapshot : public ClusterCommand mComplex_RequestedResolution; }; +/*----------------------------------------------------------------------------*\ +| Cluster CameraAvSettingsUserLevelManagement | 0x0552 | +|------------------------------------------------------------------------------| +| Commands: | | +| * MPTZSetPosition | 0x00 | +| * MPTZRelativeMove | 0x01 | +| * MPTZMoveToPreset | 0x02 | +| * MPTZSavePreset | 0x03 | +| * MPTZRemovePreset | 0x04 | +| * DPTZSetViewport | 0x05 | +| * DPTZRelativeMove | 0x06 | +|------------------------------------------------------------------------------| +| Attributes: | | +| * MPTZPosition | 0x0000 | +| * MaxPresets | 0x0001 | +| * MPTZPresets | 0x0002 | +| * DPTZRelativeMove | 0x0003 | +| * ZoomMax | 0x0004 | +| * TiltMin | 0x0005 | +| * TiltMax | 0x0006 | +| * PanMin | 0x0007 | +| * PanMax | 0x0008 | +| * GeneratedCommandList | 0xFFF8 | +| * AcceptedCommandList | 0xFFF9 | +| * AttributeList | 0xFFFB | +| * FeatureMap | 0xFFFC | +| * ClusterRevision | 0xFFFD | +|------------------------------------------------------------------------------| +| Events: | | +\*----------------------------------------------------------------------------*/ + +/* + * Command MPTZSetPosition + */ +class CameraAvSettingsUserLevelManagementMPTZSetPosition : public ClusterCommand +{ +public: + CameraAvSettingsUserLevelManagementMPTZSetPosition(CredentialIssuerCommands * credsIssuerConfig) : + ClusterCommand("mptzset-position", credsIssuerConfig) + { + AddArgument("Pan", INT16_MIN, INT16_MAX, &mRequest.pan); + AddArgument("Tilt", INT16_MIN, INT16_MAX, &mRequest.tilt); + AddArgument("Zoom", 0, UINT8_MAX, &mRequest.zoom); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvSettingsUserLevelManagement::Id; + constexpr chip::CommandId commandId = + chip::app::Clusters::CameraAvSettingsUserLevelManagement::Commands::MPTZSetPosition::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::CameraAvSettingsUserLevelManagement::Id; + constexpr chip::CommandId commandId = + chip::app::Clusters::CameraAvSettingsUserLevelManagement::Commands::MPTZSetPosition::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::CameraAvSettingsUserLevelManagement::Commands::MPTZSetPosition::Type mRequest; +}; + +/* + * Command MPTZRelativeMove + */ +class CameraAvSettingsUserLevelManagementMPTZRelativeMove : public ClusterCommand +{ +public: + CameraAvSettingsUserLevelManagementMPTZRelativeMove(CredentialIssuerCommands * credsIssuerConfig) : + ClusterCommand("mptzrelative-move", credsIssuerConfig) + { + AddArgument("PanDelta", INT16_MIN, INT16_MAX, &mRequest.panDelta); + AddArgument("TiltDelta", INT16_MIN, INT16_MAX, &mRequest.tiltDelta); + AddArgument("ZoomDelta", INT8_MIN, INT8_MAX, &mRequest.zoomDelta); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvSettingsUserLevelManagement::Id; + constexpr chip::CommandId commandId = + chip::app::Clusters::CameraAvSettingsUserLevelManagement::Commands::MPTZRelativeMove::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::CameraAvSettingsUserLevelManagement::Id; + constexpr chip::CommandId commandId = + chip::app::Clusters::CameraAvSettingsUserLevelManagement::Commands::MPTZRelativeMove::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::CameraAvSettingsUserLevelManagement::Commands::MPTZRelativeMove::Type mRequest; +}; + +/* + * Command MPTZMoveToPreset + */ +class CameraAvSettingsUserLevelManagementMPTZMoveToPreset : public ClusterCommand +{ +public: + CameraAvSettingsUserLevelManagementMPTZMoveToPreset(CredentialIssuerCommands * credsIssuerConfig) : + ClusterCommand("mptzmove-to-preset", credsIssuerConfig) + { + AddArgument("PresetID", 0, UINT8_MAX, &mRequest.presetID); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvSettingsUserLevelManagement::Id; + constexpr chip::CommandId commandId = + chip::app::Clusters::CameraAvSettingsUserLevelManagement::Commands::MPTZMoveToPreset::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::CameraAvSettingsUserLevelManagement::Id; + constexpr chip::CommandId commandId = + chip::app::Clusters::CameraAvSettingsUserLevelManagement::Commands::MPTZMoveToPreset::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::CameraAvSettingsUserLevelManagement::Commands::MPTZMoveToPreset::Type mRequest; +}; + +/* + * Command MPTZSavePreset + */ +class CameraAvSettingsUserLevelManagementMPTZSavePreset : public ClusterCommand +{ +public: + CameraAvSettingsUserLevelManagementMPTZSavePreset(CredentialIssuerCommands * credsIssuerConfig) : + ClusterCommand("mptzsave-preset", credsIssuerConfig) + { + AddArgument("PresetID", 0, UINT8_MAX, &mRequest.presetID); + AddArgument("Name", &mRequest.name); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvSettingsUserLevelManagement::Id; + constexpr chip::CommandId commandId = + chip::app::Clusters::CameraAvSettingsUserLevelManagement::Commands::MPTZSavePreset::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::CameraAvSettingsUserLevelManagement::Id; + constexpr chip::CommandId commandId = + chip::app::Clusters::CameraAvSettingsUserLevelManagement::Commands::MPTZSavePreset::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::CameraAvSettingsUserLevelManagement::Commands::MPTZSavePreset::Type mRequest; +}; + +/* + * Command MPTZRemovePreset + */ +class CameraAvSettingsUserLevelManagementMPTZRemovePreset : public ClusterCommand +{ +public: + CameraAvSettingsUserLevelManagementMPTZRemovePreset(CredentialIssuerCommands * credsIssuerConfig) : + ClusterCommand("mptzremove-preset", credsIssuerConfig) + { + AddArgument("PresetID", 0, UINT8_MAX, &mRequest.presetID); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvSettingsUserLevelManagement::Id; + constexpr chip::CommandId commandId = + chip::app::Clusters::CameraAvSettingsUserLevelManagement::Commands::MPTZRemovePreset::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::CameraAvSettingsUserLevelManagement::Id; + constexpr chip::CommandId commandId = + chip::app::Clusters::CameraAvSettingsUserLevelManagement::Commands::MPTZRemovePreset::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::CameraAvSettingsUserLevelManagement::Commands::MPTZRemovePreset::Type mRequest; +}; + +/* + * Command DPTZSetViewport + */ +class CameraAvSettingsUserLevelManagementDPTZSetViewport : public ClusterCommand +{ +public: + CameraAvSettingsUserLevelManagementDPTZSetViewport(CredentialIssuerCommands * credsIssuerConfig) : + ClusterCommand("dptzset-viewport", credsIssuerConfig), mComplex_Viewport(&mRequest.viewport) + { + AddArgument("VideoStreamID", 0, UINT16_MAX, &mRequest.videoStreamID); + AddArgument("Viewport", &mComplex_Viewport); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvSettingsUserLevelManagement::Id; + constexpr chip::CommandId commandId = + chip::app::Clusters::CameraAvSettingsUserLevelManagement::Commands::DPTZSetViewport::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::CameraAvSettingsUserLevelManagement::Id; + constexpr chip::CommandId commandId = + chip::app::Clusters::CameraAvSettingsUserLevelManagement::Commands::DPTZSetViewport::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::CameraAvSettingsUserLevelManagement::Commands::DPTZSetViewport::Type mRequest; + TypedComplexArgument mComplex_Viewport; +}; + +/* + * Command DPTZRelativeMove + */ +class CameraAvSettingsUserLevelManagementDPTZRelativeMove : public ClusterCommand +{ +public: + CameraAvSettingsUserLevelManagementDPTZRelativeMove(CredentialIssuerCommands * credsIssuerConfig) : + ClusterCommand("dptzrelative-move", credsIssuerConfig) + { + AddArgument("VideoStreamID", 0, UINT16_MAX, &mRequest.videoStreamID); + AddArgument("DeltaX", INT16_MIN, INT16_MAX, &mRequest.deltaX); + AddArgument("DeltaY", INT16_MIN, INT16_MAX, &mRequest.deltaY); + AddArgument("ZoomDelta", INT8_MIN, INT8_MAX, &mRequest.zoomDelta); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvSettingsUserLevelManagement::Id; + constexpr chip::CommandId commandId = + chip::app::Clusters::CameraAvSettingsUserLevelManagement::Commands::DPTZRelativeMove::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::CameraAvSettingsUserLevelManagement::Id; + constexpr chip::CommandId commandId = + chip::app::Clusters::CameraAvSettingsUserLevelManagement::Commands::DPTZRelativeMove::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::CameraAvSettingsUserLevelManagement::Commands::DPTZRelativeMove::Type mRequest; +}; + /*----------------------------------------------------------------------------*\ | Cluster WebRTCTransportProvider | 0x0553 | |------------------------------------------------------------------------------| @@ -26987,6 +27309,97 @@ void registerClusterCameraAvStreamManagement(Commands & commands, CredentialIssu commands.RegisterCluster(clusterName, clusterCommands); } +void registerClusterCameraAvSettingsUserLevelManagement(Commands & commands, CredentialIssuerCommands * credsIssuerConfig) +{ + using namespace chip::app::Clusters::CameraAvSettingsUserLevelManagement; + + const char * clusterName = "CameraAvSettingsUserLevelManagement"; + + 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), // + // + // Attributes + // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, "mptzposition", Attributes::MPTZPosition::Id, credsIssuerConfig), // + make_unique(Id, "max-presets", Attributes::MaxPresets::Id, credsIssuerConfig), // + make_unique(Id, "mptzpresets", Attributes::MPTZPresets::Id, credsIssuerConfig), // + make_unique(Id, "dptzrelative-move", Attributes::DPTZRelativeMove::Id, credsIssuerConfig), // + make_unique(Id, "zoom-max", Attributes::ZoomMax::Id, credsIssuerConfig), // + make_unique(Id, "tilt-min", Attributes::TiltMin::Id, credsIssuerConfig), // + make_unique(Id, "tilt-max", Attributes::TiltMax::Id, credsIssuerConfig), // + make_unique(Id, "pan-min", Attributes::PanMin::Id, credsIssuerConfig), // + make_unique(Id, "pan-max", Attributes::PanMax::Id, credsIssuerConfig), // + make_unique(Id, "generated-command-list", Attributes::GeneratedCommandList::Id, credsIssuerConfig), // + make_unique(Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, credsIssuerConfig), // + make_unique(Id, "attribute-list", Attributes::AttributeList::Id, credsIssuerConfig), // + make_unique(Id, "feature-map", Attributes::FeatureMap::Id, credsIssuerConfig), // + make_unique(Id, "cluster-revision", Attributes::ClusterRevision::Id, credsIssuerConfig), // + make_unique>(Id, credsIssuerConfig), // + make_unique>( + Id, "mptzposition", Attributes::MPTZPosition::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>(Id, "max-presets", 0, UINT8_MAX, Attributes::MaxPresets::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>( + Id, "mptzpresets", Attributes::MPTZPresets::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>( + Id, "dptzrelative-move", Attributes::DPTZRelativeMove::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>(Id, "zoom-max", 0, UINT8_MAX, Attributes::ZoomMax::Id, WriteCommandType::kForceWrite, + credsIssuerConfig), // + make_unique>(Id, "tilt-min", INT16_MIN, INT16_MAX, Attributes::TiltMin::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>(Id, "tilt-max", INT16_MIN, INT16_MAX, Attributes::TiltMax::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>(Id, "pan-min", INT16_MIN, INT16_MAX, Attributes::PanMin::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>(Id, "pan-max", INT16_MIN, INT16_MAX, Attributes::PanMax::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>( + Id, "generated-command-list", Attributes::GeneratedCommandList::Id, WriteCommandType::kForceWrite, + credsIssuerConfig), // + make_unique>>( + Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>( + Id, "attribute-list", Attributes::AttributeList::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>(Id, "feature-map", 0, UINT32_MAX, Attributes::FeatureMap::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>(Id, "cluster-revision", 0, UINT16_MAX, Attributes::ClusterRevision::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, "mptzposition", Attributes::MPTZPosition::Id, credsIssuerConfig), // + make_unique(Id, "max-presets", Attributes::MaxPresets::Id, credsIssuerConfig), // + make_unique(Id, "mptzpresets", Attributes::MPTZPresets::Id, credsIssuerConfig), // + make_unique(Id, "dptzrelative-move", Attributes::DPTZRelativeMove::Id, credsIssuerConfig), // + make_unique(Id, "zoom-max", Attributes::ZoomMax::Id, credsIssuerConfig), // + make_unique(Id, "tilt-min", Attributes::TiltMin::Id, credsIssuerConfig), // + make_unique(Id, "tilt-max", Attributes::TiltMax::Id, credsIssuerConfig), // + make_unique(Id, "pan-min", Attributes::PanMin::Id, credsIssuerConfig), // + make_unique(Id, "pan-max", Attributes::PanMax::Id, credsIssuerConfig), // + make_unique(Id, "generated-command-list", Attributes::GeneratedCommandList::Id, credsIssuerConfig), // + make_unique(Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, credsIssuerConfig), // + make_unique(Id, "attribute-list", Attributes::AttributeList::Id, credsIssuerConfig), // + make_unique(Id, "feature-map", Attributes::FeatureMap::Id, credsIssuerConfig), // + make_unique(Id, "cluster-revision", Attributes::ClusterRevision::Id, credsIssuerConfig), // + // + // Events + // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, credsIssuerConfig), // + }; + + commands.RegisterCluster(clusterName, clusterCommands); +} void registerClusterWebRTCTransportProvider(Commands & commands, CredentialIssuerCommands * credsIssuerConfig) { using namespace chip::app::Clusters::WebRTCTransportProvider; @@ -28006,6 +28419,7 @@ void registerClusters(Commands & commands, CredentialIssuerCommands * credsIssue registerClusterContentAppObserver(commands, credsIssuerConfig); registerClusterZoneManagement(commands, credsIssuerConfig); registerClusterCameraAvStreamManagement(commands, credsIssuerConfig); + registerClusterCameraAvSettingsUserLevelManagement(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 d2711c95e030fb..afda6e9979842d 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp @@ -6477,6 +6477,88 @@ void ComplexArgumentParser::Finalize( ComplexArgumentParser::Finalize(request.maxHDRFPS); } +CHIP_ERROR +ComplexArgumentParser::Setup(const char * label, + chip::app::Clusters::CameraAvSettingsUserLevelManagement::Structs::MPTZStruct::Type & request, + Json::Value & value) +{ + VerifyOrReturnError(value.isObject(), CHIP_ERROR_INVALID_ARGUMENT); + + // Copy to track which members we already processed. + Json::Value valueCopy(value); + + char labelWithMember[kMaxLabelLength]; + if (value.isMember("pan")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "pan"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.pan, value["pan"])); + } + valueCopy.removeMember("pan"); + + if (value.isMember("tilt")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "tilt"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.tilt, value["tilt"])); + } + valueCopy.removeMember("tilt"); + + if (value.isMember("zoom")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "zoom"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.zoom, value["zoom"])); + } + valueCopy.removeMember("zoom"); + + return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); +} + +void ComplexArgumentParser::Finalize(chip::app::Clusters::CameraAvSettingsUserLevelManagement::Structs::MPTZStruct::Type & request) +{ + ComplexArgumentParser::Finalize(request.pan); + ComplexArgumentParser::Finalize(request.tilt); + ComplexArgumentParser::Finalize(request.zoom); +} + +CHIP_ERROR +ComplexArgumentParser::Setup(const char * label, + chip::app::Clusters::CameraAvSettingsUserLevelManagement::Structs::MPTZPresetStruct::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("MPTZPresetStruct.presetID", "presetID", value.isMember("presetID"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("MPTZPresetStruct.name", "name", value.isMember("name"))); + ReturnErrorOnFailure( + ComplexArgumentParser::EnsureMemberExist("MPTZPresetStruct.settings", "settings", value.isMember("settings"))); + + char labelWithMember[kMaxLabelLength]; + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "presetID"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.presetID, value["presetID"])); + valueCopy.removeMember("presetID"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "name"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.name, value["name"])); + valueCopy.removeMember("name"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "settings"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.settings, value["settings"])); + valueCopy.removeMember("settings"); + + return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); +} + +void ComplexArgumentParser::Finalize( + chip::app::Clusters::CameraAvSettingsUserLevelManagement::Structs::MPTZPresetStruct::Type & request) +{ + ComplexArgumentParser::Finalize(request.presetID); + ComplexArgumentParser::Finalize(request.name); + ComplexArgumentParser::Finalize(request.settings); +} + CHIP_ERROR ComplexArgumentParser::Setup(const char * label, chip::app::Clusters::Chime::Structs::ChimeSoundStruct::Type & request, Json::Value & value) { diff --git a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h index 869fcb855a142a..853fb8a3209379 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h @@ -741,6 +741,18 @@ static CHIP_ERROR Setup(const char * label, static void Finalize(chip::app::Clusters::CameraAvStreamManagement::Structs::VideoSensorParamsStruct::Type & request); +static CHIP_ERROR Setup(const char * label, + chip::app::Clusters::CameraAvSettingsUserLevelManagement::Structs::MPTZStruct::Type & request, + Json::Value & value); + +static void Finalize(chip::app::Clusters::CameraAvSettingsUserLevelManagement::Structs::MPTZStruct::Type & request); + +static CHIP_ERROR Setup(const char * label, + chip::app::Clusters::CameraAvSettingsUserLevelManagement::Structs::MPTZPresetStruct::Type & request, + Json::Value & value); + +static void Finalize(chip::app::Clusters::CameraAvSettingsUserLevelManagement::Structs::MPTZPresetStruct::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 ce3372ab18d836..258181b9144387 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp @@ -5752,6 +5752,74 @@ CHIP_ERROR DataModelLogger::LogValue( return CHIP_NO_ERROR; } +CHIP_ERROR DataModelLogger::LogValue( + const char * label, size_t indent, + const chip::app::Clusters::CameraAvSettingsUserLevelManagement::Structs::MPTZStruct::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = LogValue("Pan", indent + 1, value.pan); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Pan'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("Tilt", indent + 1, value.tilt); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Tilt'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("Zoom", indent + 1, value.zoom); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Zoom'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} + +CHIP_ERROR DataModelLogger::LogValue( + const char * label, size_t indent, + const chip::app::Clusters::CameraAvSettingsUserLevelManagement::Structs::MPTZPresetStruct::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = LogValue("PresetID", indent + 1, value.presetID); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'PresetID'"); + return err; + } + } + { + 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 'Name'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("Settings", indent + 1, value.settings); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Settings'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} + CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const chip::app::Clusters::Chime::Structs::ChimeSoundStruct::DecodableType & value) { @@ -18732,6 +18800,85 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP } break; } + case CameraAvSettingsUserLevelManagement::Id: { + switch (path.mAttributeId) + { + case CameraAvSettingsUserLevelManagement::Attributes::MPTZPosition::Id: { + chip::app::Clusters::CameraAvSettingsUserLevelManagement::Structs::MPTZStruct::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("MPTZPosition", 1, value); + } + case CameraAvSettingsUserLevelManagement::Attributes::MaxPresets::Id: { + uint8_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("MaxPresets", 1, value); + } + case CameraAvSettingsUserLevelManagement::Attributes::MPTZPresets::Id: { + chip::app::DataModel::DecodableList< + chip::app::Clusters::CameraAvSettingsUserLevelManagement::Structs::MPTZPresetStruct::DecodableType> + value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("MPTZPresets", 1, value); + } + case CameraAvSettingsUserLevelManagement::Attributes::DPTZRelativeMove::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("DPTZRelativeMove", 1, value); + } + case CameraAvSettingsUserLevelManagement::Attributes::ZoomMax::Id: { + uint8_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("ZoomMax", 1, value); + } + case CameraAvSettingsUserLevelManagement::Attributes::TiltMin::Id: { + int16_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("TiltMin", 1, value); + } + case CameraAvSettingsUserLevelManagement::Attributes::TiltMax::Id: { + int16_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("TiltMax", 1, value); + } + case CameraAvSettingsUserLevelManagement::Attributes::PanMin::Id: { + int16_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("PanMin", 1, value); + } + case CameraAvSettingsUserLevelManagement::Attributes::PanMax::Id: { + int16_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("PanMax", 1, value); + } + case CameraAvSettingsUserLevelManagement::Attributes::GeneratedCommandList::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, + CameraAvSettingsUserLevelManagement::Id); + } + case CameraAvSettingsUserLevelManagement::Attributes::AcceptedCommandList::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, CameraAvSettingsUserLevelManagement::Id); + } + case CameraAvSettingsUserLevelManagement::Attributes::AttributeList::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, CameraAvSettingsUserLevelManagement::Id); + } + case CameraAvSettingsUserLevelManagement::Attributes::FeatureMap::Id: { + uint32_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("FeatureMap", 1, value); + } + case CameraAvSettingsUserLevelManagement::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) { diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h index dd53dfabc6a6eb..95434280b5521f 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h @@ -455,6 +455,14 @@ 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::CameraAvSettingsUserLevelManagement::Structs::MPTZStruct::DecodableType & value); + +static CHIP_ERROR +LogValue(const char * label, size_t indent, + const chip::app::Clusters::CameraAvSettingsUserLevelManagement::Structs::MPTZPresetStruct::DecodableType & value); + static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::Chime::Structs::ChimeSoundStruct::DecodableType & value); diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.cpp b/zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.cpp index 3977ee180be1e2..1994301e279689 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.cpp @@ -263,6 +263,8 @@ char const * ClusterIdToText(chip::ClusterId id) return "ZoneManagement"; case chip::app::Clusters::CameraAvStreamManagement::Id: return "CameraAvStreamManagement"; + case chip::app::Clusters::CameraAvSettingsUserLevelManagement::Id: + return "CameraAvSettingsUserLevelManagement"; case chip::app::Clusters::WebRTCTransportProvider::Id: return "WebRTCTransportProvider"; case chip::app::Clusters::WebRTCTransportRequestor::Id: @@ -4265,6 +4267,41 @@ char const * AttributeIdToText(chip::ClusterId cluster, chip::AttributeId id) return "Unknown"; } } + case chip::app::Clusters::CameraAvSettingsUserLevelManagement::Id: { + switch (id) + { + case chip::app::Clusters::CameraAvSettingsUserLevelManagement::Attributes::MPTZPosition::Id: + return "MPTZPosition"; + case chip::app::Clusters::CameraAvSettingsUserLevelManagement::Attributes::MaxPresets::Id: + return "MaxPresets"; + case chip::app::Clusters::CameraAvSettingsUserLevelManagement::Attributes::MPTZPresets::Id: + return "MPTZPresets"; + case chip::app::Clusters::CameraAvSettingsUserLevelManagement::Attributes::DPTZRelativeMove::Id: + return "DPTZRelativeMove"; + case chip::app::Clusters::CameraAvSettingsUserLevelManagement::Attributes::ZoomMax::Id: + return "ZoomMax"; + case chip::app::Clusters::CameraAvSettingsUserLevelManagement::Attributes::TiltMin::Id: + return "TiltMin"; + case chip::app::Clusters::CameraAvSettingsUserLevelManagement::Attributes::TiltMax::Id: + return "TiltMax"; + case chip::app::Clusters::CameraAvSettingsUserLevelManagement::Attributes::PanMin::Id: + return "PanMin"; + case chip::app::Clusters::CameraAvSettingsUserLevelManagement::Attributes::PanMax::Id: + return "PanMax"; + case chip::app::Clusters::CameraAvSettingsUserLevelManagement::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::CameraAvSettingsUserLevelManagement::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::CameraAvSettingsUserLevelManagement::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::CameraAvSettingsUserLevelManagement::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::CameraAvSettingsUserLevelManagement::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } case chip::app::Clusters::WebRTCTransportProvider::Id: { switch (id) { @@ -5682,6 +5719,27 @@ char const * AcceptedCommandIdToText(chip::ClusterId cluster, chip::CommandId id return "Unknown"; } } + case chip::app::Clusters::CameraAvSettingsUserLevelManagement::Id: { + switch (id) + { + case chip::app::Clusters::CameraAvSettingsUserLevelManagement::Commands::MPTZSetPosition::Id: + return "MPTZSetPosition"; + case chip::app::Clusters::CameraAvSettingsUserLevelManagement::Commands::MPTZRelativeMove::Id: + return "MPTZRelativeMove"; + case chip::app::Clusters::CameraAvSettingsUserLevelManagement::Commands::MPTZMoveToPreset::Id: + return "MPTZMoveToPreset"; + case chip::app::Clusters::CameraAvSettingsUserLevelManagement::Commands::MPTZSavePreset::Id: + return "MPTZSavePreset"; + case chip::app::Clusters::CameraAvSettingsUserLevelManagement::Commands::MPTZRemovePreset::Id: + return "MPTZRemovePreset"; + case chip::app::Clusters::CameraAvSettingsUserLevelManagement::Commands::DPTZSetViewport::Id: + return "DPTZSetViewport"; + case chip::app::Clusters::CameraAvSettingsUserLevelManagement::Commands::DPTZRelativeMove::Id: + return "DPTZRelativeMove"; + 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 c16632f02fb3aa..2d61cb58b2f359 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h @@ -156,6 +156,7 @@ | ContentAppObserver | 0x0510 | | ZoneManagement | 0x0550 | | CameraAvStreamManagement | 0x0551 | +| CameraAvSettingsUserLevelManagement | 0x0552 | | WebRTCTransportProvider | 0x0553 | | WebRTCTransportRequestor | 0x0554 | | Chime | 0x0556 | @@ -154217,6 +154218,1701 @@ class SubscribeAttributeCameraAvStreamManagementClusterRevision : public Subscri } }; +#endif // MTR_ENABLE_PROVISIONAL +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL +/*----------------------------------------------------------------------------*\ +| Cluster CameraAvSettingsUserLevelManagement | 0x0552 | +|------------------------------------------------------------------------------| +| Commands: | | +| * MPTZSetPosition | 0x00 | +| * MPTZRelativeMove | 0x01 | +| * MPTZMoveToPreset | 0x02 | +| * MPTZSavePreset | 0x03 | +| * MPTZRemovePreset | 0x04 | +| * DPTZSetViewport | 0x05 | +| * DPTZRelativeMove | 0x06 | +|------------------------------------------------------------------------------| +| Attributes: | | +| * MPTZPosition | 0x0000 | +| * MaxPresets | 0x0001 | +| * MPTZPresets | 0x0002 | +| * DPTZRelativeMove | 0x0003 | +| * ZoomMax | 0x0004 | +| * TiltMin | 0x0005 | +| * TiltMax | 0x0006 | +| * PanMin | 0x0007 | +| * PanMax | 0x0008 | +| * GeneratedCommandList | 0xFFF8 | +| * AcceptedCommandList | 0xFFF9 | +| * AttributeList | 0xFFFB | +| * FeatureMap | 0xFFFC | +| * ClusterRevision | 0xFFFD | +|------------------------------------------------------------------------------| +| Events: | | +\*----------------------------------------------------------------------------*/ + +#if MTR_ENABLE_PROVISIONAL +/* + * Command MPTZSetPosition + */ +class CameraAvSettingsUserLevelManagementMPTZSetPosition : public ClusterCommand { +public: + CameraAvSettingsUserLevelManagementMPTZSetPosition() + : ClusterCommand("mptzset-position") + { +#if MTR_ENABLE_PROVISIONAL + AddArgument("Pan", INT16_MIN, INT16_MAX, &mRequest.pan); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("Tilt", INT16_MIN, INT16_MAX, &mRequest.tilt); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("Zoom", 0, UINT8_MAX, &mRequest.zoom); +#endif // MTR_ENABLE_PROVISIONAL + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvSettingsUserLevelManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::CameraAvSettingsUserLevelManagement::Commands::MPTZSetPosition::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 = [[MTRBaseClusterCameraAVSettingsUserLevelManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRCameraAVSettingsUserLevelManagementClusterMPTZSetPositionParams alloc] init]; + params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; +#if MTR_ENABLE_PROVISIONAL + if (mRequest.pan.HasValue()) { + params.pan = [NSNumber numberWithShort:mRequest.pan.Value()]; + } else { + params.pan = nil; + } +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + if (mRequest.tilt.HasValue()) { + params.tilt = [NSNumber numberWithShort:mRequest.tilt.Value()]; + } else { + params.tilt = nil; + } +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + if (mRequest.zoom.HasValue()) { + params.zoom = [NSNumber numberWithUnsignedChar:mRequest.zoom.Value()]; + } else { + params.zoom = nil; + } +#endif // MTR_ENABLE_PROVISIONAL + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster MPTZSetPositionWithParams: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::CameraAvSettingsUserLevelManagement::Commands::MPTZSetPosition::Type mRequest; +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL +/* + * Command MPTZRelativeMove + */ +class CameraAvSettingsUserLevelManagementMPTZRelativeMove : public ClusterCommand { +public: + CameraAvSettingsUserLevelManagementMPTZRelativeMove() + : ClusterCommand("mptzrelative-move") + { +#if MTR_ENABLE_PROVISIONAL + AddArgument("PanDelta", INT16_MIN, INT16_MAX, &mRequest.panDelta); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("TiltDelta", INT16_MIN, INT16_MAX, &mRequest.tiltDelta); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("ZoomDelta", INT8_MIN, INT8_MAX, &mRequest.zoomDelta); +#endif // MTR_ENABLE_PROVISIONAL + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvSettingsUserLevelManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::CameraAvSettingsUserLevelManagement::Commands::MPTZRelativeMove::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 = [[MTRBaseClusterCameraAVSettingsUserLevelManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRCameraAVSettingsUserLevelManagementClusterMPTZRelativeMoveParams alloc] init]; + params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; +#if MTR_ENABLE_PROVISIONAL + if (mRequest.panDelta.HasValue()) { + params.panDelta = [NSNumber numberWithShort:mRequest.panDelta.Value()]; + } else { + params.panDelta = nil; + } +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + if (mRequest.tiltDelta.HasValue()) { + params.tiltDelta = [NSNumber numberWithShort:mRequest.tiltDelta.Value()]; + } else { + params.tiltDelta = nil; + } +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + if (mRequest.zoomDelta.HasValue()) { + params.zoomDelta = [NSNumber numberWithChar:mRequest.zoomDelta.Value()]; + } else { + params.zoomDelta = nil; + } +#endif // MTR_ENABLE_PROVISIONAL + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster MPTZRelativeMoveWithParams: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::CameraAvSettingsUserLevelManagement::Commands::MPTZRelativeMove::Type mRequest; +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL +/* + * Command MPTZMoveToPreset + */ +class CameraAvSettingsUserLevelManagementMPTZMoveToPreset : public ClusterCommand { +public: + CameraAvSettingsUserLevelManagementMPTZMoveToPreset() + : ClusterCommand("mptzmove-to-preset") + { +#if MTR_ENABLE_PROVISIONAL + AddArgument("PresetID", 0, UINT8_MAX, &mRequest.presetID); +#endif // MTR_ENABLE_PROVISIONAL + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvSettingsUserLevelManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::CameraAvSettingsUserLevelManagement::Commands::MPTZMoveToPreset::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 = [[MTRBaseClusterCameraAVSettingsUserLevelManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRCameraAVSettingsUserLevelManagementClusterMPTZMoveToPresetParams alloc] init]; + params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; +#if MTR_ENABLE_PROVISIONAL + params.presetID = [NSNumber numberWithUnsignedChar:mRequest.presetID]; +#endif // MTR_ENABLE_PROVISIONAL + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster MPTZMoveToPresetWithParams: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::CameraAvSettingsUserLevelManagement::Commands::MPTZMoveToPreset::Type mRequest; +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL +/* + * Command MPTZSavePreset + */ +class CameraAvSettingsUserLevelManagementMPTZSavePreset : public ClusterCommand { +public: + CameraAvSettingsUserLevelManagementMPTZSavePreset() + : ClusterCommand("mptzsave-preset") + { +#if MTR_ENABLE_PROVISIONAL + AddArgument("PresetID", 0, UINT8_MAX, &mRequest.presetID); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("Name", &mRequest.name); +#endif // MTR_ENABLE_PROVISIONAL + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvSettingsUserLevelManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::CameraAvSettingsUserLevelManagement::Commands::MPTZSavePreset::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 = [[MTRBaseClusterCameraAVSettingsUserLevelManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRCameraAVSettingsUserLevelManagementClusterMPTZSavePresetParams alloc] init]; + params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; +#if MTR_ENABLE_PROVISIONAL + if (mRequest.presetID.HasValue()) { + params.presetID = [NSNumber numberWithUnsignedChar:mRequest.presetID.Value()]; + } else { + params.presetID = nil; + } +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + params.name = [[NSString alloc] initWithBytes:mRequest.name.data() length:mRequest.name.size() encoding:NSUTF8StringEncoding]; +#endif // MTR_ENABLE_PROVISIONAL + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster MPTZSavePresetWithParams: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::CameraAvSettingsUserLevelManagement::Commands::MPTZSavePreset::Type mRequest; +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL +/* + * Command MPTZRemovePreset + */ +class CameraAvSettingsUserLevelManagementMPTZRemovePreset : public ClusterCommand { +public: + CameraAvSettingsUserLevelManagementMPTZRemovePreset() + : ClusterCommand("mptzremove-preset") + { +#if MTR_ENABLE_PROVISIONAL + AddArgument("PresetID", 0, UINT8_MAX, &mRequest.presetID); +#endif // MTR_ENABLE_PROVISIONAL + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvSettingsUserLevelManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::CameraAvSettingsUserLevelManagement::Commands::MPTZRemovePreset::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 = [[MTRBaseClusterCameraAVSettingsUserLevelManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRCameraAVSettingsUserLevelManagementClusterMPTZRemovePresetParams alloc] init]; + params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; +#if MTR_ENABLE_PROVISIONAL + params.presetID = [NSNumber numberWithUnsignedChar:mRequest.presetID]; +#endif // MTR_ENABLE_PROVISIONAL + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster MPTZRemovePresetWithParams: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::CameraAvSettingsUserLevelManagement::Commands::MPTZRemovePreset::Type mRequest; +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL +/* + * Command DPTZSetViewport + */ +class CameraAvSettingsUserLevelManagementDPTZSetViewport : public ClusterCommand { +public: + CameraAvSettingsUserLevelManagementDPTZSetViewport() + : ClusterCommand("dptzset-viewport") + , mComplex_Viewport(&mRequest.viewport) + { +#if MTR_ENABLE_PROVISIONAL + AddArgument("VideoStreamID", 0, UINT16_MAX, &mRequest.videoStreamID); +#endif // MTR_ENABLE_PROVISIONAL +#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::CameraAvSettingsUserLevelManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::CameraAvSettingsUserLevelManagement::Commands::DPTZSetViewport::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 = [[MTRBaseClusterCameraAVSettingsUserLevelManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRCameraAVSettingsUserLevelManagementClusterDPTZSetViewportParams 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.viewport = [MTRCameraAVSettingsUserLevelManagementClusterViewportStruct 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 DPTZSetViewportWithParams: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::CameraAvSettingsUserLevelManagement::Commands::DPTZSetViewport::Type mRequest; + TypedComplexArgument mComplex_Viewport; +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL +/* + * Command DPTZRelativeMove + */ +class CameraAvSettingsUserLevelManagementDPTZRelativeMove : public ClusterCommand { +public: + CameraAvSettingsUserLevelManagementDPTZRelativeMove() + : ClusterCommand("dptzrelative-move") + { +#if MTR_ENABLE_PROVISIONAL + AddArgument("VideoStreamID", 0, UINT16_MAX, &mRequest.videoStreamID); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("DeltaX", INT16_MIN, INT16_MAX, &mRequest.deltaX); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("DeltaY", INT16_MIN, INT16_MAX, &mRequest.deltaY); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("ZoomDelta", INT8_MIN, INT8_MAX, &mRequest.zoomDelta); +#endif // MTR_ENABLE_PROVISIONAL + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvSettingsUserLevelManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::CameraAvSettingsUserLevelManagement::Commands::DPTZRelativeMove::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 = [[MTRBaseClusterCameraAVSettingsUserLevelManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRCameraAVSettingsUserLevelManagementClusterDPTZRelativeMoveParams 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 + if (mRequest.deltaX.HasValue()) { + params.deltaX = [NSNumber numberWithShort:mRequest.deltaX.Value()]; + } else { + params.deltaX = nil; + } +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + if (mRequest.deltaY.HasValue()) { + params.deltaY = [NSNumber numberWithShort:mRequest.deltaY.Value()]; + } else { + params.deltaY = nil; + } +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + if (mRequest.zoomDelta.HasValue()) { + params.zoomDelta = [NSNumber numberWithChar:mRequest.zoomDelta.Value()]; + } else { + params.zoomDelta = nil; + } +#endif // MTR_ENABLE_PROVISIONAL + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster DPTZRelativeMoveWithParams: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::CameraAvSettingsUserLevelManagement::Commands::DPTZRelativeMove::Type mRequest; +}; + +#endif // MTR_ENABLE_PROVISIONAL + +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute MPTZPosition + */ +class ReadCameraAvSettingsUserLevelManagementMPTZPosition : public ReadAttribute { +public: + ReadCameraAvSettingsUserLevelManagementMPTZPosition() + : ReadAttribute("mptzposition") + { + } + + ~ReadCameraAvSettingsUserLevelManagementMPTZPosition() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvSettingsUserLevelManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvSettingsUserLevelManagement::Attributes::MPTZPosition::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 = [[MTRBaseClusterCameraAVSettingsUserLevelManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeMPTZPositionWithCompletion:^(MTRCameraAVSettingsUserLevelManagementClusterMPTZStruct * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVSettingsUserLevelManagement.MPTZPosition response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVSettingsUserLevelManagement MPTZPosition read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeCameraAvSettingsUserLevelManagementMPTZPosition : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvSettingsUserLevelManagementMPTZPosition() + : SubscribeAttribute("mptzposition") + { + } + + ~SubscribeAttributeCameraAvSettingsUserLevelManagementMPTZPosition() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvSettingsUserLevelManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvSettingsUserLevelManagement::Attributes::MPTZPosition::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 = [[MTRBaseClusterCameraAVSettingsUserLevelManagement 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 subscribeAttributeMPTZPositionWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(MTRCameraAVSettingsUserLevelManagementClusterMPTZStruct * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVSettingsUserLevelManagement.MPTZPosition 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 MaxPresets + */ +class ReadCameraAvSettingsUserLevelManagementMaxPresets : public ReadAttribute { +public: + ReadCameraAvSettingsUserLevelManagementMaxPresets() + : ReadAttribute("max-presets") + { + } + + ~ReadCameraAvSettingsUserLevelManagementMaxPresets() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvSettingsUserLevelManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvSettingsUserLevelManagement::Attributes::MaxPresets::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 = [[MTRBaseClusterCameraAVSettingsUserLevelManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeMaxPresetsWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVSettingsUserLevelManagement.MaxPresets response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVSettingsUserLevelManagement MaxPresets read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeCameraAvSettingsUserLevelManagementMaxPresets : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvSettingsUserLevelManagementMaxPresets() + : SubscribeAttribute("max-presets") + { + } + + ~SubscribeAttributeCameraAvSettingsUserLevelManagementMaxPresets() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvSettingsUserLevelManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvSettingsUserLevelManagement::Attributes::MaxPresets::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 = [[MTRBaseClusterCameraAVSettingsUserLevelManagement 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 subscribeAttributeMaxPresetsWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVSettingsUserLevelManagement.MaxPresets 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 MPTZPresets + */ +class ReadCameraAvSettingsUserLevelManagementMPTZPresets : public ReadAttribute { +public: + ReadCameraAvSettingsUserLevelManagementMPTZPresets() + : ReadAttribute("mptzpresets") + { + } + + ~ReadCameraAvSettingsUserLevelManagementMPTZPresets() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvSettingsUserLevelManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvSettingsUserLevelManagement::Attributes::MPTZPresets::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 = [[MTRBaseClusterCameraAVSettingsUserLevelManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeMPTZPresetsWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVSettingsUserLevelManagement.MPTZPresets response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVSettingsUserLevelManagement MPTZPresets read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeCameraAvSettingsUserLevelManagementMPTZPresets : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvSettingsUserLevelManagementMPTZPresets() + : SubscribeAttribute("mptzpresets") + { + } + + ~SubscribeAttributeCameraAvSettingsUserLevelManagementMPTZPresets() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvSettingsUserLevelManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvSettingsUserLevelManagement::Attributes::MPTZPresets::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 = [[MTRBaseClusterCameraAVSettingsUserLevelManagement 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 subscribeAttributeMPTZPresetsWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVSettingsUserLevelManagement.MPTZPresets 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 DPTZRelativeMove + */ +class ReadCameraAvSettingsUserLevelManagementDPTZRelativeMove : public ReadAttribute { +public: + ReadCameraAvSettingsUserLevelManagementDPTZRelativeMove() + : ReadAttribute("dptzrelative-move") + { + } + + ~ReadCameraAvSettingsUserLevelManagementDPTZRelativeMove() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvSettingsUserLevelManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvSettingsUserLevelManagement::Attributes::DPTZRelativeMove::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 = [[MTRBaseClusterCameraAVSettingsUserLevelManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeDPTZRelativeMoveWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVSettingsUserLevelManagement.DPTZRelativeMove response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVSettingsUserLevelManagement DPTZRelativeMove read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeCameraAvSettingsUserLevelManagementDPTZRelativeMove : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvSettingsUserLevelManagementDPTZRelativeMove() + : SubscribeAttribute("dptzrelative-move") + { + } + + ~SubscribeAttributeCameraAvSettingsUserLevelManagementDPTZRelativeMove() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvSettingsUserLevelManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvSettingsUserLevelManagement::Attributes::DPTZRelativeMove::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 = [[MTRBaseClusterCameraAVSettingsUserLevelManagement 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 subscribeAttributeDPTZRelativeMoveWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVSettingsUserLevelManagement.DPTZRelativeMove 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 ZoomMax + */ +class ReadCameraAvSettingsUserLevelManagementZoomMax : public ReadAttribute { +public: + ReadCameraAvSettingsUserLevelManagementZoomMax() + : ReadAttribute("zoom-max") + { + } + + ~ReadCameraAvSettingsUserLevelManagementZoomMax() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvSettingsUserLevelManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvSettingsUserLevelManagement::Attributes::ZoomMax::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 = [[MTRBaseClusterCameraAVSettingsUserLevelManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeZoomMaxWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVSettingsUserLevelManagement.ZoomMax response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVSettingsUserLevelManagement ZoomMax read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeCameraAvSettingsUserLevelManagementZoomMax : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvSettingsUserLevelManagementZoomMax() + : SubscribeAttribute("zoom-max") + { + } + + ~SubscribeAttributeCameraAvSettingsUserLevelManagementZoomMax() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvSettingsUserLevelManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvSettingsUserLevelManagement::Attributes::ZoomMax::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 = [[MTRBaseClusterCameraAVSettingsUserLevelManagement 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 subscribeAttributeZoomMaxWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVSettingsUserLevelManagement.ZoomMax 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 TiltMin + */ +class ReadCameraAvSettingsUserLevelManagementTiltMin : public ReadAttribute { +public: + ReadCameraAvSettingsUserLevelManagementTiltMin() + : ReadAttribute("tilt-min") + { + } + + ~ReadCameraAvSettingsUserLevelManagementTiltMin() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvSettingsUserLevelManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvSettingsUserLevelManagement::Attributes::TiltMin::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 = [[MTRBaseClusterCameraAVSettingsUserLevelManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeTiltMinWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVSettingsUserLevelManagement.TiltMin response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVSettingsUserLevelManagement TiltMin read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeCameraAvSettingsUserLevelManagementTiltMin : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvSettingsUserLevelManagementTiltMin() + : SubscribeAttribute("tilt-min") + { + } + + ~SubscribeAttributeCameraAvSettingsUserLevelManagementTiltMin() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvSettingsUserLevelManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvSettingsUserLevelManagement::Attributes::TiltMin::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 = [[MTRBaseClusterCameraAVSettingsUserLevelManagement 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 subscribeAttributeTiltMinWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVSettingsUserLevelManagement.TiltMin 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 TiltMax + */ +class ReadCameraAvSettingsUserLevelManagementTiltMax : public ReadAttribute { +public: + ReadCameraAvSettingsUserLevelManagementTiltMax() + : ReadAttribute("tilt-max") + { + } + + ~ReadCameraAvSettingsUserLevelManagementTiltMax() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvSettingsUserLevelManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvSettingsUserLevelManagement::Attributes::TiltMax::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 = [[MTRBaseClusterCameraAVSettingsUserLevelManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeTiltMaxWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVSettingsUserLevelManagement.TiltMax response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVSettingsUserLevelManagement TiltMax read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeCameraAvSettingsUserLevelManagementTiltMax : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvSettingsUserLevelManagementTiltMax() + : SubscribeAttribute("tilt-max") + { + } + + ~SubscribeAttributeCameraAvSettingsUserLevelManagementTiltMax() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvSettingsUserLevelManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvSettingsUserLevelManagement::Attributes::TiltMax::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 = [[MTRBaseClusterCameraAVSettingsUserLevelManagement 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 subscribeAttributeTiltMaxWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVSettingsUserLevelManagement.TiltMax 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 PanMin + */ +class ReadCameraAvSettingsUserLevelManagementPanMin : public ReadAttribute { +public: + ReadCameraAvSettingsUserLevelManagementPanMin() + : ReadAttribute("pan-min") + { + } + + ~ReadCameraAvSettingsUserLevelManagementPanMin() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvSettingsUserLevelManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvSettingsUserLevelManagement::Attributes::PanMin::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 = [[MTRBaseClusterCameraAVSettingsUserLevelManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributePanMinWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVSettingsUserLevelManagement.PanMin response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVSettingsUserLevelManagement PanMin read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeCameraAvSettingsUserLevelManagementPanMin : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvSettingsUserLevelManagementPanMin() + : SubscribeAttribute("pan-min") + { + } + + ~SubscribeAttributeCameraAvSettingsUserLevelManagementPanMin() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvSettingsUserLevelManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvSettingsUserLevelManagement::Attributes::PanMin::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 = [[MTRBaseClusterCameraAVSettingsUserLevelManagement 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 subscribeAttributePanMinWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVSettingsUserLevelManagement.PanMin 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 PanMax + */ +class ReadCameraAvSettingsUserLevelManagementPanMax : public ReadAttribute { +public: + ReadCameraAvSettingsUserLevelManagementPanMax() + : ReadAttribute("pan-max") + { + } + + ~ReadCameraAvSettingsUserLevelManagementPanMax() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvSettingsUserLevelManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvSettingsUserLevelManagement::Attributes::PanMax::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 = [[MTRBaseClusterCameraAVSettingsUserLevelManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributePanMaxWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVSettingsUserLevelManagement.PanMax response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVSettingsUserLevelManagement PanMax read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeCameraAvSettingsUserLevelManagementPanMax : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvSettingsUserLevelManagementPanMax() + : SubscribeAttribute("pan-max") + { + } + + ~SubscribeAttributeCameraAvSettingsUserLevelManagementPanMax() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvSettingsUserLevelManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvSettingsUserLevelManagement::Attributes::PanMax::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 = [[MTRBaseClusterCameraAVSettingsUserLevelManagement 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 subscribeAttributePanMaxWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVSettingsUserLevelManagement.PanMax 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 ReadCameraAvSettingsUserLevelManagementGeneratedCommandList : public ReadAttribute { +public: + ReadCameraAvSettingsUserLevelManagementGeneratedCommandList() + : ReadAttribute("generated-command-list") + { + } + + ~ReadCameraAvSettingsUserLevelManagementGeneratedCommandList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvSettingsUserLevelManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvSettingsUserLevelManagement::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 = [[MTRBaseClusterCameraAVSettingsUserLevelManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVSettingsUserLevelManagement.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVSettingsUserLevelManagement GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeCameraAvSettingsUserLevelManagementGeneratedCommandList : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvSettingsUserLevelManagementGeneratedCommandList() + : SubscribeAttribute("generated-command-list") + { + } + + ~SubscribeAttributeCameraAvSettingsUserLevelManagementGeneratedCommandList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvSettingsUserLevelManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvSettingsUserLevelManagement::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 = [[MTRBaseClusterCameraAVSettingsUserLevelManagement 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(@"CameraAVSettingsUserLevelManagement.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 ReadCameraAvSettingsUserLevelManagementAcceptedCommandList : public ReadAttribute { +public: + ReadCameraAvSettingsUserLevelManagementAcceptedCommandList() + : ReadAttribute("accepted-command-list") + { + } + + ~ReadCameraAvSettingsUserLevelManagementAcceptedCommandList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvSettingsUserLevelManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvSettingsUserLevelManagement::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 = [[MTRBaseClusterCameraAVSettingsUserLevelManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVSettingsUserLevelManagement.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVSettingsUserLevelManagement AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeCameraAvSettingsUserLevelManagementAcceptedCommandList : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvSettingsUserLevelManagementAcceptedCommandList() + : SubscribeAttribute("accepted-command-list") + { + } + + ~SubscribeAttributeCameraAvSettingsUserLevelManagementAcceptedCommandList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvSettingsUserLevelManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvSettingsUserLevelManagement::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 = [[MTRBaseClusterCameraAVSettingsUserLevelManagement 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(@"CameraAVSettingsUserLevelManagement.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute AttributeList + */ +class ReadCameraAvSettingsUserLevelManagementAttributeList : public ReadAttribute { +public: + ReadCameraAvSettingsUserLevelManagementAttributeList() + : ReadAttribute("attribute-list") + { + } + + ~ReadCameraAvSettingsUserLevelManagementAttributeList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvSettingsUserLevelManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvSettingsUserLevelManagement::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 = [[MTRBaseClusterCameraAVSettingsUserLevelManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVSettingsUserLevelManagement.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVSettingsUserLevelManagement AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeCameraAvSettingsUserLevelManagementAttributeList : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvSettingsUserLevelManagementAttributeList() + : SubscribeAttribute("attribute-list") + { + } + + ~SubscribeAttributeCameraAvSettingsUserLevelManagementAttributeList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvSettingsUserLevelManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvSettingsUserLevelManagement::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 = [[MTRBaseClusterCameraAVSettingsUserLevelManagement 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(@"CameraAVSettingsUserLevelManagement.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 ReadCameraAvSettingsUserLevelManagementFeatureMap : public ReadAttribute { +public: + ReadCameraAvSettingsUserLevelManagementFeatureMap() + : ReadAttribute("feature-map") + { + } + + ~ReadCameraAvSettingsUserLevelManagementFeatureMap() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvSettingsUserLevelManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvSettingsUserLevelManagement::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 = [[MTRBaseClusterCameraAVSettingsUserLevelManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVSettingsUserLevelManagement.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVSettingsUserLevelManagement FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeCameraAvSettingsUserLevelManagementFeatureMap : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvSettingsUserLevelManagementFeatureMap() + : SubscribeAttribute("feature-map") + { + } + + ~SubscribeAttributeCameraAvSettingsUserLevelManagementFeatureMap() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvSettingsUserLevelManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvSettingsUserLevelManagement::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 = [[MTRBaseClusterCameraAVSettingsUserLevelManagement 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(@"CameraAVSettingsUserLevelManagement.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 ReadCameraAvSettingsUserLevelManagementClusterRevision : public ReadAttribute { +public: + ReadCameraAvSettingsUserLevelManagementClusterRevision() + : ReadAttribute("cluster-revision") + { + } + + ~ReadCameraAvSettingsUserLevelManagementClusterRevision() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvSettingsUserLevelManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvSettingsUserLevelManagement::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 = [[MTRBaseClusterCameraAVSettingsUserLevelManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVSettingsUserLevelManagement.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVSettingsUserLevelManagement ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeCameraAvSettingsUserLevelManagementClusterRevision : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvSettingsUserLevelManagementClusterRevision() + : SubscribeAttribute("cluster-revision") + { + } + + ~SubscribeAttributeCameraAvSettingsUserLevelManagementClusterRevision() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvSettingsUserLevelManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvSettingsUserLevelManagement::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 = [[MTRBaseClusterCameraAVSettingsUserLevelManagement 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(@"CameraAVSettingsUserLevelManagement.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 @@ -178957,6 +180653,100 @@ void registerClusterCameraAvStreamManagement(Commands & commands) commands.RegisterCluster(clusterName, clusterCommands); #endif // MTR_ENABLE_PROVISIONAL } +void registerClusterCameraAvSettingsUserLevelManagement(Commands & commands) +{ +#if MTR_ENABLE_PROVISIONAL + using namespace chip::app::Clusters::CameraAvSettingsUserLevelManagement; + + const char * clusterName = "CameraAvSettingsUserLevelManagement"; + + 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 + 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 + }; + + commands.RegisterCluster(clusterName, clusterCommands); +#endif // MTR_ENABLE_PROVISIONAL +} void registerClusterWebRTCTransportProvider(Commands & commands) { #if MTR_ENABLE_PROVISIONAL @@ -179746,6 +181536,7 @@ void registerClusters(Commands & commands) registerClusterContentAppObserver(commands); registerClusterZoneManagement(commands); registerClusterCameraAvStreamManagement(commands); + registerClusterCameraAvSettingsUserLevelManagement(commands); registerClusterWebRTCTransportProvider(commands); registerClusterWebRTCTransportRequestor(commands); registerClusterChime(commands);