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