diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml
index d11f9f732370b0..a84e8639f703a7 100644
--- a/.github/workflows/tests.yaml
+++ b/.github/workflows/tests.yaml
@@ -210,6 +210,7 @@ jobs:
src/app/zap-templates/zcl/data-model/chip/sample-mei-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/electrical-energy-measurement-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/electrical-power-measurement-cluster.xml \
+ src/app/zap-templates/zcl/data-model/chip/zone-management-cluster.xml \
"
- name: Build Apps
run: |
diff --git a/docs/zap_clusters.md b/docs/zap_clusters.md
index 5803545d3e9533..84ca34a74d95fd 100644
--- a/docs/zap_clusters.md
+++ b/docs/zap_clusters.md
@@ -129,6 +129,7 @@ Generally regenerate using one of:
| 1294 | 0x50E | AccountLogin |
| 1295 | 0x50F | ContentControl |
| 1296 | 0x510 | ContentAppObserver |
+| 1360 | 0x550 | ZoneManagement |
| 1363 | 0x553 | WebRTCTransportProvider |
| 1364 | 0x554 | WebRTCTransportRequestor |
| 1366 | 0x556 | Chime |
diff --git a/scripts/rules.matterlint b/scripts/rules.matterlint
index b7ce7ef97541de..69715eea87efd2 100644
--- a/scripts/rules.matterlint
+++ b/scripts/rules.matterlint
@@ -120,6 +120,7 @@ load "../src/app/zap-templates/zcl/data-model/chip/resource-monitoring-cluster.x
load "../src/app/zap-templates/zcl/data-model/chip/sample-mei-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/electrical-energy-measurement-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/electrical-power-measurement-cluster.xml";
+load "../src/app/zap-templates/zcl/data-model/chip/zone-management-cluster.xml";
all endpoints {
// These attributes follow a different code path and do not have to be
diff --git a/src/app/zap-templates/zcl/data-model/chip/zone-management-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/zone-management-cluster.xml
new file mode 100644
index 00000000000000..27a947b5610015
--- /dev/null
+++ b/src/app/zap-templates/zcl/data-model/chip/zone-management-cluster.xml
@@ -0,0 +1,155 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Zone Management
+ 0x0550
+ ZONE_MANAGEMENT_CLUSTER
+ This cluster provides an interface to manage regions of interest, or Zones, which can be either manufacturer or user defined.
+ true
+
+
+
+
+
+ true
+
+ SupportedZoneSources
+ Zones
+ TimeControl
+ Sensitivity
+
+ This command SHALL create and store a TwoD Cartesian Zone.
+
+
+
+
+
+
+
+
+
+
+ The UpdateTwoDCartesianZone SHALL update a stored TwoD Cartesian Zone.
+
+
+
+
+
+
+ The GetTwoDCartesianZone SHALL return the TwoD Cartesian Zone for the passed in ZoneID.
+
+
+
+
+
+ This command SHALL be generated in response to a GetTwoDCartesianZone command.
+
+
+
+
+ This command SHALL remove the Zone mapped to the passed in ZoneID.
+
+
+
+
+
+
+
+ This event SHALL be generated when a Zone is first triggered.
+
+
+
+
+
+ This event SHALL be generated when either when the TriggerDetectedDuration value is exceeded by the TimeSinceInitialTrigger value or when the MaxDuration value is exceeded by the TimeSinceInitialTrigger value as described in ZoneTriggeringTimeControlStruct.
+
+
+
+
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 61d46b64537a51..b78abba2397fb0 100644
--- a/src/app/zap-templates/zcl/zcl-with-test-extensions.json
+++ b/src/app/zap-templates/zcl/zcl-with-test-extensions.json
@@ -140,7 +140,8 @@
"sample-mei-cluster.xml",
"types/door-lock.xml",
"types/occupancy-sensing.xml",
- "types/thermostat-user-interface-configuration.xml"
+ "types/thermostat-user-interface-configuration.xml",
+ "zone-management-cluster.xml"
],
"manufacturersXml": "../../../../src/app/zap-templates/zcl/data-model/manufacturers.xml",
"options": {
diff --git a/src/app/zap-templates/zcl/zcl.json b/src/app/zap-templates/zcl/zcl.json
index f4e04ef1f2c830..ba95e57f639a62 100644
--- a/src/app/zap-templates/zcl/zcl.json
+++ b/src/app/zap-templates/zcl/zcl.json
@@ -134,7 +134,8 @@
"sample-mei-cluster.xml",
"types/door-lock.xml",
"types/occupancy-sensing.xml",
- "types/thermostat-user-interface-configuration.xml"
+ "types/thermostat-user-interface-configuration.xml",
+ "zone-management-cluster.xml"
],
"manufacturersXml": "../../../../src/app/zap-templates/zcl/data-model/manufacturers.xml",
"options": {
diff --git a/src/app/zap_cluster_list.json b/src/app/zap_cluster_list.json
index aab95321afc639..d4c4801058415c 100644
--- a/src/app/zap_cluster_list.json
+++ b/src/app/zap_cluster_list.json
@@ -134,7 +134,8 @@
"WEB_RTC_PROVIDER_CLUSTER": [],
"WEBRTC_REQUESTOR_CLUSTER": [],
"WIFI_NETWORK_DIAGNOSTICS_CLUSTER": [],
- "WINDOW_COVERING_CLUSTER": []
+ "WINDOW_COVERING_CLUSTER": [],
+ "ZONE_MANAGEMENT_CLUSTER": []
},
"ServerDirectories": {
"ACCESS_CONTROL_CLUSTER": ["access-control-server"],
@@ -318,6 +319,7 @@
"WIFI_NETWORK_MANAGEMENT_CLUSTER": ["wifi-network-management-server"],
"WINDOW_COVERING_CLUSTER": ["window-covering-server"],
"WATER_HEATER_MANAGEMENT_CLUSTER": ["water-heater-management-server"],
- "WATER_HEATER_MODE_CLUSTER": ["mode-base-server"]
+ "WATER_HEATER_MODE_CLUSTER": ["mode-base-server"],
+ "ZONE_MANAGEMENT_CLUSTER": []
}
}
diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter
index 07b98b17953af9..f04be5c4d66f1a 100644
--- a/src/controller/data_model/controller-clusters.matter
+++ b/src/controller/data_model/controller-clusters.matter
@@ -9416,6 +9416,124 @@ provisional cluster ContentAppObserver = 1296 {
command ContentAppMessage(ContentAppMessageRequest): ContentAppMessageResponse = 0;
}
+/** This cluster provides an interface to manage regions of interest, or Zones, which can be either manufacturer or user defined. */
+provisional cluster ZoneManagement = 1360 {
+ revision 1;
+
+ enum StatusCodeEnum : enum8 {
+ kZoneNotFound = 2;
+ kZoneInUse = 3;
+ }
+
+ enum ZoneEventStoppedReasonEnum : enum8 {
+ kActionStopped = 0;
+ kTimeout = 1;
+ }
+
+ enum ZoneEventTriggeredReasonEnum : enum8 {
+ kMotion = 0;
+ }
+
+ enum ZoneSourceEnum : enum8 {
+ kMfg = 0;
+ kUser = 1;
+ }
+
+ enum ZoneTypeEnum : enum8 {
+ kTwoDCARTZone = 0;
+ }
+
+ enum ZoneUseEnum : enum8 {
+ kMotion = 0;
+ kPrivacy = 1;
+ kFocus = 2;
+ }
+
+ bitmap Feature : bitmap32 {
+ kTwoDimensionalCartesianZone = 0x1;
+ }
+
+ struct TwoDCartesianVertexStruct {
+ int16u x = 0;
+ int16u y = 1;
+ }
+
+ struct TwoDCartesianZoneStruct {
+ char_string<16> name = 0;
+ ZoneUseEnum use = 1;
+ TwoDCartesianVertexStruct vertices[] = 2;
+ optional char_string<9> color = 3;
+ }
+
+ struct ZoneInformationStruct {
+ int16u zoneID = 0;
+ ZoneTypeEnum zoneType = 1;
+ ZoneSourceEnum zoneSource = 2;
+ }
+
+ struct ZoneTriggeringTimeControlStruct {
+ int16u initialDuration = 0;
+ int16u augmentationDuration = 1;
+ elapsed_s maxDuration = 2;
+ int16u blindDuration = 3;
+ }
+
+ info event ZoneTriggered = 0 {
+ int16u zones[] = 0;
+ ZoneEventTriggeredReasonEnum reason = 1;
+ }
+
+ info event ZoneStopped = 1 {
+ int16u zones[] = 0;
+ ZoneEventStoppedReasonEnum reason = 1;
+ }
+
+ readonly attribute ZoneSourceEnum supportedZoneSources[] = 0;
+ readonly attribute optional ZoneInformationStruct zones[] = 1;
+ attribute ZoneTriggeringTimeControlStruct timeControl[] = 2;
+ attribute int8u sensitivity = 3;
+ 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 CreateTwoDCartesianZoneRequest {
+ TwoDCartesianZoneStruct zone = 0;
+ }
+
+ response struct CreateTwoDCartesianZoneResponse = 1 {
+ int16u zoneID = 0;
+ }
+
+ request struct UpdateTwoDCartesianZoneRequest {
+ int16u zoneID = 0;
+ TwoDCartesianZoneStruct zone = 1;
+ }
+
+ request struct GetTwoDCartesianZoneRequest {
+ optional nullable int16u zoneID = 0;
+ }
+
+ response struct GetTwoDCartesianZoneResponse = 4 {
+ TwoDCartesianZoneStruct zones[] = 0;
+ }
+
+ request struct RemoveZoneRequest {
+ int16u zoneID = 0;
+ }
+
+ /** This command SHALL create and store a TwoD Cartesian Zone. */
+ command access(invoke: manage) CreateTwoDCartesianZone(CreateTwoDCartesianZoneRequest): CreateTwoDCartesianZoneResponse = 0;
+ /** The UpdateTwoDCartesianZone SHALL update a stored TwoD Cartesian Zone. */
+ command access(invoke: manage) UpdateTwoDCartesianZone(UpdateTwoDCartesianZoneRequest): DefaultSuccess = 2;
+ /** The GetTwoDCartesianZone SHALL return the TwoD Cartesian Zone for the passed in ZoneID. */
+ command access(invoke: manage) GetTwoDCartesianZone(GetTwoDCartesianZoneRequest): GetTwoDCartesianZoneResponse = 3;
+ /** This command SHALL remove the Zone mapped to the passed in ZoneID. */
+ command access(invoke: manage) RemoveZone(RemoveZoneRequest): DefaultSuccess = 5;
+}
+
/** The WebRTC transport provider cluster provides a way for stream providers (e.g. Cameras) to stream or receive their data through WebRTC. */
provisional cluster WebRTCTransportProvider = 1363 {
revision 1;
diff --git a/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java b/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java
index 4104a75abb3fa5..fb50bee24febd2 100644
--- a/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java
+++ b/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java
@@ -59518,6 +59518,449 @@ public void onSuccess(byte[] tlv) {
}
}
+ public static class ZoneManagementCluster extends BaseChipCluster {
+ public static final long CLUSTER_ID = 1360L;
+
+ private static final long SUPPORTED_ZONE_SOURCES_ATTRIBUTE_ID = 0L;
+ private static final long ZONES_ATTRIBUTE_ID = 1L;
+ private static final long TIME_CONTROL_ATTRIBUTE_ID = 2L;
+ private static final long SENSITIVITY_ATTRIBUTE_ID = 3L;
+ 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 ZoneManagementCluster(long devicePtr, int endpointId) {
+ super(devicePtr, endpointId, CLUSTER_ID);
+ }
+
+ @Override
+ @Deprecated
+ public long initWithDevice(long devicePtr, int endpointId) {
+ return 0L;
+ }
+
+ public void createTwoDCartesianZone(CreateTwoDCartesianZoneResponseCallback callback, ChipStructs.ZoneManagementClusterTwoDCartesianZoneStruct zone) {
+ createTwoDCartesianZone(callback, zone, 0);
+ }
+
+ public void createTwoDCartesianZone(CreateTwoDCartesianZoneResponseCallback callback, ChipStructs.ZoneManagementClusterTwoDCartesianZoneStruct zone, int timedInvokeTimeoutMs) {
+ final long commandId = 0L;
+
+ ArrayList elements = new ArrayList<>();
+ final long zoneFieldID = 0L;
+ BaseTLVType zonetlvValue = zone.encodeTlv();
+ elements.add(new StructElement(zoneFieldID, zonetlvValue));
+
+ StructType commandArgs = new StructType(elements);
+ invoke(new InvokeCallbackImpl(callback) {
+ @Override
+ public void onResponse(StructType invokeStructValue) {
+ final long zoneIDFieldID = 0L;
+ Integer zoneID = null;
+ for (StructElement element: invokeStructValue.value()) {
+ if (element.contextTagNum() == zoneIDFieldID) {
+ if (element.value(BaseTLVType.class).type() == TLVType.UInt) {
+ UIntType castingValue = element.value(UIntType.class);
+ zoneID = castingValue.value(Integer.class);
+ }
+ }
+ }
+ callback.onSuccess(zoneID);
+ }}, commandId, commandArgs, timedInvokeTimeoutMs);
+ }
+
+ public void updateTwoDCartesianZone(DefaultClusterCallback callback, Integer zoneID, ChipStructs.ZoneManagementClusterTwoDCartesianZoneStruct zone) {
+ updateTwoDCartesianZone(callback, zoneID, zone, 0);
+ }
+
+ public void updateTwoDCartesianZone(DefaultClusterCallback callback, Integer zoneID, ChipStructs.ZoneManagementClusterTwoDCartesianZoneStruct zone, int timedInvokeTimeoutMs) {
+ final long commandId = 2L;
+
+ ArrayList elements = new ArrayList<>();
+ final long zoneIDFieldID = 0L;
+ BaseTLVType zoneIDtlvValue = new UIntType(zoneID);
+ elements.add(new StructElement(zoneIDFieldID, zoneIDtlvValue));
+
+ final long zoneFieldID = 1L;
+ BaseTLVType zonetlvValue = zone.encodeTlv();
+ elements.add(new StructElement(zoneFieldID, zonetlvValue));
+
+ StructType commandArgs = new StructType(elements);
+ invoke(new InvokeCallbackImpl(callback) {
+ @Override
+ public void onResponse(StructType invokeStructValue) {
+ callback.onSuccess();
+ }}, commandId, commandArgs, timedInvokeTimeoutMs);
+ }
+
+ public void getTwoDCartesianZone(GetTwoDCartesianZoneResponseCallback callback, @Nullable Optional zoneID) {
+ getTwoDCartesianZone(callback, zoneID, 0);
+ }
+
+ public void getTwoDCartesianZone(GetTwoDCartesianZoneResponseCallback callback, @Nullable Optional zoneID, int timedInvokeTimeoutMs) {
+ final long commandId = 3L;
+
+ ArrayList elements = new ArrayList<>();
+ final long zoneIDFieldID = 0L;
+ BaseTLVType zoneIDtlvValue = zoneID != null ? zoneID.map((nonOptionalzoneID) -> new UIntType(nonOptionalzoneID)).orElse(new EmptyType()) : new NullType();
+ elements.add(new StructElement(zoneIDFieldID, zoneIDtlvValue));
+
+ StructType commandArgs = new StructType(elements);
+ invoke(new InvokeCallbackImpl(callback) {
+ @Override
+ public void onResponse(StructType invokeStructValue) {
+ final long zonesFieldID = 0L;
+ ArrayList zones = null;
+ for (StructElement element: invokeStructValue.value()) {
+ if (element.contextTagNum() == zonesFieldID) {
+ if (element.value(BaseTLVType.class).type() == TLVType.Array) {
+ ArrayType castingValue = element.value(ArrayType.class);
+ zones = castingValue.map((elementcastingValue) -> ChipStructs.ZoneManagementClusterTwoDCartesianZoneStruct.decodeTlv(elementcastingValue));
+ }
+ }
+ }
+ callback.onSuccess(zones);
+ }}, commandId, commandArgs, timedInvokeTimeoutMs);
+ }
+
+ public void removeZone(DefaultClusterCallback callback, Integer zoneID) {
+ removeZone(callback, zoneID, 0);
+ }
+
+ public void removeZone(DefaultClusterCallback callback, Integer zoneID, int timedInvokeTimeoutMs) {
+ final long commandId = 5L;
+
+ ArrayList elements = new ArrayList<>();
+ final long zoneIDFieldID = 0L;
+ BaseTLVType zoneIDtlvValue = new UIntType(zoneID);
+ elements.add(new StructElement(zoneIDFieldID, zoneIDtlvValue));
+
+ StructType commandArgs = new StructType(elements);
+ invoke(new InvokeCallbackImpl(callback) {
+ @Override
+ public void onResponse(StructType invokeStructValue) {
+ callback.onSuccess();
+ }}, commandId, commandArgs, timedInvokeTimeoutMs);
+ }
+
+ public interface CreateTwoDCartesianZoneResponseCallback extends BaseClusterCallback {
+ void onSuccess(Integer zoneID);
+ }
+
+ public interface GetTwoDCartesianZoneResponseCallback extends BaseClusterCallback {
+ void onSuccess(ArrayList zones);
+ }
+
+ public interface SupportedZoneSourcesAttributeCallback extends BaseAttributeCallback {
+ void onSuccess(List value);
+ }
+
+ public interface ZonesAttributeCallback extends BaseAttributeCallback {
+ void onSuccess(List value);
+ }
+
+ public interface TimeControlAttributeCallback 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 readSupportedZoneSourcesAttribute(
+ SupportedZoneSourcesAttributeCallback callback) {
+ ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, SUPPORTED_ZONE_SOURCES_ATTRIBUTE_ID);
+
+ readAttribute(new ReportCallbackImpl(callback, path) {
+ @Override
+ public void onSuccess(byte[] tlv) {
+ List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv);
+ callback.onSuccess(value);
+ }
+ }, SUPPORTED_ZONE_SOURCES_ATTRIBUTE_ID, true);
+ }
+
+ public void subscribeSupportedZoneSourcesAttribute(
+ SupportedZoneSourcesAttributeCallback callback, int minInterval, int maxInterval) {
+ ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, SUPPORTED_ZONE_SOURCES_ATTRIBUTE_ID);
+
+ subscribeAttribute(new ReportCallbackImpl(callback, path) {
+ @Override
+ public void onSuccess(byte[] tlv) {
+ List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv);
+ callback.onSuccess(value);
+ }
+ }, SUPPORTED_ZONE_SOURCES_ATTRIBUTE_ID, minInterval, maxInterval);
+ }
+
+ public void readZonesAttribute(
+ ZonesAttributeCallback callback) {
+ ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ZONES_ATTRIBUTE_ID);
+
+ readAttribute(new ReportCallbackImpl(callback, path) {
+ @Override
+ public void onSuccess(byte[] tlv) {
+ List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv);
+ callback.onSuccess(value);
+ }
+ }, ZONES_ATTRIBUTE_ID, true);
+ }
+
+ public void subscribeZonesAttribute(
+ ZonesAttributeCallback callback, int minInterval, int maxInterval) {
+ ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ZONES_ATTRIBUTE_ID);
+
+ subscribeAttribute(new ReportCallbackImpl(callback, path) {
+ @Override
+ public void onSuccess(byte[] tlv) {
+ List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv);
+ callback.onSuccess(value);
+ }
+ }, ZONES_ATTRIBUTE_ID, minInterval, maxInterval);
+ }
+
+ public void readTimeControlAttribute(
+ TimeControlAttributeCallback callback) {
+ ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, TIME_CONTROL_ATTRIBUTE_ID);
+
+ readAttribute(new ReportCallbackImpl(callback, path) {
+ @Override
+ public void onSuccess(byte[] tlv) {
+ List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv);
+ callback.onSuccess(value);
+ }
+ }, TIME_CONTROL_ATTRIBUTE_ID, true);
+ }
+
+ public void writeTimeControlAttribute(DefaultClusterCallback callback, ArrayList value) {
+ writeTimeControlAttribute(callback, value, 0);
+ }
+
+ public void writeTimeControlAttribute(DefaultClusterCallback callback, ArrayList value, int timedWriteTimeoutMs) {
+ BaseTLVType tlvValue = ArrayType.generateArrayType(value, (elementvalue) -> elementvalue.encodeTlv());
+ writeAttribute(new WriteAttributesCallbackImpl(callback), TIME_CONTROL_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs);
+ }
+
+ public void subscribeTimeControlAttribute(
+ TimeControlAttributeCallback callback, int minInterval, int maxInterval) {
+ ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, TIME_CONTROL_ATTRIBUTE_ID);
+
+ subscribeAttribute(new ReportCallbackImpl(callback, path) {
+ @Override
+ public void onSuccess(byte[] tlv) {
+ List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv);
+ callback.onSuccess(value);
+ }
+ }, TIME_CONTROL_ATTRIBUTE_ID, minInterval, maxInterval);
+ }
+
+ public void readSensitivityAttribute(
+ IntegerAttributeCallback callback) {
+ ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, SENSITIVITY_ATTRIBUTE_ID);
+
+ readAttribute(new ReportCallbackImpl(callback, path) {
+ @Override
+ public void onSuccess(byte[] tlv) {
+ Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv);
+ callback.onSuccess(value);
+ }
+ }, SENSITIVITY_ATTRIBUTE_ID, true);
+ }
+
+ public void writeSensitivityAttribute(DefaultClusterCallback callback, Integer value) {
+ writeSensitivityAttribute(callback, value, 0);
+ }
+
+ public void writeSensitivityAttribute(DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) {
+ BaseTLVType tlvValue = new UIntType(value);
+ writeAttribute(new WriteAttributesCallbackImpl(callback), SENSITIVITY_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs);
+ }
+
+ public void subscribeSensitivityAttribute(
+ IntegerAttributeCallback callback, int minInterval, int maxInterval) {
+ ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, SENSITIVITY_ATTRIBUTE_ID);
+
+ subscribeAttribute(new ReportCallbackImpl(callback, path) {
+ @Override
+ public void onSuccess(byte[] tlv) {
+ Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv);
+ callback.onSuccess(value);
+ }
+ }, SENSITIVITY_ATTRIBUTE_ID, minInterval, maxInterval);
+ }
+
+ public void readGeneratedCommandListAttribute(
+ GeneratedCommandListAttributeCallback callback) {
+ ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, GENERATED_COMMAND_LIST_ATTRIBUTE_ID);
+
+ readAttribute(new ReportCallbackImpl(callback, path) {
+ @Override
+ public void onSuccess(byte[] tlv) {
+ List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv);
+ callback.onSuccess(value);
+ }
+ }, GENERATED_COMMAND_LIST_ATTRIBUTE_ID, true);
+ }
+
+ public void subscribeGeneratedCommandListAttribute(
+ GeneratedCommandListAttributeCallback callback, int minInterval, int maxInterval) {
+ ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, GENERATED_COMMAND_LIST_ATTRIBUTE_ID);
+
+ subscribeAttribute(new ReportCallbackImpl(callback, path) {
+ @Override
+ public void onSuccess(byte[] tlv) {
+ List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv);
+ callback.onSuccess(value);
+ }
+ }, GENERATED_COMMAND_LIST_ATTRIBUTE_ID, minInterval, maxInterval);
+ }
+
+ public void readAcceptedCommandListAttribute(
+ AcceptedCommandListAttributeCallback callback) {
+ ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID);
+
+ readAttribute(new ReportCallbackImpl(callback, path) {
+ @Override
+ public void onSuccess(byte[] tlv) {
+ List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv);
+ callback.onSuccess(value);
+ }
+ }, ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID, true);
+ }
+
+ public void subscribeAcceptedCommandListAttribute(
+ AcceptedCommandListAttributeCallback callback, int minInterval, int maxInterval) {
+ ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID);
+
+ subscribeAttribute(new ReportCallbackImpl(callback, path) {
+ @Override
+ public void onSuccess(byte[] tlv) {
+ List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv);
+ callback.onSuccess(value);
+ }
+ }, ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID, minInterval, maxInterval);
+ }
+
+ public void readEventListAttribute(
+ EventListAttributeCallback callback) {
+ ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, EVENT_LIST_ATTRIBUTE_ID);
+
+ readAttribute(new ReportCallbackImpl(callback, path) {
+ @Override
+ public void onSuccess(byte[] tlv) {
+ List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv);
+ callback.onSuccess(value);
+ }
+ }, EVENT_LIST_ATTRIBUTE_ID, true);
+ }
+
+ public void subscribeEventListAttribute(
+ EventListAttributeCallback callback, int minInterval, int maxInterval) {
+ ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, EVENT_LIST_ATTRIBUTE_ID);
+
+ subscribeAttribute(new ReportCallbackImpl(callback, path) {
+ @Override
+ public void onSuccess(byte[] tlv) {
+ List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv);
+ callback.onSuccess(value);
+ }
+ }, EVENT_LIST_ATTRIBUTE_ID, minInterval, maxInterval);
+ }
+
+ public void readAttributeListAttribute(
+ AttributeListAttributeCallback callback) {
+ ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ATTRIBUTE_LIST_ATTRIBUTE_ID);
+
+ readAttribute(new ReportCallbackImpl(callback, path) {
+ @Override
+ public void onSuccess(byte[] tlv) {
+ List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv);
+ callback.onSuccess(value);
+ }
+ }, ATTRIBUTE_LIST_ATTRIBUTE_ID, true);
+ }
+
+ public void subscribeAttributeListAttribute(
+ AttributeListAttributeCallback callback, int minInterval, int maxInterval) {
+ ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ATTRIBUTE_LIST_ATTRIBUTE_ID);
+
+ subscribeAttribute(new ReportCallbackImpl(callback, path) {
+ @Override
+ public void onSuccess(byte[] tlv) {
+ List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv);
+ callback.onSuccess(value);
+ }
+ }, ATTRIBUTE_LIST_ATTRIBUTE_ID, minInterval, maxInterval);
+ }
+
+ public void readFeatureMapAttribute(
+ LongAttributeCallback callback) {
+ ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, FEATURE_MAP_ATTRIBUTE_ID);
+
+ readAttribute(new ReportCallbackImpl(callback, path) {
+ @Override
+ public void onSuccess(byte[] tlv) {
+ Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv);
+ callback.onSuccess(value);
+ }
+ }, FEATURE_MAP_ATTRIBUTE_ID, true);
+ }
+
+ public void subscribeFeatureMapAttribute(
+ LongAttributeCallback callback, int minInterval, int maxInterval) {
+ ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, FEATURE_MAP_ATTRIBUTE_ID);
+
+ subscribeAttribute(new ReportCallbackImpl(callback, path) {
+ @Override
+ public void onSuccess(byte[] tlv) {
+ Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv);
+ callback.onSuccess(value);
+ }
+ }, FEATURE_MAP_ATTRIBUTE_ID, minInterval, maxInterval);
+ }
+
+ public void readClusterRevisionAttribute(
+ IntegerAttributeCallback callback) {
+ ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, CLUSTER_REVISION_ATTRIBUTE_ID);
+
+ readAttribute(new ReportCallbackImpl(callback, path) {
+ @Override
+ public void onSuccess(byte[] tlv) {
+ Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv);
+ callback.onSuccess(value);
+ }
+ }, CLUSTER_REVISION_ATTRIBUTE_ID, true);
+ }
+
+ public void subscribeClusterRevisionAttribute(
+ IntegerAttributeCallback callback, int minInterval, int maxInterval) {
+ ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, CLUSTER_REVISION_ATTRIBUTE_ID);
+
+ subscribeAttribute(new ReportCallbackImpl(callback, path) {
+ @Override
+ public void onSuccess(byte[] tlv) {
+ Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv);
+ callback.onSuccess(value);
+ }
+ }, CLUSTER_REVISION_ATTRIBUTE_ID, minInterval, maxInterval);
+ }
+ }
+
public static class WebRTCTransportProviderCluster extends BaseChipCluster {
public static final long CLUSTER_ID = 1363L;
diff --git a/src/controller/java/generated/java/chip/devicecontroller/ChipEventStructs.java b/src/controller/java/generated/java/chip/devicecontroller/ChipEventStructs.java
index 737462f3da184d..ce9f162bdeb58a 100644
--- a/src/controller/java/generated/java/chip/devicecontroller/ChipEventStructs.java
+++ b/src/controller/java/generated/java/chip/devicecontroller/ChipEventStructs.java
@@ -6187,6 +6187,128 @@ public String toString() {
return output.toString();
}
}
+public static class ZoneManagementClusterZoneTriggeredEvent {
+ public ArrayList zones;
+ public Integer reason;
+ private static final long ZONES_ID = 0L;
+ private static final long REASON_ID = 1L;
+
+ public ZoneManagementClusterZoneTriggeredEvent(
+ ArrayList zones,
+ Integer reason
+ ) {
+ this.zones = zones;
+ this.reason = reason;
+ }
+
+ public StructType encodeTlv() {
+ ArrayList values = new ArrayList<>();
+ values.add(new StructElement(ZONES_ID, ArrayType.generateArrayType(zones, (elementzones) -> new UIntType(elementzones))));
+ values.add(new StructElement(REASON_ID, new UIntType(reason)));
+
+ return new StructType(values);
+ }
+
+ public static ZoneManagementClusterZoneTriggeredEvent decodeTlv(BaseTLVType tlvValue) {
+ if (tlvValue == null || tlvValue.type() != TLVType.Struct) {
+ return null;
+ }
+ ArrayList zones = null;
+ Integer reason = null;
+ for (StructElement element: ((StructType)tlvValue).value()) {
+ if (element.contextTagNum() == ZONES_ID) {
+ if (element.value(BaseTLVType.class).type() == TLVType.Array) {
+ ArrayType castingValue = element.value(ArrayType.class);
+ zones = castingValue.map((elementcastingValue) -> elementcastingValue.value(Integer.class));
+ }
+ } else if (element.contextTagNum() == REASON_ID) {
+ if (element.value(BaseTLVType.class).type() == TLVType.UInt) {
+ UIntType castingValue = element.value(UIntType.class);
+ reason = castingValue.value(Integer.class);
+ }
+ }
+ }
+ return new ZoneManagementClusterZoneTriggeredEvent(
+ zones,
+ reason
+ );
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder output = new StringBuilder();
+ output.append("ZoneManagementClusterZoneTriggeredEvent {\n");
+ output.append("\tzones: ");
+ output.append(zones);
+ output.append("\n");
+ output.append("\treason: ");
+ output.append(reason);
+ output.append("\n");
+ output.append("}\n");
+ return output.toString();
+ }
+}
+public static class ZoneManagementClusterZoneStoppedEvent {
+ public ArrayList zones;
+ public Integer reason;
+ private static final long ZONES_ID = 0L;
+ private static final long REASON_ID = 1L;
+
+ public ZoneManagementClusterZoneStoppedEvent(
+ ArrayList zones,
+ Integer reason
+ ) {
+ this.zones = zones;
+ this.reason = reason;
+ }
+
+ public StructType encodeTlv() {
+ ArrayList values = new ArrayList<>();
+ values.add(new StructElement(ZONES_ID, ArrayType.generateArrayType(zones, (elementzones) -> new UIntType(elementzones))));
+ values.add(new StructElement(REASON_ID, new UIntType(reason)));
+
+ return new StructType(values);
+ }
+
+ public static ZoneManagementClusterZoneStoppedEvent decodeTlv(BaseTLVType tlvValue) {
+ if (tlvValue == null || tlvValue.type() != TLVType.Struct) {
+ return null;
+ }
+ ArrayList zones = null;
+ Integer reason = null;
+ for (StructElement element: ((StructType)tlvValue).value()) {
+ if (element.contextTagNum() == ZONES_ID) {
+ if (element.value(BaseTLVType.class).type() == TLVType.Array) {
+ ArrayType castingValue = element.value(ArrayType.class);
+ zones = castingValue.map((elementcastingValue) -> elementcastingValue.value(Integer.class));
+ }
+ } else if (element.contextTagNum() == REASON_ID) {
+ if (element.value(BaseTLVType.class).type() == TLVType.UInt) {
+ UIntType castingValue = element.value(UIntType.class);
+ reason = castingValue.value(Integer.class);
+ }
+ }
+ }
+ return new ZoneManagementClusterZoneStoppedEvent(
+ zones,
+ reason
+ );
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder output = new StringBuilder();
+ output.append("ZoneManagementClusterZoneStoppedEvent {\n");
+ output.append("\tzones: ");
+ output.append(zones);
+ output.append("\n");
+ output.append("\treason: ");
+ output.append(reason);
+ output.append("\n");
+ output.append("}\n");
+ return output.toString();
+ }
+}
public static class CommissionerControlClusterCommissioningRequestResultEvent {
public Long requestID;
public Long clientNodeID;
diff --git a/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java b/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java
index 88684160d1ed81..1b02cba5153975 100644
--- a/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java
+++ b/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java
@@ -12724,6 +12724,325 @@ public String toString() {
return output.toString();
}
}
+public static class ZoneManagementClusterTwoDCartesianVertexStruct {
+ public Integer x;
+ public Integer y;
+ private static final long X_ID = 0L;
+ private static final long Y_ID = 1L;
+
+ public ZoneManagementClusterTwoDCartesianVertexStruct(
+ Integer x,
+ Integer y
+ ) {
+ this.x = x;
+ this.y = y;
+ }
+
+ public StructType encodeTlv() {
+ ArrayList values = new ArrayList<>();
+ values.add(new StructElement(X_ID, new UIntType(x)));
+ values.add(new StructElement(Y_ID, new UIntType(y)));
+
+ return new StructType(values);
+ }
+
+ public static ZoneManagementClusterTwoDCartesianVertexStruct decodeTlv(BaseTLVType tlvValue) {
+ if (tlvValue == null || tlvValue.type() != TLVType.Struct) {
+ return null;
+ }
+ Integer x = null;
+ Integer y = null;
+ for (StructElement element: ((StructType)tlvValue).value()) {
+ if (element.contextTagNum() == X_ID) {
+ if (element.value(BaseTLVType.class).type() == TLVType.UInt) {
+ UIntType castingValue = element.value(UIntType.class);
+ x = castingValue.value(Integer.class);
+ }
+ } else if (element.contextTagNum() == Y_ID) {
+ if (element.value(BaseTLVType.class).type() == TLVType.UInt) {
+ UIntType castingValue = element.value(UIntType.class);
+ y = castingValue.value(Integer.class);
+ }
+ }
+ }
+ return new ZoneManagementClusterTwoDCartesianVertexStruct(
+ x,
+ y
+ );
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder output = new StringBuilder();
+ output.append("ZoneManagementClusterTwoDCartesianVertexStruct {\n");
+ output.append("\tx: ");
+ output.append(x);
+ output.append("\n");
+ output.append("\ty: ");
+ output.append(y);
+ output.append("\n");
+ output.append("}\n");
+ return output.toString();
+ }
+}
+public static class ZoneManagementClusterTwoDCartesianZoneStruct {
+ public String name;
+ public Integer use;
+ public ArrayList vertices;
+ public Optional color;
+ private static final long NAME_ID = 0L;
+ private static final long USE_ID = 1L;
+ private static final long VERTICES_ID = 2L;
+ private static final long COLOR_ID = 3L;
+
+ public ZoneManagementClusterTwoDCartesianZoneStruct(
+ String name,
+ Integer use,
+ ArrayList vertices,
+ Optional color
+ ) {
+ this.name = name;
+ this.use = use;
+ this.vertices = vertices;
+ this.color = color;
+ }
+
+ public StructType encodeTlv() {
+ ArrayList values = new ArrayList<>();
+ values.add(new StructElement(NAME_ID, new StringType(name)));
+ values.add(new StructElement(USE_ID, new UIntType(use)));
+ values.add(new StructElement(VERTICES_ID, ArrayType.generateArrayType(vertices, (elementvertices) -> elementvertices.encodeTlv())));
+ values.add(new StructElement(COLOR_ID, color.map((nonOptionalcolor) -> new StringType(nonOptionalcolor)).orElse(new EmptyType())));
+
+ return new StructType(values);
+ }
+
+ public static ZoneManagementClusterTwoDCartesianZoneStruct decodeTlv(BaseTLVType tlvValue) {
+ if (tlvValue == null || tlvValue.type() != TLVType.Struct) {
+ return null;
+ }
+ String name = null;
+ Integer use = null;
+ ArrayList vertices = null;
+ Optional color = Optional.empty();
+ for (StructElement element: ((StructType)tlvValue).value()) {
+ 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() == USE_ID) {
+ if (element.value(BaseTLVType.class).type() == TLVType.UInt) {
+ UIntType castingValue = element.value(UIntType.class);
+ use = castingValue.value(Integer.class);
+ }
+ } else if (element.contextTagNum() == VERTICES_ID) {
+ if (element.value(BaseTLVType.class).type() == TLVType.Array) {
+ ArrayType castingValue = element.value(ArrayType.class);
+ vertices = castingValue.map((elementcastingValue) -> ChipStructs.ZoneManagementClusterTwoDCartesianVertexStruct.decodeTlv(elementcastingValue));
+ }
+ } else if (element.contextTagNum() == COLOR_ID) {
+ if (element.value(BaseTLVType.class).type() == TLVType.String) {
+ StringType castingValue = element.value(StringType.class);
+ color = Optional.of(castingValue.value(String.class));
+ }
+ }
+ }
+ return new ZoneManagementClusterTwoDCartesianZoneStruct(
+ name,
+ use,
+ vertices,
+ color
+ );
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder output = new StringBuilder();
+ output.append("ZoneManagementClusterTwoDCartesianZoneStruct {\n");
+ output.append("\tname: ");
+ output.append(name);
+ output.append("\n");
+ output.append("\tuse: ");
+ output.append(use);
+ output.append("\n");
+ output.append("\tvertices: ");
+ output.append(vertices);
+ output.append("\n");
+ output.append("\tcolor: ");
+ output.append(color);
+ output.append("\n");
+ output.append("}\n");
+ return output.toString();
+ }
+}
+public static class ZoneManagementClusterZoneInformationStruct {
+ public Integer zoneID;
+ public Integer zoneType;
+ public Integer zoneSource;
+ private static final long ZONE_ID_ID = 0L;
+ private static final long ZONE_TYPE_ID = 1L;
+ private static final long ZONE_SOURCE_ID = 2L;
+
+ public ZoneManagementClusterZoneInformationStruct(
+ Integer zoneID,
+ Integer zoneType,
+ Integer zoneSource
+ ) {
+ this.zoneID = zoneID;
+ this.zoneType = zoneType;
+ this.zoneSource = zoneSource;
+ }
+
+ public StructType encodeTlv() {
+ ArrayList values = new ArrayList<>();
+ values.add(new StructElement(ZONE_ID_ID, new UIntType(zoneID)));
+ values.add(new StructElement(ZONE_TYPE_ID, new UIntType(zoneType)));
+ values.add(new StructElement(ZONE_SOURCE_ID, new UIntType(zoneSource)));
+
+ return new StructType(values);
+ }
+
+ public static ZoneManagementClusterZoneInformationStruct decodeTlv(BaseTLVType tlvValue) {
+ if (tlvValue == null || tlvValue.type() != TLVType.Struct) {
+ return null;
+ }
+ Integer zoneID = null;
+ Integer zoneType = null;
+ Integer zoneSource = null;
+ for (StructElement element: ((StructType)tlvValue).value()) {
+ if (element.contextTagNum() == ZONE_ID_ID) {
+ if (element.value(BaseTLVType.class).type() == TLVType.UInt) {
+ UIntType castingValue = element.value(UIntType.class);
+ zoneID = castingValue.value(Integer.class);
+ }
+ } else if (element.contextTagNum() == ZONE_TYPE_ID) {
+ if (element.value(BaseTLVType.class).type() == TLVType.UInt) {
+ UIntType castingValue = element.value(UIntType.class);
+ zoneType = castingValue.value(Integer.class);
+ }
+ } else if (element.contextTagNum() == ZONE_SOURCE_ID) {
+ if (element.value(BaseTLVType.class).type() == TLVType.UInt) {
+ UIntType castingValue = element.value(UIntType.class);
+ zoneSource = castingValue.value(Integer.class);
+ }
+ }
+ }
+ return new ZoneManagementClusterZoneInformationStruct(
+ zoneID,
+ zoneType,
+ zoneSource
+ );
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder output = new StringBuilder();
+ output.append("ZoneManagementClusterZoneInformationStruct {\n");
+ output.append("\tzoneID: ");
+ output.append(zoneID);
+ output.append("\n");
+ output.append("\tzoneType: ");
+ output.append(zoneType);
+ output.append("\n");
+ output.append("\tzoneSource: ");
+ output.append(zoneSource);
+ output.append("\n");
+ output.append("}\n");
+ return output.toString();
+ }
+}
+public static class ZoneManagementClusterZoneTriggeringTimeControlStruct {
+ public Integer initialDuration;
+ public Integer augmentationDuration;
+ public Long maxDuration;
+ public Integer blindDuration;
+ private static final long INITIAL_DURATION_ID = 0L;
+ private static final long AUGMENTATION_DURATION_ID = 1L;
+ private static final long MAX_DURATION_ID = 2L;
+ private static final long BLIND_DURATION_ID = 3L;
+
+ public ZoneManagementClusterZoneTriggeringTimeControlStruct(
+ Integer initialDuration,
+ Integer augmentationDuration,
+ Long maxDuration,
+ Integer blindDuration
+ ) {
+ this.initialDuration = initialDuration;
+ this.augmentationDuration = augmentationDuration;
+ this.maxDuration = maxDuration;
+ this.blindDuration = blindDuration;
+ }
+
+ public StructType encodeTlv() {
+ ArrayList values = new ArrayList<>();
+ values.add(new StructElement(INITIAL_DURATION_ID, new UIntType(initialDuration)));
+ values.add(new StructElement(AUGMENTATION_DURATION_ID, new UIntType(augmentationDuration)));
+ values.add(new StructElement(MAX_DURATION_ID, new UIntType(maxDuration)));
+ values.add(new StructElement(BLIND_DURATION_ID, new UIntType(blindDuration)));
+
+ return new StructType(values);
+ }
+
+ public static ZoneManagementClusterZoneTriggeringTimeControlStruct decodeTlv(BaseTLVType tlvValue) {
+ if (tlvValue == null || tlvValue.type() != TLVType.Struct) {
+ return null;
+ }
+ Integer initialDuration = null;
+ Integer augmentationDuration = null;
+ Long maxDuration = null;
+ Integer blindDuration = null;
+ for (StructElement element: ((StructType)tlvValue).value()) {
+ if (element.contextTagNum() == INITIAL_DURATION_ID) {
+ if (element.value(BaseTLVType.class).type() == TLVType.UInt) {
+ UIntType castingValue = element.value(UIntType.class);
+ initialDuration = castingValue.value(Integer.class);
+ }
+ } else if (element.contextTagNum() == AUGMENTATION_DURATION_ID) {
+ if (element.value(BaseTLVType.class).type() == TLVType.UInt) {
+ UIntType castingValue = element.value(UIntType.class);
+ augmentationDuration = castingValue.value(Integer.class);
+ }
+ } else if (element.contextTagNum() == MAX_DURATION_ID) {
+ if (element.value(BaseTLVType.class).type() == TLVType.UInt) {
+ UIntType castingValue = element.value(UIntType.class);
+ maxDuration = castingValue.value(Long.class);
+ }
+ } else if (element.contextTagNum() == BLIND_DURATION_ID) {
+ if (element.value(BaseTLVType.class).type() == TLVType.UInt) {
+ UIntType castingValue = element.value(UIntType.class);
+ blindDuration = castingValue.value(Integer.class);
+ }
+ }
+ }
+ return new ZoneManagementClusterZoneTriggeringTimeControlStruct(
+ initialDuration,
+ augmentationDuration,
+ maxDuration,
+ blindDuration
+ );
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder output = new StringBuilder();
+ output.append("ZoneManagementClusterZoneTriggeringTimeControlStruct {\n");
+ output.append("\tinitialDuration: ");
+ output.append(initialDuration);
+ output.append("\n");
+ output.append("\taugmentationDuration: ");
+ output.append(augmentationDuration);
+ output.append("\n");
+ output.append("\tmaxDuration: ");
+ output.append(maxDuration);
+ output.append("\n");
+ output.append("\tblindDuration: ");
+ output.append(blindDuration);
+ output.append("\n");
+ output.append("}\n");
+ return output.toString();
+ }
+}
public static class WebRTCTransportProviderClusterICEServerStruct {
public ArrayList urls;
public Optional username;
diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java
index 28a415a3008fc1..36adc739075a12 100644
--- a/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java
+++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java
@@ -379,6 +379,9 @@ public static BaseCluster getCluster(long clusterId) {
if (clusterId == ContentAppObserver.ID) {
return new ContentAppObserver();
}
+ if (clusterId == ZoneManagement.ID) {
+ return new ZoneManagement();
+ }
if (clusterId == WebRTCTransportProvider.ID) {
return new WebRTCTransportProvider();
}
@@ -16888,6 +16891,184 @@ public long getCommandID(String name) throws IllegalArgumentException {
return Command.valueOf(name).getID();
}
}
+ public static class ZoneManagement implements BaseCluster {
+ public static final long ID = 1360L;
+ public long getID() {
+ return ID;
+ }
+
+ public enum Attribute {
+ SupportedZoneSources(0L),
+ Zones(1L),
+ TimeControl(2L),
+ Sensitivity(3L),
+ 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 {
+ ZoneTriggered(0L),
+ ZoneStopped(1L),;
+ private final long id;
+ Event(long id) {
+ this.id = id;
+ }
+
+ public long getID() {
+ return id;
+ }
+
+ public static Event value(long id) throws NoSuchFieldError {
+ for (Event event : Event.values()) {
+ if (event.getID() == id) {
+ return event;
+ }
+ }
+ throw new NoSuchFieldError();
+ }
+ }
+
+ public enum Command {
+ CreateTwoDCartesianZone(0L),
+ UpdateTwoDCartesianZone(2L),
+ GetTwoDCartesianZone(3L),
+ RemoveZone(5L),;
+ 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 CreateTwoDCartesianZoneCommandField {Zone(0),;
+ private final int id;
+ CreateTwoDCartesianZoneCommandField(int id) {
+ this.id = id;
+ }
+
+ public int getID() {
+ return id;
+ }
+ public static CreateTwoDCartesianZoneCommandField value(int id) throws NoSuchFieldError {
+ for (CreateTwoDCartesianZoneCommandField field : CreateTwoDCartesianZoneCommandField.values()) {
+ if (field.getID() == id) {
+ return field;
+ }
+ }
+ throw new NoSuchFieldError();
+ }
+ }public enum UpdateTwoDCartesianZoneCommandField {ZoneID(0),Zone(1),;
+ private final int id;
+ UpdateTwoDCartesianZoneCommandField(int id) {
+ this.id = id;
+ }
+
+ public int getID() {
+ return id;
+ }
+ public static UpdateTwoDCartesianZoneCommandField value(int id) throws NoSuchFieldError {
+ for (UpdateTwoDCartesianZoneCommandField field : UpdateTwoDCartesianZoneCommandField.values()) {
+ if (field.getID() == id) {
+ return field;
+ }
+ }
+ throw new NoSuchFieldError();
+ }
+ }public enum GetTwoDCartesianZoneCommandField {ZoneID(0),;
+ private final int id;
+ GetTwoDCartesianZoneCommandField(int id) {
+ this.id = id;
+ }
+
+ public int getID() {
+ return id;
+ }
+ public static GetTwoDCartesianZoneCommandField value(int id) throws NoSuchFieldError {
+ for (GetTwoDCartesianZoneCommandField field : GetTwoDCartesianZoneCommandField.values()) {
+ if (field.getID() == id) {
+ return field;
+ }
+ }
+ throw new NoSuchFieldError();
+ }
+ }public enum RemoveZoneCommandField {ZoneID(0),;
+ private final int id;
+ RemoveZoneCommandField(int id) {
+ this.id = id;
+ }
+
+ public int getID() {
+ return id;
+ }
+ public static RemoveZoneCommandField value(int id) throws NoSuchFieldError {
+ for (RemoveZoneCommandField field : RemoveZoneCommandField.values()) {
+ if (field.getID() == id) {
+ return field;
+ }
+ }
+ throw new NoSuchFieldError();
+ }
+ }@Override
+ public String getAttributeName(long id) throws NoSuchFieldError {
+ return Attribute.value(id).toString();
+ }
+
+ @Override
+ public String getEventName(long id) throws NoSuchFieldError {
+ return Event.value(id).toString();
+ }
+
+ @Override
+ public String getCommandName(long id) throws NoSuchFieldError {
+ return Command.value(id).toString();
+ }
+
+ @Override
+ public long getAttributeID(String name) throws IllegalArgumentException {
+ return Attribute.valueOf(name).getID();
+ }
+
+ @Override
+ public long getEventID(String name) throws IllegalArgumentException {
+ return Event.valueOf(name).getID();
+ }
+
+ @Override
+ public long getCommandID(String name) throws IllegalArgumentException {
+ return Command.valueOf(name).getID();
+ }
+ }
public static class WebRTCTransportProvider implements BaseCluster {
public static final long ID = 1363L;
public long getID() {
diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java
index 27dda463b3b0f3..a8ead57ed46932 100644
--- a/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java
+++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java
@@ -19995,6 +19995,198 @@ public void onError(Exception ex) {
}
+ public static class DelegatedZoneManagementClusterCreateTwoDCartesianZoneResponseCallback implements ChipClusters.ZoneManagementCluster.CreateTwoDCartesianZoneResponseCallback, DelegatedClusterCallback {
+ private ClusterCommandCallback callback;
+ @Override
+ public void setCallbackDelegate(ClusterCommandCallback callback) {
+ this.callback = callback;
+ }
+
+ @Override
+ public void onSuccess(Integer zoneID) {
+ Map responseValues = new LinkedHashMap<>();
+
+ CommandResponseInfo zoneIDResponseValue = new CommandResponseInfo("zoneID", "Integer");
+ responseValues.put(zoneIDResponseValue, zoneID);
+ callback.onSuccess(responseValues);
+ }
+
+ @Override
+ public void onError(Exception error) {
+ callback.onFailure(error);
+ }
+ }
+
+ public static class DelegatedZoneManagementClusterGetTwoDCartesianZoneResponseCallback implements ChipClusters.ZoneManagementCluster.GetTwoDCartesianZoneResponseCallback, DelegatedClusterCallback {
+ private ClusterCommandCallback callback;
+ @Override
+ public void setCallbackDelegate(ClusterCommandCallback callback) {
+ this.callback = callback;
+ }
+
+ @Override
+ public void onSuccess(ArrayList zones) {
+ Map responseValues = new LinkedHashMap<>();
+
+ // zones: TwoDCartesianZoneStruct
+ // Conversion from this type to Java is not properly implemented yet
+
+ callback.onSuccess(responseValues);
+ }
+
+ @Override
+ public void onError(Exception error) {
+ callback.onFailure(error);
+ }
+ }
+ public static class DelegatedZoneManagementClusterSupportedZoneSourcesAttributeCallback implements ChipClusters.ZoneManagementCluster.SupportedZoneSourcesAttributeCallback, 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 DelegatedZoneManagementClusterZonesAttributeCallback implements ChipClusters.ZoneManagementCluster.ZonesAttributeCallback, 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 DelegatedZoneManagementClusterTimeControlAttributeCallback implements ChipClusters.ZoneManagementCluster.TimeControlAttributeCallback, 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 DelegatedZoneManagementClusterGeneratedCommandListAttributeCallback implements ChipClusters.ZoneManagementCluster.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 DelegatedZoneManagementClusterAcceptedCommandListAttributeCallback implements ChipClusters.ZoneManagementCluster.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 DelegatedZoneManagementClusterEventListAttributeCallback implements ChipClusters.ZoneManagementCluster.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 DelegatedZoneManagementClusterAttributeListAttributeCallback implements ChipClusters.ZoneManagementCluster.AttributeListAttributeCallback, DelegatedClusterCallback {
+ private ClusterCommandCallback callback;
+ @Override
+ public void setCallbackDelegate(ClusterCommandCallback callback) {
+ this.callback = callback;
+ }
+
+ @Override
+ public void onSuccess(List valueList) {
+ Map responseValues = new LinkedHashMap<>();
+ CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List");
+ responseValues.put(commandResponseInfo, valueList);
+ callback.onSuccess(responseValues);
+ }
+
+ @Override
+ public void onError(Exception ex) {
+ callback.onFailure(ex);
+ }
+ }
+
+
public static class DelegatedWebRTCTransportProviderClusterSolicitOfferResponseCallback implements ChipClusters.WebRTCTransportProviderCluster.SolicitOfferResponseCallback, DelegatedClusterCallback {
private ClusterCommandCallback callback;
@Override
@@ -22699,6 +22891,10 @@ public Map initializeClusterMap() {
(ptr, endpointId) -> new ChipClusters.ContentAppObserverCluster(ptr, endpointId), new HashMap<>());
clusterMap.put("contentAppObserver", contentAppObserverClusterInfo);
+ ClusterInfo zoneManagementClusterInfo = new ClusterInfo(
+ (ptr, endpointId) -> new ChipClusters.ZoneManagementCluster(ptr, endpointId), new HashMap<>());
+ clusterMap.put("zoneManagement", zoneManagementClusterInfo);
+
ClusterInfo webRTCTransportProviderClusterInfo = new ClusterInfo(
(ptr, endpointId) -> new ChipClusters.WebRTCTransportProviderCluster(ptr, endpointId), new HashMap<>());
clusterMap.put("webRTCTransportProvider", webRTCTransportProviderClusterInfo);
@@ -22852,6 +23048,7 @@ public void combineCommand(Map destination, Map> getCommandMap() {
commandMap.put("contentAppObserver", contentAppObserverClusterInteractionInfoMap);
+ Map zoneManagementClusterInteractionInfoMap = new LinkedHashMap<>();
+
+ Map zoneManagementcreateTwoDCartesianZoneCommandParams = new LinkedHashMap();
+
+ InteractionInfo zoneManagementcreateTwoDCartesianZoneInteractionInfo = new InteractionInfo(
+ (cluster, callback, commandArguments) -> {
+ ((ChipClusters.ZoneManagementCluster) cluster)
+ .createTwoDCartesianZone((ChipClusters.ZoneManagementCluster.CreateTwoDCartesianZoneResponseCallback) callback
+ , (ChipStructs.ZoneManagementClusterTwoDCartesianZoneStruct)
+ commandArguments.get("zone")
+
+ );
+ },
+ () -> new DelegatedZoneManagementClusterCreateTwoDCartesianZoneResponseCallback(),
+ zoneManagementcreateTwoDCartesianZoneCommandParams
+ );
+ zoneManagementClusterInteractionInfoMap.put("createTwoDCartesianZone", zoneManagementcreateTwoDCartesianZoneInteractionInfo);
+
+ Map zoneManagementupdateTwoDCartesianZoneCommandParams = new LinkedHashMap();
+
+ CommandParameterInfo zoneManagementupdateTwoDCartesianZonezoneIDCommandParameterInfo = new CommandParameterInfo("zoneID", Integer.class, Integer.class);
+ zoneManagementupdateTwoDCartesianZoneCommandParams.put("zoneID",zoneManagementupdateTwoDCartesianZonezoneIDCommandParameterInfo);
+
+ InteractionInfo zoneManagementupdateTwoDCartesianZoneInteractionInfo = new InteractionInfo(
+ (cluster, callback, commandArguments) -> {
+ ((ChipClusters.ZoneManagementCluster) cluster)
+ .updateTwoDCartesianZone((DefaultClusterCallback) callback
+ , (Integer)
+ commandArguments.get("zoneID")
+ , (ChipStructs.ZoneManagementClusterTwoDCartesianZoneStruct)
+ commandArguments.get("zone")
+ );
+ },
+ () -> new DelegatedDefaultClusterCallback(),
+ zoneManagementupdateTwoDCartesianZoneCommandParams
+ );
+ zoneManagementClusterInteractionInfoMap.put("updateTwoDCartesianZone", zoneManagementupdateTwoDCartesianZoneInteractionInfo);
+
+ Map zoneManagementgetTwoDCartesianZoneCommandParams = new LinkedHashMap();
+
+ CommandParameterInfo zoneManagementgetTwoDCartesianZonezoneIDCommandParameterInfo = new CommandParameterInfo("zoneID", Optional.class, Integer.class);
+ zoneManagementgetTwoDCartesianZoneCommandParams.put("zoneID",zoneManagementgetTwoDCartesianZonezoneIDCommandParameterInfo);
+ InteractionInfo zoneManagementgetTwoDCartesianZoneInteractionInfo = new InteractionInfo(
+ (cluster, callback, commandArguments) -> {
+ ((ChipClusters.ZoneManagementCluster) cluster)
+ .getTwoDCartesianZone((ChipClusters.ZoneManagementCluster.GetTwoDCartesianZoneResponseCallback) callback
+ , (Optional)
+ commandArguments.get("zoneID")
+
+ );
+ },
+ () -> new DelegatedZoneManagementClusterGetTwoDCartesianZoneResponseCallback(),
+ zoneManagementgetTwoDCartesianZoneCommandParams
+ );
+ zoneManagementClusterInteractionInfoMap.put("getTwoDCartesianZone", zoneManagementgetTwoDCartesianZoneInteractionInfo);
+
+ Map zoneManagementremoveZoneCommandParams = new LinkedHashMap();
+
+ CommandParameterInfo zoneManagementremoveZonezoneIDCommandParameterInfo = new CommandParameterInfo("zoneID", Integer.class, Integer.class);
+ zoneManagementremoveZoneCommandParams.put("zoneID",zoneManagementremoveZonezoneIDCommandParameterInfo);
+ InteractionInfo zoneManagementremoveZoneInteractionInfo = new InteractionInfo(
+ (cluster, callback, commandArguments) -> {
+ ((ChipClusters.ZoneManagementCluster) cluster)
+ .removeZone((DefaultClusterCallback) callback
+ , (Integer)
+ commandArguments.get("zoneID")
+ );
+ },
+ () -> new DelegatedDefaultClusterCallback(),
+ zoneManagementremoveZoneCommandParams
+ );
+ zoneManagementClusterInteractionInfoMap.put("removeZone", zoneManagementremoveZoneInteractionInfo);
+
+ commandMap.put("zoneManagement", zoneManagementClusterInteractionInfoMap);
+
Map webRTCTransportProviderClusterInteractionInfoMap = new LinkedHashMap<>();
Map webRTCTransportProvidersolicitOfferCommandParams = new LinkedHashMap();
diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java
index 41df5ac5c85aff..7c1bdf9f4390e0 100644
--- a/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java
+++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java
@@ -18247,6 +18247,120 @@ private static Map readContentAppObserverInteractionInf
return result;
}
+ private static Map readZoneManagementInteractionInfo() {
+ Map result = new LinkedHashMap<>();Map readZoneManagementSupportedZoneSourcesCommandParams = new LinkedHashMap();
+ InteractionInfo readZoneManagementSupportedZoneSourcesAttributeInteractionInfo = new InteractionInfo(
+ (cluster, callback, commandArguments) -> {
+ ((ChipClusters.ZoneManagementCluster) cluster).readSupportedZoneSourcesAttribute(
+ (ChipClusters.ZoneManagementCluster.SupportedZoneSourcesAttributeCallback) callback
+ );
+ },
+ () -> new ClusterInfoMapping.DelegatedZoneManagementClusterSupportedZoneSourcesAttributeCallback(),
+ readZoneManagementSupportedZoneSourcesCommandParams
+ );
+ result.put("readSupportedZoneSourcesAttribute", readZoneManagementSupportedZoneSourcesAttributeInteractionInfo);
+ Map readZoneManagementZonesCommandParams = new LinkedHashMap();
+ InteractionInfo readZoneManagementZonesAttributeInteractionInfo = new InteractionInfo(
+ (cluster, callback, commandArguments) -> {
+ ((ChipClusters.ZoneManagementCluster) cluster).readZonesAttribute(
+ (ChipClusters.ZoneManagementCluster.ZonesAttributeCallback) callback
+ );
+ },
+ () -> new ClusterInfoMapping.DelegatedZoneManagementClusterZonesAttributeCallback(),
+ readZoneManagementZonesCommandParams
+ );
+ result.put("readZonesAttribute", readZoneManagementZonesAttributeInteractionInfo);
+ Map readZoneManagementTimeControlCommandParams = new LinkedHashMap();
+ InteractionInfo readZoneManagementTimeControlAttributeInteractionInfo = new InteractionInfo(
+ (cluster, callback, commandArguments) -> {
+ ((ChipClusters.ZoneManagementCluster) cluster).readTimeControlAttribute(
+ (ChipClusters.ZoneManagementCluster.TimeControlAttributeCallback) callback
+ );
+ },
+ () -> new ClusterInfoMapping.DelegatedZoneManagementClusterTimeControlAttributeCallback(),
+ readZoneManagementTimeControlCommandParams
+ );
+ result.put("readTimeControlAttribute", readZoneManagementTimeControlAttributeInteractionInfo);
+ Map readZoneManagementSensitivityCommandParams = new LinkedHashMap();
+ InteractionInfo readZoneManagementSensitivityAttributeInteractionInfo = new InteractionInfo(
+ (cluster, callback, commandArguments) -> {
+ ((ChipClusters.ZoneManagementCluster) cluster).readSensitivityAttribute(
+ (ChipClusters.IntegerAttributeCallback) callback
+ );
+ },
+ () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(),
+ readZoneManagementSensitivityCommandParams
+ );
+ result.put("readSensitivityAttribute", readZoneManagementSensitivityAttributeInteractionInfo);
+ Map readZoneManagementGeneratedCommandListCommandParams = new LinkedHashMap();
+ InteractionInfo readZoneManagementGeneratedCommandListAttributeInteractionInfo = new InteractionInfo(
+ (cluster, callback, commandArguments) -> {
+ ((ChipClusters.ZoneManagementCluster) cluster).readGeneratedCommandListAttribute(
+ (ChipClusters.ZoneManagementCluster.GeneratedCommandListAttributeCallback) callback
+ );
+ },
+ () -> new ClusterInfoMapping.DelegatedZoneManagementClusterGeneratedCommandListAttributeCallback(),
+ readZoneManagementGeneratedCommandListCommandParams
+ );
+ result.put("readGeneratedCommandListAttribute", readZoneManagementGeneratedCommandListAttributeInteractionInfo);
+ Map readZoneManagementAcceptedCommandListCommandParams = new LinkedHashMap();
+ InteractionInfo readZoneManagementAcceptedCommandListAttributeInteractionInfo = new InteractionInfo(
+ (cluster, callback, commandArguments) -> {
+ ((ChipClusters.ZoneManagementCluster) cluster).readAcceptedCommandListAttribute(
+ (ChipClusters.ZoneManagementCluster.AcceptedCommandListAttributeCallback) callback
+ );
+ },
+ () -> new ClusterInfoMapping.DelegatedZoneManagementClusterAcceptedCommandListAttributeCallback(),
+ readZoneManagementAcceptedCommandListCommandParams
+ );
+ result.put("readAcceptedCommandListAttribute", readZoneManagementAcceptedCommandListAttributeInteractionInfo);
+ Map readZoneManagementEventListCommandParams = new LinkedHashMap();
+ InteractionInfo readZoneManagementEventListAttributeInteractionInfo = new InteractionInfo(
+ (cluster, callback, commandArguments) -> {
+ ((ChipClusters.ZoneManagementCluster) cluster).readEventListAttribute(
+ (ChipClusters.ZoneManagementCluster.EventListAttributeCallback) callback
+ );
+ },
+ () -> new ClusterInfoMapping.DelegatedZoneManagementClusterEventListAttributeCallback(),
+ readZoneManagementEventListCommandParams
+ );
+ result.put("readEventListAttribute", readZoneManagementEventListAttributeInteractionInfo);
+ Map readZoneManagementAttributeListCommandParams = new LinkedHashMap();
+ InteractionInfo readZoneManagementAttributeListAttributeInteractionInfo = new InteractionInfo(
+ (cluster, callback, commandArguments) -> {
+ ((ChipClusters.ZoneManagementCluster) cluster).readAttributeListAttribute(
+ (ChipClusters.ZoneManagementCluster.AttributeListAttributeCallback) callback
+ );
+ },
+ () -> new ClusterInfoMapping.DelegatedZoneManagementClusterAttributeListAttributeCallback(),
+ readZoneManagementAttributeListCommandParams
+ );
+ result.put("readAttributeListAttribute", readZoneManagementAttributeListAttributeInteractionInfo);
+ Map readZoneManagementFeatureMapCommandParams = new LinkedHashMap();
+ InteractionInfo readZoneManagementFeatureMapAttributeInteractionInfo = new InteractionInfo(
+ (cluster, callback, commandArguments) -> {
+ ((ChipClusters.ZoneManagementCluster) cluster).readFeatureMapAttribute(
+ (ChipClusters.LongAttributeCallback) callback
+ );
+ },
+ () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(),
+ readZoneManagementFeatureMapCommandParams
+ );
+ result.put("readFeatureMapAttribute", readZoneManagementFeatureMapAttributeInteractionInfo);
+ Map readZoneManagementClusterRevisionCommandParams = new LinkedHashMap();
+ InteractionInfo readZoneManagementClusterRevisionAttributeInteractionInfo = new InteractionInfo(
+ (cluster, callback, commandArguments) -> {
+ ((ChipClusters.ZoneManagementCluster) cluster).readClusterRevisionAttribute(
+ (ChipClusters.IntegerAttributeCallback) callback
+ );
+ },
+ () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(),
+ readZoneManagementClusterRevisionCommandParams
+ );
+ result.put("readClusterRevisionAttribute", readZoneManagementClusterRevisionAttributeInteractionInfo);
+
+ return result;
+ }
private static Map readWebRTCTransportProviderInteractionInfo() {
Map result = new LinkedHashMap<>();Map readWebRTCTransportProviderCurrentSessionsCommandParams = new LinkedHashMap();
InteractionInfo readWebRTCTransportProviderCurrentSessionsAttributeInteractionInfo = new InteractionInfo(
@@ -19962,6 +20076,7 @@ public Map> getReadAttributeMap() {
put("accountLogin", readAccountLoginInteractionInfo());
put("contentControl", readContentControlInteractionInfo());
put("contentAppObserver", readContentAppObserverInteractionInfo());
+ put("zoneManagement", readZoneManagementInteractionInfo());
put("webRTCTransportProvider", readWebRTCTransportProviderInteractionInfo());
put("webRTCTransportRequestor", readWebRTCTransportRequestorInteractionInfo());
put("chime", readChimeInteractionInfo());
diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java
index b2ffaac83a4110..011171e81a47a0 100644
--- a/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java
+++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java
@@ -3472,6 +3472,30 @@ public Map> getWriteAttributeMap() {
writeAttributeMap.put("contentControl", writeContentControlInteractionInfo);
Map writeContentAppObserverInteractionInfo = new LinkedHashMap<>();
writeAttributeMap.put("contentAppObserver", writeContentAppObserverInteractionInfo);
+ Map writeZoneManagementInteractionInfo = new LinkedHashMap<>();
+ Map writeZoneManagementSensitivityCommandParams = new LinkedHashMap();
+ CommandParameterInfo zoneManagementsensitivityCommandParameterInfo =
+ new CommandParameterInfo(
+ "value",
+ Integer.class,
+ Integer.class
+ );
+ writeZoneManagementSensitivityCommandParams.put(
+ "value",
+ zoneManagementsensitivityCommandParameterInfo
+ );
+ InteractionInfo writeZoneManagementSensitivityAttributeInteractionInfo = new InteractionInfo(
+ (cluster, callback, commandArguments) -> {
+ ((ChipClusters.ZoneManagementCluster) cluster).writeSensitivityAttribute(
+ (DefaultClusterCallback) callback,
+ (Integer) commandArguments.get("value")
+ );
+ },
+ () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(),
+ writeZoneManagementSensitivityCommandParams
+ );
+ writeZoneManagementInteractionInfo.put("writeSensitivityAttribute", writeZoneManagementSensitivityAttributeInteractionInfo);
+ writeAttributeMap.put("zoneManagement", writeZoneManagementInteractionInfo);
Map writeWebRTCTransportProviderInteractionInfo = new LinkedHashMap<>();
writeAttributeMap.put("webRTCTransportProvider", writeWebRTCTransportProviderInteractionInfo);
Map writeWebRTCTransportRequestorInteractionInfo = new LinkedHashMap<>();
diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/ZoneManagementClusterZoneStoppedEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/ZoneManagementClusterZoneStoppedEvent.kt
new file mode 100644
index 00000000000000..ce1aba910110dc
--- /dev/null
+++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/ZoneManagementClusterZoneStoppedEvent.kt
@@ -0,0 +1,68 @@
+/*
+ *
+ * Copyright (c) 2023 Project CHIP Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package chip.devicecontroller.cluster.eventstructs
+
+import chip.devicecontroller.cluster.*
+import matter.tlv.AnonymousTag
+import matter.tlv.ContextSpecificTag
+import matter.tlv.Tag
+import matter.tlv.TlvReader
+import matter.tlv.TlvWriter
+
+class ZoneManagementClusterZoneStoppedEvent(val zones: List, val reason: UInt) {
+ override fun toString(): String = buildString {
+ append("ZoneManagementClusterZoneStoppedEvent {\n")
+ append("\tzones : $zones\n")
+ append("\treason : $reason\n")
+ append("}\n")
+ }
+
+ fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) {
+ tlvWriter.apply {
+ startStructure(tlvTag)
+ startArray(ContextSpecificTag(TAG_ZONES))
+ for (item in zones.iterator()) {
+ put(AnonymousTag, item)
+ }
+ endArray()
+ put(ContextSpecificTag(TAG_REASON), reason)
+ endStructure()
+ }
+ }
+
+ companion object {
+ private const val TAG_ZONES = 0
+ private const val TAG_REASON = 1
+
+ fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): ZoneManagementClusterZoneStoppedEvent {
+ tlvReader.enterStructure(tlvTag)
+ val zones =
+ buildList {
+ tlvReader.enterArray(ContextSpecificTag(TAG_ZONES))
+ while (!tlvReader.isEndOfContainer()) {
+ this.add(tlvReader.getUInt(AnonymousTag))
+ }
+ tlvReader.exitContainer()
+ }
+ val reason = tlvReader.getUInt(ContextSpecificTag(TAG_REASON))
+
+ tlvReader.exitContainer()
+
+ return ZoneManagementClusterZoneStoppedEvent(zones, reason)
+ }
+ }
+}
diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/ZoneManagementClusterZoneTriggeredEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/ZoneManagementClusterZoneTriggeredEvent.kt
new file mode 100644
index 00000000000000..610fee65212063
--- /dev/null
+++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/ZoneManagementClusterZoneTriggeredEvent.kt
@@ -0,0 +1,68 @@
+/*
+ *
+ * Copyright (c) 2023 Project CHIP Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package chip.devicecontroller.cluster.eventstructs
+
+import chip.devicecontroller.cluster.*
+import matter.tlv.AnonymousTag
+import matter.tlv.ContextSpecificTag
+import matter.tlv.Tag
+import matter.tlv.TlvReader
+import matter.tlv.TlvWriter
+
+class ZoneManagementClusterZoneTriggeredEvent(val zones: List, val reason: UInt) {
+ override fun toString(): String = buildString {
+ append("ZoneManagementClusterZoneTriggeredEvent {\n")
+ append("\tzones : $zones\n")
+ append("\treason : $reason\n")
+ append("}\n")
+ }
+
+ fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) {
+ tlvWriter.apply {
+ startStructure(tlvTag)
+ startArray(ContextSpecificTag(TAG_ZONES))
+ for (item in zones.iterator()) {
+ put(AnonymousTag, item)
+ }
+ endArray()
+ put(ContextSpecificTag(TAG_REASON), reason)
+ endStructure()
+ }
+ }
+
+ companion object {
+ private const val TAG_ZONES = 0
+ private const val TAG_REASON = 1
+
+ fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): ZoneManagementClusterZoneTriggeredEvent {
+ tlvReader.enterStructure(tlvTag)
+ val zones =
+ buildList {
+ tlvReader.enterArray(ContextSpecificTag(TAG_ZONES))
+ while (!tlvReader.isEndOfContainer()) {
+ this.add(tlvReader.getUInt(AnonymousTag))
+ }
+ tlvReader.exitContainer()
+ }
+ val reason = tlvReader.getUInt(ContextSpecificTag(TAG_REASON))
+
+ tlvReader.exitContainer()
+
+ return ZoneManagementClusterZoneTriggeredEvent(zones, reason)
+ }
+ }
+}
diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/files.gni b/src/controller/java/generated/java/chip/devicecontroller/cluster/files.gni
index 115bbe53cb3c6d..08a9ad5d6caa56 100644
--- a/src/controller/java/generated/java/chip/devicecontroller/cluster/files.gni
+++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/files.gni
@@ -164,6 +164,10 @@ structs_sources = [
"${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/WebRTCTransportProviderClusterWebRTCSessionStruct.kt",
"${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/WebRTCTransportRequestorClusterICEServerStruct.kt",
"${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/WebRTCTransportRequestorClusterWebRTCSessionStruct.kt",
+ "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ZoneManagementClusterTwoDCartesianVertexStruct.kt",
+ "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ZoneManagementClusterTwoDCartesianZoneStruct.kt",
+ "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ZoneManagementClusterZoneInformationStruct.kt",
+ "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ZoneManagementClusterZoneTriggeringTimeControlStruct.kt",
]
eventstructs_sources = [
@@ -251,4 +255,6 @@ eventstructs_sources = [
"${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/WiFiNetworkDiagnosticsClusterAssociationFailureEvent.kt",
"${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/WiFiNetworkDiagnosticsClusterConnectionStatusEvent.kt",
"${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/WiFiNetworkDiagnosticsClusterDisconnectionEvent.kt",
+ "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/ZoneManagementClusterZoneStoppedEvent.kt",
+ "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/ZoneManagementClusterZoneTriggeredEvent.kt",
]
\ No newline at end of file
diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ZoneManagementClusterTwoDCartesianVertexStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ZoneManagementClusterTwoDCartesianVertexStruct.kt
new file mode 100644
index 00000000000000..649b0338fda10c
--- /dev/null
+++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ZoneManagementClusterTwoDCartesianVertexStruct.kt
@@ -0,0 +1,56 @@
+/*
+ *
+ * Copyright (c) 2023 Project CHIP Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package chip.devicecontroller.cluster.structs
+
+import chip.devicecontroller.cluster.*
+import matter.tlv.ContextSpecificTag
+import matter.tlv.Tag
+import matter.tlv.TlvReader
+import matter.tlv.TlvWriter
+
+class ZoneManagementClusterTwoDCartesianVertexStruct(val x: UInt, val y: UInt) {
+ override fun toString(): String = buildString {
+ append("ZoneManagementClusterTwoDCartesianVertexStruct {\n")
+ append("\tx : $x\n")
+ append("\ty : $y\n")
+ append("}\n")
+ }
+
+ fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) {
+ tlvWriter.apply {
+ startStructure(tlvTag)
+ put(ContextSpecificTag(TAG_X), x)
+ put(ContextSpecificTag(TAG_Y), y)
+ endStructure()
+ }
+ }
+
+ companion object {
+ private const val TAG_X = 0
+ private const val TAG_Y = 1
+
+ fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): ZoneManagementClusterTwoDCartesianVertexStruct {
+ tlvReader.enterStructure(tlvTag)
+ val x = tlvReader.getUInt(ContextSpecificTag(TAG_X))
+ val y = tlvReader.getUInt(ContextSpecificTag(TAG_Y))
+
+ tlvReader.exitContainer()
+
+ return ZoneManagementClusterTwoDCartesianVertexStruct(x, y)
+ }
+ }
+}
diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ZoneManagementClusterTwoDCartesianZoneStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ZoneManagementClusterTwoDCartesianZoneStruct.kt
new file mode 100644
index 00000000000000..b42e6ebd80b243
--- /dev/null
+++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ZoneManagementClusterTwoDCartesianZoneStruct.kt
@@ -0,0 +1,90 @@
+/*
+ *
+ * Copyright (c) 2023 Project CHIP Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package chip.devicecontroller.cluster.structs
+
+import chip.devicecontroller.cluster.*
+import java.util.Optional
+import matter.tlv.AnonymousTag
+import matter.tlv.ContextSpecificTag
+import matter.tlv.Tag
+import matter.tlv.TlvReader
+import matter.tlv.TlvWriter
+
+class ZoneManagementClusterTwoDCartesianZoneStruct(
+ val name: String,
+ val use: UInt,
+ val vertices: List,
+ val color: Optional,
+) {
+ override fun toString(): String = buildString {
+ append("ZoneManagementClusterTwoDCartesianZoneStruct {\n")
+ append("\tname : $name\n")
+ append("\tuse : $use\n")
+ append("\tvertices : $vertices\n")
+ append("\tcolor : $color\n")
+ append("}\n")
+ }
+
+ fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) {
+ tlvWriter.apply {
+ startStructure(tlvTag)
+ put(ContextSpecificTag(TAG_NAME), name)
+ put(ContextSpecificTag(TAG_USE), use)
+ startArray(ContextSpecificTag(TAG_VERTICES))
+ for (item in vertices.iterator()) {
+ item.toTlv(AnonymousTag, this)
+ }
+ endArray()
+ if (color.isPresent) {
+ val optcolor = color.get()
+ put(ContextSpecificTag(TAG_COLOR), optcolor)
+ }
+ endStructure()
+ }
+ }
+
+ companion object {
+ private const val TAG_NAME = 0
+ private const val TAG_USE = 1
+ private const val TAG_VERTICES = 2
+ private const val TAG_COLOR = 3
+
+ fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): ZoneManagementClusterTwoDCartesianZoneStruct {
+ tlvReader.enterStructure(tlvTag)
+ val name = tlvReader.getString(ContextSpecificTag(TAG_NAME))
+ val use = tlvReader.getUInt(ContextSpecificTag(TAG_USE))
+ val vertices =
+ buildList {
+ tlvReader.enterArray(ContextSpecificTag(TAG_VERTICES))
+ while (!tlvReader.isEndOfContainer()) {
+ add(ZoneManagementClusterTwoDCartesianVertexStruct.fromTlv(AnonymousTag, tlvReader))
+ }
+ tlvReader.exitContainer()
+ }
+ val color =
+ if (tlvReader.isNextTag(ContextSpecificTag(TAG_COLOR))) {
+ Optional.of(tlvReader.getString(ContextSpecificTag(TAG_COLOR)))
+ } else {
+ Optional.empty()
+ }
+
+ tlvReader.exitContainer()
+
+ return ZoneManagementClusterTwoDCartesianZoneStruct(name, use, vertices, color)
+ }
+ }
+}
diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ZoneManagementClusterZoneInformationStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ZoneManagementClusterZoneInformationStruct.kt
new file mode 100644
index 00000000000000..3073c80152b2e5
--- /dev/null
+++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ZoneManagementClusterZoneInformationStruct.kt
@@ -0,0 +1,64 @@
+/*
+ *
+ * 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 ZoneManagementClusterZoneInformationStruct(
+ val zoneID: UInt,
+ val zoneType: UInt,
+ val zoneSource: UInt,
+) {
+ override fun toString(): String = buildString {
+ append("ZoneManagementClusterZoneInformationStruct {\n")
+ append("\tzoneID : $zoneID\n")
+ append("\tzoneType : $zoneType\n")
+ append("\tzoneSource : $zoneSource\n")
+ append("}\n")
+ }
+
+ fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) {
+ tlvWriter.apply {
+ startStructure(tlvTag)
+ put(ContextSpecificTag(TAG_ZONE_ID), zoneID)
+ put(ContextSpecificTag(TAG_ZONE_TYPE), zoneType)
+ put(ContextSpecificTag(TAG_ZONE_SOURCE), zoneSource)
+ endStructure()
+ }
+ }
+
+ companion object {
+ private const val TAG_ZONE_ID = 0
+ private const val TAG_ZONE_TYPE = 1
+ private const val TAG_ZONE_SOURCE = 2
+
+ fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): ZoneManagementClusterZoneInformationStruct {
+ tlvReader.enterStructure(tlvTag)
+ val zoneID = tlvReader.getUInt(ContextSpecificTag(TAG_ZONE_ID))
+ val zoneType = tlvReader.getUInt(ContextSpecificTag(TAG_ZONE_TYPE))
+ val zoneSource = tlvReader.getUInt(ContextSpecificTag(TAG_ZONE_SOURCE))
+
+ tlvReader.exitContainer()
+
+ return ZoneManagementClusterZoneInformationStruct(zoneID, zoneType, zoneSource)
+ }
+ }
+}
diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ZoneManagementClusterZoneTriggeringTimeControlStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ZoneManagementClusterZoneTriggeringTimeControlStruct.kt
new file mode 100644
index 00000000000000..3e55171ac8c1dc
--- /dev/null
+++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ZoneManagementClusterZoneTriggeringTimeControlStruct.kt
@@ -0,0 +1,77 @@
+/*
+ *
+ * Copyright (c) 2023 Project CHIP Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package chip.devicecontroller.cluster.structs
+
+import chip.devicecontroller.cluster.*
+import matter.tlv.ContextSpecificTag
+import matter.tlv.Tag
+import matter.tlv.TlvReader
+import matter.tlv.TlvWriter
+
+class ZoneManagementClusterZoneTriggeringTimeControlStruct(
+ val initialDuration: UInt,
+ val augmentationDuration: UInt,
+ val maxDuration: ULong,
+ val blindDuration: UInt,
+) {
+ override fun toString(): String = buildString {
+ append("ZoneManagementClusterZoneTriggeringTimeControlStruct {\n")
+ append("\tinitialDuration : $initialDuration\n")
+ append("\taugmentationDuration : $augmentationDuration\n")
+ append("\tmaxDuration : $maxDuration\n")
+ append("\tblindDuration : $blindDuration\n")
+ append("}\n")
+ }
+
+ fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) {
+ tlvWriter.apply {
+ startStructure(tlvTag)
+ put(ContextSpecificTag(TAG_INITIAL_DURATION), initialDuration)
+ put(ContextSpecificTag(TAG_AUGMENTATION_DURATION), augmentationDuration)
+ put(ContextSpecificTag(TAG_MAX_DURATION), maxDuration)
+ put(ContextSpecificTag(TAG_BLIND_DURATION), blindDuration)
+ endStructure()
+ }
+ }
+
+ companion object {
+ private const val TAG_INITIAL_DURATION = 0
+ private const val TAG_AUGMENTATION_DURATION = 1
+ private const val TAG_MAX_DURATION = 2
+ private const val TAG_BLIND_DURATION = 3
+
+ fun fromTlv(
+ tlvTag: Tag,
+ tlvReader: TlvReader,
+ ): ZoneManagementClusterZoneTriggeringTimeControlStruct {
+ tlvReader.enterStructure(tlvTag)
+ val initialDuration = tlvReader.getUInt(ContextSpecificTag(TAG_INITIAL_DURATION))
+ val augmentationDuration = tlvReader.getUInt(ContextSpecificTag(TAG_AUGMENTATION_DURATION))
+ val maxDuration = tlvReader.getULong(ContextSpecificTag(TAG_MAX_DURATION))
+ val blindDuration = tlvReader.getUInt(ContextSpecificTag(TAG_BLIND_DURATION))
+
+ tlvReader.exitContainer()
+
+ return ZoneManagementClusterZoneTriggeringTimeControlStruct(
+ initialDuration,
+ augmentationDuration,
+ maxDuration,
+ blindDuration,
+ )
+ }
+ }
+}
diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/ZoneManagementCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/ZoneManagementCluster.kt
new file mode 100644
index 00000000000000..c51fe6eaf0da23
--- /dev/null
+++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/ZoneManagementCluster.kt
@@ -0,0 +1,1296 @@
+/*
+ *
+ * Copyright (c) 2023 Project CHIP Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package matter.controller.cluster.clusters
+
+import java.time.Duration
+import java.util.logging.Level
+import java.util.logging.Logger
+import kotlinx.coroutines.flow.Flow
+import kotlinx.coroutines.flow.transform
+import matter.controller.InvokeRequest
+import matter.controller.InvokeResponse
+import matter.controller.MatterController
+import matter.controller.ReadData
+import matter.controller.ReadRequest
+import matter.controller.SubscribeRequest
+import matter.controller.SubscriptionState
+import matter.controller.UByteSubscriptionState
+import matter.controller.UIntSubscriptionState
+import matter.controller.UShortSubscriptionState
+import matter.controller.WriteRequest
+import matter.controller.WriteRequests
+import matter.controller.WriteResponse
+import matter.controller.cluster.structs.*
+import matter.controller.model.AttributePath
+import matter.controller.model.CommandPath
+import matter.tlv.AnonymousTag
+import matter.tlv.ContextSpecificTag
+import matter.tlv.TlvReader
+import matter.tlv.TlvWriter
+
+class ZoneManagementCluster(
+ private val controller: MatterController,
+ private val endpointId: UShort,
+) {
+ class CreateTwoDCartesianZoneResponse(val zoneID: UShort)
+
+ class GetTwoDCartesianZoneResponse(val zones: List)
+
+ class SupportedZoneSourcesAttribute(val value: List)
+
+ sealed class SupportedZoneSourcesAttributeSubscriptionState {
+ data class Success(val value: List) : SupportedZoneSourcesAttributeSubscriptionState()
+
+ data class Error(val exception: Exception) : SupportedZoneSourcesAttributeSubscriptionState()
+
+ object SubscriptionEstablished : SupportedZoneSourcesAttributeSubscriptionState()
+ }
+
+ class ZonesAttribute(val value: List?)
+
+ sealed class ZonesAttributeSubscriptionState {
+ data class Success(val value: List?) :
+ ZonesAttributeSubscriptionState()
+
+ data class Error(val exception: Exception) : ZonesAttributeSubscriptionState()
+
+ object SubscriptionEstablished : ZonesAttributeSubscriptionState()
+ }
+
+ class TimeControlAttribute(val value: List)
+
+ sealed class TimeControlAttributeSubscriptionState {
+ data class Success(val value: List) :
+ TimeControlAttributeSubscriptionState()
+
+ data class Error(val exception: Exception) : TimeControlAttributeSubscriptionState()
+
+ object SubscriptionEstablished : TimeControlAttributeSubscriptionState()
+ }
+
+ 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 createTwoDCartesianZone(
+ zone: ZoneManagementClusterTwoDCartesianZoneStruct,
+ timedInvokeTimeout: Duration? = null,
+ ): CreateTwoDCartesianZoneResponse {
+ val commandId: UInt = 0u
+
+ val tlvWriter = TlvWriter()
+ tlvWriter.startStructure(AnonymousTag)
+
+ val TAG_ZONE_REQ: Int = 0
+ zone.toTlv(ContextSpecificTag(TAG_ZONE_REQ), tlvWriter)
+ tlvWriter.endStructure()
+
+ val request: InvokeRequest =
+ InvokeRequest(
+ CommandPath(endpointId, clusterId = CLUSTER_ID, commandId),
+ tlvPayload = tlvWriter.getEncoded(),
+ timedRequest = timedInvokeTimeout,
+ )
+
+ val response: InvokeResponse = controller.invoke(request)
+ logger.log(Level.FINE, "Invoke command succeeded: ${response}")
+
+ val tlvReader = TlvReader(response.payload)
+ tlvReader.enterStructure(AnonymousTag)
+ val TAG_ZONE_ID: Int = 0
+ var zoneID_decoded: UShort? = null
+
+ while (!tlvReader.isEndOfContainer()) {
+ val tag = tlvReader.peekElement().tag
+
+ if (tag == ContextSpecificTag(TAG_ZONE_ID)) {
+ zoneID_decoded = tlvReader.getUShort(tag)
+ } else {
+ tlvReader.skipElement()
+ }
+ }
+
+ if (zoneID_decoded == null) {
+ throw IllegalStateException("zoneID not found in TLV")
+ }
+
+ tlvReader.exitContainer()
+
+ return CreateTwoDCartesianZoneResponse(zoneID_decoded)
+ }
+
+ suspend fun updateTwoDCartesianZone(
+ zoneID: UShort,
+ zone: ZoneManagementClusterTwoDCartesianZoneStruct,
+ timedInvokeTimeout: Duration? = null,
+ ) {
+ val commandId: UInt = 2u
+
+ val tlvWriter = TlvWriter()
+ tlvWriter.startStructure(AnonymousTag)
+
+ val TAG_ZONE_ID_REQ: Int = 0
+ tlvWriter.put(ContextSpecificTag(TAG_ZONE_ID_REQ), zoneID)
+
+ val TAG_ZONE_REQ: Int = 1
+ zone.toTlv(ContextSpecificTag(TAG_ZONE_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 getTwoDCartesianZone(
+ zoneID: UShort?,
+ timedInvokeTimeout: Duration? = null,
+ ): GetTwoDCartesianZoneResponse {
+ val commandId: UInt = 3u
+
+ val tlvWriter = TlvWriter()
+ tlvWriter.startStructure(AnonymousTag)
+
+ val TAG_ZONE_ID_REQ: Int = 0
+ zoneID?.let { tlvWriter.put(ContextSpecificTag(TAG_ZONE_ID_REQ), zoneID) }
+ tlvWriter.endStructure()
+
+ val request: InvokeRequest =
+ InvokeRequest(
+ CommandPath(endpointId, clusterId = CLUSTER_ID, commandId),
+ tlvPayload = tlvWriter.getEncoded(),
+ timedRequest = timedInvokeTimeout,
+ )
+
+ val response: InvokeResponse = controller.invoke(request)
+ logger.log(Level.FINE, "Invoke command succeeded: ${response}")
+
+ val tlvReader = TlvReader(response.payload)
+ tlvReader.enterStructure(AnonymousTag)
+ val TAG_ZONES: Int = 0
+ var zones_decoded: List? = null
+
+ while (!tlvReader.isEndOfContainer()) {
+ val tag = tlvReader.peekElement().tag
+
+ if (tag == ContextSpecificTag(TAG_ZONES)) {
+ zones_decoded =
+ buildList {
+ tlvReader.enterArray(tag)
+ while (!tlvReader.isEndOfContainer()) {
+ add(ZoneManagementClusterTwoDCartesianZoneStruct.fromTlv(AnonymousTag, tlvReader))
+ }
+ tlvReader.exitContainer()
+ }
+ } else {
+ tlvReader.skipElement()
+ }
+ }
+
+ if (zones_decoded == null) {
+ throw IllegalStateException("zones not found in TLV")
+ }
+
+ tlvReader.exitContainer()
+
+ return GetTwoDCartesianZoneResponse(zones_decoded)
+ }
+
+ suspend fun removeZone(zoneID: UShort, timedInvokeTimeout: Duration? = null) {
+ val commandId: UInt = 5u
+
+ val tlvWriter = TlvWriter()
+ tlvWriter.startStructure(AnonymousTag)
+
+ val TAG_ZONE_ID_REQ: Int = 0
+ tlvWriter.put(ContextSpecificTag(TAG_ZONE_ID_REQ), zoneID)
+ 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 readSupportedZoneSourcesAttribute(): SupportedZoneSourcesAttribute {
+ 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) { "Supportedzonesources attribute not found in response" }
+
+ // Decode the TLV data into the appropriate type
+ val tlvReader = TlvReader(attributeData.data)
+ val decodedValue: List =
+ buildList {
+ tlvReader.enterArray(AnonymousTag)
+ while (!tlvReader.isEndOfContainer()) {
+ add(tlvReader.getUByte(AnonymousTag))
+ }
+ tlvReader.exitContainer()
+ }
+
+ return SupportedZoneSourcesAttribute(decodedValue)
+ }
+
+ suspend fun subscribeSupportedZoneSourcesAttribute(
+ 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(
+ SupportedZoneSourcesAttributeSubscriptionState.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) {
+ "Supportedzonesources attribute not found in Node State update"
+ }
+
+ // Decode the TLV data into the appropriate type
+ val tlvReader = TlvReader(attributeData.data)
+ val decodedValue: List =
+ buildList {
+ tlvReader.enterArray(AnonymousTag)
+ while (!tlvReader.isEndOfContainer()) {
+ add(tlvReader.getUByte(AnonymousTag))
+ }
+ tlvReader.exitContainer()
+ }
+
+ emit(SupportedZoneSourcesAttributeSubscriptionState.Success(decodedValue))
+ }
+ SubscriptionState.SubscriptionEstablished -> {
+ emit(SupportedZoneSourcesAttributeSubscriptionState.SubscriptionEstablished)
+ }
+ }
+ }
+ }
+
+ suspend fun readZonesAttribute(): ZonesAttribute {
+ 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) { "Zones 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(ZoneManagementClusterZoneInformationStruct.fromTlv(AnonymousTag, tlvReader))
+ }
+ tlvReader.exitContainer()
+ }
+ } else {
+ null
+ }
+
+ return ZonesAttribute(decodedValue)
+ }
+
+ suspend fun subscribeZonesAttribute(
+ 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(
+ ZonesAttributeSubscriptionState.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) { "Zones 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(ZoneManagementClusterZoneInformationStruct.fromTlv(AnonymousTag, tlvReader))
+ }
+ tlvReader.exitContainer()
+ }
+ } else {
+ null
+ }
+
+ decodedValue?.let { emit(ZonesAttributeSubscriptionState.Success(it)) }
+ }
+ SubscriptionState.SubscriptionEstablished -> {
+ emit(ZonesAttributeSubscriptionState.SubscriptionEstablished)
+ }
+ }
+ }
+ }
+
+ suspend fun readTimeControlAttribute(): TimeControlAttribute {
+ 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) { "Timecontrol 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(ZoneManagementClusterZoneTriggeringTimeControlStruct.fromTlv(AnonymousTag, tlvReader))
+ }
+ tlvReader.exitContainer()
+ }
+
+ return TimeControlAttribute(decodedValue)
+ }
+
+ suspend fun writeTimeControlAttribute(
+ value: List,
+ timedWriteTimeout: Duration? = null,
+ ) {
+ val ATTRIBUTE_ID: UInt = 2u
+
+ val tlvWriter = TlvWriter()
+ tlvWriter.startArray(AnonymousTag)
+ for (item in value.iterator()) {
+ item.toTlv(AnonymousTag, tlvWriter)
+ }
+ tlvWriter.endArray()
+
+ val writeRequests: WriteRequests =
+ WriteRequests(
+ requests =
+ listOf(
+ WriteRequest(
+ attributePath =
+ AttributePath(endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID),
+ tlvPayload = tlvWriter.getEncoded(),
+ )
+ ),
+ timedRequest = timedWriteTimeout,
+ )
+
+ val response: WriteResponse = controller.write(writeRequests)
+
+ when (response) {
+ is WriteResponse.Success -> {
+ logger.log(Level.FINE, "Write command succeeded")
+ }
+ is WriteResponse.PartialWriteFailure -> {
+ val aggregatedErrorMessage =
+ response.failures.joinToString("\n") { failure ->
+ "Error at ${failure.attributePath}: ${failure.ex.message}"
+ }
+
+ response.failures.forEach { failure ->
+ logger.log(Level.WARNING, "Error at ${failure.attributePath}: ${failure.ex.message}")
+ }
+
+ throw IllegalStateException("Write command failed with errors: \n$aggregatedErrorMessage")
+ }
+ }
+ }
+
+ suspend fun subscribeTimeControlAttribute(
+ 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(
+ TimeControlAttributeSubscriptionState.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) { "Timecontrol 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(
+ ZoneManagementClusterZoneTriggeringTimeControlStruct.fromTlv(
+ AnonymousTag,
+ tlvReader,
+ )
+ )
+ }
+ tlvReader.exitContainer()
+ }
+
+ emit(TimeControlAttributeSubscriptionState.Success(decodedValue))
+ }
+ SubscriptionState.SubscriptionEstablished -> {
+ emit(TimeControlAttributeSubscriptionState.SubscriptionEstablished)
+ }
+ }
+ }
+ }
+
+ suspend fun readSensitivityAttribute(): UByte {
+ 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) { "Sensitivity attribute not found in response" }
+
+ // Decode the TLV data into the appropriate type
+ val tlvReader = TlvReader(attributeData.data)
+ val decodedValue: UByte = tlvReader.getUByte(AnonymousTag)
+
+ return decodedValue
+ }
+
+ suspend fun writeSensitivityAttribute(value: UByte, timedWriteTimeout: Duration? = null) {
+ val ATTRIBUTE_ID: UInt = 3u
+
+ val tlvWriter = TlvWriter()
+ tlvWriter.put(AnonymousTag, value)
+
+ val writeRequests: WriteRequests =
+ WriteRequests(
+ requests =
+ listOf(
+ WriteRequest(
+ attributePath =
+ AttributePath(endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID),
+ tlvPayload = tlvWriter.getEncoded(),
+ )
+ ),
+ timedRequest = timedWriteTimeout,
+ )
+
+ val response: WriteResponse = controller.write(writeRequests)
+
+ when (response) {
+ is WriteResponse.Success -> {
+ logger.log(Level.FINE, "Write command succeeded")
+ }
+ is WriteResponse.PartialWriteFailure -> {
+ val aggregatedErrorMessage =
+ response.failures.joinToString("\n") { failure ->
+ "Error at ${failure.attributePath}: ${failure.ex.message}"
+ }
+
+ response.failures.forEach { failure ->
+ logger.log(Level.WARNING, "Error at ${failure.attributePath}: ${failure.ex.message}")
+ }
+
+ throw IllegalStateException("Write command failed with errors: \n$aggregatedErrorMessage")
+ }
+ }
+ }
+
+ suspend fun subscribeSensitivityAttribute(
+ 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(
+ 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) { "Sensitivity attribute not found in Node State update" }
+
+ // Decode the TLV data into the appropriate type
+ val tlvReader = TlvReader(attributeData.data)
+ val decodedValue: UByte = tlvReader.getUByte(AnonymousTag)
+
+ emit(UByteSubscriptionState.Success(decodedValue))
+ }
+ SubscriptionState.SubscriptionEstablished -> {
+ emit(UByteSubscriptionState.SubscriptionEstablished)
+ }
+ }
+ }
+ }
+
+ suspend fun 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(ZoneManagementCluster::class.java.name)
+ const val CLUSTER_ID: UInt = 1360u
+ }
+}
diff --git a/src/controller/java/generated/java/matter/controller/cluster/eventstructs/ZoneManagementClusterZoneStoppedEvent.kt b/src/controller/java/generated/java/matter/controller/cluster/eventstructs/ZoneManagementClusterZoneStoppedEvent.kt
new file mode 100644
index 00000000000000..424437cf892762
--- /dev/null
+++ b/src/controller/java/generated/java/matter/controller/cluster/eventstructs/ZoneManagementClusterZoneStoppedEvent.kt
@@ -0,0 +1,68 @@
+/*
+ *
+ * Copyright (c) 2023 Project CHIP Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package matter.controller.cluster.eventstructs
+
+import matter.controller.cluster.*
+import matter.tlv.AnonymousTag
+import matter.tlv.ContextSpecificTag
+import matter.tlv.Tag
+import matter.tlv.TlvReader
+import matter.tlv.TlvWriter
+
+class ZoneManagementClusterZoneStoppedEvent(val zones: List, val reason: UByte) {
+ override fun toString(): String = buildString {
+ append("ZoneManagementClusterZoneStoppedEvent {\n")
+ append("\tzones : $zones\n")
+ append("\treason : $reason\n")
+ append("}\n")
+ }
+
+ fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) {
+ tlvWriter.apply {
+ startStructure(tlvTag)
+ startArray(ContextSpecificTag(TAG_ZONES))
+ for (item in zones.iterator()) {
+ put(AnonymousTag, item)
+ }
+ endArray()
+ put(ContextSpecificTag(TAG_REASON), reason)
+ endStructure()
+ }
+ }
+
+ companion object {
+ private const val TAG_ZONES = 0
+ private const val TAG_REASON = 1
+
+ fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): ZoneManagementClusterZoneStoppedEvent {
+ tlvReader.enterStructure(tlvTag)
+ val zones =
+ buildList {
+ tlvReader.enterArray(ContextSpecificTag(TAG_ZONES))
+ while (!tlvReader.isEndOfContainer()) {
+ this.add(tlvReader.getUShort(AnonymousTag))
+ }
+ tlvReader.exitContainer()
+ }
+ val reason = tlvReader.getUByte(ContextSpecificTag(TAG_REASON))
+
+ tlvReader.exitContainer()
+
+ return ZoneManagementClusterZoneStoppedEvent(zones, reason)
+ }
+ }
+}
diff --git a/src/controller/java/generated/java/matter/controller/cluster/eventstructs/ZoneManagementClusterZoneTriggeredEvent.kt b/src/controller/java/generated/java/matter/controller/cluster/eventstructs/ZoneManagementClusterZoneTriggeredEvent.kt
new file mode 100644
index 00000000000000..42300fd3502357
--- /dev/null
+++ b/src/controller/java/generated/java/matter/controller/cluster/eventstructs/ZoneManagementClusterZoneTriggeredEvent.kt
@@ -0,0 +1,68 @@
+/*
+ *
+ * Copyright (c) 2023 Project CHIP Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package matter.controller.cluster.eventstructs
+
+import matter.controller.cluster.*
+import matter.tlv.AnonymousTag
+import matter.tlv.ContextSpecificTag
+import matter.tlv.Tag
+import matter.tlv.TlvReader
+import matter.tlv.TlvWriter
+
+class ZoneManagementClusterZoneTriggeredEvent(val zones: List, val reason: UByte) {
+ override fun toString(): String = buildString {
+ append("ZoneManagementClusterZoneTriggeredEvent {\n")
+ append("\tzones : $zones\n")
+ append("\treason : $reason\n")
+ append("}\n")
+ }
+
+ fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) {
+ tlvWriter.apply {
+ startStructure(tlvTag)
+ startArray(ContextSpecificTag(TAG_ZONES))
+ for (item in zones.iterator()) {
+ put(AnonymousTag, item)
+ }
+ endArray()
+ put(ContextSpecificTag(TAG_REASON), reason)
+ endStructure()
+ }
+ }
+
+ companion object {
+ private const val TAG_ZONES = 0
+ private const val TAG_REASON = 1
+
+ fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): ZoneManagementClusterZoneTriggeredEvent {
+ tlvReader.enterStructure(tlvTag)
+ val zones =
+ buildList {
+ tlvReader.enterArray(ContextSpecificTag(TAG_ZONES))
+ while (!tlvReader.isEndOfContainer()) {
+ this.add(tlvReader.getUShort(AnonymousTag))
+ }
+ tlvReader.exitContainer()
+ }
+ val reason = tlvReader.getUByte(ContextSpecificTag(TAG_REASON))
+
+ tlvReader.exitContainer()
+
+ return ZoneManagementClusterZoneTriggeredEvent(zones, reason)
+ }
+ }
+}
diff --git a/src/controller/java/generated/java/matter/controller/cluster/files.gni b/src/controller/java/generated/java/matter/controller/cluster/files.gni
index 73e0a1190a0ac4..a237dc952140d2 100644
--- a/src/controller/java/generated/java/matter/controller/cluster/files.gni
+++ b/src/controller/java/generated/java/matter/controller/cluster/files.gni
@@ -164,6 +164,10 @@ matter_structs_sources = [
"${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/WebRTCTransportProviderClusterWebRTCSessionStruct.kt",
"${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/WebRTCTransportRequestorClusterICEServerStruct.kt",
"${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/WebRTCTransportRequestorClusterWebRTCSessionStruct.kt",
+ "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/ZoneManagementClusterTwoDCartesianVertexStruct.kt",
+ "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/ZoneManagementClusterTwoDCartesianZoneStruct.kt",
+ "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/ZoneManagementClusterZoneInformationStruct.kt",
+ "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/ZoneManagementClusterZoneTriggeringTimeControlStruct.kt",
]
matter_eventstructs_sources = [
@@ -251,6 +255,8 @@ matter_eventstructs_sources = [
"${chip_root}/src/controller/java/generated/java/matter/controller/cluster/eventstructs/WiFiNetworkDiagnosticsClusterAssociationFailureEvent.kt",
"${chip_root}/src/controller/java/generated/java/matter/controller/cluster/eventstructs/WiFiNetworkDiagnosticsClusterConnectionStatusEvent.kt",
"${chip_root}/src/controller/java/generated/java/matter/controller/cluster/eventstructs/WiFiNetworkDiagnosticsClusterDisconnectionEvent.kt",
+ "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/eventstructs/ZoneManagementClusterZoneStoppedEvent.kt",
+ "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/eventstructs/ZoneManagementClusterZoneTriggeredEvent.kt",
]
matter_clusters_sources = [
@@ -379,4 +385,5 @@ matter_clusters_sources = [
"${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/WiFiNetworkDiagnosticsCluster.kt",
"${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/WiFiNetworkManagementCluster.kt",
"${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/WindowCoveringCluster.kt",
+ "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/ZoneManagementCluster.kt",
]
\ No newline at end of file
diff --git a/src/controller/java/generated/java/matter/controller/cluster/structs/ZoneManagementClusterTwoDCartesianVertexStruct.kt b/src/controller/java/generated/java/matter/controller/cluster/structs/ZoneManagementClusterTwoDCartesianVertexStruct.kt
new file mode 100644
index 00000000000000..3ff890b7eccf08
--- /dev/null
+++ b/src/controller/java/generated/java/matter/controller/cluster/structs/ZoneManagementClusterTwoDCartesianVertexStruct.kt
@@ -0,0 +1,56 @@
+/*
+ *
+ * Copyright (c) 2023 Project CHIP Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package matter.controller.cluster.structs
+
+import matter.controller.cluster.*
+import matter.tlv.ContextSpecificTag
+import matter.tlv.Tag
+import matter.tlv.TlvReader
+import matter.tlv.TlvWriter
+
+class ZoneManagementClusterTwoDCartesianVertexStruct(val x: UShort, val y: UShort) {
+ override fun toString(): String = buildString {
+ append("ZoneManagementClusterTwoDCartesianVertexStruct {\n")
+ append("\tx : $x\n")
+ append("\ty : $y\n")
+ append("}\n")
+ }
+
+ fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) {
+ tlvWriter.apply {
+ startStructure(tlvTag)
+ put(ContextSpecificTag(TAG_X), x)
+ put(ContextSpecificTag(TAG_Y), y)
+ endStructure()
+ }
+ }
+
+ companion object {
+ private const val TAG_X = 0
+ private const val TAG_Y = 1
+
+ fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): ZoneManagementClusterTwoDCartesianVertexStruct {
+ tlvReader.enterStructure(tlvTag)
+ val x = tlvReader.getUShort(ContextSpecificTag(TAG_X))
+ val y = tlvReader.getUShort(ContextSpecificTag(TAG_Y))
+
+ tlvReader.exitContainer()
+
+ return ZoneManagementClusterTwoDCartesianVertexStruct(x, y)
+ }
+ }
+}
diff --git a/src/controller/java/generated/java/matter/controller/cluster/structs/ZoneManagementClusterTwoDCartesianZoneStruct.kt b/src/controller/java/generated/java/matter/controller/cluster/structs/ZoneManagementClusterTwoDCartesianZoneStruct.kt
new file mode 100644
index 00000000000000..117fabb7091a21
--- /dev/null
+++ b/src/controller/java/generated/java/matter/controller/cluster/structs/ZoneManagementClusterTwoDCartesianZoneStruct.kt
@@ -0,0 +1,90 @@
+/*
+ *
+ * Copyright (c) 2023 Project CHIP Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package matter.controller.cluster.structs
+
+import java.util.Optional
+import matter.controller.cluster.*
+import matter.tlv.AnonymousTag
+import matter.tlv.ContextSpecificTag
+import matter.tlv.Tag
+import matter.tlv.TlvReader
+import matter.tlv.TlvWriter
+
+class ZoneManagementClusterTwoDCartesianZoneStruct(
+ val name: String,
+ val use: UByte,
+ val vertices: List,
+ val color: Optional,
+) {
+ override fun toString(): String = buildString {
+ append("ZoneManagementClusterTwoDCartesianZoneStruct {\n")
+ append("\tname : $name\n")
+ append("\tuse : $use\n")
+ append("\tvertices : $vertices\n")
+ append("\tcolor : $color\n")
+ append("}\n")
+ }
+
+ fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) {
+ tlvWriter.apply {
+ startStructure(tlvTag)
+ put(ContextSpecificTag(TAG_NAME), name)
+ put(ContextSpecificTag(TAG_USE), use)
+ startArray(ContextSpecificTag(TAG_VERTICES))
+ for (item in vertices.iterator()) {
+ item.toTlv(AnonymousTag, this)
+ }
+ endArray()
+ if (color.isPresent) {
+ val optcolor = color.get()
+ put(ContextSpecificTag(TAG_COLOR), optcolor)
+ }
+ endStructure()
+ }
+ }
+
+ companion object {
+ private const val TAG_NAME = 0
+ private const val TAG_USE = 1
+ private const val TAG_VERTICES = 2
+ private const val TAG_COLOR = 3
+
+ fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): ZoneManagementClusterTwoDCartesianZoneStruct {
+ tlvReader.enterStructure(tlvTag)
+ val name = tlvReader.getString(ContextSpecificTag(TAG_NAME))
+ val use = tlvReader.getUByte(ContextSpecificTag(TAG_USE))
+ val vertices =
+ buildList {
+ tlvReader.enterArray(ContextSpecificTag(TAG_VERTICES))
+ while (!tlvReader.isEndOfContainer()) {
+ add(ZoneManagementClusterTwoDCartesianVertexStruct.fromTlv(AnonymousTag, tlvReader))
+ }
+ tlvReader.exitContainer()
+ }
+ val color =
+ if (tlvReader.isNextTag(ContextSpecificTag(TAG_COLOR))) {
+ Optional.of(tlvReader.getString(ContextSpecificTag(TAG_COLOR)))
+ } else {
+ Optional.empty()
+ }
+
+ tlvReader.exitContainer()
+
+ return ZoneManagementClusterTwoDCartesianZoneStruct(name, use, vertices, color)
+ }
+ }
+}
diff --git a/src/controller/java/generated/java/matter/controller/cluster/structs/ZoneManagementClusterZoneInformationStruct.kt b/src/controller/java/generated/java/matter/controller/cluster/structs/ZoneManagementClusterZoneInformationStruct.kt
new file mode 100644
index 00000000000000..8de10c83a43d2d
--- /dev/null
+++ b/src/controller/java/generated/java/matter/controller/cluster/structs/ZoneManagementClusterZoneInformationStruct.kt
@@ -0,0 +1,64 @@
+/*
+ *
+ * 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 ZoneManagementClusterZoneInformationStruct(
+ val zoneID: UShort,
+ val zoneType: UByte,
+ val zoneSource: UByte,
+) {
+ override fun toString(): String = buildString {
+ append("ZoneManagementClusterZoneInformationStruct {\n")
+ append("\tzoneID : $zoneID\n")
+ append("\tzoneType : $zoneType\n")
+ append("\tzoneSource : $zoneSource\n")
+ append("}\n")
+ }
+
+ fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) {
+ tlvWriter.apply {
+ startStructure(tlvTag)
+ put(ContextSpecificTag(TAG_ZONE_ID), zoneID)
+ put(ContextSpecificTag(TAG_ZONE_TYPE), zoneType)
+ put(ContextSpecificTag(TAG_ZONE_SOURCE), zoneSource)
+ endStructure()
+ }
+ }
+
+ companion object {
+ private const val TAG_ZONE_ID = 0
+ private const val TAG_ZONE_TYPE = 1
+ private const val TAG_ZONE_SOURCE = 2
+
+ fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): ZoneManagementClusterZoneInformationStruct {
+ tlvReader.enterStructure(tlvTag)
+ val zoneID = tlvReader.getUShort(ContextSpecificTag(TAG_ZONE_ID))
+ val zoneType = tlvReader.getUByte(ContextSpecificTag(TAG_ZONE_TYPE))
+ val zoneSource = tlvReader.getUByte(ContextSpecificTag(TAG_ZONE_SOURCE))
+
+ tlvReader.exitContainer()
+
+ return ZoneManagementClusterZoneInformationStruct(zoneID, zoneType, zoneSource)
+ }
+ }
+}
diff --git a/src/controller/java/generated/java/matter/controller/cluster/structs/ZoneManagementClusterZoneTriggeringTimeControlStruct.kt b/src/controller/java/generated/java/matter/controller/cluster/structs/ZoneManagementClusterZoneTriggeringTimeControlStruct.kt
new file mode 100644
index 00000000000000..8978d74256a2c9
--- /dev/null
+++ b/src/controller/java/generated/java/matter/controller/cluster/structs/ZoneManagementClusterZoneTriggeringTimeControlStruct.kt
@@ -0,0 +1,77 @@
+/*
+ *
+ * Copyright (c) 2023 Project CHIP Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package matter.controller.cluster.structs
+
+import matter.controller.cluster.*
+import matter.tlv.ContextSpecificTag
+import matter.tlv.Tag
+import matter.tlv.TlvReader
+import matter.tlv.TlvWriter
+
+class ZoneManagementClusterZoneTriggeringTimeControlStruct(
+ val initialDuration: UShort,
+ val augmentationDuration: UShort,
+ val maxDuration: UInt,
+ val blindDuration: UShort,
+) {
+ override fun toString(): String = buildString {
+ append("ZoneManagementClusterZoneTriggeringTimeControlStruct {\n")
+ append("\tinitialDuration : $initialDuration\n")
+ append("\taugmentationDuration : $augmentationDuration\n")
+ append("\tmaxDuration : $maxDuration\n")
+ append("\tblindDuration : $blindDuration\n")
+ append("}\n")
+ }
+
+ fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) {
+ tlvWriter.apply {
+ startStructure(tlvTag)
+ put(ContextSpecificTag(TAG_INITIAL_DURATION), initialDuration)
+ put(ContextSpecificTag(TAG_AUGMENTATION_DURATION), augmentationDuration)
+ put(ContextSpecificTag(TAG_MAX_DURATION), maxDuration)
+ put(ContextSpecificTag(TAG_BLIND_DURATION), blindDuration)
+ endStructure()
+ }
+ }
+
+ companion object {
+ private const val TAG_INITIAL_DURATION = 0
+ private const val TAG_AUGMENTATION_DURATION = 1
+ private const val TAG_MAX_DURATION = 2
+ private const val TAG_BLIND_DURATION = 3
+
+ fun fromTlv(
+ tlvTag: Tag,
+ tlvReader: TlvReader,
+ ): ZoneManagementClusterZoneTriggeringTimeControlStruct {
+ tlvReader.enterStructure(tlvTag)
+ val initialDuration = tlvReader.getUShort(ContextSpecificTag(TAG_INITIAL_DURATION))
+ val augmentationDuration = tlvReader.getUShort(ContextSpecificTag(TAG_AUGMENTATION_DURATION))
+ val maxDuration = tlvReader.getUInt(ContextSpecificTag(TAG_MAX_DURATION))
+ val blindDuration = tlvReader.getUShort(ContextSpecificTag(TAG_BLIND_DURATION))
+
+ tlvReader.exitContainer()
+
+ return ZoneManagementClusterZoneTriggeringTimeControlStruct(
+ initialDuration,
+ augmentationDuration,
+ maxDuration,
+ blindDuration,
+ )
+ }
+ }
+}
diff --git a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp
index 19f3f8d3ed8efb..217e10fc3a6b90 100644
--- a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp
+++ b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp
@@ -42236,6 +42236,328 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR
}
break;
}
+ case app::Clusters::ZoneManagement::Id: {
+ using namespace app::Clusters::ZoneManagement;
+ switch (aPath.mAttributeId)
+ {
+ case Attributes::SupportedZoneSources::Id: {
+ using TypeInfo = Attributes::SupportedZoneSources::TypeInfo;
+ TypeInfo::DecodableType cppValue;
+ *aError = app::DataModel::Decode(aReader, cppValue);
+ if (*aError != CHIP_NO_ERROR)
+ {
+ return nullptr;
+ }
+ jobject value;
+ chip::JniReferences::GetInstance().CreateArrayList(value);
+
+ auto iter_value_0 = cppValue.begin();
+ while (iter_value_0.Next())
+ {
+ auto & entry_0 = iter_value_0.GetValue();
+ jobject newElement_0;
+ std::string newElement_0ClassName = "java/lang/Integer";
+ std::string newElement_0CtorSignature = "(I)V";
+ jint jninewElement_0 = static_cast(entry_0);
+ chip::JniReferences::GetInstance().CreateBoxedObject(
+ newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0);
+ chip::JniReferences::GetInstance().AddToList(value, newElement_0);
+ }
+ return value;
+ }
+ case Attributes::Zones::Id: {
+ using TypeInfo = Attributes::Zones::TypeInfo;
+ TypeInfo::DecodableType cppValue;
+ *aError = app::DataModel::Decode(aReader, cppValue);
+ if (*aError != CHIP_NO_ERROR)
+ {
+ return nullptr;
+ }
+ jobject value;
+ chip::JniReferences::GetInstance().CreateArrayList(value);
+
+ auto iter_value_0 = cppValue.begin();
+ while (iter_value_0.Next())
+ {
+ auto & entry_0 = iter_value_0.GetValue();
+ jobject newElement_0;
+ jobject newElement_0_zoneID;
+ std::string newElement_0_zoneIDClassName = "java/lang/Integer";
+ std::string newElement_0_zoneIDCtorSignature = "(I)V";
+ jint jninewElement_0_zoneID = static_cast(entry_0.zoneID);
+ chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_zoneIDClassName.c_str(),
+ newElement_0_zoneIDCtorSignature.c_str(),
+ jninewElement_0_zoneID, newElement_0_zoneID);
+ jobject newElement_0_zoneType;
+ std::string newElement_0_zoneTypeClassName = "java/lang/Integer";
+ std::string newElement_0_zoneTypeCtorSignature = "(I)V";
+ jint jninewElement_0_zoneType = static_cast(entry_0.zoneType);
+ chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_zoneTypeClassName.c_str(),
+ newElement_0_zoneTypeCtorSignature.c_str(),
+ jninewElement_0_zoneType, newElement_0_zoneType);
+ jobject newElement_0_zoneSource;
+ std::string newElement_0_zoneSourceClassName = "java/lang/Integer";
+ std::string newElement_0_zoneSourceCtorSignature = "(I)V";
+ jint jninewElement_0_zoneSource = static_cast(entry_0.zoneSource);
+ chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_zoneSourceClassName.c_str(),
+ newElement_0_zoneSourceCtorSignature.c_str(),
+ jninewElement_0_zoneSource, newElement_0_zoneSource);
+
+ jclass zoneInformationStructStructClass_1;
+ err = chip::JniReferences::GetInstance().GetLocalClassRef(
+ env, "chip/devicecontroller/ChipStructs$ZoneManagementClusterZoneInformationStruct",
+ zoneInformationStructStructClass_1);
+ if (err != CHIP_NO_ERROR)
+ {
+ ChipLogError(Zcl, "Could not find class ChipStructs$ZoneManagementClusterZoneInformationStruct");
+ return nullptr;
+ }
+
+ jmethodID zoneInformationStructStructCtor_1;
+ err = chip::JniReferences::GetInstance().FindMethod(env, zoneInformationStructStructClass_1, "",
+ "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;)V",
+ &zoneInformationStructStructCtor_1);
+ if (err != CHIP_NO_ERROR || zoneInformationStructStructCtor_1 == nullptr)
+ {
+ ChipLogError(Zcl, "Could not find ChipStructs$ZoneManagementClusterZoneInformationStruct constructor");
+ return nullptr;
+ }
+
+ newElement_0 = env->NewObject(zoneInformationStructStructClass_1, zoneInformationStructStructCtor_1,
+ newElement_0_zoneID, newElement_0_zoneType, newElement_0_zoneSource);
+ chip::JniReferences::GetInstance().AddToList(value, newElement_0);
+ }
+ return value;
+ }
+ case Attributes::TimeControl::Id: {
+ using TypeInfo = Attributes::TimeControl::TypeInfo;
+ TypeInfo::DecodableType cppValue;
+ *aError = app::DataModel::Decode(aReader, cppValue);
+ if (*aError != CHIP_NO_ERROR)
+ {
+ return nullptr;
+ }
+ jobject value;
+ chip::JniReferences::GetInstance().CreateArrayList(value);
+
+ auto iter_value_0 = cppValue.begin();
+ while (iter_value_0.Next())
+ {
+ auto & entry_0 = iter_value_0.GetValue();
+ jobject newElement_0;
+ jobject newElement_0_initialDuration;
+ std::string newElement_0_initialDurationClassName = "java/lang/Integer";
+ std::string newElement_0_initialDurationCtorSignature = "(I)V";
+ jint jninewElement_0_initialDuration = static_cast(entry_0.initialDuration);
+ chip::JniReferences::GetInstance().CreateBoxedObject(
+ newElement_0_initialDurationClassName.c_str(), newElement_0_initialDurationCtorSignature.c_str(),
+ jninewElement_0_initialDuration, newElement_0_initialDuration);
+ jobject newElement_0_augmentationDuration;
+ std::string newElement_0_augmentationDurationClassName = "java/lang/Integer";
+ std::string newElement_0_augmentationDurationCtorSignature = "(I)V";
+ jint jninewElement_0_augmentationDuration = static_cast(entry_0.augmentationDuration);
+ chip::JniReferences::GetInstance().CreateBoxedObject(
+ newElement_0_augmentationDurationClassName.c_str(), newElement_0_augmentationDurationCtorSignature.c_str(),
+ jninewElement_0_augmentationDuration, newElement_0_augmentationDuration);
+ jobject newElement_0_maxDuration;
+ std::string newElement_0_maxDurationClassName = "java/lang/Long";
+ std::string newElement_0_maxDurationCtorSignature = "(J)V";
+ jlong jninewElement_0_maxDuration = static_cast(entry_0.maxDuration);
+ chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_maxDurationClassName.c_str(),
+ newElement_0_maxDurationCtorSignature.c_str(),
+ jninewElement_0_maxDuration, newElement_0_maxDuration);
+ jobject newElement_0_blindDuration;
+ std::string newElement_0_blindDurationClassName = "java/lang/Integer";
+ std::string newElement_0_blindDurationCtorSignature = "(I)V";
+ jint jninewElement_0_blindDuration = static_cast(entry_0.blindDuration);
+ chip::JniReferences::GetInstance().CreateBoxedObject(
+ newElement_0_blindDurationClassName.c_str(), newElement_0_blindDurationCtorSignature.c_str(),
+ jninewElement_0_blindDuration, newElement_0_blindDuration);
+
+ jclass zoneTriggeringTimeControlStructStructClass_1;
+ err = chip::JniReferences::GetInstance().GetLocalClassRef(
+ env, "chip/devicecontroller/ChipStructs$ZoneManagementClusterZoneTriggeringTimeControlStruct",
+ zoneTriggeringTimeControlStructStructClass_1);
+ if (err != CHIP_NO_ERROR)
+ {
+ ChipLogError(Zcl, "Could not find class ChipStructs$ZoneManagementClusterZoneTriggeringTimeControlStruct");
+ return nullptr;
+ }
+
+ jmethodID zoneTriggeringTimeControlStructStructCtor_1;
+ err = chip::JniReferences::GetInstance().FindMethod(
+ env, zoneTriggeringTimeControlStructStructClass_1, "",
+ "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Long;Ljava/lang/Integer;)V",
+ &zoneTriggeringTimeControlStructStructCtor_1);
+ if (err != CHIP_NO_ERROR || zoneTriggeringTimeControlStructStructCtor_1 == nullptr)
+ {
+ ChipLogError(Zcl,
+ "Could not find ChipStructs$ZoneManagementClusterZoneTriggeringTimeControlStruct constructor");
+ return nullptr;
+ }
+
+ newElement_0 =
+ env->NewObject(zoneTriggeringTimeControlStructStructClass_1, zoneTriggeringTimeControlStructStructCtor_1,
+ newElement_0_initialDuration, newElement_0_augmentationDuration, newElement_0_maxDuration,
+ newElement_0_blindDuration);
+ chip::JniReferences::GetInstance().AddToList(value, newElement_0);
+ }
+ return value;
+ }
+ case Attributes::Sensitivity::Id: {
+ using TypeInfo = Attributes::Sensitivity::TypeInfo;
+ TypeInfo::DecodableType cppValue;
+ *aError = app::DataModel::Decode(aReader, cppValue);
+ if (*aError != CHIP_NO_ERROR)
+ {
+ return nullptr;
+ }
+ jobject value;
+ std::string valueClassName = "java/lang/Integer";
+ std::string valueCtorSignature = "(I)V";
+ jint jnivalue = static_cast(cppValue);
+ chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue,
+ value);
+ return value;
+ }
+ case Attributes::GeneratedCommandList::Id: {
+ using TypeInfo = Attributes::GeneratedCommandList::TypeInfo;
+ TypeInfo::DecodableType cppValue;
+ *aError = app::DataModel::Decode(aReader, cppValue);
+ if (*aError != CHIP_NO_ERROR)
+ {
+ return nullptr;
+ }
+ jobject value;
+ chip::JniReferences::GetInstance().CreateArrayList(value);
+
+ auto iter_value_0 = cppValue.begin();
+ while (iter_value_0.Next())
+ {
+ auto & entry_0 = iter_value_0.GetValue();
+ jobject newElement_0;
+ std::string newElement_0ClassName = "java/lang/Long";
+ std::string newElement_0CtorSignature = "(J)V";
+ jlong jninewElement_0 = static_cast(entry_0);
+ chip::JniReferences::GetInstance().CreateBoxedObject(
+ newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0);
+ chip::JniReferences::GetInstance().AddToList(value, newElement_0);
+ }
+ return value;
+ }
+ case Attributes::AcceptedCommandList::Id: {
+ using TypeInfo = Attributes::AcceptedCommandList::TypeInfo;
+ TypeInfo::DecodableType cppValue;
+ *aError = app::DataModel::Decode(aReader, cppValue);
+ if (*aError != CHIP_NO_ERROR)
+ {
+ return nullptr;
+ }
+ jobject value;
+ chip::JniReferences::GetInstance().CreateArrayList(value);
+
+ auto iter_value_0 = cppValue.begin();
+ while (iter_value_0.Next())
+ {
+ auto & entry_0 = iter_value_0.GetValue();
+ jobject newElement_0;
+ std::string newElement_0ClassName = "java/lang/Long";
+ std::string newElement_0CtorSignature = "(J)V";
+ jlong jninewElement_0 = static_cast(entry_0);
+ chip::JniReferences::GetInstance().CreateBoxedObject(
+ newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0);
+ chip::JniReferences::GetInstance().AddToList(value, newElement_0);
+ }
+ return value;
+ }
+ case Attributes::EventList::Id: {
+ using TypeInfo = Attributes::EventList::TypeInfo;
+ TypeInfo::DecodableType cppValue;
+ *aError = app::DataModel::Decode(aReader, cppValue);
+ if (*aError != CHIP_NO_ERROR)
+ {
+ return nullptr;
+ }
+ jobject value;
+ chip::JniReferences::GetInstance().CreateArrayList(value);
+
+ auto iter_value_0 = cppValue.begin();
+ while (iter_value_0.Next())
+ {
+ auto & entry_0 = iter_value_0.GetValue();
+ jobject newElement_0;
+ std::string newElement_0ClassName = "java/lang/Long";
+ std::string newElement_0CtorSignature = "(J)V";
+ jlong jninewElement_0 = static_cast(entry_0);
+ chip::JniReferences::GetInstance().CreateBoxedObject(
+ newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0);
+ chip::JniReferences::GetInstance().AddToList(value, newElement_0);
+ }
+ return value;
+ }
+ case Attributes::AttributeList::Id: {
+ using TypeInfo = Attributes::AttributeList::TypeInfo;
+ TypeInfo::DecodableType cppValue;
+ *aError = app::DataModel::Decode(aReader, cppValue);
+ if (*aError != CHIP_NO_ERROR)
+ {
+ return nullptr;
+ }
+ jobject value;
+ chip::JniReferences::GetInstance().CreateArrayList(value);
+
+ auto iter_value_0 = cppValue.begin();
+ while (iter_value_0.Next())
+ {
+ auto & entry_0 = iter_value_0.GetValue();
+ jobject newElement_0;
+ std::string newElement_0ClassName = "java/lang/Long";
+ std::string newElement_0CtorSignature = "(J)V";
+ jlong jninewElement_0 = static_cast(entry_0);
+ chip::JniReferences::GetInstance().CreateBoxedObject(
+ newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0);
+ chip::JniReferences::GetInstance().AddToList(value, newElement_0);
+ }
+ return value;
+ }
+ case Attributes::FeatureMap::Id: {
+ using TypeInfo = Attributes::FeatureMap::TypeInfo;
+ TypeInfo::DecodableType cppValue;
+ *aError = app::DataModel::Decode(aReader, cppValue);
+ if (*aError != CHIP_NO_ERROR)
+ {
+ return nullptr;
+ }
+ jobject value;
+ std::string valueClassName = "java/lang/Long";
+ std::string valueCtorSignature = "(J)V";
+ jlong jnivalue = static_cast(cppValue);
+ chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(),
+ jnivalue, value);
+ return value;
+ }
+ case Attributes::ClusterRevision::Id: {
+ using TypeInfo = Attributes::ClusterRevision::TypeInfo;
+ TypeInfo::DecodableType cppValue;
+ *aError = app::DataModel::Decode(aReader, cppValue);
+ if (*aError != CHIP_NO_ERROR)
+ {
+ return nullptr;
+ }
+ jobject value;
+ std::string valueClassName = "java/lang/Integer";
+ std::string valueCtorSignature = "(I)V";
+ jint jnivalue = static_cast(cppValue);
+ chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue,
+ value);
+ return value;
+ }
+ default:
+ *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB;
+ break;
+ }
+ break;
+ }
case app::Clusters::WebRTCTransportProvider::Id: {
using namespace app::Clusters::WebRTCTransportProvider;
switch (aPath.mAttributeId)
diff --git a/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp
index 45f23441804336..dcb49ce6627f55 100644
--- a/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp
+++ b/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp
@@ -8248,6 +8248,120 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader &
}
break;
}
+ case app::Clusters::ZoneManagement::Id: {
+ using namespace app::Clusters::ZoneManagement;
+ switch (aPath.mEventId)
+ {
+ case Events::ZoneTriggered::Id: {
+ Events::ZoneTriggered::DecodableType cppValue;
+ *aError = app::DataModel::Decode(aReader, cppValue);
+ if (*aError != CHIP_NO_ERROR)
+ {
+ return nullptr;
+ }
+ jobject value_zones;
+ chip::JniReferences::GetInstance().CreateArrayList(value_zones);
+
+ auto iter_value_zones_0 = cppValue.zones.begin();
+ while (iter_value_zones_0.Next())
+ {
+ auto & entry_0 = iter_value_zones_0.GetValue();
+ jobject newElement_0;
+ std::string newElement_0ClassName = "java/lang/Integer";
+ std::string newElement_0CtorSignature = "(I)V";
+ jint jninewElement_0 = static_cast(entry_0);
+ chip::JniReferences::GetInstance().CreateBoxedObject(
+ newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0);
+ chip::JniReferences::GetInstance().AddToList(value_zones, newElement_0);
+ }
+
+ jobject value_reason;
+ std::string value_reasonClassName = "java/lang/Integer";
+ std::string value_reasonCtorSignature = "(I)V";
+ jint jnivalue_reason = static_cast(cppValue.reason);
+ chip::JniReferences::GetInstance().CreateBoxedObject(
+ value_reasonClassName.c_str(), value_reasonCtorSignature.c_str(), jnivalue_reason, value_reason);
+
+ jclass zoneTriggeredStructClass;
+ err = chip::JniReferences::GetInstance().GetLocalClassRef(
+ env, "chip/devicecontroller/ChipEventStructs$ZoneManagementClusterZoneTriggeredEvent", zoneTriggeredStructClass);
+ if (err != CHIP_NO_ERROR)
+ {
+ ChipLogError(Zcl, "Could not find class ChipEventStructs$ZoneManagementClusterZoneTriggeredEvent");
+ return nullptr;
+ }
+
+ jmethodID zoneTriggeredStructCtor;
+ err = chip::JniReferences::GetInstance().FindMethod(
+ env, zoneTriggeredStructClass, "