From 82438f5615722989a39ca92ace5f105959efcc59 Mon Sep 17 00:00:00 2001 From: Petru Lauric <81822411+plauric@users.noreply.github.com> Date: Thu, 15 Jun 2023 11:16:49 -0400 Subject: [PATCH] [Feature] RVC operational state cluster xml (#26989) * add non-generated code * add generated files * Update .github/workflows/tests.yaml * address code review feedback * Update src/controller/data_model/BUILD.gn * Apply suggestions from code review * add generated code * Update src/app/zap-templates/zcl/data-model/chip/operational-state-rvc-cluster.xml * add generated code * add missing EOL * address code review feedback * update the RVC and the generic OpState XMLs * fix typo + indentation * enable the stop and start commands in the controller clusters zap file * add RVC OpState cluster to OpState struct definitions * remove spaces at the end of the line --- .github/workflows/tests.yaml | 1 + .gitignore | 1 + .../all-clusters-app.matter | 11 + .../all-clusters-minimal-app.matter | 11 + .../bridge-common/bridge-app.matter | 11 + ...p_rootnode_dimmablelight_bCwGYSDpoe.matter | 11 + ...de_colortemperaturelight_hbUnzYVeyn.matter | 11 + .../rootnode_contactsensor_lFAGG1bfRO.matter | 11 + .../rootnode_dimmablelight_bCwGYSDpoe.matter | 11 + .../rootnode_doorlock_aNKYAreMXE.matter | 11 + ...tnode_extendedcolorlight_8lcaaYJVAa.matter | 11 + .../devices/rootnode_fan_7N2TobIlOX.matter | 11 + .../rootnode_flowsensor_1zVxHedlaV.matter | 11 + ...tnode_heatingcoolingunit_ncdGai1E5a.matter | 11 + .../rootnode_humiditysensor_Xyj4gda6Hb.matter | 11 + .../rootnode_lightsensor_lZQycTFcJK.matter | 11 + ...rootnode_occupancysensor_iHyVgifZuo.matter | 11 + .../rootnode_onofflight_bbs1b7IaOV.matter | 11 + ...ootnode_onofflightswitch_FsPlMr090Q.matter | 11 + ...rootnode_onoffpluginunit_Wtf8ss5EBY.matter | 11 + .../rootnode_pressuresensor_s0qC9wLH4k.matter | 11 + .../devices/rootnode_pump_a811bb33a0.matter | 11 + .../rootnode_speaker_RpzeXdimqA.matter | 11 + ...otnode_temperaturesensor_Qy1zkNW7c3.matter | 11 + .../rootnode_thermostat_bm3fb8dhYi.matter | 11 + .../rootnode_windowcovering_RLCxaGi9Yx.matter | 11 + .../contact-sensor-app.matter | 11 + .../light-switch-app.matter | 11 + .../data_model/lighting-app-thread.matter | 11 + .../data_model/lighting-app-wifi.matter | 11 + .../lighting-common/lighting-app.matter | 11 + .../nxp/zap/lighting-on-off.matter | 11 + examples/lighting-app/qpg/zap/light.matter | 11 + .../data_model/lighting-thread-app.matter | 11 + .../data_model/lighting-wifi-app.matter | 11 + examples/lock-app/lock-common/lock-app.matter | 11 + examples/lock-app/nxp/zap/lock-app.matter | 11 + examples/lock-app/qpg/zap/lock.matter | 11 + .../log-source-common/log-source-app.matter | 11 + .../ota-provider-app.matter | 11 + .../ota-requestor-app.matter | 11 + .../placeholder/linux/apps/app1/config.matter | 11 + .../placeholder/linux/apps/app2/config.matter | 11 + examples/pump-app/pump-common/pump-app.matter | 11 + .../pump-controller-app.matter | 11 + .../smoke-co-alarm-app.matter | 11 + .../temperature-measurement.matter | 11 + .../thermostat-common/thermostat.matter | 11 + examples/tv-app/tv-common/tv-app.matter | 11 + .../tv-casting-common/tv-casting-app.matter | 11 + examples/window-app/common/window-app.matter | 11 + scripts/rules.matterlint | 1 + src/app/zap-templates/zcl/data-model/all.xml | 1 + .../chip/operational-state-cluster.xml | 18 +- .../chip/operational-state-rvc-cluster.xml | 91 ++ .../zcl/zcl-with-test-extensions.json | 7 +- src/app/zap-templates/zcl/zcl.json | 7 +- src/app/zap_cluster_list.json | 1 + src/controller/data_model/BUILD.gn | 2 + .../data_model/controller-clusters.matter | 88 +- .../data_model/controller-clusters.zap | 340 ++++- .../devicecontroller/ClusterIDMapping.java | 115 ++ .../devicecontroller/ClusterReadMapping.java | 115 ++ .../devicecontroller/ClusterWriteMapping.java | 2 + .../CHIPAttributeTLVValueDecoder.cpp | 439 ++++++- .../java/zap-generated/CHIPClientCallbacks.h | 14 + .../CHIPEventTLVValueDecoder.cpp | 204 ++- .../zap-generated/CHIPInvokeCallbacks.cpp | 127 +- .../java/zap-generated/CHIPInvokeCallbacks.h | 16 + .../java/zap-generated/CHIPReadCallbacks.cpp | 626 +++++++++- .../chip/devicecontroller/ChipClusters.java | 304 +++++ .../devicecontroller/ChipEventStructs.java | 54 + .../chip/devicecontroller/ChipIdLookup.java | 51 + .../chip/devicecontroller/ChipStructs.java | 68 +- .../devicecontroller/ClusterInfoMapping.java | 228 ++++ .../python/chip/clusters/CHIPClusters.py | 106 ++ .../python/chip/clusters/Objects.py | 416 ++++++- .../MTRAttributeSpecifiedCheck.mm | 48 + .../MTRAttributeTLVValueDecoder.mm | 334 ++++- .../CHIP/zap-generated/MTRBaseClusters.h | 231 ++++ .../CHIP/zap-generated/MTRBaseClusters.mm | 724 +++++++++++ .../zap-generated/MTRBaseClusters_Internal.h | 5 + .../CHIP/zap-generated/MTRCallbackBridge.h | 475 +++++++ .../CHIP/zap-generated/MTRCallbackBridge.mm | 480 ++++++- .../CHIP/zap-generated/MTRClusterConstants.h | 32 + .../CHIP/zap-generated/MTRClusters.h | 77 ++ .../CHIP/zap-generated/MTRClusters.mm | 429 +++++++ .../CHIP/zap-generated/MTRClusters_Internal.h | 5 + .../zap-generated/MTRCommandPayloadsObjc.h | 132 ++ .../zap-generated/MTRCommandPayloadsObjc.mm | 211 +++- .../MTRCommandPayloads_Internal.h | 8 + .../zap-generated/MTREventTLVValueDecoder.mm | 105 +- .../CHIP/zap-generated/MTRStructsObjc.h | 27 +- .../CHIP/zap-generated/MTRStructsObjc.mm | 130 +- .../zap-generated/attributes/Accessors.cpp | 174 +++ .../zap-generated/attributes/Accessors.h | 30 + .../app-common/zap-generated/callback.h | 109 ++ .../zap-generated/cluster-enums-check.h | 32 + .../app-common/zap-generated/cluster-enums.h | 34 + .../zap-generated/cluster-objects.cpp | 370 +++++- .../zap-generated/cluster-objects.h | 498 +++++++- .../app-common/zap-generated/ids/Attributes.h | 54 + .../app-common/zap-generated/ids/Clusters.h | 3 + .../app-common/zap-generated/ids/Commands.h | 26 + .../app-common/zap-generated/ids/Events.h | 14 + .../app-common/zap-generated/print-cluster.h | 8 + .../zap-generated/cluster/Commands.h | 233 ++++ .../cluster/ComplexArgumentParser.cpp | 147 +-- .../cluster/ComplexArgumentParser.h | 20 +- .../cluster/logging/DataModelLogger.cpp | 269 +++- .../cluster/logging/DataModelLogger.h | 21 +- .../zap-generated/cluster/Commands.h | 1098 +++++++++++++++++ 112 files changed, 10214 insertions(+), 361 deletions(-) create mode 100644 src/app/zap-templates/zcl/data-model/chip/operational-state-rvc-cluster.xml diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 2d641bb21a0e53..47ad5341ac7f4d 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -167,6 +167,7 @@ jobs: src/app/zap-templates/zcl/data-model/chip/onoff-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/operational-credentials-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/operational-state-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/operational-state-rvc-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/pressure-measurement-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/power-source-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/power-source-configuration-cluster.xml \ diff --git a/.gitignore b/.gitignore index 4c17bb63a84a8c..21a01b1000a779 100644 --- a/.gitignore +++ b/.gitignore @@ -80,3 +80,4 @@ examples/thermostat/ameba/build # https://github.com/espressif/idf-component-manager#using-with-a-project examples/*/esp32/managed_components examples/*/esp32/dependencies.lock +examples/all-clusters-app/all-clusters-common/all-clusters-app.zap.old diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter index dd8e49f387652d..02d9c1ddec2298 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter @@ -18,11 +18,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter index ac09d5456eb636..104fa4b1dac252 100644 --- a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter +++ b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter @@ -18,11 +18,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/bridge-app/bridge-common/bridge-app.matter b/examples/bridge-app/bridge-common/bridge-app.matter index 6531edb1e75503..92cadc203dee65 100644 --- a/examples/bridge-app/bridge-common/bridge-app.matter +++ b/examples/bridge-app/bridge-common/bridge-app.matter @@ -18,11 +18,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter b/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter index a458da9d021e37..50a92f95409d58 100644 --- a/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter +++ b/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter @@ -18,11 +18,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.matter b/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.matter index ebc9e4e5486f58..54efa018e7cfa0 100644 --- a/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.matter +++ b/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.matter @@ -18,11 +18,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter b/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter index 72da64cff277aa..bb701a18ee67f0 100644 --- a/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter +++ b/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter @@ -18,11 +18,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter b/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter index c8bbadd07fab6d..c2e5318a739ab1 100644 --- a/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter +++ b/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter @@ -18,11 +18,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter b/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter index 7280968fb259fc..44034fc276cd9a 100644 --- a/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter +++ b/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter @@ -18,11 +18,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter b/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter index a7d53aaeecd93c..b3287ac4d76f5d 100644 --- a/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter +++ b/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter @@ -18,11 +18,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/chef/devices/rootnode_fan_7N2TobIlOX.matter b/examples/chef/devices/rootnode_fan_7N2TobIlOX.matter index 0ad9c02d5cc4c2..7ce96d6a1b79cc 100644 --- a/examples/chef/devices/rootnode_fan_7N2TobIlOX.matter +++ b/examples/chef/devices/rootnode_fan_7N2TobIlOX.matter @@ -18,11 +18,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter b/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter index 3aab05c6ace501..cf1217be0a4a81 100644 --- a/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter +++ b/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter @@ -18,11 +18,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter b/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter index 0c50e8602406b8..293c6f20d54f28 100644 --- a/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter +++ b/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter @@ -18,11 +18,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter b/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter index dbf22aa9b13b97..c92b8e34fd8d89 100644 --- a/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter +++ b/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter @@ -18,11 +18,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter b/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter index 8f11a43bf3ac8e..a4ce7b2f50b217 100644 --- a/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter +++ b/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter @@ -18,11 +18,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter b/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter index 174d400db5ea1c..2419ff7c662a6b 100644 --- a/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter +++ b/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter @@ -18,11 +18,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter b/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter index 7bb540870bd8b6..58b80e234217b1 100644 --- a/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter +++ b/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter @@ -18,11 +18,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter b/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter index caffea35361731..75810385dd8bee 100644 --- a/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter +++ b/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter @@ -18,11 +18,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter b/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter index 1502efbb5aac49..116c9888f85784 100644 --- a/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter +++ b/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter @@ -18,11 +18,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter b/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter index 9deb03484943b1..156127529e8d0b 100644 --- a/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter +++ b/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter @@ -18,11 +18,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/chef/devices/rootnode_pump_a811bb33a0.matter b/examples/chef/devices/rootnode_pump_a811bb33a0.matter index 391a6975cd2737..96c4e8ccf06ba9 100644 --- a/examples/chef/devices/rootnode_pump_a811bb33a0.matter +++ b/examples/chef/devices/rootnode_pump_a811bb33a0.matter @@ -18,11 +18,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter b/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter index 17f82500378cd3..f9b2b1a0bf7fed 100644 --- a/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter +++ b/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter @@ -18,11 +18,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter b/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter index e04574d866f334..3271ad89c92a0f 100644 --- a/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter +++ b/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter @@ -18,11 +18,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter b/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter index b0462727f5b4fc..694dc771797ce9 100644 --- a/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter +++ b/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter @@ -18,11 +18,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter b/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter index e4a671aad8c9ad..c2eea25c88feb7 100644 --- a/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter +++ b/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter @@ -18,11 +18,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.matter b/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.matter index 18cdf112410294..a7a951c52a0ac2 100644 --- a/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.matter +++ b/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.matter @@ -18,11 +18,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/light-switch-app/light-switch-common/light-switch-app.matter b/examples/light-switch-app/light-switch-common/light-switch-app.matter index eef00caa037cc2..054967c1f9ec29 100644 --- a/examples/light-switch-app/light-switch-common/light-switch-app.matter +++ b/examples/light-switch-app/light-switch-common/light-switch-app.matter @@ -18,11 +18,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ client cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.matter b/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.matter index d96ec9472c60cc..96ad29d946455b 100644 --- a/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.matter +++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.matter @@ -18,11 +18,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.matter b/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.matter index 9cfe2296c4c6e0..abea6c297c8826 100644 --- a/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.matter +++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.matter @@ -18,11 +18,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/lighting-app/lighting-common/lighting-app.matter b/examples/lighting-app/lighting-common/lighting-app.matter index e8a2e130590652..4a6f7909a556d7 100644 --- a/examples/lighting-app/lighting-common/lighting-app.matter +++ b/examples/lighting-app/lighting-common/lighting-app.matter @@ -18,11 +18,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/lighting-app/nxp/zap/lighting-on-off.matter b/examples/lighting-app/nxp/zap/lighting-on-off.matter index 52db5c7fafafb3..0ae348837f0df0 100644 --- a/examples/lighting-app/nxp/zap/lighting-on-off.matter +++ b/examples/lighting-app/nxp/zap/lighting-on-off.matter @@ -18,11 +18,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/lighting-app/qpg/zap/light.matter b/examples/lighting-app/qpg/zap/light.matter index 41c986eb8e0584..644724d1b7021c 100644 --- a/examples/lighting-app/qpg/zap/light.matter +++ b/examples/lighting-app/qpg/zap/light.matter @@ -18,11 +18,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/lighting-app/silabs/data_model/lighting-thread-app.matter b/examples/lighting-app/silabs/data_model/lighting-thread-app.matter index 35d143b87c10b5..c53787eaf6418e 100644 --- a/examples/lighting-app/silabs/data_model/lighting-thread-app.matter +++ b/examples/lighting-app/silabs/data_model/lighting-thread-app.matter @@ -18,11 +18,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/lighting-app/silabs/data_model/lighting-wifi-app.matter b/examples/lighting-app/silabs/data_model/lighting-wifi-app.matter index f57a222dae038f..65ec6c1f964fd6 100644 --- a/examples/lighting-app/silabs/data_model/lighting-wifi-app.matter +++ b/examples/lighting-app/silabs/data_model/lighting-wifi-app.matter @@ -18,11 +18,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/lock-app/lock-common/lock-app.matter b/examples/lock-app/lock-common/lock-app.matter index f65707d1bf81a7..bbe991722a17f7 100644 --- a/examples/lock-app/lock-common/lock-app.matter +++ b/examples/lock-app/lock-common/lock-app.matter @@ -18,11 +18,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/lock-app/nxp/zap/lock-app.matter b/examples/lock-app/nxp/zap/lock-app.matter index 1991075fd9bb86..e006c0ff6baf09 100644 --- a/examples/lock-app/nxp/zap/lock-app.matter +++ b/examples/lock-app/nxp/zap/lock-app.matter @@ -18,11 +18,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/lock-app/qpg/zap/lock.matter b/examples/lock-app/qpg/zap/lock.matter index a701a908691e9f..77dade82d35019 100644 --- a/examples/lock-app/qpg/zap/lock.matter +++ b/examples/lock-app/qpg/zap/lock.matter @@ -18,11 +18,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/log-source-app/log-source-common/log-source-app.matter b/examples/log-source-app/log-source-common/log-source-app.matter index 23798cde6f2219..f982536f029c5c 100644 --- a/examples/log-source-app/log-source-common/log-source-app.matter +++ b/examples/log-source-app/log-source-common/log-source-app.matter @@ -18,11 +18,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** The Access Control Cluster exposes a data model view of a Node's Access Control List (ACL), which codifies the rules used to manage and enforce Access Control for the Node's endpoints and their associated diff --git a/examples/ota-provider-app/ota-provider-common/ota-provider-app.matter b/examples/ota-provider-app/ota-provider-common/ota-provider-app.matter index 60ce28100ca0b7..1048f1f23d986f 100644 --- a/examples/ota-provider-app/ota-provider-common/ota-provider-app.matter +++ b/examples/ota-provider-app/ota-provider-common/ota-provider-app.matter @@ -18,11 +18,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ server cluster Descriptor = 29 { struct DeviceTypeStruct { diff --git a/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.matter b/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.matter index 79eb0c8f93911d..624a7909f336f4 100644 --- a/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.matter +++ b/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.matter @@ -18,11 +18,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/placeholder/linux/apps/app1/config.matter b/examples/placeholder/linux/apps/app1/config.matter index 43897ccc850a9f..ced41db421494b 100644 --- a/examples/placeholder/linux/apps/app1/config.matter +++ b/examples/placeholder/linux/apps/app1/config.matter @@ -18,11 +18,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/placeholder/linux/apps/app2/config.matter b/examples/placeholder/linux/apps/app2/config.matter index a08f06fd56a176..486524fe426c1b 100644 --- a/examples/placeholder/linux/apps/app2/config.matter +++ b/examples/placeholder/linux/apps/app2/config.matter @@ -18,11 +18,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/pump-app/pump-common/pump-app.matter b/examples/pump-app/pump-common/pump-app.matter index 06e12a5b21d32d..e43d3afa2ca24c 100644 --- a/examples/pump-app/pump-common/pump-app.matter +++ b/examples/pump-app/pump-common/pump-app.matter @@ -18,11 +18,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/pump-controller-app/pump-controller-common/pump-controller-app.matter b/examples/pump-controller-app/pump-controller-common/pump-controller-app.matter index 15b6233cc69855..0025fb8aa63a3c 100644 --- a/examples/pump-controller-app/pump-controller-common/pump-controller-app.matter +++ b/examples/pump-controller-app/pump-controller-common/pump-controller-app.matter @@ -18,11 +18,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/smoke-co-alarm-app/smoke-co-alarm-common/smoke-co-alarm-app.matter b/examples/smoke-co-alarm-app/smoke-co-alarm-common/smoke-co-alarm-app.matter index efe45e7e9a6c70..3ceab153db1fa4 100644 --- a/examples/smoke-co-alarm-app/smoke-co-alarm-common/smoke-co-alarm-app.matter +++ b/examples/smoke-co-alarm-app/smoke-co-alarm-common/smoke-co-alarm-app.matter @@ -18,11 +18,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.matter b/examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.matter index 1a2aaab3ae031a..d7a1ec6b003f64 100644 --- a/examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.matter +++ b/examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.matter @@ -18,11 +18,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ server cluster Descriptor = 29 { struct DeviceTypeStruct { diff --git a/examples/thermostat/thermostat-common/thermostat.matter b/examples/thermostat/thermostat-common/thermostat.matter index 304de497411237..85fcfa9afbbbdf 100644 --- a/examples/thermostat/thermostat-common/thermostat.matter +++ b/examples/thermostat/thermostat-common/thermostat.matter @@ -18,11 +18,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ client cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/tv-app/tv-common/tv-app.matter b/examples/tv-app/tv-common/tv-app.matter index c60e578a902dfe..11c4b348cbe8a2 100644 --- a/examples/tv-app/tv-common/tv-app.matter +++ b/examples/tv-app/tv-common/tv-app.matter @@ -18,11 +18,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for switching devices between 'On' and 'Off' states. */ server cluster OnOff = 6 { enum OnOffDelayedAllOffEffectVariant : ENUM8 { diff --git a/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter b/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter index a2e66c29348bca..559e42c257415c 100644 --- a/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter +++ b/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter @@ -18,11 +18,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/window-app/common/window-app.matter b/examples/window-app/common/window-app.matter index 409aec2feb4ca6..ba4f26b31b963b 100644 --- a/examples/window-app/common/window-app.matter +++ b/examples/window-app/common/window-app.matter @@ -18,11 +18,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/scripts/rules.matterlint b/scripts/rules.matterlint index 69a6cee7f88af0..7134768396864a 100644 --- a/scripts/rules.matterlint +++ b/scripts/rules.matterlint @@ -50,6 +50,7 @@ load "../src/app/zap-templates/zcl/data-model/chip/occupancy-sensing-cluster.xml load "../src/app/zap-templates/zcl/data-model/chip/onoff-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/operational-credentials-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/operational-state-cluster.xml"; +load "../src/app/zap-templates/zcl/data-model/chip/operational-state-rvc-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/power-source-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/power-source-configuration-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/pressure-measurement-cluster.xml"; diff --git a/src/app/zap-templates/zcl/data-model/all.xml b/src/app/zap-templates/zcl/data-model/all.xml index 849921d488c814..7aec7f0f260116 100644 --- a/src/app/zap-templates/zcl/data-model/all.xml +++ b/src/app/zap-templates/zcl/data-model/all.xml @@ -49,6 +49,7 @@ + diff --git a/src/app/zap-templates/zcl/data-model/chip/operational-state-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/operational-state-cluster.xml index de156b7a726041..e454bbee517ae3 100644 --- a/src/app/zap-templates/zcl/data-model/chip/operational-state-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/operational-state-cluster.xml @@ -35,15 +35,17 @@ limitations under the License. - - + + + - - - + + + + @@ -59,10 +61,10 @@ limitations under the License. PhaseList CurrentPhase - CountdownTime + CountdownTime OperationalStateList OperationalState - OperationalError + OperationalError Upon receipt, the device SHALL pause its operation if it is possible based on the current function of the server. @@ -92,7 +94,7 @@ limitations under the License. OperationCompletion - + diff --git a/src/app/zap-templates/zcl/data-model/chip/operational-state-rvc-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/operational-state-rvc-cluster.xml new file mode 100644 index 00000000000000..c568f3f873871f --- /dev/null +++ b/src/app/zap-templates/zcl/data-model/chip/operational-state-rvc-cluster.xml @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + Robots + Robotic Vacuum Operational State + 0x0061 + OPERATIONAL_STATE_RVC_CLUSTER + true + true + This cluster supports remotely monitoring and, where supported, changing the operational state of a Robotic Vacuum. + + + + PhaseList + CurrentPhase + CountdownTime + OperationalStateList + OperationalState + OperationalError + + + Upon receipt, the device SHALL pause its operation if it is possible based on the current function of the server. + + + + Upon receipt, the device SHALL stop its operation if it is at a position where it is safe to do so and/or permitted. + + + + Upon receipt, the device SHALL start its operation if it is safe to do so and the device is in an operational state from which it can be started. + + + + Upon receipt, the device SHALL resume its operation from the point it was at when it received the Pause command, or from the point when it was paused by means outside of this cluster (for example by manual button press). + + + + This command SHALL be generated in response to any of the Start, Stop, Pause, or Resume commands. + + + + + OperationalError + + + + + OperationCompletion + + + + + + + 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 24be37cd01d7d1..3e52c910fe02d5 100644 --- a/src/app/zap-templates/zcl/zcl-with-test-extensions.json +++ b/src/app/zap-templates/zcl/zcl-with-test-extensions.json @@ -67,6 +67,7 @@ "onoff-switch-configuration-cluster.xml", "operational-credentials-cluster.xml", "operational-state-cluster.xml", + "operational-state-rvc-cluster.xml", "pressure-measurement-cluster.xml", "power-source-cluster.xml", "power-source-configuration-cluster.xml", @@ -300,7 +301,11 @@ "LocalTime" ], "Temperature Control": ["SupportedTemperatureLevels"], - "Operational State": ["OperationalState", "OperationalError"] + "Operational State": ["OperationalState", "OperationalError"], + "Robotic Vacuum Operational State": [ + "OperationalState", + "OperationalError" + ] }, "defaultReportingPolicy": "mandatory", "ZCLDataTypes": ["ARRAY", "BITMAP", "ENUM", "NUMBER", "STRING", "STRUCT"], diff --git a/src/app/zap-templates/zcl/zcl.json b/src/app/zap-templates/zcl/zcl.json index 220ce3a3c9574f..91567280ea4764 100644 --- a/src/app/zap-templates/zcl/zcl.json +++ b/src/app/zap-templates/zcl/zcl.json @@ -65,6 +65,7 @@ "onoff-switch-configuration-cluster.xml", "operational-credentials-cluster.xml", "operational-state-cluster.xml", + "operational-state-rvc-cluster.xml", "pressure-measurement-cluster.xml", "power-source-cluster.xml", "power-source-configuration-cluster.xml", @@ -298,7 +299,11 @@ "LocalTime" ], "Temperature Control": ["SupportedTemperatureLevels"], - "Operational State": ["OperationalState", "OperationalError"] + "Operational State": ["OperationalState", "OperationalError"], + "Robotic Vacuum Operational State": [ + "OperationalState", + "OperationalError" + ] }, "defaultReportingPolicy": "mandatory", "ZCLDataTypes": ["ARRAY", "BITMAP", "ENUM", "NUMBER", "STRING", "STRUCT"], diff --git a/src/app/zap_cluster_list.json b/src/app/zap_cluster_list.json index ae3c9ff51732e2..0e7b0c1593cd6a 100644 --- a/src/app/zap_cluster_list.json +++ b/src/app/zap_cluster_list.json @@ -84,6 +84,7 @@ "ON_OFF_SWITCH_CONFIGURATION_CLUSTER": [], "OPERATIONAL_CREDENTIALS_CLUSTER": [], "OPERATIONAL_STATE_CLUSTER": [], + "OPERATIONAL_STATE_RVC_CLUSTER": [], "OTA_BOOTLOAD_CLUSTER": [], "OTA_SOFTWARE_UPDATE_PROVIDER_CLUSTER": [], "OTA_SOFTWARE_UPDATE_REQUESTOR_CLUSTER": [], diff --git a/src/controller/data_model/BUILD.gn b/src/controller/data_model/BUILD.gn index 88eee715a7f08f..698c950b3b81d0 100644 --- a/src/controller/data_model/BUILD.gn +++ b/src/controller/data_model/BUILD.gn @@ -242,6 +242,8 @@ if (current_os == "android" || matter_enable_java_compilation) { "jni/RefrigeratorAndTemperatureControlledCabinetModeSelectClient-ReadImpl.cpp", "jni/RelativeHumidityMeasurementClient-InvokeSubscribeImpl.cpp", "jni/RelativeHumidityMeasurementClient-ReadImpl.cpp", + "jni/RoboticVacuumOperationalStateClient-InvokeSubscribeImpl.cpp", + "jni/RoboticVacuumOperationalStateClient-ReadImpl.cpp", "jni/RvcCleanModeSelectClient-InvokeSubscribeImpl.cpp", "jni/RvcCleanModeSelectClient-ReadImpl.cpp", "jni/RvcRunModeSelectClient-InvokeSubscribeImpl.cpp", diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index 8515fe3b3d9d41..2da11212f13c50 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -18,11 +18,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ client cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { @@ -3357,14 +3368,81 @@ client cluster OperationalState = 96 { } struct ErrorStateStruct { - ErrorStateEnum errorStateID = 0; - nullable char_string<64> errorStateLabel = 1; + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; + } + + struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; + } + + critical event OperationalError = 0 { + ErrorStateStruct errorState = 0; + } + + info event OperationCompletion = 1 { + ENUM8 completionErrorCode = 0; + optional nullable elapsed_s totalOperationalTime = 1; + optional nullable elapsed_s pausedTime = 2; + } + + readonly attribute nullable CHAR_STRING phaseList[] = 0; + readonly attribute nullable int8u currentPhase = 1; + readonly attribute optional nullable elapsed_s countdownTime = 2; + readonly attribute OperationalStateStruct operationalStateList[] = 3; + readonly attribute OperationalStateStruct operationalState = 4; + readonly attribute ErrorStateStruct operationalError = 5; + 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; + + response struct OperationalCommandResponse = 4 { + ErrorStateStruct commandResponseState = 0; + } + + /** Upon receipt, the device SHALL pause its operation if it is possible based on the current function of the server. */ + command Pause(): OperationalCommandResponse = 0; + /** Upon receipt, the device SHALL stop its operation if it is at a position where it is safe to do so and/or permitted. */ + command Stop(): OperationalCommandResponse = 1; + /** Upon receipt, the device SHALL start its operation if it is safe to do so and the device is in an operational state from which it can be started. */ + command Start(): OperationalCommandResponse = 2; + /** Upon receipt, the device SHALL resume its operation from the point it was at when it received the Pause command, or from the point when it was paused by means outside of this cluster (for example by manual button press). */ + command Resume(): OperationalCommandResponse = 3; +} + +/** This cluster supports remotely monitoring and, where supported, changing the operational state of a Robotic Vacuum. */ +client cluster RoboticVacuumOperationalState = 97 { + enum ErrorStateEnum : ENUM8 { + kFailedToFindChargingDock = 64; + kStuck = 65; + kDustBinMissing = 66; + kDustBinFull = 67; + kWaterTankEmpty = 68; + kWaterTankMissing = 69; + kWaterTankLidOpen = 70; + kMopCleaningPadMissing = 71; + } + + enum OperationalStateEnum : ENUM8 { + kSeekingCharger = 64; + kCharging = 65; + kDocked = 66; + } + + struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; optional char_string<64> errorStateDetails = 2; } struct OperationalStateStruct { - OperationalStateEnum operationalStateID = 0; - char_string<64> operationalStateLabel = 1; + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; } critical event OperationalError = 0 { @@ -3372,7 +3450,7 @@ client cluster OperationalState = 96 { } info event OperationCompletion = 1 { - ErrorStateEnum completionErrorCode = 0; + ENUM8 completionErrorCode = 0; optional nullable elapsed_s totalOperationalTime = 1; optional nullable elapsed_s pausedTime = 2; } diff --git a/src/controller/data_model/controller-clusters.zap b/src/controller/data_model/controller-clusters.zap index c393c9e320bc7f..238e6e3cd83233 100644 --- a/src/controller/data_model/controller-clusters.zap +++ b/src/controller/data_model/controller-clusters.zap @@ -11292,7 +11292,7 @@ "side": "server", "type": "array", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -11356,7 +11356,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -11372,7 +11372,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -11388,7 +11388,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -11404,7 +11404,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -11966,16 +11966,6 @@ "define": "REFRIGERATOR_ALARM", "side": "client", "enabled": 1, - "commands": [ - { - "name": "Reset", - "code": 0, - "mfgCode": null, - "source": "client", - "incoming": 0, - "outgoing": 1 - } - ], "attributes": [ { "name": "FeatureMap", @@ -12035,22 +12025,6 @@ "maxInterval": 65534, "reportableChange": 0 }, - { - "name": "Latch", - "code": 1, - "mfgCode": null, - "side": "server", - "type": "AlarmMap", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, { "name": "State", "code": 2, @@ -13179,6 +13153,310 @@ } ] }, + { + "name": "Robotic Vacuum Operational State", + "code": 97, + "mfgCode": null, + "define": "OPERATIONAL_STATE_RVC_CLUSTER", + "side": "client", + "enabled": 1, + "commands": [ + { + "name": "Pause", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "Stop", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "Start", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "Resume", + "code": 3, + "mfgCode": null, + "source": "client", + "incoming": 0, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Robotic Vacuum Operational State", + "code": 97, + "mfgCode": null, + "define": "OPERATIONAL_STATE_RVC_CLUSTER", + "side": "server", + "enabled": 0, + "commands": [ + { + "name": "OperationalCommandResponse", + "code": 4, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "PhaseList", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentPhase", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CountdownTime", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "elapsed_s", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OperationalStateList", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OperationalState", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "OperationalStateStruct", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OperationalError", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "ErrorStateStruct", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ], + "events": [ + { + "name": "OperationalError", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "OperationCompletion", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1 + } + ] + }, { "name": "HEPA Filter Monitoring", "code": 113, diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java index f95bd3e9867c45..9b988ead4d2a73 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java @@ -187,6 +187,9 @@ public static BaseCluster getCluster(long clusterId) { if (clusterId == OperationalState.ID) { return new OperationalState(); } + if (clusterId == RoboticVacuumOperationalState.ID) { + return new RoboticVacuumOperationalState(); + } if (clusterId == HepaFilterMonitoring.ID) { return new HepaFilterMonitoring(); } @@ -7706,6 +7709,118 @@ public long getCommandID(String name) throws IllegalArgumentException { return Command.valueOf(name).getID(); } } + public static class RoboticVacuumOperationalState implements BaseCluster { + public static final long ID = 97L; + public long getID() { + return ID; + } + + public enum Attribute { + PhaseList(0L), + CurrentPhase(1L), + CountdownTime(2L), + OperationalStateList(3L), + OperationalState(4L), + OperationalError(5L), + 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 { + OperationalError(0L), + OperationCompletion(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 { + Pause(0L), + Stop(1L), + Start(2L), + Resume(3L),; + 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(); + } + }@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 HepaFilterMonitoring implements BaseCluster { public static final long ID = 113L; public long getID() { diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java index 40a742a4b047ad..5b67e5c2e3247b 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java @@ -7420,6 +7420,120 @@ private static Map readOperationalStateInteractionInfo( return result; } + private static Map readRoboticVacuumOperationalStateInteractionInfo() { + Map result = new LinkedHashMap<>();Map readRoboticVacuumOperationalStatePhaseListCommandParams = new LinkedHashMap(); + InteractionInfo readRoboticVacuumOperationalStatePhaseListAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.RoboticVacuumOperationalStateCluster) cluster).readPhaseListAttribute( + (ChipClusters.RoboticVacuumOperationalStateCluster.PhaseListAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedRoboticVacuumOperationalStateClusterPhaseListAttributeCallback(), + readRoboticVacuumOperationalStatePhaseListCommandParams + ); + result.put("readPhaseListAttribute", readRoboticVacuumOperationalStatePhaseListAttributeInteractionInfo); + Map readRoboticVacuumOperationalStateCurrentPhaseCommandParams = new LinkedHashMap(); + InteractionInfo readRoboticVacuumOperationalStateCurrentPhaseAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.RoboticVacuumOperationalStateCluster) cluster).readCurrentPhaseAttribute( + (ChipClusters.RoboticVacuumOperationalStateCluster.CurrentPhaseAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedRoboticVacuumOperationalStateClusterCurrentPhaseAttributeCallback(), + readRoboticVacuumOperationalStateCurrentPhaseCommandParams + ); + result.put("readCurrentPhaseAttribute", readRoboticVacuumOperationalStateCurrentPhaseAttributeInteractionInfo); + Map readRoboticVacuumOperationalStateCountdownTimeCommandParams = new LinkedHashMap(); + InteractionInfo readRoboticVacuumOperationalStateCountdownTimeAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.RoboticVacuumOperationalStateCluster) cluster).readCountdownTimeAttribute( + (ChipClusters.RoboticVacuumOperationalStateCluster.CountdownTimeAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedRoboticVacuumOperationalStateClusterCountdownTimeAttributeCallback(), + readRoboticVacuumOperationalStateCountdownTimeCommandParams + ); + result.put("readCountdownTimeAttribute", readRoboticVacuumOperationalStateCountdownTimeAttributeInteractionInfo); + Map readRoboticVacuumOperationalStateOperationalStateListCommandParams = new LinkedHashMap(); + InteractionInfo readRoboticVacuumOperationalStateOperationalStateListAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.RoboticVacuumOperationalStateCluster) cluster).readOperationalStateListAttribute( + (ChipClusters.RoboticVacuumOperationalStateCluster.OperationalStateListAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedRoboticVacuumOperationalStateClusterOperationalStateListAttributeCallback(), + readRoboticVacuumOperationalStateOperationalStateListCommandParams + ); + result.put("readOperationalStateListAttribute", readRoboticVacuumOperationalStateOperationalStateListAttributeInteractionInfo); + Map readRoboticVacuumOperationalStateGeneratedCommandListCommandParams = new LinkedHashMap(); + InteractionInfo readRoboticVacuumOperationalStateGeneratedCommandListAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.RoboticVacuumOperationalStateCluster) cluster).readGeneratedCommandListAttribute( + (ChipClusters.RoboticVacuumOperationalStateCluster.GeneratedCommandListAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedRoboticVacuumOperationalStateClusterGeneratedCommandListAttributeCallback(), + readRoboticVacuumOperationalStateGeneratedCommandListCommandParams + ); + result.put("readGeneratedCommandListAttribute", readRoboticVacuumOperationalStateGeneratedCommandListAttributeInteractionInfo); + Map readRoboticVacuumOperationalStateAcceptedCommandListCommandParams = new LinkedHashMap(); + InteractionInfo readRoboticVacuumOperationalStateAcceptedCommandListAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.RoboticVacuumOperationalStateCluster) cluster).readAcceptedCommandListAttribute( + (ChipClusters.RoboticVacuumOperationalStateCluster.AcceptedCommandListAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedRoboticVacuumOperationalStateClusterAcceptedCommandListAttributeCallback(), + readRoboticVacuumOperationalStateAcceptedCommandListCommandParams + ); + result.put("readAcceptedCommandListAttribute", readRoboticVacuumOperationalStateAcceptedCommandListAttributeInteractionInfo); + Map readRoboticVacuumOperationalStateEventListCommandParams = new LinkedHashMap(); + InteractionInfo readRoboticVacuumOperationalStateEventListAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.RoboticVacuumOperationalStateCluster) cluster).readEventListAttribute( + (ChipClusters.RoboticVacuumOperationalStateCluster.EventListAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedRoboticVacuumOperationalStateClusterEventListAttributeCallback(), + readRoboticVacuumOperationalStateEventListCommandParams + ); + result.put("readEventListAttribute", readRoboticVacuumOperationalStateEventListAttributeInteractionInfo); + Map readRoboticVacuumOperationalStateAttributeListCommandParams = new LinkedHashMap(); + InteractionInfo readRoboticVacuumOperationalStateAttributeListAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.RoboticVacuumOperationalStateCluster) cluster).readAttributeListAttribute( + (ChipClusters.RoboticVacuumOperationalStateCluster.AttributeListAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedRoboticVacuumOperationalStateClusterAttributeListAttributeCallback(), + readRoboticVacuumOperationalStateAttributeListCommandParams + ); + result.put("readAttributeListAttribute", readRoboticVacuumOperationalStateAttributeListAttributeInteractionInfo); + Map readRoboticVacuumOperationalStateFeatureMapCommandParams = new LinkedHashMap(); + InteractionInfo readRoboticVacuumOperationalStateFeatureMapAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.RoboticVacuumOperationalStateCluster) cluster).readFeatureMapAttribute( + (ChipClusters.LongAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readRoboticVacuumOperationalStateFeatureMapCommandParams + ); + result.put("readFeatureMapAttribute", readRoboticVacuumOperationalStateFeatureMapAttributeInteractionInfo); + Map readRoboticVacuumOperationalStateClusterRevisionCommandParams = new LinkedHashMap(); + InteractionInfo readRoboticVacuumOperationalStateClusterRevisionAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.RoboticVacuumOperationalStateCluster) cluster).readClusterRevisionAttribute( + (ChipClusters.IntegerAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readRoboticVacuumOperationalStateClusterRevisionCommandParams + ); + result.put("readClusterRevisionAttribute", readRoboticVacuumOperationalStateClusterRevisionAttributeInteractionInfo); + + return result; + } private static Map readHepaFilterMonitoringInteractionInfo() { Map result = new LinkedHashMap<>();Map readHepaFilterMonitoringConditionCommandParams = new LinkedHashMap(); InteractionInfo readHepaFilterMonitoringConditionAttributeInteractionInfo = new InteractionInfo( @@ -23222,6 +23336,7 @@ public Map> getReadAttributeMap() { put("airQuality", readAirQualityInteractionInfo()); put("smokeCoAlarm", readSmokeCoAlarmInteractionInfo()); put("operationalState", readOperationalStateInteractionInfo()); + put("roboticVacuumOperationalState", readRoboticVacuumOperationalStateInteractionInfo()); put("hepaFilterMonitoring", readHepaFilterMonitoringInteractionInfo()); put("activatedCarbonFilterMonitoring", readActivatedCarbonFilterMonitoringInteractionInfo()); put("ceramicFilterMonitoring", readCeramicFilterMonitoringInteractionInfo()); diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java index 3028e3525125f5..659c5d0ee3dc1d 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java @@ -1078,6 +1078,8 @@ public Map> getWriteAttributeMap() { writeAttributeMap.put("smokeCoAlarm", writeSmokeCoAlarmInteractionInfo); Map writeOperationalStateInteractionInfo = new LinkedHashMap<>(); writeAttributeMap.put("operationalState", writeOperationalStateInteractionInfo); + Map writeRoboticVacuumOperationalStateInteractionInfo = new LinkedHashMap<>(); + writeAttributeMap.put("roboticVacuumOperationalState", writeRoboticVacuumOperationalStateInteractionInfo); Map writeHepaFilterMonitoringInteractionInfo = new LinkedHashMap<>(); writeAttributeMap.put("hepaFilterMonitoring", writeHepaFilterMonitoringInteractionInfo); Map writeActivatedCarbonFilterMonitoringInteractionInfo = new LinkedHashMap<>(); diff --git a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp index 0248cc27172020..615c368c0707c8 100644 --- a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp @@ -15011,10 +15011,20 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR std::string newElement_0_operationalStateIDCtorSignature = "(I)V"; chip::JniReferences::GetInstance().CreateBoxedObject( newElement_0_operationalStateIDClassName.c_str(), newElement_0_operationalStateIDCtorSignature.c_str(), - static_cast(entry_0.operationalStateID), newElement_0_operationalStateID); + entry_0.operationalStateID, newElement_0_operationalStateID); jobject newElement_0_operationalStateLabel; - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.operationalStateLabel, - newElement_0_operationalStateLabel)); + if (!entry_0.operationalStateLabel.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_0_operationalStateLabel); + } + else + { + jobject newElement_0_operationalStateLabelInsideOptional; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF( + entry_0.operationalStateLabel.Value(), newElement_0_operationalStateLabelInsideOptional)); + chip::JniReferences::GetInstance().CreateOptional(newElement_0_operationalStateLabelInsideOptional, + newElement_0_operationalStateLabel); + } jclass operationalStateStructStructClass_1; err = chip::JniReferences::GetInstance().GetClassRef( @@ -15026,7 +15036,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jmethodID operationalStateStructStructCtor_1 = - env->GetMethodID(operationalStateStructStructClass_1, "", "(Ljava/lang/Integer;Ljava/lang/String;)V"); + env->GetMethodID(operationalStateStructStructClass_1, "", "(Ljava/lang/Integer;Ljava/util/Optional;)V"); if (operationalStateStructStructCtor_1 == nullptr) { ChipLogError(Zcl, "Could not find ChipStructs$OperationalStateClusterOperationalStateStruct constructor"); @@ -15051,12 +15061,22 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR jobject value_operationalStateID; std::string value_operationalStateIDClassName = "java/lang/Integer"; std::string value_operationalStateIDCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject( - value_operationalStateIDClassName.c_str(), value_operationalStateIDCtorSignature.c_str(), - static_cast(cppValue.operationalStateID), value_operationalStateID); + chip::JniReferences::GetInstance().CreateBoxedObject(value_operationalStateIDClassName.c_str(), + value_operationalStateIDCtorSignature.c_str(), + cppValue.operationalStateID, value_operationalStateID); jobject value_operationalStateLabel; - LogErrorOnFailure( - chip::JniReferences::GetInstance().CharToStringUTF(cppValue.operationalStateLabel, value_operationalStateLabel)); + if (!cppValue.operationalStateLabel.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_operationalStateLabel); + } + else + { + jobject value_operationalStateLabelInsideOptional; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue.operationalStateLabel.Value(), + value_operationalStateLabelInsideOptional)); + chip::JniReferences::GetInstance().CreateOptional(value_operationalStateLabelInsideOptional, + value_operationalStateLabel); + } jclass operationalStateStructStructClass_0; err = chip::JniReferences::GetInstance().GetClassRef( @@ -15068,7 +15088,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jmethodID operationalStateStructStructCtor_0 = - env->GetMethodID(operationalStateStructStructClass_0, "", "(Ljava/lang/Integer;Ljava/lang/String;)V"); + env->GetMethodID(operationalStateStructStructClass_0, "", "(Ljava/lang/Integer;Ljava/util/Optional;)V"); if (operationalStateStructStructCtor_0 == nullptr) { ChipLogError(Zcl, "Could not find ChipStructs$OperationalStateClusterOperationalStateStruct constructor"); @@ -15091,18 +15111,20 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR jobject value_errorStateID; std::string value_errorStateIDClassName = "java/lang/Integer"; std::string value_errorStateIDCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject( - value_errorStateIDClassName.c_str(), value_errorStateIDCtorSignature.c_str(), - static_cast(cppValue.errorStateID), value_errorStateID); + chip::JniReferences::GetInstance().CreateBoxedObject(value_errorStateIDClassName.c_str(), + value_errorStateIDCtorSignature.c_str(), + cppValue.errorStateID, value_errorStateID); jobject value_errorStateLabel; - if (cppValue.errorStateLabel.IsNull()) + if (!cppValue.errorStateLabel.HasValue()) { - value_errorStateLabel = nullptr; + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_errorStateLabel); } else { - LogErrorOnFailure( - chip::JniReferences::GetInstance().CharToStringUTF(cppValue.errorStateLabel.Value(), value_errorStateLabel)); + jobject value_errorStateLabelInsideOptional; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue.errorStateLabel.Value(), + value_errorStateLabelInsideOptional)); + chip::JniReferences::GetInstance().CreateOptional(value_errorStateLabelInsideOptional, value_errorStateLabel); } jobject value_errorStateDetails; if (!cppValue.errorStateDetails.HasValue()) @@ -15126,7 +15148,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jmethodID errorStateStructStructCtor_0 = env->GetMethodID( - errorStateStructStructClass_0, "", "(Ljava/lang/Integer;Ljava/lang/String;Ljava/util/Optional;)V"); + errorStateStructStructClass_0, "", "(Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;)V"); if (errorStateStructStructCtor_0 == nullptr) { ChipLogError(Zcl, "Could not find ChipStructs$OperationalStateClusterErrorStateStruct constructor"); @@ -15269,6 +15291,387 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR } break; } + case app::Clusters::RoboticVacuumOperationalState::Id: { + using namespace app::Clusters::RoboticVacuumOperationalState; + switch (aPath.mAttributeId) + { + case Attributes::PhaseList::Id: { + using TypeInfo = Attributes::PhaseList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + if (cppValue.IsNull()) + { + value = nullptr; + } + else + { + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_1 = cppValue.Value().begin(); + while (iter_value_1.Next()) + { + auto & entry_1 = iter_value_1.GetValue(); + jobject newElement_1; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_1, newElement_1)); + chip::JniReferences::GetInstance().AddToList(value, newElement_1); + } + } + return value; + } + case Attributes::CurrentPhase::Id: { + using TypeInfo = Attributes::CurrentPhase::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + if (cppValue.IsNull()) + { + value = nullptr; + } + else + { + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue.Value(), value); + } + return value; + } + case Attributes::CountdownTime::Id: { + using TypeInfo = Attributes::CountdownTime::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + if (cppValue.IsNull()) + { + value = nullptr; + } + else + { + std::string valueClassName = "java/lang/Long"; + std::string valueCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue.Value(), value); + } + return value; + } + case Attributes::OperationalStateList::Id: { + using TypeInfo = Attributes::OperationalStateList::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_operationalStateID; + std::string newElement_0_operationalStateIDClassName = "java/lang/Integer"; + std::string newElement_0_operationalStateIDCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_operationalStateIDClassName.c_str(), newElement_0_operationalStateIDCtorSignature.c_str(), + entry_0.operationalStateID, newElement_0_operationalStateID); + jobject newElement_0_operationalStateLabel; + if (!entry_0.operationalStateLabel.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_0_operationalStateLabel); + } + else + { + jobject newElement_0_operationalStateLabelInsideOptional; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF( + entry_0.operationalStateLabel.Value(), newElement_0_operationalStateLabelInsideOptional)); + chip::JniReferences::GetInstance().CreateOptional(newElement_0_operationalStateLabelInsideOptional, + newElement_0_operationalStateLabel); + } + + jclass operationalStateStructStructClass_1; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipStructs$RoboticVacuumOperationalStateClusterOperationalStateStruct", + operationalStateStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, + "Could not find class ChipStructs$RoboticVacuumOperationalStateClusterOperationalStateStruct"); + return nullptr; + } + jmethodID operationalStateStructStructCtor_1 = + env->GetMethodID(operationalStateStructStructClass_1, "", "(Ljava/lang/Integer;Ljava/util/Optional;)V"); + if (operationalStateStructStructCtor_1 == nullptr) + { + ChipLogError( + Zcl, "Could not find ChipStructs$RoboticVacuumOperationalStateClusterOperationalStateStruct constructor"); + return nullptr; + } + + newElement_0 = env->NewObject(operationalStateStructStructClass_1, operationalStateStructStructCtor_1, + newElement_0_operationalStateID, newElement_0_operationalStateLabel); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::OperationalState::Id: { + using TypeInfo = Attributes::OperationalState::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + jobject value_operationalStateID; + std::string value_operationalStateIDClassName = "java/lang/Integer"; + std::string value_operationalStateIDCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(value_operationalStateIDClassName.c_str(), + value_operationalStateIDCtorSignature.c_str(), + cppValue.operationalStateID, value_operationalStateID); + jobject value_operationalStateLabel; + if (!cppValue.operationalStateLabel.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_operationalStateLabel); + } + else + { + jobject value_operationalStateLabelInsideOptional; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue.operationalStateLabel.Value(), + value_operationalStateLabelInsideOptional)); + chip::JniReferences::GetInstance().CreateOptional(value_operationalStateLabelInsideOptional, + value_operationalStateLabel); + } + + jclass operationalStateStructStructClass_0; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipStructs$RoboticVacuumOperationalStateClusterOperationalStateStruct", + operationalStateStructStructClass_0); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$RoboticVacuumOperationalStateClusterOperationalStateStruct"); + return nullptr; + } + jmethodID operationalStateStructStructCtor_0 = + env->GetMethodID(operationalStateStructStructClass_0, "", "(Ljava/lang/Integer;Ljava/util/Optional;)V"); + if (operationalStateStructStructCtor_0 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$RoboticVacuumOperationalStateClusterOperationalStateStruct constructor"); + return nullptr; + } + + value = env->NewObject(operationalStateStructStructClass_0, operationalStateStructStructCtor_0, + value_operationalStateID, value_operationalStateLabel); + return value; + } + case Attributes::OperationalError::Id: { + using TypeInfo = Attributes::OperationalError::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + jobject value_errorStateID; + std::string value_errorStateIDClassName = "java/lang/Integer"; + std::string value_errorStateIDCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(value_errorStateIDClassName.c_str(), + value_errorStateIDCtorSignature.c_str(), + cppValue.errorStateID, value_errorStateID); + jobject value_errorStateLabel; + if (!cppValue.errorStateLabel.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_errorStateLabel); + } + else + { + jobject value_errorStateLabelInsideOptional; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue.errorStateLabel.Value(), + value_errorStateLabelInsideOptional)); + chip::JniReferences::GetInstance().CreateOptional(value_errorStateLabelInsideOptional, value_errorStateLabel); + } + jobject value_errorStateDetails; + if (!cppValue.errorStateDetails.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_errorStateDetails); + } + else + { + jobject value_errorStateDetailsInsideOptional; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue.errorStateDetails.Value(), + value_errorStateDetailsInsideOptional)); + chip::JniReferences::GetInstance().CreateOptional(value_errorStateDetailsInsideOptional, value_errorStateDetails); + } + + jclass errorStateStructStructClass_0; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipStructs$RoboticVacuumOperationalStateClusterErrorStateStruct", + errorStateStructStructClass_0); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$RoboticVacuumOperationalStateClusterErrorStateStruct"); + return nullptr; + } + jmethodID errorStateStructStructCtor_0 = env->GetMethodID( + errorStateStructStructClass_0, "", "(Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;)V"); + if (errorStateStructStructCtor_0 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$RoboticVacuumOperationalStateClusterErrorStateStruct constructor"); + return nullptr; + } + + value = env->NewObject(errorStateStructStructClass_0, errorStateStructStructCtor_0, value_errorStateID, + value_errorStateLabel, value_errorStateDetails); + return value; + } + case Attributes::GeneratedCommandList::Id: { + using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + 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"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), entry_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"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), entry_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"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), entry_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"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), entry_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"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue, 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"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue, value); + return value; + } + default: + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + break; + } + break; + } case app::Clusters::HepaFilterMonitoring::Id: { using namespace app::Clusters::HepaFilterMonitoring; switch (aPath.mAttributeId) diff --git a/src/controller/java/zap-generated/CHIPClientCallbacks.h b/src/controller/java/zap-generated/CHIPClientCallbacks.h index b7537c2e38ad24..0c5b959a478e20 100644 --- a/src/controller/java/zap-generated/CHIPClientCallbacks.h +++ b/src/controller/java/zap-generated/CHIPClientCallbacks.h @@ -594,6 +594,20 @@ typedef void (*OperationalStateEventListListAttributeCallback)(void * context, const chip::app::DataModel::DecodableList & data); typedef void (*OperationalStateAttributeListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); +typedef void (*RoboticVacuumOperationalStatePhaseListListAttributeCallback)( + void * context, const chip::app::DataModel::Nullable> & data); +typedef void (*RoboticVacuumOperationalStateOperationalStateListListAttributeCallback)( + void * context, + const chip::app::DataModel::DecodableList< + chip::app::Clusters::RoboticVacuumOperationalState::Structs::OperationalStateStruct::DecodableType> & data); +typedef void (*RoboticVacuumOperationalStateGeneratedCommandListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +typedef void (*RoboticVacuumOperationalStateAcceptedCommandListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +typedef void (*RoboticVacuumOperationalStateEventListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +typedef void (*RoboticVacuumOperationalStateAttributeListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); typedef void (*HepaFilterMonitoringGeneratedCommandListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); typedef void (*HepaFilterMonitoringAcceptedCommandListListAttributeCallback)( diff --git a/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp index 03ebc2ef9083f4..79f848d427a08b 100644 --- a/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp @@ -2883,16 +2883,19 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & std::string value_errorState_errorStateIDCtorSignature = "(I)V"; chip::JniReferences::GetInstance().CreateBoxedObject( value_errorState_errorStateIDClassName.c_str(), value_errorState_errorStateIDCtorSignature.c_str(), - static_cast(cppValue.errorState.errorStateID), value_errorState_errorStateID); + cppValue.errorState.errorStateID, value_errorState_errorStateID); jobject value_errorState_errorStateLabel; - if (cppValue.errorState.errorStateLabel.IsNull()) + if (!cppValue.errorState.errorStateLabel.HasValue()) { - value_errorState_errorStateLabel = nullptr; + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_errorState_errorStateLabel); } else { - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue.errorState.errorStateLabel.Value(), - value_errorState_errorStateLabel)); + jobject value_errorState_errorStateLabelInsideOptional; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF( + cppValue.errorState.errorStateLabel.Value(), value_errorState_errorStateLabelInsideOptional)); + chip::JniReferences::GetInstance().CreateOptional(value_errorState_errorStateLabelInsideOptional, + value_errorState_errorStateLabel); } jobject value_errorState_errorStateDetails; if (!cppValue.errorState.errorStateDetails.HasValue()) @@ -2917,7 +2920,7 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & return nullptr; } jmethodID errorStateStructStructCtor_0 = env->GetMethodID( - errorStateStructStructClass_0, "", "(Ljava/lang/Integer;Ljava/lang/String;Ljava/util/Optional;)V"); + errorStateStructStructClass_0, "", "(Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;)V"); if (errorStateStructStructCtor_0 == nullptr) { ChipLogError(Zcl, "Could not find ChipStructs$OperationalStateClusterErrorStateStruct constructor"); @@ -2960,9 +2963,9 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & jobject value_completionErrorCode; std::string value_completionErrorCodeClassName = "java/lang/Integer"; std::string value_completionErrorCodeCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject( - value_completionErrorCodeClassName.c_str(), value_completionErrorCodeCtorSignature.c_str(), - static_cast(cppValue.completionErrorCode), value_completionErrorCode); + chip::JniReferences::GetInstance().CreateBoxedObject(value_completionErrorCodeClassName.c_str(), + value_completionErrorCodeCtorSignature.c_str(), + cppValue.completionErrorCode, value_completionErrorCode); jobject value_totalOperationalTime; if (!cppValue.totalOperationalTime.HasValue()) @@ -3040,6 +3043,189 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & } break; } + case app::Clusters::RoboticVacuumOperationalState::Id: { + using namespace app::Clusters::RoboticVacuumOperationalState; + switch (aPath.mEventId) + { + case Events::OperationalError::Id: { + Events::OperationalError::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value_errorState; + jobject value_errorState_errorStateID; + std::string value_errorState_errorStateIDClassName = "java/lang/Integer"; + std::string value_errorState_errorStateIDCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + value_errorState_errorStateIDClassName.c_str(), value_errorState_errorStateIDCtorSignature.c_str(), + cppValue.errorState.errorStateID, value_errorState_errorStateID); + jobject value_errorState_errorStateLabel; + if (!cppValue.errorState.errorStateLabel.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_errorState_errorStateLabel); + } + else + { + jobject value_errorState_errorStateLabelInsideOptional; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF( + cppValue.errorState.errorStateLabel.Value(), value_errorState_errorStateLabelInsideOptional)); + chip::JniReferences::GetInstance().CreateOptional(value_errorState_errorStateLabelInsideOptional, + value_errorState_errorStateLabel); + } + jobject value_errorState_errorStateDetails; + if (!cppValue.errorState.errorStateDetails.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_errorState_errorStateDetails); + } + else + { + jobject value_errorState_errorStateDetailsInsideOptional; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF( + cppValue.errorState.errorStateDetails.Value(), value_errorState_errorStateDetailsInsideOptional)); + chip::JniReferences::GetInstance().CreateOptional(value_errorState_errorStateDetailsInsideOptional, + value_errorState_errorStateDetails); + } + + jclass errorStateStructStructClass_0; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipStructs$RoboticVacuumOperationalStateClusterErrorStateStruct", + errorStateStructStructClass_0); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$RoboticVacuumOperationalStateClusterErrorStateStruct"); + return nullptr; + } + jmethodID errorStateStructStructCtor_0 = env->GetMethodID( + errorStateStructStructClass_0, "", "(Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;)V"); + if (errorStateStructStructCtor_0 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$RoboticVacuumOperationalStateClusterErrorStateStruct constructor"); + return nullptr; + } + + value_errorState = + env->NewObject(errorStateStructStructClass_0, errorStateStructStructCtor_0, value_errorState_errorStateID, + value_errorState_errorStateLabel, value_errorState_errorStateDetails); + + jclass operationalErrorStructClass; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipEventStructs$RoboticVacuumOperationalStateClusterOperationalErrorEvent", + operationalErrorStructClass); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, + "Could not find class ChipEventStructs$RoboticVacuumOperationalStateClusterOperationalErrorEvent"); + return nullptr; + } + jmethodID operationalErrorStructCtor = + env->GetMethodID(operationalErrorStructClass, "", + "(Lchip/devicecontroller/ChipStructs$RoboticVacuumOperationalStateClusterErrorStateStruct;)V"); + if (operationalErrorStructCtor == nullptr) + { + ChipLogError( + Zcl, "Could not find ChipEventStructs$RoboticVacuumOperationalStateClusterOperationalErrorEvent constructor"); + return nullptr; + } + + jobject value = env->NewObject(operationalErrorStructClass, operationalErrorStructCtor, value_errorState); + + return value; + } + case Events::OperationCompletion::Id: { + Events::OperationCompletion::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value_completionErrorCode; + std::string value_completionErrorCodeClassName = "java/lang/Integer"; + std::string value_completionErrorCodeCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(value_completionErrorCodeClassName.c_str(), + value_completionErrorCodeCtorSignature.c_str(), + cppValue.completionErrorCode, value_completionErrorCode); + + jobject value_totalOperationalTime; + if (!cppValue.totalOperationalTime.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_totalOperationalTime); + } + else + { + jobject value_totalOperationalTimeInsideOptional; + if (cppValue.totalOperationalTime.Value().IsNull()) + { + value_totalOperationalTimeInsideOptional = nullptr; + } + else + { + std::string value_totalOperationalTimeInsideOptionalClassName = "java/lang/Long"; + std::string value_totalOperationalTimeInsideOptionalCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + value_totalOperationalTimeInsideOptionalClassName.c_str(), + value_totalOperationalTimeInsideOptionalCtorSignature.c_str(), + cppValue.totalOperationalTime.Value().Value(), value_totalOperationalTimeInsideOptional); + } + chip::JniReferences::GetInstance().CreateOptional(value_totalOperationalTimeInsideOptional, + value_totalOperationalTime); + } + + jobject value_pausedTime; + if (!cppValue.pausedTime.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_pausedTime); + } + else + { + jobject value_pausedTimeInsideOptional; + if (cppValue.pausedTime.Value().IsNull()) + { + value_pausedTimeInsideOptional = nullptr; + } + else + { + std::string value_pausedTimeInsideOptionalClassName = "java/lang/Long"; + std::string value_pausedTimeInsideOptionalCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + value_pausedTimeInsideOptionalClassName.c_str(), value_pausedTimeInsideOptionalCtorSignature.c_str(), + cppValue.pausedTime.Value().Value(), value_pausedTimeInsideOptional); + } + chip::JniReferences::GetInstance().CreateOptional(value_pausedTimeInsideOptional, value_pausedTime); + } + + jclass operationCompletionStructClass; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipEventStructs$RoboticVacuumOperationalStateClusterOperationCompletionEvent", + operationCompletionStructClass); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, + "Could not find class ChipEventStructs$RoboticVacuumOperationalStateClusterOperationCompletionEvent"); + return nullptr; + } + jmethodID operationCompletionStructCtor = env->GetMethodID( + operationCompletionStructClass, "", "(Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;)V"); + if (operationCompletionStructCtor == nullptr) + { + ChipLogError( + Zcl, + "Could not find ChipEventStructs$RoboticVacuumOperationalStateClusterOperationCompletionEvent constructor"); + return nullptr; + } + + jobject value = env->NewObject(operationCompletionStructClass, operationCompletionStructCtor, value_completionErrorCode, + value_totalOperationalTime, value_pausedTime); + + return value; + } + default: + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; + break; + } + break; + } case app::Clusters::HepaFilterMonitoring::Id: { using namespace app::Clusters::HepaFilterMonitoring; switch (aPath.mEventId) diff --git a/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp b/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp index dacb197027abec..1b889b3567489d 100644 --- a/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp +++ b/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp @@ -3322,16 +3322,19 @@ void CHIPOperationalStateClusterOperationalCommandResponseCallback::CallbackFn( std::string CommandResponseState_errorStateIDCtorSignature = "(I)V"; chip::JniReferences::GetInstance().CreateBoxedObject( CommandResponseState_errorStateIDClassName.c_str(), CommandResponseState_errorStateIDCtorSignature.c_str(), - static_cast(dataResponse.commandResponseState.errorStateID), CommandResponseState_errorStateID); + dataResponse.commandResponseState.errorStateID, CommandResponseState_errorStateID); jobject CommandResponseState_errorStateLabel; - if (dataResponse.commandResponseState.errorStateLabel.IsNull()) + if (!dataResponse.commandResponseState.errorStateLabel.HasValue()) { - CommandResponseState_errorStateLabel = nullptr; + chip::JniReferences::GetInstance().CreateOptional(nullptr, CommandResponseState_errorStateLabel); } else { + jobject CommandResponseState_errorStateLabelInsideOptional; LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF( - dataResponse.commandResponseState.errorStateLabel.Value(), CommandResponseState_errorStateLabel)); + dataResponse.commandResponseState.errorStateLabel.Value(), CommandResponseState_errorStateLabelInsideOptional)); + chip::JniReferences::GetInstance().CreateOptional(CommandResponseState_errorStateLabelInsideOptional, + CommandResponseState_errorStateLabel); } jobject CommandResponseState_errorStateDetails; if (!dataResponse.commandResponseState.errorStateDetails.HasValue()) @@ -3356,7 +3359,7 @@ void CHIPOperationalStateClusterOperationalCommandResponseCallback::CallbackFn( return; } jmethodID errorStateStructStructCtor_0 = - env->GetMethodID(errorStateStructStructClass_0, "", "(Ljava/lang/Integer;Ljava/lang/String;Ljava/util/Optional;)V"); + env->GetMethodID(errorStateStructStructClass_0, "", "(Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;)V"); if (errorStateStructStructCtor_0 == nullptr) { ChipLogError(Zcl, "Could not find ChipStructs$OperationalStateClusterErrorStateStruct constructor"); @@ -3369,6 +3372,120 @@ void CHIPOperationalStateClusterOperationalCommandResponseCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, CommandResponseState); } +CHIPRoboticVacuumOperationalStateClusterOperationalCommandResponseCallback:: + CHIPRoboticVacuumOperationalStateClusterOperationalCommandResponseCallback(jobject javaCallback) : + Callback::Callback(CallbackFn, this) +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPRoboticVacuumOperationalStateClusterOperationalCommandResponseCallback:: + ~CHIPRoboticVacuumOperationalStateClusterOperationalCommandResponseCallback() +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +}; + +void CHIPRoboticVacuumOperationalStateClusterOperationalCommandResponseCallback::CallbackFn( + void * context, + const chip::app::Clusters::RoboticVacuumOperationalState::Commands::OperationalCommandResponse::DecodableType & dataResponse) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + jmethodID javaMethod; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); + + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); + VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); + + javaCallbackRef = cppCallback->javaCallbackRef; + // Java callback is allowed to be null, exit early if this is the case. + VerifyOrReturn(javaCallbackRef != nullptr); + + err = JniReferences::GetInstance().FindMethod( + env, javaCallbackRef, "onSuccess", + "(Lchip/devicecontroller/ChipStructs$RoboticVacuumOperationalStateClusterErrorStateStruct;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); + + jobject CommandResponseState; + jobject CommandResponseState_errorStateID; + std::string CommandResponseState_errorStateIDClassName = "java/lang/Integer"; + std::string CommandResponseState_errorStateIDCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + CommandResponseState_errorStateIDClassName.c_str(), CommandResponseState_errorStateIDCtorSignature.c_str(), + dataResponse.commandResponseState.errorStateID, CommandResponseState_errorStateID); + jobject CommandResponseState_errorStateLabel; + if (!dataResponse.commandResponseState.errorStateLabel.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, CommandResponseState_errorStateLabel); + } + else + { + jobject CommandResponseState_errorStateLabelInsideOptional; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF( + dataResponse.commandResponseState.errorStateLabel.Value(), CommandResponseState_errorStateLabelInsideOptional)); + chip::JniReferences::GetInstance().CreateOptional(CommandResponseState_errorStateLabelInsideOptional, + CommandResponseState_errorStateLabel); + } + jobject CommandResponseState_errorStateDetails; + if (!dataResponse.commandResponseState.errorStateDetails.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, CommandResponseState_errorStateDetails); + } + else + { + jobject CommandResponseState_errorStateDetailsInsideOptional; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF( + dataResponse.commandResponseState.errorStateDetails.Value(), CommandResponseState_errorStateDetailsInsideOptional)); + chip::JniReferences::GetInstance().CreateOptional(CommandResponseState_errorStateDetailsInsideOptional, + CommandResponseState_errorStateDetails); + } + + jclass errorStateStructStructClass_0; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipStructs$RoboticVacuumOperationalStateClusterErrorStateStruct", + errorStateStructStructClass_0); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$RoboticVacuumOperationalStateClusterErrorStateStruct"); + return; + } + jmethodID errorStateStructStructCtor_0 = + env->GetMethodID(errorStateStructStructClass_0, "", "(Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;)V"); + if (errorStateStructStructCtor_0 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$RoboticVacuumOperationalStateClusterErrorStateStruct constructor"); + return; + } + + CommandResponseState = + env->NewObject(errorStateStructStructClass_0, errorStateStructStructCtor_0, CommandResponseState_errorStateID, + CommandResponseState_errorStateLabel, CommandResponseState_errorStateDetails); + + env->CallVoidMethod(javaCallbackRef, javaMethod, CommandResponseState); +} CHIPDoorLockClusterGetWeekDayScheduleResponseCallback::CHIPDoorLockClusterGetWeekDayScheduleResponseCallback(jobject javaCallback) : Callback::Callback(CallbackFn, this) { diff --git a/src/controller/java/zap-generated/CHIPInvokeCallbacks.h b/src/controller/java/zap-generated/CHIPInvokeCallbacks.h index 585195f541e966..c838d0e129b262 100644 --- a/src/controller/java/zap-generated/CHIPInvokeCallbacks.h +++ b/src/controller/java/zap-generated/CHIPInvokeCallbacks.h @@ -571,6 +571,22 @@ class CHIPOperationalStateClusterOperationalCommandResponseCallback jobject javaCallbackRef; }; +class CHIPRoboticVacuumOperationalStateClusterOperationalCommandResponseCallback + : public Callback::Callback +{ +public: + CHIPRoboticVacuumOperationalStateClusterOperationalCommandResponseCallback(jobject javaCallback); + + ~CHIPRoboticVacuumOperationalStateClusterOperationalCommandResponseCallback(); + + static void CallbackFn( + void * context, + const chip::app::Clusters::RoboticVacuumOperationalState::Commands::OperationalCommandResponse::DecodableType & data); + +private: + jobject javaCallbackRef; +}; + class CHIPDoorLockClusterGetWeekDayScheduleResponseCallback : public Callback::Callback { diff --git a/src/controller/java/zap-generated/CHIPReadCallbacks.cpp b/src/controller/java/zap-generated/CHIPReadCallbacks.cpp index 23be9ec0902b8f..fcc2f44b7a1f5e 100644 --- a/src/controller/java/zap-generated/CHIPReadCallbacks.cpp +++ b/src/controller/java/zap-generated/CHIPReadCallbacks.cpp @@ -25127,12 +25127,22 @@ void CHIPOperationalStateOperationalStateListAttributeCallback::CallbackFn( jobject newElement_0_operationalStateID; std::string newElement_0_operationalStateIDClassName = "java/lang/Integer"; std::string newElement_0_operationalStateIDCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_0_operationalStateIDClassName.c_str(), newElement_0_operationalStateIDCtorSignature.c_str(), - static_cast(entry_0.operationalStateID), newElement_0_operationalStateID); + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_operationalStateIDClassName.c_str(), + newElement_0_operationalStateIDCtorSignature.c_str(), + entry_0.operationalStateID, newElement_0_operationalStateID); jobject newElement_0_operationalStateLabel; - LogErrorOnFailure( - chip::JniReferences::GetInstance().CharToStringUTF(entry_0.operationalStateLabel, newElement_0_operationalStateLabel)); + if (!entry_0.operationalStateLabel.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_0_operationalStateLabel); + } + else + { + jobject newElement_0_operationalStateLabelInsideOptional; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.operationalStateLabel.Value(), + newElement_0_operationalStateLabelInsideOptional)); + chip::JniReferences::GetInstance().CreateOptional(newElement_0_operationalStateLabelInsideOptional, + newElement_0_operationalStateLabel); + } jclass operationalStateStructStructClass_1; err = chip::JniReferences::GetInstance().GetClassRef( @@ -25144,7 +25154,7 @@ void CHIPOperationalStateOperationalStateListAttributeCallback::CallbackFn( return; } jmethodID operationalStateStructStructCtor_1 = - env->GetMethodID(operationalStateStructStructClass_1, "", "(Ljava/lang/Integer;Ljava/lang/String;)V"); + env->GetMethodID(operationalStateStructStructClass_1, "", "(Ljava/lang/Integer;Ljava/util/Optional;)V"); if (operationalStateStructStructCtor_1 == nullptr) { ChipLogError(Zcl, "Could not find ChipStructs$OperationalStateClusterOperationalStateStruct constructor"); @@ -25444,6 +25454,610 @@ void CHIPOperationalStateAttributeListAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } +CHIPRoboticVacuumOperationalStatePhaseListAttributeCallback::CHIPRoboticVacuumOperationalStatePhaseListAttributeCallback( + jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPRoboticVacuumOperationalStatePhaseListAttributeCallback::~CHIPRoboticVacuumOperationalStatePhaseListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPRoboticVacuumOperationalStatePhaseListAttributeCallback::CallbackFn( + void * context, const chip::app::DataModel::Nullable> & list) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject arrayListObj; + if (list.IsNull()) + { + arrayListObj = nullptr; + } + else + { + chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); + + auto iter_arrayListObj_1 = list.Value().begin(); + while (iter_arrayListObj_1.Next()) + { + auto & entry_1 = iter_arrayListObj_1.GetValue(); + jobject newElement_1; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_1, newElement_1)); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_1); + } + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPRoboticVacuumOperationalStateCurrentPhaseAttributeCallback::CHIPRoboticVacuumOperationalStateCurrentPhaseAttributeCallback( + jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPRoboticVacuumOperationalStateCurrentPhaseAttributeCallback::~CHIPRoboticVacuumOperationalStateCurrentPhaseAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPRoboticVacuumOperationalStateCurrentPhaseAttributeCallback::CallbackFn( + void * context, const chip::app::DataModel::Nullable & value) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject javaValue; + if (value.IsNull()) + { + javaValue = nullptr; + } + else + { + std::string javaValueClassName = "java/lang/Integer"; + std::string javaValueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(javaValueClassName.c_str(), javaValueCtorSignature.c_str(), + value.Value(), javaValue); + } + + env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); +} + +CHIPRoboticVacuumOperationalStateCountdownTimeAttributeCallback::CHIPRoboticVacuumOperationalStateCountdownTimeAttributeCallback( + jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPRoboticVacuumOperationalStateCountdownTimeAttributeCallback::~CHIPRoboticVacuumOperationalStateCountdownTimeAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPRoboticVacuumOperationalStateCountdownTimeAttributeCallback::CallbackFn( + void * context, const chip::app::DataModel::Nullable & value) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Long;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject javaValue; + if (value.IsNull()) + { + javaValue = nullptr; + } + else + { + std::string javaValueClassName = "java/lang/Long"; + std::string javaValueCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(javaValueClassName.c_str(), javaValueCtorSignature.c_str(), + value.Value(), javaValue); + } + + env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); +} + +CHIPRoboticVacuumOperationalStateOperationalStateListAttributeCallback:: + CHIPRoboticVacuumOperationalStateOperationalStateListAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPRoboticVacuumOperationalStateOperationalStateListAttributeCallback:: + ~CHIPRoboticVacuumOperationalStateOperationalStateListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPRoboticVacuumOperationalStateOperationalStateListAttributeCallback::CallbackFn( + void * context, + const chip::app::DataModel::DecodableList< + chip::app::Clusters::RoboticVacuumOperationalState::Structs::OperationalStateStruct::DecodableType> & list) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject arrayListObj; + chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); + + auto iter_arrayListObj_0 = list.begin(); + while (iter_arrayListObj_0.Next()) + { + auto & entry_0 = iter_arrayListObj_0.GetValue(); + jobject newElement_0; + jobject newElement_0_operationalStateID; + std::string newElement_0_operationalStateIDClassName = "java/lang/Integer"; + std::string newElement_0_operationalStateIDCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_operationalStateIDClassName.c_str(), + newElement_0_operationalStateIDCtorSignature.c_str(), + entry_0.operationalStateID, newElement_0_operationalStateID); + jobject newElement_0_operationalStateLabel; + if (!entry_0.operationalStateLabel.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_0_operationalStateLabel); + } + else + { + jobject newElement_0_operationalStateLabelInsideOptional; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.operationalStateLabel.Value(), + newElement_0_operationalStateLabelInsideOptional)); + chip::JniReferences::GetInstance().CreateOptional(newElement_0_operationalStateLabelInsideOptional, + newElement_0_operationalStateLabel); + } + + jclass operationalStateStructStructClass_1; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipStructs$RoboticVacuumOperationalStateClusterOperationalStateStruct", + operationalStateStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$RoboticVacuumOperationalStateClusterOperationalStateStruct"); + return; + } + jmethodID operationalStateStructStructCtor_1 = + env->GetMethodID(operationalStateStructStructClass_1, "", "(Ljava/lang/Integer;Ljava/util/Optional;)V"); + if (operationalStateStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$RoboticVacuumOperationalStateClusterOperationalStateStruct constructor"); + return; + } + + newElement_0 = env->NewObject(operationalStateStructStructClass_1, operationalStateStructStructCtor_1, + newElement_0_operationalStateID, newElement_0_operationalStateLabel); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPRoboticVacuumOperationalStateGeneratedCommandListAttributeCallback:: + CHIPRoboticVacuumOperationalStateGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPRoboticVacuumOperationalStateGeneratedCommandListAttributeCallback:: + ~CHIPRoboticVacuumOperationalStateGeneratedCommandListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPRoboticVacuumOperationalStateGeneratedCommandListAttributeCallback::CallbackFn( + void * context, const chip::app::DataModel::DecodableList & list) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject arrayListObj; + chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); + + auto iter_arrayListObj_0 = list.begin(); + while (iter_arrayListObj_0.Next()) + { + auto & entry_0 = iter_arrayListObj_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0ClassName.c_str(), + newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPRoboticVacuumOperationalStateAcceptedCommandListAttributeCallback:: + CHIPRoboticVacuumOperationalStateAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPRoboticVacuumOperationalStateAcceptedCommandListAttributeCallback:: + ~CHIPRoboticVacuumOperationalStateAcceptedCommandListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPRoboticVacuumOperationalStateAcceptedCommandListAttributeCallback::CallbackFn( + void * context, const chip::app::DataModel::DecodableList & list) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject arrayListObj; + chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); + + auto iter_arrayListObj_0 = list.begin(); + while (iter_arrayListObj_0.Next()) + { + auto & entry_0 = iter_arrayListObj_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0ClassName.c_str(), + newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPRoboticVacuumOperationalStateEventListAttributeCallback::CHIPRoboticVacuumOperationalStateEventListAttributeCallback( + jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPRoboticVacuumOperationalStateEventListAttributeCallback::~CHIPRoboticVacuumOperationalStateEventListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPRoboticVacuumOperationalStateEventListAttributeCallback::CallbackFn( + void * context, const chip::app::DataModel::DecodableList & list) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject arrayListObj; + chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); + + auto iter_arrayListObj_0 = list.begin(); + while (iter_arrayListObj_0.Next()) + { + auto & entry_0 = iter_arrayListObj_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0ClassName.c_str(), + newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPRoboticVacuumOperationalStateAttributeListAttributeCallback::CHIPRoboticVacuumOperationalStateAttributeListAttributeCallback( + jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPRoboticVacuumOperationalStateAttributeListAttributeCallback::~CHIPRoboticVacuumOperationalStateAttributeListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPRoboticVacuumOperationalStateAttributeListAttributeCallback::CallbackFn( + void * context, const chip::app::DataModel::DecodableList & list) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject arrayListObj; + chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); + + auto iter_arrayListObj_0 = list.begin(); + while (iter_arrayListObj_0.Next()) + { + auto & entry_0 = iter_arrayListObj_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0ClassName.c_str(), + newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + CHIPHepaFilterMonitoringGeneratedCommandListAttributeCallback::CHIPHepaFilterMonitoringGeneratedCommandListAttributeCallback( jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java b/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java index f9aca55fe803e6..c47f7a1cdd6770 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java @@ -16780,6 +16780,310 @@ private native void subscribeClusterRevisionAttribute(long chipClusterPtr, , int minInterval, int maxInterval); } + public static class RoboticVacuumOperationalStateCluster extends BaseChipCluster { + public static final long CLUSTER_ID = 97L; + + public RoboticVacuumOperationalStateCluster(long devicePtr, int endpointId) { + super(devicePtr, endpointId); + } + + @Override + public native long initWithDevice(long devicePtr, int endpointId); + + public void pause(OperationalCommandResponseCallback callback + ) { + pause(chipClusterPtr, callback, null); + } + + public void pause(OperationalCommandResponseCallback callback + + , int timedInvokeTimeoutMs) { + pause(chipClusterPtr, callback, timedInvokeTimeoutMs); + } + + public void stop(OperationalCommandResponseCallback callback + ) { + stop(chipClusterPtr, callback, null); + } + + public void stop(OperationalCommandResponseCallback callback + + , int timedInvokeTimeoutMs) { + stop(chipClusterPtr, callback, timedInvokeTimeoutMs); + } + + public void start(OperationalCommandResponseCallback callback + ) { + start(chipClusterPtr, callback, null); + } + + public void start(OperationalCommandResponseCallback callback + + , int timedInvokeTimeoutMs) { + start(chipClusterPtr, callback, timedInvokeTimeoutMs); + } + + public void resume(OperationalCommandResponseCallback callback + ) { + resume(chipClusterPtr, callback, null); + } + + public void resume(OperationalCommandResponseCallback callback + + , int timedInvokeTimeoutMs) { + resume(chipClusterPtr, callback, timedInvokeTimeoutMs); + } + private native void pause(long chipClusterPtr, OperationalCommandResponseCallback Callback + + , @Nullable Integer timedInvokeTimeoutMs); + private native void stop(long chipClusterPtr, OperationalCommandResponseCallback Callback + + , @Nullable Integer timedInvokeTimeoutMs); + private native void start(long chipClusterPtr, OperationalCommandResponseCallback Callback + + , @Nullable Integer timedInvokeTimeoutMs); + private native void resume(long chipClusterPtr, OperationalCommandResponseCallback Callback + + , @Nullable Integer timedInvokeTimeoutMs); + public interface OperationalCommandResponseCallback { + void onSuccess(ChipStructs.RoboticVacuumOperationalStateClusterErrorStateStruct commandResponseState); + + void onError(Exception error); + } + + + public interface PhaseListAttributeCallback { + void onSuccess(@Nullable List valueList); + void onError(Exception ex); + default void onSubscriptionEstablished(long subscriptionId) {} + } + public interface CurrentPhaseAttributeCallback { + void onSuccess(@Nullable Integer value); + void onError(Exception ex); + default void onSubscriptionEstablished(long subscriptionId) {} + } + public interface CountdownTimeAttributeCallback { + void onSuccess(@Nullable Long value); + void onError(Exception ex); + default void onSubscriptionEstablished(long subscriptionId) {} + } + public interface OperationalStateListAttributeCallback { + void onSuccess( List valueList); + void onError(Exception ex); + default void onSubscriptionEstablished(long subscriptionId) {} + } + public interface GeneratedCommandListAttributeCallback { + void onSuccess( List valueList); + void onError(Exception ex); + default void onSubscriptionEstablished(long subscriptionId) {} + } + public interface AcceptedCommandListAttributeCallback { + void onSuccess( List valueList); + void onError(Exception ex); + default void onSubscriptionEstablished(long subscriptionId) {} + } + public interface EventListAttributeCallback { + void onSuccess( List valueList); + void onError(Exception ex); + default void onSubscriptionEstablished(long subscriptionId) {} + } + public interface AttributeListAttributeCallback { + void onSuccess( List valueList); + void onError(Exception ex); + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public void readPhaseListAttribute( + PhaseListAttributeCallback callback + ) { + readPhaseListAttribute(chipClusterPtr, callback); + } + public void subscribePhaseListAttribute( + PhaseListAttributeCallback callback + , + int minInterval, int maxInterval) { + subscribePhaseListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readCurrentPhaseAttribute( + CurrentPhaseAttributeCallback callback + ) { + readCurrentPhaseAttribute(chipClusterPtr, callback); + } + public void subscribeCurrentPhaseAttribute( + CurrentPhaseAttributeCallback callback + , + int minInterval, int maxInterval) { + subscribeCurrentPhaseAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readCountdownTimeAttribute( + CountdownTimeAttributeCallback callback + ) { + readCountdownTimeAttribute(chipClusterPtr, callback); + } + public void subscribeCountdownTimeAttribute( + CountdownTimeAttributeCallback callback + , + int minInterval, int maxInterval) { + subscribeCountdownTimeAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readOperationalStateListAttribute( + OperationalStateListAttributeCallback callback + ) { + readOperationalStateListAttribute(chipClusterPtr, callback); + } + public void subscribeOperationalStateListAttribute( + OperationalStateListAttributeCallback callback + , + int minInterval, int maxInterval) { + subscribeOperationalStateListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readGeneratedCommandListAttribute( + GeneratedCommandListAttributeCallback callback + ) { + readGeneratedCommandListAttribute(chipClusterPtr, callback); + } + public void subscribeGeneratedCommandListAttribute( + GeneratedCommandListAttributeCallback callback + , + int minInterval, int maxInterval) { + subscribeGeneratedCommandListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readAcceptedCommandListAttribute( + AcceptedCommandListAttributeCallback callback + ) { + readAcceptedCommandListAttribute(chipClusterPtr, callback); + } + public void subscribeAcceptedCommandListAttribute( + AcceptedCommandListAttributeCallback callback + , + int minInterval, int maxInterval) { + subscribeAcceptedCommandListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readEventListAttribute( + EventListAttributeCallback callback + ) { + readEventListAttribute(chipClusterPtr, callback); + } + public void subscribeEventListAttribute( + EventListAttributeCallback callback + , + int minInterval, int maxInterval) { + subscribeEventListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readAttributeListAttribute( + AttributeListAttributeCallback callback + ) { + readAttributeListAttribute(chipClusterPtr, callback); + } + public void subscribeAttributeListAttribute( + AttributeListAttributeCallback callback + , + int minInterval, int maxInterval) { + subscribeAttributeListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readFeatureMapAttribute( + LongAttributeCallback callback + ) { + readFeatureMapAttribute(chipClusterPtr, callback); + } + public void subscribeFeatureMapAttribute( + LongAttributeCallback callback +, + int minInterval, int maxInterval) { + subscribeFeatureMapAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readClusterRevisionAttribute( + IntegerAttributeCallback callback + ) { + readClusterRevisionAttribute(chipClusterPtr, callback); + } + public void subscribeClusterRevisionAttribute( + IntegerAttributeCallback callback +, + int minInterval, int maxInterval) { + subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + private native void readPhaseListAttribute(long chipClusterPtr, + PhaseListAttributeCallback callback + ); + private native void subscribePhaseListAttribute(long chipClusterPtr, + PhaseListAttributeCallback callback + , int minInterval, int maxInterval); + + private native void readCurrentPhaseAttribute(long chipClusterPtr, + CurrentPhaseAttributeCallback callback + ); + private native void subscribeCurrentPhaseAttribute(long chipClusterPtr, + CurrentPhaseAttributeCallback callback + , int minInterval, int maxInterval); + + private native void readCountdownTimeAttribute(long chipClusterPtr, + CountdownTimeAttributeCallback callback + ); + private native void subscribeCountdownTimeAttribute(long chipClusterPtr, + CountdownTimeAttributeCallback callback + , int minInterval, int maxInterval); + + private native void readOperationalStateListAttribute(long chipClusterPtr, + OperationalStateListAttributeCallback callback + ); + private native void subscribeOperationalStateListAttribute(long chipClusterPtr, + OperationalStateListAttributeCallback callback + , int minInterval, int maxInterval); + + private native void readGeneratedCommandListAttribute(long chipClusterPtr, + GeneratedCommandListAttributeCallback callback + ); + private native void subscribeGeneratedCommandListAttribute(long chipClusterPtr, + GeneratedCommandListAttributeCallback callback + , int minInterval, int maxInterval); + + private native void readAcceptedCommandListAttribute(long chipClusterPtr, + AcceptedCommandListAttributeCallback callback + ); + private native void subscribeAcceptedCommandListAttribute(long chipClusterPtr, + AcceptedCommandListAttributeCallback callback + , int minInterval, int maxInterval); + + private native void readEventListAttribute(long chipClusterPtr, + EventListAttributeCallback callback + ); + private native void subscribeEventListAttribute(long chipClusterPtr, + EventListAttributeCallback callback + , int minInterval, int maxInterval); + + private native void readAttributeListAttribute(long chipClusterPtr, + AttributeListAttributeCallback callback + ); + private native void subscribeAttributeListAttribute(long chipClusterPtr, + AttributeListAttributeCallback callback + , int minInterval, int maxInterval); + + private native void readFeatureMapAttribute(long chipClusterPtr, + LongAttributeCallback callback + ); + private native void subscribeFeatureMapAttribute(long chipClusterPtr, + LongAttributeCallback callback +, int minInterval, int maxInterval); + + private native void readClusterRevisionAttribute(long chipClusterPtr, + IntegerAttributeCallback callback + ); + private native void subscribeClusterRevisionAttribute(long chipClusterPtr, + IntegerAttributeCallback callback +, int minInterval, int maxInterval); + } + public static class HepaFilterMonitoringCluster extends BaseChipCluster { public static final long CLUSTER_ID = 113L; diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ChipEventStructs.java b/src/controller/java/zap-generated/chip/devicecontroller/ChipEventStructs.java index 5141fbb60aa041..acbf63d6f4c4e2 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ChipEventStructs.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ChipEventStructs.java @@ -1305,6 +1305,60 @@ public String toString() { } } +public static class RoboticVacuumOperationalStateClusterOperationalErrorEvent { +public ChipStructs.RoboticVacuumOperationalStateClusterErrorStateStruct errorState; + + public RoboticVacuumOperationalStateClusterOperationalErrorEvent( + ChipStructs.RoboticVacuumOperationalStateClusterErrorStateStruct errorState + ) { + this.errorState = errorState; + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("RoboticVacuumOperationalStateClusterOperationalErrorEvent {\n"); + output.append("\terrorState: "); + output.append(errorState); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} + +public static class RoboticVacuumOperationalStateClusterOperationCompletionEvent { +public Integer completionErrorCode; +public @Nullable Optional totalOperationalTime; +public @Nullable Optional pausedTime; + + public RoboticVacuumOperationalStateClusterOperationCompletionEvent( + Integer completionErrorCode + , @Nullable Optional totalOperationalTime + , @Nullable Optional pausedTime + ) { + this.completionErrorCode = completionErrorCode; + this.totalOperationalTime = totalOperationalTime; + this.pausedTime = pausedTime; + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("RoboticVacuumOperationalStateClusterOperationCompletionEvent {\n"); + output.append("\tcompletionErrorCode: "); + output.append(completionErrorCode); + output.append("\n"); + output.append("\ttotalOperationalTime: "); + output.append(totalOperationalTime); + output.append("\n"); + output.append("\tpausedTime: "); + output.append(pausedTime); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} + public static class DoorLockClusterDoorLockAlarmEvent { public Integer alarmCode; diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ChipIdLookup.java b/src/controller/java/zap-generated/chip/devicecontroller/ChipIdLookup.java index 83e7e60c2e79ea..1691df2f2bd8ee 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ChipIdLookup.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ChipIdLookup.java @@ -183,6 +183,9 @@ public static String clusterIdToName(long clusterId) { if (clusterId == 96L) { return "OperationalState"; } + if (clusterId == 97L) { + return "RoboticVacuumOperationalState"; + } if (clusterId == 113L) { return "HepaFilterMonitoring"; } @@ -2570,6 +2573,45 @@ public static String attributeIdToName(long clusterId, long attributeId) { } return ""; } + if (clusterId == 97L) { + if (attributeId == 0L) { + return "PhaseList"; + } + if (attributeId == 1L) { + return "CurrentPhase"; + } + if (attributeId == 2L) { + return "CountdownTime"; + } + if (attributeId == 3L) { + return "OperationalStateList"; + } + if (attributeId == 4L) { + return "OperationalState"; + } + if (attributeId == 5L) { + return "OperationalError"; + } + if (attributeId == 65528L) { + return "GeneratedCommandList"; + } + if (attributeId == 65529L) { + return "AcceptedCommandList"; + } + if (attributeId == 65530L) { + return "EventList"; + } + if (attributeId == 65531L) { + return "AttributeList"; + } + if (attributeId == 65532L) { + return "FeatureMap"; + } + if (attributeId == 65533L) { + return "ClusterRevision"; + } + return ""; + } if (clusterId == 113L) { if (attributeId == 0L) { return "Condition"; @@ -7366,6 +7408,15 @@ public static String eventIdToName(long clusterId, long eventId) { } return ""; } + if (clusterId == 97L) { + if (eventId == 0L) { + return "OperationalError"; + } + if (eventId == 1L) { + return "OperationCompletion"; + } + return ""; + } if (clusterId == 113L) { return ""; } diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ChipStructs.java b/src/controller/java/zap-generated/chip/devicecontroller/ChipStructs.java index b5294f94e6054b..e7aff346222b4a 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ChipStructs.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ChipStructs.java @@ -1940,12 +1940,12 @@ public String toString() { public static class OperationalStateClusterErrorStateStruct { public Integer errorStateID; -public @Nullable String errorStateLabel; +public Optional errorStateLabel; public Optional errorStateDetails; public OperationalStateClusterErrorStateStruct( Integer errorStateID - , @Nullable String errorStateLabel + , Optional errorStateLabel , Optional errorStateDetails ) { this.errorStateID = errorStateID; @@ -1973,11 +1973,11 @@ public String toString() { public static class OperationalStateClusterOperationalStateStruct { public Integer operationalStateID; -public String operationalStateLabel; +public Optional operationalStateLabel; public OperationalStateClusterOperationalStateStruct( Integer operationalStateID - , String operationalStateLabel + , Optional operationalStateLabel ) { this.operationalStateID = operationalStateID; this.operationalStateLabel = operationalStateLabel; @@ -1998,6 +1998,66 @@ public String toString() { } } +public static class RoboticVacuumOperationalStateClusterErrorStateStruct { +public Integer errorStateID; +public Optional errorStateLabel; +public Optional errorStateDetails; + + public RoboticVacuumOperationalStateClusterErrorStateStruct( + Integer errorStateID + , Optional errorStateLabel + , Optional errorStateDetails + ) { + this.errorStateID = errorStateID; + this.errorStateLabel = errorStateLabel; + this.errorStateDetails = errorStateDetails; + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("RoboticVacuumOperationalStateClusterErrorStateStruct {\n"); + output.append("\terrorStateID: "); + output.append(errorStateID); + output.append("\n"); + output.append("\terrorStateLabel: "); + output.append(errorStateLabel); + output.append("\n"); + output.append("\terrorStateDetails: "); + output.append(errorStateDetails); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} + +public static class RoboticVacuumOperationalStateClusterOperationalStateStruct { +public Integer operationalStateID; +public Optional operationalStateLabel; + + public RoboticVacuumOperationalStateClusterOperationalStateStruct( + Integer operationalStateID + , Optional operationalStateLabel + ) { + this.operationalStateID = operationalStateID; + this.operationalStateLabel = operationalStateLabel; + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("RoboticVacuumOperationalStateClusterOperationalStateStruct {\n"); + output.append("\toperationalStateID: "); + output.append(operationalStateID); + output.append("\n"); + output.append("\toperationalStateLabel: "); + output.append(operationalStateLabel); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} + public static class DoorLockClusterCredentialStruct { public Integer credentialType; public Integer credentialIndex; diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java b/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java index 92f7fa0d6f7645..71d7a62f7ecf6f 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java @@ -7319,6 +7319,180 @@ 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 DelegatedRoboticVacuumOperationalStateClusterOperationalCommandResponseCallback implements ChipClusters.RoboticVacuumOperationalStateCluster.OperationalCommandResponseCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(ChipStructs.RoboticVacuumOperationalStateClusterErrorStateStruct CommandResponseState) { + Map responseValues = new LinkedHashMap<>(); + // CommandResponseState: Struct ErrorStateStruct + // 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 DelegatedRoboticVacuumOperationalStateClusterPhaseListAttributeCallback implements ChipClusters.RoboticVacuumOperationalStateCluster.PhaseListAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + +@Override + public void onSuccess(@Nullable 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 DelegatedRoboticVacuumOperationalStateClusterCurrentPhaseAttributeCallback implements ChipClusters.RoboticVacuumOperationalStateCluster.CurrentPhaseAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + +@Override + public void onSuccess(@Nullable Integer value) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Integer"); + responseValues.put(commandResponseInfo, value); + callback.onSuccess(responseValues); + } + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + public static class DelegatedRoboticVacuumOperationalStateClusterCountdownTimeAttributeCallback implements ChipClusters.RoboticVacuumOperationalStateCluster.CountdownTimeAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + +@Override + public void onSuccess(@Nullable Long value) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Long"); + responseValues.put(commandResponseInfo, value); + callback.onSuccess(responseValues); + } + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + public static class DelegatedRoboticVacuumOperationalStateClusterOperationalStateListAttributeCallback implements ChipClusters.RoboticVacuumOperationalStateCluster.OperationalStateListAttributeCallback, 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 DelegatedRoboticVacuumOperationalStateClusterGeneratedCommandListAttributeCallback implements ChipClusters.RoboticVacuumOperationalStateCluster.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 DelegatedRoboticVacuumOperationalStateClusterAcceptedCommandListAttributeCallback implements ChipClusters.RoboticVacuumOperationalStateCluster.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 DelegatedRoboticVacuumOperationalStateClusterEventListAttributeCallback implements ChipClusters.RoboticVacuumOperationalStateCluster.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 DelegatedRoboticVacuumOperationalStateClusterAttributeListAttributeCallback implements ChipClusters.RoboticVacuumOperationalStateCluster.AttributeListAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + @Override public void onSuccess( List valueList) { Map responseValues = new LinkedHashMap<>(); @@ -19852,6 +20026,9 @@ public Map initializeClusterMap() { ClusterInfo operationalStateClusterInfo = new ClusterInfo( (ptr, endpointId) -> new ChipClusters.OperationalStateCluster(ptr, endpointId), new HashMap<>()); clusterMap.put("operationalState", operationalStateClusterInfo); + ClusterInfo roboticVacuumOperationalStateClusterInfo = new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.RoboticVacuumOperationalStateCluster(ptr, endpointId), new HashMap<>()); + clusterMap.put("roboticVacuumOperationalState", roboticVacuumOperationalStateClusterInfo); ClusterInfo hepaFilterMonitoringClusterInfo = new ClusterInfo( (ptr, endpointId) -> new ChipClusters.HepaFilterMonitoringCluster(ptr, endpointId), new HashMap<>()); clusterMap.put("hepaFilterMonitoring", hepaFilterMonitoringClusterInfo); @@ -20143,6 +20320,7 @@ public void combineCommand(Map destination, Map> getCommandMap() { commandMap.put("smokeCoAlarm", smokeCoAlarmClusterInteractionInfoMap); Map operationalStateClusterInteractionInfoMap = new LinkedHashMap<>(); commandMap.put("operationalState", operationalStateClusterInteractionInfoMap); + Map roboticVacuumOperationalStateClusterInteractionInfoMap = new LinkedHashMap<>(); + Map roboticVacuumOperationalStatepauseCommandParams = new LinkedHashMap(); + InteractionInfo roboticVacuumOperationalStatepauseInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.RoboticVacuumOperationalStateCluster) cluster) + .pause((ChipClusters.RoboticVacuumOperationalStateCluster.OperationalCommandResponseCallback) callback + + ); + }, + () -> new DelegatedRoboticVacuumOperationalStateClusterOperationalCommandResponseCallback(), + roboticVacuumOperationalStatepauseCommandParams + ); + roboticVacuumOperationalStateClusterInteractionInfoMap.put("pause", roboticVacuumOperationalStatepauseInteractionInfo); + Map roboticVacuumOperationalStatestopCommandParams = new LinkedHashMap(); + InteractionInfo roboticVacuumOperationalStatestopInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.RoboticVacuumOperationalStateCluster) cluster) + .stop((ChipClusters.RoboticVacuumOperationalStateCluster.OperationalCommandResponseCallback) callback + + ); + }, + () -> new DelegatedRoboticVacuumOperationalStateClusterOperationalCommandResponseCallback(), + roboticVacuumOperationalStatestopCommandParams + ); + roboticVacuumOperationalStateClusterInteractionInfoMap.put("stop", roboticVacuumOperationalStatestopInteractionInfo); + Map roboticVacuumOperationalStatestartCommandParams = new LinkedHashMap(); + InteractionInfo roboticVacuumOperationalStatestartInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.RoboticVacuumOperationalStateCluster) cluster) + .start((ChipClusters.RoboticVacuumOperationalStateCluster.OperationalCommandResponseCallback) callback + + ); + }, + () -> new DelegatedRoboticVacuumOperationalStateClusterOperationalCommandResponseCallback(), + roboticVacuumOperationalStatestartCommandParams + ); + roboticVacuumOperationalStateClusterInteractionInfoMap.put("start", roboticVacuumOperationalStatestartInteractionInfo); + Map roboticVacuumOperationalStateresumeCommandParams = new LinkedHashMap(); + InteractionInfo roboticVacuumOperationalStateresumeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.RoboticVacuumOperationalStateCluster) cluster) + .resume((ChipClusters.RoboticVacuumOperationalStateCluster.OperationalCommandResponseCallback) callback + + ); + }, + () -> new DelegatedRoboticVacuumOperationalStateClusterOperationalCommandResponseCallback(), + roboticVacuumOperationalStateresumeCommandParams + ); + roboticVacuumOperationalStateClusterInteractionInfoMap.put("resume", roboticVacuumOperationalStateresumeInteractionInfo); + commandMap.put("roboticVacuumOperationalState", roboticVacuumOperationalStateClusterInteractionInfoMap); Map hepaFilterMonitoringClusterInteractionInfoMap = new LinkedHashMap<>(); commandMap.put("hepaFilterMonitoring", hepaFilterMonitoringClusterInteractionInfoMap); Map activatedCarbonFilterMonitoringClusterInteractionInfoMap = new LinkedHashMap<>(); diff --git a/src/controller/python/chip/clusters/CHIPClusters.py b/src/controller/python/chip/clusters/CHIPClusters.py index d65219839e0887..3a561178d48930 100644 --- a/src/controller/python/chip/clusters/CHIPClusters.py +++ b/src/controller/python/chip/clusters/CHIPClusters.py @@ -5305,6 +5305,110 @@ class ChipClusters: }, }, } + _ROBOTIC_VACUUM_OPERATIONAL_STATE_CLUSTER_INFO = { + "clusterName": "RoboticVacuumOperationalState", + "clusterId": 0x00000061, + "commands": { + 0x00000000: { + "commandId": 0x00000000, + "commandName": "Pause", + "args": { + }, + }, + 0x00000001: { + "commandId": 0x00000001, + "commandName": "Stop", + "args": { + }, + }, + 0x00000002: { + "commandId": 0x00000002, + "commandName": "Start", + "args": { + }, + }, + 0x00000003: { + "commandId": 0x00000003, + "commandName": "Resume", + "args": { + }, + }, + }, + "attributes": { + 0x00000000: { + "attributeName": "PhaseList", + "attributeId": 0x00000000, + "type": "str", + "reportable": True, + }, + 0x00000001: { + "attributeName": "CurrentPhase", + "attributeId": 0x00000001, + "type": "int", + "reportable": True, + }, + 0x00000002: { + "attributeName": "CountdownTime", + "attributeId": 0x00000002, + "type": "int", + "reportable": True, + }, + 0x00000003: { + "attributeName": "OperationalStateList", + "attributeId": 0x00000003, + "type": "", + "reportable": True, + }, + 0x00000004: { + "attributeName": "OperationalState", + "attributeId": 0x00000004, + "type": "", + "reportable": True, + }, + 0x00000005: { + "attributeName": "OperationalError", + "attributeId": 0x00000005, + "type": "", + "reportable": True, + }, + 0x0000FFF8: { + "attributeName": "GeneratedCommandList", + "attributeId": 0x0000FFF8, + "type": "int", + "reportable": True, + }, + 0x0000FFF9: { + "attributeName": "AcceptedCommandList", + "attributeId": 0x0000FFF9, + "type": "int", + "reportable": True, + }, + 0x0000FFFA: { + "attributeName": "EventList", + "attributeId": 0x0000FFFA, + "type": "int", + "reportable": True, + }, + 0x0000FFFB: { + "attributeName": "AttributeList", + "attributeId": 0x0000FFFB, + "type": "int", + "reportable": True, + }, + 0x0000FFFC: { + "attributeName": "FeatureMap", + "attributeId": 0x0000FFFC, + "type": "int", + "reportable": True, + }, + 0x0000FFFD: { + "attributeName": "ClusterRevision", + "attributeId": 0x0000FFFD, + "type": "int", + "reportable": True, + }, + }, + } _HEPA_FILTER_MONITORING_CLUSTER_INFO = { "clusterName": "HepaFilterMonitoring", "clusterId": 0x00000071, @@ -15591,6 +15695,7 @@ class ChipClusters: 0x0000005B: _AIR_QUALITY_CLUSTER_INFO, 0x0000005C: _SMOKE_CO_ALARM_CLUSTER_INFO, 0x00000060: _OPERATIONAL_STATE_CLUSTER_INFO, + 0x00000061: _ROBOTIC_VACUUM_OPERATIONAL_STATE_CLUSTER_INFO, 0x00000071: _HEPA_FILTER_MONITORING_CLUSTER_INFO, 0x00000072: _ACTIVATED_CARBON_FILTER_MONITORING_CLUSTER_INFO, 0x00000073: _CERAMIC_FILTER_MONITORING_CLUSTER_INFO, @@ -15725,6 +15830,7 @@ class ChipClusters: "AirQuality": _AIR_QUALITY_CLUSTER_INFO, "SmokeCoAlarm": _SMOKE_CO_ALARM_CLUSTER_INFO, "OperationalState": _OPERATIONAL_STATE_CLUSTER_INFO, + "RoboticVacuumOperationalState": _ROBOTIC_VACUUM_OPERATIONAL_STATE_CLUSTER_INFO, "HepaFilterMonitoring": _HEPA_FILTER_MONITORING_CLUSTER_INFO, "ActivatedCarbonFilterMonitoring": _ACTIVATED_CARBON_FILTER_MONITORING_CLUSTER_INFO, "CeramicFilterMonitoring": _CERAMIC_FILTER_MONITORING_CLUSTER_INFO, diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index 06be17d6c5a97d..2f9c0c0bc7ac56 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -18235,13 +18235,13 @@ class ErrorStateStruct(ClusterObject): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields=[ - ClusterObjectFieldDescriptor(Label="errorStateID", Tag=0, Type=OperationalState.Enums.ErrorStateEnum), - ClusterObjectFieldDescriptor(Label="errorStateLabel", Tag=1, Type=typing.Union[Nullable, str]), + ClusterObjectFieldDescriptor(Label="errorStateID", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="errorStateLabel", Tag=1, Type=typing.Optional[str]), ClusterObjectFieldDescriptor(Label="errorStateDetails", Tag=2, Type=typing.Optional[str]), ]) - errorStateID: 'OperationalState.Enums.ErrorStateEnum' = 0 - errorStateLabel: 'typing.Union[Nullable, str]' = NullValue + errorStateID: 'uint' = 0 + errorStateLabel: 'typing.Optional[str]' = None errorStateDetails: 'typing.Optional[str]' = None @dataclass @@ -18250,12 +18250,12 @@ class OperationalStateStruct(ClusterObject): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields=[ - ClusterObjectFieldDescriptor(Label="operationalStateID", Tag=0, Type=OperationalState.Enums.OperationalStateEnum), - ClusterObjectFieldDescriptor(Label="operationalStateLabel", Tag=1, Type=str), + ClusterObjectFieldDescriptor(Label="operationalStateID", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="operationalStateLabel", Tag=1, Type=typing.Optional[str]), ]) - operationalStateID: 'OperationalState.Enums.OperationalStateEnum' = 0 - operationalStateLabel: 'str' = "" + operationalStateID: 'uint' = 0 + operationalStateLabel: 'typing.Optional[str]' = None class Commands: @dataclass @@ -18553,12 +18553,408 @@ def event_id(cls) -> int: def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields=[ - ClusterObjectFieldDescriptor(Label="completionErrorCode", Tag=0, Type=OperationalState.Enums.ErrorStateEnum), + ClusterObjectFieldDescriptor(Label="completionErrorCode", Tag=0, Type=uint), ClusterObjectFieldDescriptor(Label="totalOperationalTime", Tag=1, Type=typing.Union[None, Nullable, uint]), ClusterObjectFieldDescriptor(Label="pausedTime", Tag=2, Type=typing.Union[None, Nullable, uint]), ]) - completionErrorCode: 'OperationalState.Enums.ErrorStateEnum' = 0 + completionErrorCode: 'uint' = 0 + totalOperationalTime: 'typing.Union[None, Nullable, uint]' = None + pausedTime: 'typing.Union[None, Nullable, uint]' = None + + +@dataclass +class RoboticVacuumOperationalState(Cluster): + id: typing.ClassVar[int] = 0x0061 + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="phaseList", Tag=0x00000000, Type=typing.Union[Nullable, typing.List[str]]), + ClusterObjectFieldDescriptor(Label="currentPhase", Tag=0x00000001, Type=typing.Union[Nullable, uint]), + ClusterObjectFieldDescriptor(Label="countdownTime", Tag=0x00000002, Type=typing.Union[None, Nullable, uint]), + ClusterObjectFieldDescriptor(Label="operationalStateList", Tag=0x00000003, Type=typing.List[RoboticVacuumOperationalState.Structs.OperationalStateStruct]), + ClusterObjectFieldDescriptor(Label="operationalState", Tag=0x00000004, Type=RoboticVacuumOperationalState.Structs.OperationalStateStruct), + ClusterObjectFieldDescriptor(Label="operationalError", Tag=0x00000005, Type=RoboticVacuumOperationalState.Structs.ErrorStateStruct), + ClusterObjectFieldDescriptor(Label="generatedCommandList", Tag=0x0000FFF8, Type=typing.List[uint]), + ClusterObjectFieldDescriptor(Label="acceptedCommandList", Tag=0x0000FFF9, Type=typing.List[uint]), + ClusterObjectFieldDescriptor(Label="eventList", Tag=0x0000FFFA, Type=typing.List[uint]), + ClusterObjectFieldDescriptor(Label="attributeList", Tag=0x0000FFFB, Type=typing.List[uint]), + ClusterObjectFieldDescriptor(Label="featureMap", Tag=0x0000FFFC, Type=uint), + ClusterObjectFieldDescriptor(Label="clusterRevision", Tag=0x0000FFFD, Type=uint), + ]) + + phaseList: 'typing.Union[Nullable, typing.List[str]]' = None + currentPhase: 'typing.Union[Nullable, uint]' = None + countdownTime: 'typing.Union[None, Nullable, uint]' = None + operationalStateList: 'typing.List[RoboticVacuumOperationalState.Structs.OperationalStateStruct]' = None + operationalState: 'RoboticVacuumOperationalState.Structs.OperationalStateStruct' = None + operationalError: 'RoboticVacuumOperationalState.Structs.ErrorStateStruct' = None + generatedCommandList: 'typing.List[uint]' = None + acceptedCommandList: 'typing.List[uint]' = None + eventList: 'typing.List[uint]' = None + attributeList: 'typing.List[uint]' = None + featureMap: 'uint' = None + clusterRevision: 'uint' = None + + class Enums: + class ErrorStateEnum(MatterIntEnum): + kFailedToFindChargingDock = 0x40 + kStuck = 0x41 + kDustBinMissing = 0x42 + kDustBinFull = 0x43 + kWaterTankEmpty = 0x44 + kWaterTankMissing = 0x45 + kWaterTankLidOpen = 0x46 + kMopCleaningPadMissing = 0x47 + # All received enum values that are not listed above will be mapped + # to kUnknownEnumValue. This is a helper enum value that should only + # be used by code to process how it handles receiving and unknown + # enum value. This specific should never be transmitted. + kUnknownEnumValue = 0, + + class OperationalStateEnum(MatterIntEnum): + kSeekingCharger = 0x40 + kCharging = 0x41 + kDocked = 0x42 + # All received enum values that are not listed above will be mapped + # to kUnknownEnumValue. This is a helper enum value that should only + # be used by code to process how it handles receiving and unknown + # enum value. This specific should never be transmitted. + kUnknownEnumValue = 0, + + class Structs: + @dataclass + class ErrorStateStruct(ClusterObject): + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="errorStateID", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="errorStateLabel", Tag=1, Type=typing.Optional[str]), + ClusterObjectFieldDescriptor(Label="errorStateDetails", Tag=2, Type=typing.Optional[str]), + ]) + + errorStateID: 'uint' = 0 + errorStateLabel: 'typing.Optional[str]' = None + errorStateDetails: 'typing.Optional[str]' = None + + @dataclass + class OperationalStateStruct(ClusterObject): + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="operationalStateID", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="operationalStateLabel", Tag=1, Type=typing.Optional[str]), + ]) + + operationalStateID: 'uint' = 0 + operationalStateLabel: 'typing.Optional[str]' = None + + class Commands: + @dataclass + class Pause(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x0061 + command_id: typing.ClassVar[int] = 0x00000000 + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = 'OperationalCommandResponse' + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ]) + + @dataclass + class Stop(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x0061 + command_id: typing.ClassVar[int] = 0x00000001 + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = 'OperationalCommandResponse' + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ]) + + @dataclass + class Start(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x0061 + command_id: typing.ClassVar[int] = 0x00000002 + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = 'OperationalCommandResponse' + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ]) + + @dataclass + class Resume(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x0061 + command_id: typing.ClassVar[int] = 0x00000003 + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = 'OperationalCommandResponse' + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ]) + + @dataclass + class OperationalCommandResponse(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x0061 + command_id: typing.ClassVar[int] = 0x00000004 + is_client: typing.ClassVar[bool] = False + response_type: typing.ClassVar[str] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="commandResponseState", Tag=0, Type=RoboticVacuumOperationalState.Structs.ErrorStateStruct), + ]) + + commandResponseState: 'RoboticVacuumOperationalState.Structs.ErrorStateStruct' = field(default_factory=lambda: RoboticVacuumOperationalState.Structs.ErrorStateStruct()) + + class Attributes: + @dataclass + class PhaseList(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0061 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000000 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Union[Nullable, typing.List[str]]) + + value: 'typing.Union[Nullable, typing.List[str]]' = NullValue + + @dataclass + class CurrentPhase(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0061 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000001 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Union[Nullable, uint]) + + value: 'typing.Union[Nullable, uint]' = NullValue + + @dataclass + class CountdownTime(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0061 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000002 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Union[None, Nullable, uint]) + + value: 'typing.Union[None, Nullable, uint]' = None + + @dataclass + class OperationalStateList(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0061 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000003 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.List[RoboticVacuumOperationalState.Structs.OperationalStateStruct]) + + value: 'typing.List[RoboticVacuumOperationalState.Structs.OperationalStateStruct]' = field(default_factory=lambda: []) + + @dataclass + class OperationalState(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0061 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000004 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=RoboticVacuumOperationalState.Structs.OperationalStateStruct) + + value: 'RoboticVacuumOperationalState.Structs.OperationalStateStruct' = field(default_factory=lambda: RoboticVacuumOperationalState.Structs.OperationalStateStruct()) + + @dataclass + class OperationalError(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0061 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000005 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=RoboticVacuumOperationalState.Structs.ErrorStateStruct) + + value: 'RoboticVacuumOperationalState.Structs.ErrorStateStruct' = field(default_factory=lambda: RoboticVacuumOperationalState.Structs.ErrorStateStruct()) + + @dataclass + class GeneratedCommandList(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0061 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFF8 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.List[uint]) + + value: 'typing.List[uint]' = field(default_factory=lambda: []) + + @dataclass + class AcceptedCommandList(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0061 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFF9 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.List[uint]) + + value: 'typing.List[uint]' = field(default_factory=lambda: []) + + @dataclass + class EventList(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0061 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFFA + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.List[uint]) + + value: 'typing.List[uint]' = field(default_factory=lambda: []) + + @dataclass + class AttributeList(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0061 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFFB + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.List[uint]) + + value: 'typing.List[uint]' = field(default_factory=lambda: []) + + @dataclass + class FeatureMap(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0061 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFFC + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=uint) + + value: 'uint' = 0 + + @dataclass + class ClusterRevision(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0061 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFFD + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=uint) + + value: 'uint' = 0 + + class Events: + @dataclass + class OperationalError(ClusterEvent): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0061 + + @ChipUtility.classproperty + def event_id(cls) -> int: + return 0x00000000 + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="errorState", Tag=0, Type=RoboticVacuumOperationalState.Structs.ErrorStateStruct), + ]) + + errorState: 'RoboticVacuumOperationalState.Structs.ErrorStateStruct' = field(default_factory=lambda: RoboticVacuumOperationalState.Structs.ErrorStateStruct()) + + @dataclass + class OperationCompletion(ClusterEvent): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0061 + + @ChipUtility.classproperty + def event_id(cls) -> int: + return 0x00000001 + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="completionErrorCode", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="totalOperationalTime", Tag=1, Type=typing.Union[None, Nullable, uint]), + ClusterObjectFieldDescriptor(Label="pausedTime", Tag=2, Type=typing.Union[None, Nullable, uint]), + ]) + + completionErrorCode: 'uint' = 0 totalOperationalTime: 'typing.Union[None, Nullable, uint]' = None pausedTime: 'typing.Union[None, Nullable, uint]' = None diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm index 0920c65ca69499..ca5f6de6d4d508 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm @@ -2018,6 +2018,51 @@ static BOOL AttributeIsSpecifiedInOperationalStateCluster(AttributeId aAttribute } } } +static BOOL AttributeIsSpecifiedInRoboticVacuumOperationalStateCluster(AttributeId aAttributeId) +{ + using namespace Clusters::RoboticVacuumOperationalState; + switch (aAttributeId) { + case Attributes::PhaseList::Id: { + return YES; + } + case Attributes::CurrentPhase::Id: { + return YES; + } + case Attributes::CountdownTime::Id: { + return YES; + } + case Attributes::OperationalStateList::Id: { + return YES; + } + case Attributes::OperationalState::Id: { + return YES; + } + case Attributes::OperationalError::Id: { + return YES; + } + case Attributes::GeneratedCommandList::Id: { + return YES; + } + case Attributes::AcceptedCommandList::Id: { + return YES; + } + case Attributes::EventList::Id: { + return YES; + } + case Attributes::AttributeList::Id: { + return YES; + } + case Attributes::FeatureMap::Id: { + return YES; + } + case Attributes::ClusterRevision::Id: { + return YES; + } + default: { + return NO; + } + } +} static BOOL AttributeIsSpecifiedInHEPAFilterMonitoringCluster(AttributeId aAttributeId) { using namespace Clusters::HepaFilterMonitoring; @@ -5100,6 +5145,9 @@ BOOL MTRAttributeIsSpecified(ClusterId aClusterId, AttributeId aAttributeId) case Clusters::OperationalState::Id: { return AttributeIsSpecifiedInOperationalStateCluster(aAttributeId); } + case Clusters::RoboticVacuumOperationalState::Id: { + return AttributeIsSpecifiedInRoboticVacuumOperationalStateCluster(aAttributeId); + } case Clusters::HepaFilterMonitoring::Id: { return AttributeIsSpecifiedInHEPAFilterMonitoringCluster(aAttributeId); } diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm index 4d7cbd75eab3d6..a5635f62e1e325 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm @@ -10146,12 +10146,16 @@ static id _Nullable DecodeAttributeValueForOperationalStateCluster( auto & entry_0 = iter_0.GetValue(); MTROperationalStateClusterOperationalStateStruct * newElement_0; newElement_0 = [MTROperationalStateClusterOperationalStateStruct new]; - newElement_0.operationalStateID = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.operationalStateID)]; - newElement_0.operationalStateLabel = AsString(entry_0.operationalStateLabel); - if (newElement_0.operationalStateLabel == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; + newElement_0.operationalStateID = [NSNumber numberWithUnsignedChar:entry_0.operationalStateID]; + if (entry_0.operationalStateLabel.HasValue()) { + newElement_0.operationalStateLabel = AsString(entry_0.operationalStateLabel.Value()); + if (newElement_0.operationalStateLabel == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + } else { + newElement_0.operationalStateLabel = nil; } [array_0 addObject:newElement_0]; } @@ -10173,12 +10177,16 @@ static id _Nullable DecodeAttributeValueForOperationalStateCluster( } MTROperationalStateClusterOperationalStateStruct * _Nonnull value; value = [MTROperationalStateClusterOperationalStateStruct new]; - value.operationalStateID = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.operationalStateID)]; - value.operationalStateLabel = AsString(cppValue.operationalStateLabel); - if (value.operationalStateLabel == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; + value.operationalStateID = [NSNumber numberWithUnsignedChar:cppValue.operationalStateID]; + if (cppValue.operationalStateLabel.HasValue()) { + value.operationalStateLabel = AsString(cppValue.operationalStateLabel.Value()); + if (value.operationalStateLabel == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + } else { + value.operationalStateLabel = nil; } return value; } @@ -10191,16 +10199,311 @@ static id _Nullable DecodeAttributeValueForOperationalStateCluster( } MTROperationalStateClusterErrorStateStruct * _Nonnull value; value = [MTROperationalStateClusterErrorStateStruct new]; - value.errorStateID = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.errorStateID)]; - if (cppValue.errorStateLabel.IsNull()) { + value.errorStateID = [NSNumber numberWithUnsignedChar:cppValue.errorStateID]; + if (cppValue.errorStateLabel.HasValue()) { + value.errorStateLabel = AsString(cppValue.errorStateLabel.Value()); + if (value.errorStateLabel == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + } else { value.errorStateLabel = nil; + } + if (cppValue.errorStateDetails.HasValue()) { + value.errorStateDetails = AsString(cppValue.errorStateDetails.Value()); + if (value.errorStateDetails == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + } else { + value.errorStateDetails = nil; + } + return value; + } + case Attributes::GeneratedCommandList::Id: { + using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; + } + return value; + } + case Attributes::AcceptedCommandList::Id: { + using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; + } + return value; + } + case Attributes::EventList::Id: { + using TypeInfo = Attributes::EventList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; + } + return value; + } + case Attributes::AttributeList::Id: { + using TypeInfo = Attributes::AttributeList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; + } + return value; + } + case Attributes::FeatureMap::Id: { + using TypeInfo = Attributes::FeatureMap::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedInt:cppValue]; + return value; + } + case Attributes::ClusterRevision::Id: { + using TypeInfo = Attributes::ClusterRevision::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; + return value; + } + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForRoboticVacuumOperationalStateCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::RoboticVacuumOperationalState; + switch (aAttributeId) { + case Attributes::PhaseList::Id: { + using TypeInfo = Attributes::PhaseList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSArray * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + { // Scope for our temporary variables + auto * array_1 = [NSMutableArray new]; + auto iter_1 = cppValue.Value().begin(); + while (iter_1.Next()) { + auto & entry_1 = iter_1.GetValue(); + NSString * newElement_1; + newElement_1 = AsString(entry_1); + if (newElement_1 == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + [array_1 addObject:newElement_1]; + } + CHIP_ERROR err = iter_1.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_1; + } + } + return value; + } + case Attributes::CurrentPhase::Id: { + using TypeInfo = Attributes::CurrentPhase::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; + } + return value; + } + case Attributes::CountdownTime::Id: { + using TypeInfo = Attributes::CountdownTime::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; } else { + value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; + } + return value; + } + case Attributes::OperationalStateList::Id: { + using TypeInfo = Attributes::OperationalStateList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + MTRRoboticVacuumOperationalStateClusterOperationalStateStruct * newElement_0; + newElement_0 = [MTRRoboticVacuumOperationalStateClusterOperationalStateStruct new]; + newElement_0.operationalStateID = [NSNumber numberWithUnsignedChar:entry_0.operationalStateID]; + if (entry_0.operationalStateLabel.HasValue()) { + newElement_0.operationalStateLabel = AsString(entry_0.operationalStateLabel.Value()); + if (newElement_0.operationalStateLabel == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + } else { + newElement_0.operationalStateLabel = nil; + } + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; + } + return value; + } + case Attributes::OperationalState::Id: { + using TypeInfo = Attributes::OperationalState::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + MTRRoboticVacuumOperationalStateClusterOperationalStateStruct * _Nonnull value; + value = [MTRRoboticVacuumOperationalStateClusterOperationalStateStruct new]; + value.operationalStateID = [NSNumber numberWithUnsignedChar:cppValue.operationalStateID]; + if (cppValue.operationalStateLabel.HasValue()) { + value.operationalStateLabel = AsString(cppValue.operationalStateLabel.Value()); + if (value.operationalStateLabel == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + } else { + value.operationalStateLabel = nil; + } + return value; + } + case Attributes::OperationalError::Id: { + using TypeInfo = Attributes::OperationalError::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + MTRRoboticVacuumOperationalStateClusterErrorStateStruct * _Nonnull value; + value = [MTRRoboticVacuumOperationalStateClusterErrorStateStruct new]; + value.errorStateID = [NSNumber numberWithUnsignedChar:cppValue.errorStateID]; + if (cppValue.errorStateLabel.HasValue()) { value.errorStateLabel = AsString(cppValue.errorStateLabel.Value()); if (value.errorStateLabel == nil) { CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; *aError = err; return nil; } + } else { + value.errorStateLabel = nil; } if (cppValue.errorStateDetails.HasValue()) { value.errorStateDetails = AsString(cppValue.errorStateDetails.Value()); @@ -24288,6 +24591,9 @@ id _Nullable MTRDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::T case Clusters::OperationalState::Id: { return DecodeAttributeValueForOperationalStateCluster(aPath.mAttributeId, aReader, aError); } + case Clusters::RoboticVacuumOperationalState::Id: { + return DecodeAttributeValueForRoboticVacuumOperationalStateCluster(aPath.mAttributeId, aReader, aError); + } case Clusters::HepaFilterMonitoring::Id: { return DecodeAttributeValueForHEPAFilterMonitoringCluster(aPath.mAttributeId, aReader, aError); } diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h index 599499f005e8a3..6a8ead093b0344 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h @@ -8736,6 +8736,220 @@ MTR_NEWLY_AVAILABLE @end +/** + * Cluster Robotic Vacuum Operational State + * + * This cluster supports remotely monitoring and, where supported, changing the operational state of a Robotic Vacuum. + */ +MTR_NEWLY_AVAILABLE +@interface MTRBaseClusterRoboticVacuumOperationalState : MTRCluster + +- (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device + endpointID:(NSNumber *)endpointID + queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER MTR_NEWLY_AVAILABLE; + +/** + * Command Pause + * + * Upon receipt, the device SHALL pause its operation if it is possible based on the current function of the server. + */ +- (void)pauseWithParams:(MTRRoboticVacuumOperationalStateClusterPauseParams * _Nullable)params + completion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; +- (void)pauseWithCompletion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; +/** + * Command Stop + * + * Upon receipt, the device SHALL stop its operation if it is at a position where it is safe to do so and/or permitted. + */ +- (void)stopWithParams:(MTRRoboticVacuumOperationalStateClusterStopParams * _Nullable)params + completion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; +- (void)stopWithCompletion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; +/** + * Command Start + * + * Upon receipt, the device SHALL start its operation if it is safe to do so and the device is in an operational state from which it + * can be started. + */ +- (void)startWithParams:(MTRRoboticVacuumOperationalStateClusterStartParams * _Nullable)params + completion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; +- (void)startWithCompletion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; +/** + * Command Resume + * + * Upon receipt, the device SHALL resume its operation from the point it was at when it received the Pause command, or from the + * point when it was paused by means outside of this cluster (for example by manual button press). + */ +- (void)resumeWithParams:(MTRRoboticVacuumOperationalStateClusterResumeParams * _Nullable)params + completion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; +- (void)resumeWithCompletion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; + +- (void)readAttributePhaseListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion + MTR_NEWLY_AVAILABLE; +- (void)subscribeAttributePhaseListWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler + MTR_NEWLY_AVAILABLE; ++ (void)readAttributePhaseListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion + MTR_NEWLY_AVAILABLE; + +- (void)readAttributeCurrentPhaseWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion + MTR_NEWLY_AVAILABLE; +- (void)subscribeAttributeCurrentPhaseWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler + MTR_NEWLY_AVAILABLE; ++ (void)readAttributeCurrentPhaseWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion + MTR_NEWLY_AVAILABLE; + +- (void)readAttributeCountdownTimeWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion + MTR_NEWLY_AVAILABLE; +- (void)subscribeAttributeCountdownTimeWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler + MTR_NEWLY_AVAILABLE; ++ (void)readAttributeCountdownTimeWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion + MTR_NEWLY_AVAILABLE; + +- (void)readAttributeOperationalStateListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion + MTR_NEWLY_AVAILABLE; +- (void)subscribeAttributeOperationalStateListWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, + NSError * _Nullable error))reportHandler MTR_NEWLY_AVAILABLE; ++ (void)readAttributeOperationalStateListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSArray * _Nullable value, + NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; + +- (void)readAttributeOperationalStateWithCompletion: + (void (^)(MTRRoboticVacuumOperationalStateClusterOperationalStateStruct * _Nullable value, NSError * _Nullable error))completion + MTR_NEWLY_AVAILABLE; +- (void)subscribeAttributeOperationalStateWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler: + (void (^)( + MTRRoboticVacuumOperationalStateClusterOperationalStateStruct * _Nullable value, + NSError * _Nullable error))reportHandler MTR_NEWLY_AVAILABLE; ++ (void) + readAttributeOperationalStateWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion: + (void (^)( + MTRRoboticVacuumOperationalStateClusterOperationalStateStruct * _Nullable value, + NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; + +- (void)readAttributeOperationalErrorWithCompletion: + (void (^)(MTRRoboticVacuumOperationalStateClusterErrorStateStruct * _Nullable value, NSError * _Nullable error))completion + MTR_NEWLY_AVAILABLE; +- (void)subscribeAttributeOperationalErrorWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler: + (void (^)(MTRRoboticVacuumOperationalStateClusterErrorStateStruct * _Nullable value, + NSError * _Nullable error))reportHandler MTR_NEWLY_AVAILABLE; ++ (void)readAttributeOperationalErrorWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion: + (void (^)( + MTRRoboticVacuumOperationalStateClusterErrorStateStruct * _Nullable value, + NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; + +- (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion + MTR_NEWLY_AVAILABLE; +- (void)subscribeAttributeGeneratedCommandListWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, + NSError * _Nullable error))reportHandler MTR_NEWLY_AVAILABLE; ++ (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSArray * _Nullable value, + NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; + +- (void)readAttributeAcceptedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion + MTR_NEWLY_AVAILABLE; +- (void)subscribeAttributeAcceptedCommandListWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, + NSError * _Nullable error))reportHandler MTR_NEWLY_AVAILABLE; ++ (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSArray * _Nullable value, + NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; + +- (void)readAttributeEventListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion + MTR_NEWLY_AVAILABLE; +- (void)subscribeAttributeEventListWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler + MTR_NEWLY_AVAILABLE; ++ (void)readAttributeEventListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion + MTR_NEWLY_AVAILABLE; + +- (void)readAttributeAttributeListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion + MTR_NEWLY_AVAILABLE; +- (void)subscribeAttributeAttributeListWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler + MTR_NEWLY_AVAILABLE; ++ (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion + MTR_NEWLY_AVAILABLE; + +- (void)readAttributeFeatureMapWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion + MTR_NEWLY_AVAILABLE; +- (void)subscribeAttributeFeatureMapWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler + MTR_NEWLY_AVAILABLE; ++ (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion + MTR_NEWLY_AVAILABLE; + +- (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion + MTR_NEWLY_AVAILABLE; +- (void)subscribeAttributeClusterRevisionWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler + MTR_NEWLY_AVAILABLE; ++ (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + /** * Cluster HEPA Filter Monitoring * @@ -24439,6 +24653,23 @@ typedef NS_ENUM(uint8_t, MTROperationalState) { MTROperationalStateError MTR_NEWLY_AVAILABLE = 0x03, } MTR_NEWLY_AVAILABLE; +typedef NS_ENUM(uint8_t, MTRRoboticVacuumOperationalStateErrorState) { + MTRRoboticVacuumOperationalStateErrorStateFailedToFindChargingDock MTR_NEWLY_AVAILABLE = 0x40, + MTRRoboticVacuumOperationalStateErrorStateStuck MTR_NEWLY_AVAILABLE = 0x41, + MTRRoboticVacuumOperationalStateErrorStateDustBinMissing MTR_NEWLY_AVAILABLE = 0x42, + MTRRoboticVacuumOperationalStateErrorStateDustBinFull MTR_NEWLY_AVAILABLE = 0x43, + MTRRoboticVacuumOperationalStateErrorStateWaterTankEmpty MTR_NEWLY_AVAILABLE = 0x44, + MTRRoboticVacuumOperationalStateErrorStateWaterTankMissing MTR_NEWLY_AVAILABLE = 0x45, + MTRRoboticVacuumOperationalStateErrorStateWaterTankLidOpen MTR_NEWLY_AVAILABLE = 0x46, + MTRRoboticVacuumOperationalStateErrorStateMopCleaningPadMissing MTR_NEWLY_AVAILABLE = 0x47, +} MTR_NEWLY_AVAILABLE; + +typedef NS_ENUM(uint8_t, MTRRoboticVacuumOperationalStateOperationalState) { + MTRRoboticVacuumOperationalStateOperationalStateSeekingCharger MTR_NEWLY_AVAILABLE = 0x40, + MTRRoboticVacuumOperationalStateOperationalStateCharging MTR_NEWLY_AVAILABLE = 0x41, + MTRRoboticVacuumOperationalStateOperationalStateDocked MTR_NEWLY_AVAILABLE = 0x42, +} MTR_NEWLY_AVAILABLE; + typedef NS_ENUM(uint8_t, MTRHEPAFilterMonitoringChangeIndication) { MTRHEPAFilterMonitoringChangeIndicationOK MTR_NEWLY_AVAILABLE = 0x00, MTRHEPAFilterMonitoringChangeIndicationWarning MTR_NEWLY_AVAILABLE = 0x01, diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm index cdf9f56791411a..087572b6978dba 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm @@ -50705,6 +50705,730 @@ + (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheC @end +@implementation MTRBaseClusterRoboticVacuumOperationalState + +- (instancetype)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue +{ + if (self = [super initWithQueue:queue]) { + if (device == nil) { + return nil; + } + + _device = device; + _endpoint = [endpointID unsignedShortValue]; + } + return self; +} + +- (void)pauseWithCompletion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion +{ + [self pauseWithParams:nil completion:completion]; +} +- (void)pauseWithParams:(MTRRoboticVacuumOperationalStateClusterPauseParams * _Nullable)params + completion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion +{ + // Make a copy of params before we go async. + params = [params copy]; + auto * bridge = new MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseCallbackBridge(self.callbackQueue, + completion, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, + RoboticVacuumOperationalStateClusterOperationalCommandResponseCallbackType successCb, MTRErrorCallback failureCb, + MTRCallbackBridgeBase * bridge) { + auto * typedBridge + = static_cast(bridge); + Optional timedInvokeTimeoutMs; + Optional invokeTimeout; + ListFreer listFreer; + RoboticVacuumOperationalState::Commands::Pause::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + if (params.serverSideProcessingTimeout != nil) { + // Clamp to a number of seconds that will not overflow 32-bit + // int when converted to ms. + auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); + invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); + } + } + + return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self->_endpoint, + timedInvokeTimeoutMs, invokeTimeout); + }); + std::move(*bridge).DispatchAction(self.device); +} + +- (void)stopWithCompletion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion +{ + [self stopWithParams:nil completion:completion]; +} +- (void)stopWithParams:(MTRRoboticVacuumOperationalStateClusterStopParams * _Nullable)params + completion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion +{ + // Make a copy of params before we go async. + params = [params copy]; + auto * bridge = new MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseCallbackBridge(self.callbackQueue, + completion, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, + RoboticVacuumOperationalStateClusterOperationalCommandResponseCallbackType successCb, MTRErrorCallback failureCb, + MTRCallbackBridgeBase * bridge) { + auto * typedBridge + = static_cast(bridge); + Optional timedInvokeTimeoutMs; + Optional invokeTimeout; + ListFreer listFreer; + RoboticVacuumOperationalState::Commands::Stop::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + if (params.serverSideProcessingTimeout != nil) { + // Clamp to a number of seconds that will not overflow 32-bit + // int when converted to ms. + auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); + invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); + } + } + + return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self->_endpoint, + timedInvokeTimeoutMs, invokeTimeout); + }); + std::move(*bridge).DispatchAction(self.device); +} + +- (void)startWithCompletion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion +{ + [self startWithParams:nil completion:completion]; +} +- (void)startWithParams:(MTRRoboticVacuumOperationalStateClusterStartParams * _Nullable)params + completion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion +{ + // Make a copy of params before we go async. + params = [params copy]; + auto * bridge = new MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseCallbackBridge(self.callbackQueue, + completion, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, + RoboticVacuumOperationalStateClusterOperationalCommandResponseCallbackType successCb, MTRErrorCallback failureCb, + MTRCallbackBridgeBase * bridge) { + auto * typedBridge + = static_cast(bridge); + Optional timedInvokeTimeoutMs; + Optional invokeTimeout; + ListFreer listFreer; + RoboticVacuumOperationalState::Commands::Start::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + if (params.serverSideProcessingTimeout != nil) { + // Clamp to a number of seconds that will not overflow 32-bit + // int when converted to ms. + auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); + invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); + } + } + + return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self->_endpoint, + timedInvokeTimeoutMs, invokeTimeout); + }); + std::move(*bridge).DispatchAction(self.device); +} + +- (void)resumeWithCompletion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion +{ + [self resumeWithParams:nil completion:completion]; +} +- (void)resumeWithParams:(MTRRoboticVacuumOperationalStateClusterResumeParams * _Nullable)params + completion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion +{ + // Make a copy of params before we go async. + params = [params copy]; + auto * bridge = new MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseCallbackBridge(self.callbackQueue, + completion, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, + RoboticVacuumOperationalStateClusterOperationalCommandResponseCallbackType successCb, MTRErrorCallback failureCb, + MTRCallbackBridgeBase * bridge) { + auto * typedBridge + = static_cast(bridge); + Optional timedInvokeTimeoutMs; + Optional invokeTimeout; + ListFreer listFreer; + RoboticVacuumOperationalState::Commands::Resume::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + if (params.serverSideProcessingTimeout != nil) { + // Clamp to a number of seconds that will not overflow 32-bit + // int when converted to ms. + auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); + invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); + } + } + + return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self->_endpoint, + timedInvokeTimeoutMs, invokeTimeout); + }); + std::move(*bridge).DispatchAction(self.device); +} + +- (void)readAttributePhaseListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + MTRReadParams * params = [[MTRReadParams alloc] init]; + using TypeInfo = RoboticVacuumOperationalState::Attributes::PhaseList::TypeInfo; + return MTRReadAttribute( + params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + +- (void)subscribeAttributePhaseListWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = RoboticVacuumOperationalState::Attributes::PhaseList::TypeInfo; + MTRSubscribeAttribute(params, subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, + TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + ++ (void)readAttributePhaseListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + auto * bridge = new MTRRoboticVacuumOperationalStatePhaseListListAttributeCallbackBridge(queue, completion); + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, + ^(RoboticVacuumOperationalStatePhaseListListAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = RoboticVacuumOperationalState::Attributes::PhaseList::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +- (void)readAttributeCurrentPhaseWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + MTRReadParams * params = [[MTRReadParams alloc] init]; + using TypeInfo = RoboticVacuumOperationalState::Attributes::CurrentPhase::TypeInfo; + return MTRReadAttribute( + params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + +- (void)subscribeAttributeCurrentPhaseWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = RoboticVacuumOperationalState::Attributes::CurrentPhase::TypeInfo; + MTRSubscribeAttribute(params, + subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), + TypeInfo::GetAttributeId()); +} + ++ (void)readAttributeCurrentPhaseWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + auto * bridge = new MTRNullableInt8uAttributeCallbackBridge(queue, completion); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = RoboticVacuumOperationalState::Attributes::CurrentPhase::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +- (void)readAttributeCountdownTimeWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + MTRReadParams * params = [[MTRReadParams alloc] init]; + using TypeInfo = RoboticVacuumOperationalState::Attributes::CountdownTime::TypeInfo; + return MTRReadAttribute( + params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + +- (void)subscribeAttributeCountdownTimeWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = RoboticVacuumOperationalState::Attributes::CountdownTime::TypeInfo; + MTRSubscribeAttribute(params, + subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), + TypeInfo::GetAttributeId()); +} + ++ (void)readAttributeCountdownTimeWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + auto * bridge = new MTRNullableInt32uAttributeCallbackBridge(queue, completion); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = RoboticVacuumOperationalState::Attributes::CountdownTime::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +- (void)readAttributeOperationalStateListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + MTRReadParams * params = [[MTRReadParams alloc] init]; + using TypeInfo = RoboticVacuumOperationalState::Attributes::OperationalStateList::TypeInfo; + return MTRReadAttribute( + params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + +- (void)subscribeAttributeOperationalStateListWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler: + (void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = RoboticVacuumOperationalState::Attributes::OperationalStateList::TypeInfo; + MTRSubscribeAttribute(params, subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, + TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + ++ (void)readAttributeOperationalStateListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion: + (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + auto * bridge = new MTRRoboticVacuumOperationalStateOperationalStateListListAttributeCallbackBridge(queue, completion); + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, + ^(RoboticVacuumOperationalStateOperationalStateListListAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = RoboticVacuumOperationalState::Attributes::OperationalStateList::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +- (void)readAttributeOperationalStateWithCompletion: + (void (^)(MTRRoboticVacuumOperationalStateClusterOperationalStateStruct * _Nullable value, NSError * _Nullable error))completion +{ + MTRReadParams * params = [[MTRReadParams alloc] init]; + using TypeInfo = RoboticVacuumOperationalState::Attributes::OperationalState::TypeInfo; + return MTRReadAttribute( + params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + +- (void)subscribeAttributeOperationalStateWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler: + (void (^)( + MTRRoboticVacuumOperationalStateClusterOperationalStateStruct * _Nullable value, + NSError * _Nullable error))reportHandler +{ + using TypeInfo = RoboticVacuumOperationalState::Attributes::OperationalState::TypeInfo; + MTRSubscribeAttribute(params, subscriptionEstablished, + reportHandler, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + ++ (void) + readAttributeOperationalStateWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion: + (void (^)( + MTRRoboticVacuumOperationalStateClusterOperationalStateStruct * _Nullable value, + NSError * _Nullable error))completion +{ + auto * bridge = new MTRRoboticVacuumOperationalStateOperationalStateStructAttributeCallbackBridge(queue, completion); + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, + ^(RoboticVacuumOperationalStateOperationalStateStructAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = RoboticVacuumOperationalState::Attributes::OperationalState::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +- (void)readAttributeOperationalErrorWithCompletion: + (void (^)(MTRRoboticVacuumOperationalStateClusterErrorStateStruct * _Nullable value, NSError * _Nullable error))completion +{ + MTRReadParams * params = [[MTRReadParams alloc] init]; + using TypeInfo = RoboticVacuumOperationalState::Attributes::OperationalError::TypeInfo; + return MTRReadAttribute( + params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + +- (void)subscribeAttributeOperationalErrorWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler: + (void (^)(MTRRoboticVacuumOperationalStateClusterErrorStateStruct * _Nullable value, + NSError * _Nullable error))reportHandler +{ + using TypeInfo = RoboticVacuumOperationalState::Attributes::OperationalError::TypeInfo; + MTRSubscribeAttribute(params, subscriptionEstablished, + reportHandler, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + ++ (void)readAttributeOperationalErrorWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion: + (void (^)( + MTRRoboticVacuumOperationalStateClusterErrorStateStruct * _Nullable value, + NSError * _Nullable error))completion +{ + auto * bridge = new MTRRoboticVacuumOperationalStateOperationalErrorStructAttributeCallbackBridge(queue, completion); + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, + ^(RoboticVacuumOperationalStateOperationalErrorStructAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = RoboticVacuumOperationalState::Attributes::OperationalError::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +- (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + MTRReadParams * params = [[MTRReadParams alloc] init]; + using TypeInfo = RoboticVacuumOperationalState::Attributes::GeneratedCommandList::TypeInfo; + return MTRReadAttribute( + params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + +- (void)subscribeAttributeGeneratedCommandListWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler: + (void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = RoboticVacuumOperationalState::Attributes::GeneratedCommandList::TypeInfo; + MTRSubscribeAttribute(params, subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, + TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + ++ (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion: + (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + auto * bridge = new MTRRoboticVacuumOperationalStateGeneratedCommandListListAttributeCallbackBridge(queue, completion); + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, + ^(RoboticVacuumOperationalStateGeneratedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = RoboticVacuumOperationalState::Attributes::GeneratedCommandList::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +- (void)readAttributeAcceptedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + MTRReadParams * params = [[MTRReadParams alloc] init]; + using TypeInfo = RoboticVacuumOperationalState::Attributes::AcceptedCommandList::TypeInfo; + return MTRReadAttribute( + params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + +- (void)subscribeAttributeAcceptedCommandListWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler: + (void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = RoboticVacuumOperationalState::Attributes::AcceptedCommandList::TypeInfo; + MTRSubscribeAttribute(params, subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, + TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + ++ (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion: + (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + auto * bridge = new MTRRoboticVacuumOperationalStateAcceptedCommandListListAttributeCallbackBridge(queue, completion); + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, + ^(RoboticVacuumOperationalStateAcceptedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = RoboticVacuumOperationalState::Attributes::AcceptedCommandList::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +- (void)readAttributeEventListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + MTRReadParams * params = [[MTRReadParams alloc] init]; + using TypeInfo = RoboticVacuumOperationalState::Attributes::EventList::TypeInfo; + return MTRReadAttribute( + params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + +- (void)subscribeAttributeEventListWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = RoboticVacuumOperationalState::Attributes::EventList::TypeInfo; + MTRSubscribeAttribute(params, subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, + TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + ++ (void)readAttributeEventListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + auto * bridge = new MTRRoboticVacuumOperationalStateEventListListAttributeCallbackBridge(queue, completion); + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, + ^(RoboticVacuumOperationalStateEventListListAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = RoboticVacuumOperationalState::Attributes::EventList::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +- (void)readAttributeAttributeListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + MTRReadParams * params = [[MTRReadParams alloc] init]; + using TypeInfo = RoboticVacuumOperationalState::Attributes::AttributeList::TypeInfo; + return MTRReadAttribute( + params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + +- (void)subscribeAttributeAttributeListWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = RoboticVacuumOperationalState::Attributes::AttributeList::TypeInfo; + MTRSubscribeAttribute(params, subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, + TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + ++ (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + auto * bridge = new MTRRoboticVacuumOperationalStateAttributeListListAttributeCallbackBridge(queue, completion); + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, + ^(RoboticVacuumOperationalStateAttributeListListAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = RoboticVacuumOperationalState::Attributes::AttributeList::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +- (void)readAttributeFeatureMapWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + MTRReadParams * params = [[MTRReadParams alloc] init]; + using TypeInfo = RoboticVacuumOperationalState::Attributes::FeatureMap::TypeInfo; + return MTRReadAttribute( + params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + +- (void)subscribeAttributeFeatureMapWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = RoboticVacuumOperationalState::Attributes::FeatureMap::TypeInfo; + MTRSubscribeAttribute(params, + subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), + TypeInfo::GetAttributeId()); +} + ++ (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = RoboticVacuumOperationalState::Attributes::FeatureMap::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +- (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + MTRReadParams * params = [[MTRReadParams alloc] init]; + using TypeInfo = RoboticVacuumOperationalState::Attributes::ClusterRevision::TypeInfo; + return MTRReadAttribute( + params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + +- (void)subscribeAttributeClusterRevisionWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = RoboticVacuumOperationalState::Attributes::ClusterRevision::TypeInfo; + MTRSubscribeAttribute(params, + subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), + TypeInfo::GetAttributeId()); +} + ++ (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = RoboticVacuumOperationalState::Attributes::ClusterRevision::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +@end + @implementation MTRBaseClusterHEPAFilterMonitoring - (instancetype)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters_Internal.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters_Internal.h index 1063a353250da9..aa29354560fb44 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters_Internal.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters_Internal.h @@ -225,6 +225,11 @@ @property (nonatomic, assign, readonly) chip::EndpointId endpoint; @end +@interface MTRBaseClusterRoboticVacuumOperationalState () +@property (nonatomic, strong, readonly) MTRBaseDevice * device; +@property (nonatomic, assign, readonly) chip::EndpointId endpoint; +@end + @interface MTRBaseClusterHEPAFilterMonitoring () @property (nonatomic, strong, readonly) MTRBaseDevice * device; @property (nonatomic, assign, readonly) chip::EndpointId endpoint; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.h b/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.h index e239e1f9d503eb..df099251b0729e 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.h @@ -87,6 +87,8 @@ typedef void (*GroupKeyManagementClusterKeySetReadAllIndicesResponseCallbackType void *, const chip::app::Clusters::GroupKeyManagement::Commands::KeySetReadAllIndicesResponse::DecodableType &); typedef void (*OperationalStateClusterOperationalCommandResponseCallbackType)( void *, const chip::app::Clusters::OperationalState::Commands::OperationalCommandResponse::DecodableType &); +typedef void (*RoboticVacuumOperationalStateClusterOperationalCommandResponseCallbackType)( + void *, const chip::app::Clusters::RoboticVacuumOperationalState::Commands::OperationalCommandResponse::DecodableType &); typedef void (*DoorLockClusterGetWeekDayScheduleResponseCallbackType)( void *, const chip::app::Clusters::DoorLock::Commands::GetWeekDayScheduleResponse::DecodableType &); typedef void (*DoorLockClusterGetYearDayScheduleResponseCallbackType)( @@ -414,6 +416,14 @@ typedef void (*OperationalStateClusterOperationalStateEnumAttributeCallback)( void *, chip::app::Clusters::OperationalState::OperationalStateEnum); typedef void (*NullableOperationalStateClusterOperationalStateEnumAttributeCallback)( void *, const chip::app::DataModel::Nullable &); +typedef void (*RoboticVacuumOperationalStateClusterErrorStateEnumAttributeCallback)( + void *, chip::app::Clusters::RoboticVacuumOperationalState::ErrorStateEnum); +typedef void (*NullableRoboticVacuumOperationalStateClusterErrorStateEnumAttributeCallback)( + void *, const chip::app::DataModel::Nullable &); +typedef void (*RoboticVacuumOperationalStateClusterOperationalStateEnumAttributeCallback)( + void *, chip::app::Clusters::RoboticVacuumOperationalState::OperationalStateEnum); +typedef void (*NullableRoboticVacuumOperationalStateClusterOperationalStateEnumAttributeCallback)( + void *, const chip::app::DataModel::Nullable &); typedef void (*HEPAFilterMonitoringClusterChangeIndicationEnumAttributeCallback)( void *, chip::app::Clusters::HepaFilterMonitoring::ChangeIndicationEnum); typedef void (*NullableHEPAFilterMonitoringClusterChangeIndicationEnumAttributeCallback)( @@ -1221,6 +1231,24 @@ typedef void (*OperationalStateEventListListAttributeCallback)(void * context, const chip::app::DataModel::DecodableList & data); typedef void (*OperationalStateAttributeListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); +typedef void (*RoboticVacuumOperationalStatePhaseListListAttributeCallback)( + void * context, const chip::app::DataModel::Nullable> & data); +typedef void (*RoboticVacuumOperationalStateOperationalStateListListAttributeCallback)( + void * context, + const chip::app::DataModel::DecodableList< + chip::app::Clusters::RoboticVacuumOperationalState::Structs::OperationalStateStruct::DecodableType> & data); +typedef void (*RoboticVacuumOperationalStateOperationalStateStructAttributeCallback)( + void *, const chip::app::Clusters::RoboticVacuumOperationalState::Structs::OperationalStateStruct::DecodableType &); +typedef void (*RoboticVacuumOperationalStateOperationalErrorStructAttributeCallback)( + void *, const chip::app::Clusters::RoboticVacuumOperationalState::Structs::ErrorStateStruct::DecodableType &); +typedef void (*RoboticVacuumOperationalStateGeneratedCommandListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +typedef void (*RoboticVacuumOperationalStateAcceptedCommandListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +typedef void (*RoboticVacuumOperationalStateEventListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +typedef void (*RoboticVacuumOperationalStateAttributeListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); typedef void (*HEPAFilterMonitoringGeneratedCommandListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); typedef void (*HEPAFilterMonitoringAcceptedCommandListListAttributeCallback)( @@ -9591,6 +9619,286 @@ class MTROperationalStateAttributeListListAttributeCallbackSubscriptionBridge MTRSubscriptionEstablishedHandler mEstablishedHandler; }; +class MTRRoboticVacuumOperationalStatePhaseListListAttributeCallbackBridge + : public MTRCallbackBridge +{ +public: + MTRRoboticVacuumOperationalStatePhaseListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; + + MTRRoboticVacuumOperationalStatePhaseListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action) : + MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; + + static void OnSuccessFn(void * context, + const chip::app::DataModel::Nullable> & value); +}; + +class MTRRoboticVacuumOperationalStatePhaseListListAttributeCallbackSubscriptionBridge + : public MTRRoboticVacuumOperationalStatePhaseListListAttributeCallbackBridge +{ +public: + MTRRoboticVacuumOperationalStatePhaseListListAttributeCallbackSubscriptionBridge( + dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action, + MTRSubscriptionEstablishedHandler establishedHandler) : + MTRRoboticVacuumOperationalStatePhaseListListAttributeCallbackBridge(queue, handler, action), + mEstablishedHandler(establishedHandler) + {} + + void OnSubscriptionEstablished(); + using MTRRoboticVacuumOperationalStatePhaseListListAttributeCallbackBridge::KeepAliveOnCallback; + using MTRRoboticVacuumOperationalStatePhaseListListAttributeCallbackBridge::OnDone; + +private: + MTRSubscriptionEstablishedHandler mEstablishedHandler; +}; + +class MTRRoboticVacuumOperationalStateOperationalStateListListAttributeCallbackBridge + : public MTRCallbackBridge +{ +public: + MTRRoboticVacuumOperationalStateOperationalStateListListAttributeCallbackBridge(dispatch_queue_t queue, + ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; + + MTRRoboticVacuumOperationalStateOperationalStateListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action) : + MTRCallbackBridge(queue, handler, action, + OnSuccessFn){}; + + static void + OnSuccessFn(void * context, + const chip::app::DataModel::DecodableList< + chip::app::Clusters::RoboticVacuumOperationalState::Structs::OperationalStateStruct::DecodableType> & value); +}; + +class MTRRoboticVacuumOperationalStateOperationalStateListListAttributeCallbackSubscriptionBridge + : public MTRRoboticVacuumOperationalStateOperationalStateListListAttributeCallbackBridge +{ +public: + MTRRoboticVacuumOperationalStateOperationalStateListListAttributeCallbackSubscriptionBridge( + dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action, + MTRSubscriptionEstablishedHandler establishedHandler) : + MTRRoboticVacuumOperationalStateOperationalStateListListAttributeCallbackBridge(queue, handler, action), + mEstablishedHandler(establishedHandler) + {} + + void OnSubscriptionEstablished(); + using MTRRoboticVacuumOperationalStateOperationalStateListListAttributeCallbackBridge::KeepAliveOnCallback; + using MTRRoboticVacuumOperationalStateOperationalStateListListAttributeCallbackBridge::OnDone; + +private: + MTRSubscriptionEstablishedHandler mEstablishedHandler; +}; + +class MTRRoboticVacuumOperationalStateOperationalStateStructAttributeCallbackBridge + : public MTRCallbackBridge +{ +public: + MTRRoboticVacuumOperationalStateOperationalStateStructAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; + + MTRRoboticVacuumOperationalStateOperationalStateStructAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action) : + MTRCallbackBridge(queue, handler, action, + OnSuccessFn){}; + + static void + OnSuccessFn(void * context, + const chip::app::Clusters::RoboticVacuumOperationalState::Structs::OperationalStateStruct::DecodableType & value); +}; + +class MTRRoboticVacuumOperationalStateOperationalStateStructAttributeCallbackSubscriptionBridge + : public MTRRoboticVacuumOperationalStateOperationalStateStructAttributeCallbackBridge +{ +public: + MTRRoboticVacuumOperationalStateOperationalStateStructAttributeCallbackSubscriptionBridge( + dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action, + MTRSubscriptionEstablishedHandler establishedHandler) : + MTRRoboticVacuumOperationalStateOperationalStateStructAttributeCallbackBridge(queue, handler, action), + mEstablishedHandler(establishedHandler) + {} + + void OnSubscriptionEstablished(); + using MTRRoboticVacuumOperationalStateOperationalStateStructAttributeCallbackBridge::KeepAliveOnCallback; + using MTRRoboticVacuumOperationalStateOperationalStateStructAttributeCallbackBridge::OnDone; + +private: + MTRSubscriptionEstablishedHandler mEstablishedHandler; +}; + +class MTRRoboticVacuumOperationalStateOperationalErrorStructAttributeCallbackBridge + : public MTRCallbackBridge +{ +public: + MTRRoboticVacuumOperationalStateOperationalErrorStructAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; + + MTRRoboticVacuumOperationalStateOperationalErrorStructAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action) : + MTRCallbackBridge(queue, handler, action, + OnSuccessFn){}; + + static void + OnSuccessFn(void * context, + const chip::app::Clusters::RoboticVacuumOperationalState::Structs::ErrorStateStruct::DecodableType & value); +}; + +class MTRRoboticVacuumOperationalStateOperationalErrorStructAttributeCallbackSubscriptionBridge + : public MTRRoboticVacuumOperationalStateOperationalErrorStructAttributeCallbackBridge +{ +public: + MTRRoboticVacuumOperationalStateOperationalErrorStructAttributeCallbackSubscriptionBridge( + dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action, + MTRSubscriptionEstablishedHandler establishedHandler) : + MTRRoboticVacuumOperationalStateOperationalErrorStructAttributeCallbackBridge(queue, handler, action), + mEstablishedHandler(establishedHandler) + {} + + void OnSubscriptionEstablished(); + using MTRRoboticVacuumOperationalStateOperationalErrorStructAttributeCallbackBridge::KeepAliveOnCallback; + using MTRRoboticVacuumOperationalStateOperationalErrorStructAttributeCallbackBridge::OnDone; + +private: + MTRSubscriptionEstablishedHandler mEstablishedHandler; +}; + +class MTRRoboticVacuumOperationalStateGeneratedCommandListListAttributeCallbackBridge + : public MTRCallbackBridge +{ +public: + MTRRoboticVacuumOperationalStateGeneratedCommandListListAttributeCallbackBridge(dispatch_queue_t queue, + ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; + + MTRRoboticVacuumOperationalStateGeneratedCommandListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action) : + MTRCallbackBridge(queue, handler, action, + OnSuccessFn){}; + + static void OnSuccessFn(void * context, const chip::app::DataModel::DecodableList & value); +}; + +class MTRRoboticVacuumOperationalStateGeneratedCommandListListAttributeCallbackSubscriptionBridge + : public MTRRoboticVacuumOperationalStateGeneratedCommandListListAttributeCallbackBridge +{ +public: + MTRRoboticVacuumOperationalStateGeneratedCommandListListAttributeCallbackSubscriptionBridge( + dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action, + MTRSubscriptionEstablishedHandler establishedHandler) : + MTRRoboticVacuumOperationalStateGeneratedCommandListListAttributeCallbackBridge(queue, handler, action), + mEstablishedHandler(establishedHandler) + {} + + void OnSubscriptionEstablished(); + using MTRRoboticVacuumOperationalStateGeneratedCommandListListAttributeCallbackBridge::KeepAliveOnCallback; + using MTRRoboticVacuumOperationalStateGeneratedCommandListListAttributeCallbackBridge::OnDone; + +private: + MTRSubscriptionEstablishedHandler mEstablishedHandler; +}; + +class MTRRoboticVacuumOperationalStateAcceptedCommandListListAttributeCallbackBridge + : public MTRCallbackBridge +{ +public: + MTRRoboticVacuumOperationalStateAcceptedCommandListListAttributeCallbackBridge(dispatch_queue_t queue, + ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; + + MTRRoboticVacuumOperationalStateAcceptedCommandListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action) : + MTRCallbackBridge(queue, handler, action, + OnSuccessFn){}; + + static void OnSuccessFn(void * context, const chip::app::DataModel::DecodableList & value); +}; + +class MTRRoboticVacuumOperationalStateAcceptedCommandListListAttributeCallbackSubscriptionBridge + : public MTRRoboticVacuumOperationalStateAcceptedCommandListListAttributeCallbackBridge +{ +public: + MTRRoboticVacuumOperationalStateAcceptedCommandListListAttributeCallbackSubscriptionBridge( + dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action, + MTRSubscriptionEstablishedHandler establishedHandler) : + MTRRoboticVacuumOperationalStateAcceptedCommandListListAttributeCallbackBridge(queue, handler, action), + mEstablishedHandler(establishedHandler) + {} + + void OnSubscriptionEstablished(); + using MTRRoboticVacuumOperationalStateAcceptedCommandListListAttributeCallbackBridge::KeepAliveOnCallback; + using MTRRoboticVacuumOperationalStateAcceptedCommandListListAttributeCallbackBridge::OnDone; + +private: + MTRSubscriptionEstablishedHandler mEstablishedHandler; +}; + +class MTRRoboticVacuumOperationalStateEventListListAttributeCallbackBridge + : public MTRCallbackBridge +{ +public: + MTRRoboticVacuumOperationalStateEventListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; + + MTRRoboticVacuumOperationalStateEventListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action) : + MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; + + static void OnSuccessFn(void * context, const chip::app::DataModel::DecodableList & value); +}; + +class MTRRoboticVacuumOperationalStateEventListListAttributeCallbackSubscriptionBridge + : public MTRRoboticVacuumOperationalStateEventListListAttributeCallbackBridge +{ +public: + MTRRoboticVacuumOperationalStateEventListListAttributeCallbackSubscriptionBridge( + dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action, + MTRSubscriptionEstablishedHandler establishedHandler) : + MTRRoboticVacuumOperationalStateEventListListAttributeCallbackBridge(queue, handler, action), + mEstablishedHandler(establishedHandler) + {} + + void OnSubscriptionEstablished(); + using MTRRoboticVacuumOperationalStateEventListListAttributeCallbackBridge::KeepAliveOnCallback; + using MTRRoboticVacuumOperationalStateEventListListAttributeCallbackBridge::OnDone; + +private: + MTRSubscriptionEstablishedHandler mEstablishedHandler; +}; + +class MTRRoboticVacuumOperationalStateAttributeListListAttributeCallbackBridge + : public MTRCallbackBridge +{ +public: + MTRRoboticVacuumOperationalStateAttributeListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; + + MTRRoboticVacuumOperationalStateAttributeListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action) : + MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; + + static void OnSuccessFn(void * context, const chip::app::DataModel::DecodableList & value); +}; + +class MTRRoboticVacuumOperationalStateAttributeListListAttributeCallbackSubscriptionBridge + : public MTRRoboticVacuumOperationalStateAttributeListListAttributeCallbackBridge +{ +public: + MTRRoboticVacuumOperationalStateAttributeListListAttributeCallbackSubscriptionBridge( + dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action, + MTRSubscriptionEstablishedHandler establishedHandler) : + MTRRoboticVacuumOperationalStateAttributeListListAttributeCallbackBridge(queue, handler, action), + mEstablishedHandler(establishedHandler) + {} + + void OnSubscriptionEstablished(); + using MTRRoboticVacuumOperationalStateAttributeListListAttributeCallbackBridge::KeepAliveOnCallback; + using MTRRoboticVacuumOperationalStateAttributeListListAttributeCallbackBridge::OnDone; + +private: + MTRSubscriptionEstablishedHandler mEstablishedHandler; +}; + class MTRHEPAFilterMonitoringGeneratedCommandListListAttributeCallbackBridge : public MTRCallbackBridge { @@ -16764,6 +17072,25 @@ class MTROperationalStateClusterOperationalCommandResponseCallbackBridge const chip::app::Clusters::OperationalState::Commands::OperationalCommandResponse::DecodableType & data); }; +class MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseCallbackBridge + : public MTRCallbackBridge +{ +public: + MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseCallbackBridge(dispatch_queue_t queue, + ResponseHandler handler) : + MTRCallbackBridge(queue, handler, + OnSuccessFn){}; + + MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action) : + MTRCallbackBridge(queue, handler, action, + OnSuccessFn){}; + + static void OnSuccessFn( + void * context, + const chip::app::Clusters::RoboticVacuumOperationalState::Commands::OperationalCommandResponse::DecodableType & data); +}; + class MTRDoorLockClusterGetWeekDayScheduleResponseCallbackBridge : public MTRCallbackBridge { @@ -22345,6 +22672,154 @@ class MTRNullableOperationalStateClusterOperationalStateEnumAttributeCallbackSub MTRSubscriptionEstablishedHandler mEstablishedHandler; }; +class MTRRoboticVacuumOperationalStateClusterErrorStateEnumAttributeCallbackBridge + : public MTRCallbackBridge +{ +public: + MTRRoboticVacuumOperationalStateClusterErrorStateEnumAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; + + MTRRoboticVacuumOperationalStateClusterErrorStateEnumAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action) : + MTRCallbackBridge(queue, handler, action, + OnSuccessFn){}; + + static void OnSuccessFn(void * context, chip::app::Clusters::RoboticVacuumOperationalState::ErrorStateEnum value); +}; + +class MTRRoboticVacuumOperationalStateClusterErrorStateEnumAttributeCallbackSubscriptionBridge + : public MTRRoboticVacuumOperationalStateClusterErrorStateEnumAttributeCallbackBridge +{ +public: + MTRRoboticVacuumOperationalStateClusterErrorStateEnumAttributeCallbackSubscriptionBridge( + dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action, + MTRSubscriptionEstablishedHandler establishedHandler) : + MTRRoboticVacuumOperationalStateClusterErrorStateEnumAttributeCallbackBridge(queue, handler, action), + mEstablishedHandler(establishedHandler) + {} + + void OnSubscriptionEstablished(); + using MTRRoboticVacuumOperationalStateClusterErrorStateEnumAttributeCallbackBridge::KeepAliveOnCallback; + using MTRRoboticVacuumOperationalStateClusterErrorStateEnumAttributeCallbackBridge::OnDone; + +private: + MTRSubscriptionEstablishedHandler mEstablishedHandler; +}; + +class MTRNullableRoboticVacuumOperationalStateClusterErrorStateEnumAttributeCallbackBridge + : public MTRCallbackBridge +{ +public: + MTRNullableRoboticVacuumOperationalStateClusterErrorStateEnumAttributeCallbackBridge(dispatch_queue_t queue, + ResponseHandler handler) : + MTRCallbackBridge(queue, handler, + OnSuccessFn){}; + + MTRNullableRoboticVacuumOperationalStateClusterErrorStateEnumAttributeCallbackBridge(dispatch_queue_t queue, + ResponseHandler handler, + MTRActionBlock action) : + MTRCallbackBridge(queue, handler, action, + OnSuccessFn){}; + + static void + OnSuccessFn(void * context, + const chip::app::DataModel::Nullable & value); +}; + +class MTRNullableRoboticVacuumOperationalStateClusterErrorStateEnumAttributeCallbackSubscriptionBridge + : public MTRNullableRoboticVacuumOperationalStateClusterErrorStateEnumAttributeCallbackBridge +{ +public: + MTRNullableRoboticVacuumOperationalStateClusterErrorStateEnumAttributeCallbackSubscriptionBridge( + dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action, + MTRSubscriptionEstablishedHandler establishedHandler) : + MTRNullableRoboticVacuumOperationalStateClusterErrorStateEnumAttributeCallbackBridge(queue, handler, action), + mEstablishedHandler(establishedHandler) + {} + + void OnSubscriptionEstablished(); + using MTRNullableRoboticVacuumOperationalStateClusterErrorStateEnumAttributeCallbackBridge::KeepAliveOnCallback; + using MTRNullableRoboticVacuumOperationalStateClusterErrorStateEnumAttributeCallbackBridge::OnDone; + +private: + MTRSubscriptionEstablishedHandler mEstablishedHandler; +}; + +class MTRRoboticVacuumOperationalStateClusterOperationalStateEnumAttributeCallbackBridge + : public MTRCallbackBridge +{ +public: + MTRRoboticVacuumOperationalStateClusterOperationalStateEnumAttributeCallbackBridge(dispatch_queue_t queue, + ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; + + MTRRoboticVacuumOperationalStateClusterOperationalStateEnumAttributeCallbackBridge(dispatch_queue_t queue, + ResponseHandler handler, + MTRActionBlock action) : + MTRCallbackBridge(queue, handler, action, + OnSuccessFn){}; + + static void OnSuccessFn(void * context, chip::app::Clusters::RoboticVacuumOperationalState::OperationalStateEnum value); +}; + +class MTRRoboticVacuumOperationalStateClusterOperationalStateEnumAttributeCallbackSubscriptionBridge + : public MTRRoboticVacuumOperationalStateClusterOperationalStateEnumAttributeCallbackBridge +{ +public: + MTRRoboticVacuumOperationalStateClusterOperationalStateEnumAttributeCallbackSubscriptionBridge( + dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action, + MTRSubscriptionEstablishedHandler establishedHandler) : + MTRRoboticVacuumOperationalStateClusterOperationalStateEnumAttributeCallbackBridge(queue, handler, action), + mEstablishedHandler(establishedHandler) + {} + + void OnSubscriptionEstablished(); + using MTRRoboticVacuumOperationalStateClusterOperationalStateEnumAttributeCallbackBridge::KeepAliveOnCallback; + using MTRRoboticVacuumOperationalStateClusterOperationalStateEnumAttributeCallbackBridge::OnDone; + +private: + MTRSubscriptionEstablishedHandler mEstablishedHandler; +}; + +class MTRNullableRoboticVacuumOperationalStateClusterOperationalStateEnumAttributeCallbackBridge + : public MTRCallbackBridge +{ +public: + MTRNullableRoboticVacuumOperationalStateClusterOperationalStateEnumAttributeCallbackBridge(dispatch_queue_t queue, + ResponseHandler handler) : + MTRCallbackBridge(queue, handler, + OnSuccessFn){}; + + MTRNullableRoboticVacuumOperationalStateClusterOperationalStateEnumAttributeCallbackBridge(dispatch_queue_t queue, + ResponseHandler handler, + MTRActionBlock action) : + MTRCallbackBridge(queue, handler, action, + OnSuccessFn){}; + + static void OnSuccessFn( + void * context, + const chip::app::DataModel::Nullable & value); +}; + +class MTRNullableRoboticVacuumOperationalStateClusterOperationalStateEnumAttributeCallbackSubscriptionBridge + : public MTRNullableRoboticVacuumOperationalStateClusterOperationalStateEnumAttributeCallbackBridge +{ +public: + MTRNullableRoboticVacuumOperationalStateClusterOperationalStateEnumAttributeCallbackSubscriptionBridge( + dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action, + MTRSubscriptionEstablishedHandler establishedHandler) : + MTRNullableRoboticVacuumOperationalStateClusterOperationalStateEnumAttributeCallbackBridge(queue, handler, action), + mEstablishedHandler(establishedHandler) + {} + + void OnSubscriptionEstablished(); + using MTRNullableRoboticVacuumOperationalStateClusterOperationalStateEnumAttributeCallbackBridge::KeepAliveOnCallback; + using MTRNullableRoboticVacuumOperationalStateClusterOperationalStateEnumAttributeCallbackBridge::OnDone; + +private: + MTRSubscriptionEstablishedHandler mEstablishedHandler; +}; + class MTRHEPAFilterMonitoringClusterChangeIndicationEnumAttributeCallbackBridge : public MTRCallbackBridge { diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.mm b/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.mm index 41a77955b9d517..1293afafc039f6 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.mm @@ -8965,12 +8965,16 @@ auto & entry_0 = iter_0.GetValue(); MTROperationalStateClusterOperationalStateStruct * newElement_0; newElement_0 = [MTROperationalStateClusterOperationalStateStruct new]; - newElement_0.operationalStateID = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.operationalStateID)]; - newElement_0.operationalStateLabel = AsString(entry_0.operationalStateLabel); - if (newElement_0.operationalStateLabel == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - OnFailureFn(context, err); - return; + newElement_0.operationalStateID = [NSNumber numberWithUnsignedChar:entry_0.operationalStateID]; + if (entry_0.operationalStateLabel.HasValue()) { + newElement_0.operationalStateLabel = AsString(entry_0.operationalStateLabel.Value()); + if (newElement_0.operationalStateLabel == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + OnFailureFn(context, err); + return; + } + } else { + newElement_0.operationalStateLabel = nil; } [array_0 addObject:newElement_0]; } @@ -9004,12 +9008,16 @@ { MTROperationalStateClusterOperationalStateStruct * _Nonnull objCValue; objCValue = [MTROperationalStateClusterOperationalStateStruct new]; - objCValue.operationalStateID = [NSNumber numberWithUnsignedChar:chip::to_underlying(value.operationalStateID)]; - objCValue.operationalStateLabel = AsString(value.operationalStateLabel); - if (objCValue.operationalStateLabel == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - OnFailureFn(context, err); - return; + objCValue.operationalStateID = [NSNumber numberWithUnsignedChar:value.operationalStateID]; + if (value.operationalStateLabel.HasValue()) { + objCValue.operationalStateLabel = AsString(value.operationalStateLabel.Value()); + if (objCValue.operationalStateLabel == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + OnFailureFn(context, err); + return; + } + } else { + objCValue.operationalStateLabel = nil; } DispatchSuccess(context, objCValue); }; @@ -9034,16 +9042,16 @@ { MTROperationalStateClusterErrorStateStruct * _Nonnull objCValue; objCValue = [MTROperationalStateClusterErrorStateStruct new]; - objCValue.errorStateID = [NSNumber numberWithUnsignedChar:chip::to_underlying(value.errorStateID)]; - if (value.errorStateLabel.IsNull()) { - objCValue.errorStateLabel = nil; - } else { + objCValue.errorStateID = [NSNumber numberWithUnsignedChar:value.errorStateID]; + if (value.errorStateLabel.HasValue()) { objCValue.errorStateLabel = AsString(value.errorStateLabel.Value()); if (objCValue.errorStateLabel == nil) { CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; OnFailureFn(context, err); return; } + } else { + objCValue.errorStateLabel = nil; } if (value.errorStateDetails.HasValue()) { objCValue.errorStateDetails = AsString(value.errorStateDetails.Value()); @@ -9225,6 +9233,333 @@ } } +void MTRRoboticVacuumOperationalStatePhaseListListAttributeCallbackBridge::OnSuccessFn( + void * context, const chip::app::DataModel::Nullable> & value) +{ + NSArray * _Nullable objCValue; + if (value.IsNull()) { + objCValue = nil; + } else { + { // Scope for our temporary variables + auto * array_1 = [NSMutableArray new]; + auto iter_1 = value.Value().begin(); + while (iter_1.Next()) { + auto & entry_1 = iter_1.GetValue(); + NSString * newElement_1; + newElement_1 = AsString(entry_1); + if (newElement_1 == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + OnFailureFn(context, err); + return; + } + [array_1 addObject:newElement_1]; + } + CHIP_ERROR err = iter_1.GetStatus(); + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, err); + return; + } + objCValue = array_1; + } + } + DispatchSuccess(context, objCValue); +}; + +void MTRRoboticVacuumOperationalStatePhaseListListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() +{ + if (!mQueue) { + return; + } + + if (mEstablishedHandler != nil) { + dispatch_async(mQueue, mEstablishedHandler); + // On failure, mEstablishedHandler will be cleaned up by our destructor, + // but we can clean it up earlier on successful subscription + // establishment. + mEstablishedHandler = nil; + } +} + +void MTRRoboticVacuumOperationalStateOperationalStateListListAttributeCallbackBridge::OnSuccessFn(void * context, + const chip::app::DataModel::DecodableList< + chip::app::Clusters::RoboticVacuumOperationalState::Structs::OperationalStateStruct::DecodableType> & value) +{ + NSArray * _Nonnull objCValue; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = value.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + MTRRoboticVacuumOperationalStateClusterOperationalStateStruct * newElement_0; + newElement_0 = [MTRRoboticVacuumOperationalStateClusterOperationalStateStruct new]; + newElement_0.operationalStateID = [NSNumber numberWithUnsignedChar:entry_0.operationalStateID]; + if (entry_0.operationalStateLabel.HasValue()) { + newElement_0.operationalStateLabel = AsString(entry_0.operationalStateLabel.Value()); + if (newElement_0.operationalStateLabel == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + OnFailureFn(context, err); + return; + } + } else { + newElement_0.operationalStateLabel = nil; + } + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, err); + return; + } + objCValue = array_0; + } + DispatchSuccess(context, objCValue); +}; + +void MTRRoboticVacuumOperationalStateOperationalStateListListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() +{ + if (!mQueue) { + return; + } + + if (mEstablishedHandler != nil) { + dispatch_async(mQueue, mEstablishedHandler); + // On failure, mEstablishedHandler will be cleaned up by our destructor, + // but we can clean it up earlier on successful subscription + // establishment. + mEstablishedHandler = nil; + } +} + +void MTRRoboticVacuumOperationalStateOperationalStateStructAttributeCallbackBridge::OnSuccessFn(void * context, + const chip::app::Clusters::RoboticVacuumOperationalState::Structs::OperationalStateStruct::DecodableType & value) +{ + MTRRoboticVacuumOperationalStateClusterOperationalStateStruct * _Nonnull objCValue; + objCValue = [MTRRoboticVacuumOperationalStateClusterOperationalStateStruct new]; + objCValue.operationalStateID = [NSNumber numberWithUnsignedChar:value.operationalStateID]; + if (value.operationalStateLabel.HasValue()) { + objCValue.operationalStateLabel = AsString(value.operationalStateLabel.Value()); + if (objCValue.operationalStateLabel == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + OnFailureFn(context, err); + return; + } + } else { + objCValue.operationalStateLabel = nil; + } + DispatchSuccess(context, objCValue); +}; + +void MTRRoboticVacuumOperationalStateOperationalStateStructAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() +{ + if (!mQueue) { + return; + } + + if (mEstablishedHandler != nil) { + dispatch_async(mQueue, mEstablishedHandler); + // On failure, mEstablishedHandler will be cleaned up by our destructor, + // but we can clean it up earlier on successful subscription + // establishment. + mEstablishedHandler = nil; + } +} + +void MTRRoboticVacuumOperationalStateOperationalErrorStructAttributeCallbackBridge::OnSuccessFn( + void * context, const chip::app::Clusters::RoboticVacuumOperationalState::Structs::ErrorStateStruct::DecodableType & value) +{ + MTRRoboticVacuumOperationalStateClusterErrorStateStruct * _Nonnull objCValue; + objCValue = [MTRRoboticVacuumOperationalStateClusterErrorStateStruct new]; + objCValue.errorStateID = [NSNumber numberWithUnsignedChar:value.errorStateID]; + if (value.errorStateLabel.HasValue()) { + objCValue.errorStateLabel = AsString(value.errorStateLabel.Value()); + if (objCValue.errorStateLabel == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + OnFailureFn(context, err); + return; + } + } else { + objCValue.errorStateLabel = nil; + } + if (value.errorStateDetails.HasValue()) { + objCValue.errorStateDetails = AsString(value.errorStateDetails.Value()); + if (objCValue.errorStateDetails == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + OnFailureFn(context, err); + return; + } + } else { + objCValue.errorStateDetails = nil; + } + DispatchSuccess(context, objCValue); +}; + +void MTRRoboticVacuumOperationalStateOperationalErrorStructAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() +{ + if (!mQueue) { + return; + } + + if (mEstablishedHandler != nil) { + dispatch_async(mQueue, mEstablishedHandler); + // On failure, mEstablishedHandler will be cleaned up by our destructor, + // but we can clean it up earlier on successful subscription + // establishment. + mEstablishedHandler = nil; + } +} + +void MTRRoboticVacuumOperationalStateGeneratedCommandListListAttributeCallbackBridge::OnSuccessFn( + void * context, const chip::app::DataModel::DecodableList & value) +{ + NSArray * _Nonnull objCValue; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = value.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, err); + return; + } + objCValue = array_0; + } + DispatchSuccess(context, objCValue); +}; + +void MTRRoboticVacuumOperationalStateGeneratedCommandListListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() +{ + if (!mQueue) { + return; + } + + if (mEstablishedHandler != nil) { + dispatch_async(mQueue, mEstablishedHandler); + // On failure, mEstablishedHandler will be cleaned up by our destructor, + // but we can clean it up earlier on successful subscription + // establishment. + mEstablishedHandler = nil; + } +} + +void MTRRoboticVacuumOperationalStateAcceptedCommandListListAttributeCallbackBridge::OnSuccessFn( + void * context, const chip::app::DataModel::DecodableList & value) +{ + NSArray * _Nonnull objCValue; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = value.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, err); + return; + } + objCValue = array_0; + } + DispatchSuccess(context, objCValue); +}; + +void MTRRoboticVacuumOperationalStateAcceptedCommandListListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() +{ + if (!mQueue) { + return; + } + + if (mEstablishedHandler != nil) { + dispatch_async(mQueue, mEstablishedHandler); + // On failure, mEstablishedHandler will be cleaned up by our destructor, + // but we can clean it up earlier on successful subscription + // establishment. + mEstablishedHandler = nil; + } +} + +void MTRRoboticVacuumOperationalStateEventListListAttributeCallbackBridge::OnSuccessFn( + void * context, const chip::app::DataModel::DecodableList & value) +{ + NSArray * _Nonnull objCValue; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = value.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, err); + return; + } + objCValue = array_0; + } + DispatchSuccess(context, objCValue); +}; + +void MTRRoboticVacuumOperationalStateEventListListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() +{ + if (!mQueue) { + return; + } + + if (mEstablishedHandler != nil) { + dispatch_async(mQueue, mEstablishedHandler); + // On failure, mEstablishedHandler will be cleaned up by our destructor, + // but we can clean it up earlier on successful subscription + // establishment. + mEstablishedHandler = nil; + } +} + +void MTRRoboticVacuumOperationalStateAttributeListListAttributeCallbackBridge::OnSuccessFn( + void * context, const chip::app::DataModel::DecodableList & value) +{ + NSArray * _Nonnull objCValue; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = value.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, err); + return; + } + objCValue = array_0; + } + DispatchSuccess(context, objCValue); +}; + +void MTRRoboticVacuumOperationalStateAttributeListListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() +{ + if (!mQueue) { + return; + } + + if (mEstablishedHandler != nil) { + dispatch_async(mQueue, mEstablishedHandler); + // On failure, mEstablishedHandler will be cleaned up by our destructor, + // but we can clean it up earlier on successful subscription + // establishment. + mEstablishedHandler = nil; + } +} + void MTRHEPAFilterMonitoringGeneratedCommandListListAttributeCallbackBridge::OnSuccessFn( void * context, const chip::app::DataModel::DecodableList & value) { @@ -17409,6 +17744,18 @@ DispatchSuccess(context, response); }; +void MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseCallbackBridge::OnSuccessFn(void * context, + const chip::app::Clusters::RoboticVacuumOperationalState::Commands::OperationalCommandResponse::DecodableType & data) +{ + auto * response = [MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams new]; + CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, err); + return; + } + DispatchSuccess(context, response); +}; + void MTRDoorLockClusterGetWeekDayScheduleResponseCallbackBridge::OnSuccessFn( void * context, const chip::app::Clusters::DoorLock::Commands::GetWeekDayScheduleResponse::DecodableType & data) { @@ -21480,6 +21827,107 @@ } } +void MTRRoboticVacuumOperationalStateClusterErrorStateEnumAttributeCallbackBridge::OnSuccessFn( + void * context, chip::app::Clusters::RoboticVacuumOperationalState::ErrorStateEnum value) +{ + NSNumber * _Nonnull objCValue; + objCValue = [NSNumber numberWithUnsignedChar:chip::to_underlying(value)]; + DispatchSuccess(context, objCValue); +}; + +void MTRRoboticVacuumOperationalStateClusterErrorStateEnumAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() +{ + if (!mQueue) { + return; + } + + if (mEstablishedHandler != nil) { + dispatch_async(mQueue, mEstablishedHandler); + // On failure, mEstablishedHandler will be cleaned up by our destructor, + // but we can clean it up earlier on successful subscription + // establishment. + mEstablishedHandler = nil; + } +} + +void MTRNullableRoboticVacuumOperationalStateClusterErrorStateEnumAttributeCallbackBridge::OnSuccessFn(void * context, + const chip::app::DataModel::Nullable & value) +{ + NSNumber * _Nullable objCValue; + if (value.IsNull()) { + objCValue = nil; + } else { + objCValue = [NSNumber numberWithUnsignedChar:chip::to_underlying(value.Value())]; + } + DispatchSuccess(context, objCValue); +}; + +void MTRNullableRoboticVacuumOperationalStateClusterErrorStateEnumAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() +{ + if (!mQueue) { + return; + } + + if (mEstablishedHandler != nil) { + dispatch_async(mQueue, mEstablishedHandler); + // On failure, mEstablishedHandler will be cleaned up by our destructor, + // but we can clean it up earlier on successful subscription + // establishment. + mEstablishedHandler = nil; + } +} + +void MTRRoboticVacuumOperationalStateClusterOperationalStateEnumAttributeCallbackBridge::OnSuccessFn( + void * context, chip::app::Clusters::RoboticVacuumOperationalState::OperationalStateEnum value) +{ + NSNumber * _Nonnull objCValue; + objCValue = [NSNumber numberWithUnsignedChar:chip::to_underlying(value)]; + DispatchSuccess(context, objCValue); +}; + +void MTRRoboticVacuumOperationalStateClusterOperationalStateEnumAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() +{ + if (!mQueue) { + return; + } + + if (mEstablishedHandler != nil) { + dispatch_async(mQueue, mEstablishedHandler); + // On failure, mEstablishedHandler will be cleaned up by our destructor, + // but we can clean it up earlier on successful subscription + // establishment. + mEstablishedHandler = nil; + } +} + +void MTRNullableRoboticVacuumOperationalStateClusterOperationalStateEnumAttributeCallbackBridge::OnSuccessFn(void * context, + const chip::app::DataModel::Nullable & value) +{ + NSNumber * _Nullable objCValue; + if (value.IsNull()) { + objCValue = nil; + } else { + objCValue = [NSNumber numberWithUnsignedChar:chip::to_underlying(value.Value())]; + } + DispatchSuccess(context, objCValue); +}; + +void MTRNullableRoboticVacuumOperationalStateClusterOperationalStateEnumAttributeCallbackSubscriptionBridge:: + OnSubscriptionEstablished() +{ + if (!mQueue) { + return; + } + + if (mEstablishedHandler != nil) { + dispatch_async(mQueue, mEstablishedHandler); + // On failure, mEstablishedHandler will be cleaned up by our destructor, + // but we can clean it up earlier on successful subscription + // establishment. + mEstablishedHandler = nil; + } +} + void MTRHEPAFilterMonitoringClusterChangeIndicationEnumAttributeCallbackBridge::OnSuccessFn( void * context, chip::app::Clusters::HepaFilterMonitoring::ChangeIndicationEnum value) { diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h index 0e06ba47e07b3f..e92763b74e85bb 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h @@ -281,6 +281,7 @@ typedef NS_ENUM(uint32_t, MTRClusterIDType) { MTRClusterIDTypeAirQualityID MTR_NEWLY_AVAILABLE = 0x0000005B, MTRClusterIDTypeSmokeCOAlarmID MTR_NEWLY_AVAILABLE = 0x0000005C, MTRClusterIDTypeOperationalStateID MTR_NEWLY_AVAILABLE = 0x00000060, + MTRClusterIDTypeRoboticVacuumOperationalStateID MTR_NEWLY_AVAILABLE = 0x00000061, MTRClusterIDTypeHEPAFilterMonitoringID MTR_NEWLY_AVAILABLE = 0x00000071, MTRClusterIDTypeActivatedCarbonFilterMonitoringID MTR_NEWLY_AVAILABLE = 0x00000072, MTRClusterIDTypeDoorLockID API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x00000101, @@ -3825,6 +3826,26 @@ typedef NS_ENUM(uint32_t, MTRAttributeIDType) { MTRAttributeIDTypeClusterOperationalStateAttributeClusterRevisionID MTR_NEWLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeClusterRevisionID, + // Cluster RoboticVacuumOperationalState attributes + MTRAttributeIDTypeClusterRoboticVacuumOperationalStateAttributePhaseListID MTR_NEWLY_AVAILABLE = 0x00000000, + MTRAttributeIDTypeClusterRoboticVacuumOperationalStateAttributeCurrentPhaseID MTR_NEWLY_AVAILABLE = 0x00000001, + MTRAttributeIDTypeClusterRoboticVacuumOperationalStateAttributeCountdownTimeID MTR_NEWLY_AVAILABLE = 0x00000002, + MTRAttributeIDTypeClusterRoboticVacuumOperationalStateAttributeOperationalStateListID MTR_NEWLY_AVAILABLE = 0x00000003, + MTRAttributeIDTypeClusterRoboticVacuumOperationalStateAttributeOperationalStateID MTR_NEWLY_AVAILABLE = 0x00000004, + MTRAttributeIDTypeClusterRoboticVacuumOperationalStateAttributeOperationalErrorID MTR_NEWLY_AVAILABLE = 0x00000005, + MTRAttributeIDTypeClusterRoboticVacuumOperationalStateAttributeGeneratedCommandListID MTR_NEWLY_AVAILABLE + = MTRAttributeIDTypeGlobalAttributeGeneratedCommandListID, + MTRAttributeIDTypeClusterRoboticVacuumOperationalStateAttributeAcceptedCommandListID MTR_NEWLY_AVAILABLE + = MTRAttributeIDTypeGlobalAttributeAcceptedCommandListID, + MTRAttributeIDTypeClusterRoboticVacuumOperationalStateAttributeEventListID MTR_NEWLY_AVAILABLE + = MTRAttributeIDTypeGlobalAttributeEventListID, + MTRAttributeIDTypeClusterRoboticVacuumOperationalStateAttributeAttributeListID MTR_NEWLY_AVAILABLE + = MTRAttributeIDTypeGlobalAttributeAttributeListID, + MTRAttributeIDTypeClusterRoboticVacuumOperationalStateAttributeFeatureMapID MTR_NEWLY_AVAILABLE + = MTRAttributeIDTypeGlobalAttributeFeatureMapID, + MTRAttributeIDTypeClusterRoboticVacuumOperationalStateAttributeClusterRevisionID MTR_NEWLY_AVAILABLE + = MTRAttributeIDTypeGlobalAttributeClusterRevisionID, + // Cluster HEPAFilterMonitoring attributes MTRAttributeIDTypeClusterHEPAFilterMonitoringAttributeConditionID MTR_NEWLY_AVAILABLE = 0x00000000, MTRAttributeIDTypeClusterHEPAFilterMonitoringAttributeDegradationDirectionID MTR_NEWLY_AVAILABLE = 0x00000001, @@ -9276,6 +9297,13 @@ typedef NS_ENUM(uint32_t, MTRCommandIDType) { MTRCommandIDTypeClusterOperationalStateCommandResumeID MTR_NEWLY_AVAILABLE = 0x00000003, MTRCommandIDTypeClusterOperationalStateCommandOperationalCommandResponseID MTR_NEWLY_AVAILABLE = 0x00000004, + // Cluster RoboticVacuumOperationalState commands + MTRCommandIDTypeClusterRoboticVacuumOperationalStateCommandPauseID MTR_NEWLY_AVAILABLE = 0x00000000, + MTRCommandIDTypeClusterRoboticVacuumOperationalStateCommandStopID MTR_NEWLY_AVAILABLE = 0x00000001, + MTRCommandIDTypeClusterRoboticVacuumOperationalStateCommandStartID MTR_NEWLY_AVAILABLE = 0x00000002, + MTRCommandIDTypeClusterRoboticVacuumOperationalStateCommandResumeID MTR_NEWLY_AVAILABLE = 0x00000003, + MTRCommandIDTypeClusterRoboticVacuumOperationalStateCommandOperationalCommandResponseID MTR_NEWLY_AVAILABLE = 0x00000004, + // Cluster HEPAFilterMonitoring commands MTRCommandIDTypeClusterHEPAFilterMonitoringCommandResetConditionID MTR_NEWLY_AVAILABLE = 0x00000000, @@ -10425,6 +10453,10 @@ typedef NS_ENUM(uint32_t, MTREventIDType) { MTREventIDTypeClusterOperationalStateEventOperationalErrorID MTR_NEWLY_AVAILABLE = 0x00000000, MTREventIDTypeClusterOperationalStateEventOperationCompletionID MTR_NEWLY_AVAILABLE = 0x00000001, + // Cluster RoboticVacuumOperationalState events + MTREventIDTypeClusterRoboticVacuumOperationalStateEventOperationalErrorID MTR_NEWLY_AVAILABLE = 0x00000000, + MTREventIDTypeClusterRoboticVacuumOperationalStateEventOperationCompletionID MTR_NEWLY_AVAILABLE = 0x00000001, + // Cluster DoorLock deprecated event names MTRClusterDoorLockEventDoorLockAlarmID MTR_DEPRECATED("Please use MTREventIDTypeClusterDoorLockEventDoorLockAlarmID", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)) diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h index dcc4a1916f0fe1..5357cdde89d6b1 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h @@ -3056,6 +3056,83 @@ MTR_NEWLY_AVAILABLE @end +/** + * Cluster Robotic Vacuum Operational State + * This cluster supports remotely monitoring and, where supported, changing the operational state of a Robotic Vacuum. + */ +MTR_NEWLY_AVAILABLE +@interface MTRClusterRoboticVacuumOperationalState : MTRCluster + +- (instancetype _Nullable)initWithDevice:(MTRDevice *)device + endpointID:(NSNumber *)endpointID + queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER MTR_NEWLY_AVAILABLE; + +- (void)pauseWithParams:(MTRRoboticVacuumOperationalStateClusterPauseParams * _Nullable)params + expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries + expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs + completion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; +- (void)pauseWithExpectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; +- (void)stopWithParams:(MTRRoboticVacuumOperationalStateClusterStopParams * _Nullable)params + expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries + expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs + completion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; +- (void)stopWithExpectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; +- (void)startWithParams:(MTRRoboticVacuumOperationalStateClusterStartParams * _Nullable)params + expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries + expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs + completion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; +- (void)startWithExpectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; +- (void)resumeWithParams:(MTRRoboticVacuumOperationalStateClusterResumeParams * _Nullable)params + expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries + expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs + completion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; +- (void)resumeWithExpectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; + +- (NSDictionary *)readAttributePhaseListWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; + +- (NSDictionary *)readAttributeCurrentPhaseWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; + +- (NSDictionary *)readAttributeCountdownTimeWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; + +- (NSDictionary *)readAttributeOperationalStateListWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; + +- (NSDictionary *)readAttributeOperationalStateWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; + +- (NSDictionary *)readAttributeOperationalErrorWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; + +- (NSDictionary *)readAttributeEventListWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + /** * Cluster HEPA Filter Monitoring * Attributes and commands for monitoring HEPA filters in a device diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm index 2f1684e89b3480..006cc041f8adaa 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm @@ -13913,6 +13913,435 @@ - (void)resumeWithParams:(MTROperationalStateClusterResumeParams * _Nullable)par @end +@implementation MTRClusterRoboticVacuumOperationalState + +- (instancetype)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue +{ + if (self = [super initWithQueue:queue]) { + if (device == nil) { + return nil; + } + + _endpoint = [endpointID unsignedShortValue]; + _device = device; + } + return self; +} + +- (void)pauseWithExpectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion +{ + [self pauseWithParams:nil expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs completion:completion]; +} +- (void)pauseWithParams:(MTRRoboticVacuumOperationalStateClusterPauseParams * _Nullable)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion +{ + NSString * logPrefix = [NSString stringWithFormat:@"MTRDevice command %u %u %u %u", self.device.deviceController.fabricIndex, + _endpoint, (unsigned int) MTRClusterIDTypeRoboticVacuumOperationalStateID, + (unsigned int) MTRCommandIDTypeClusterRoboticVacuumOperationalStateCommandPauseID]; + // Make a copy of params before we go async. + params = [params copy]; + NSNumber * timedInvokeTimeoutMsParam = params.timedInvokeTimeoutMs; + if (timedInvokeTimeoutMsParam) { + timedInvokeTimeoutMsParam = MTRClampedNumber(timedInvokeTimeoutMsParam, @(1), @(UINT16_MAX)); + } + MTRAsyncCallbackQueueWorkItem * workItem = [[MTRAsyncCallbackQueueWorkItem alloc] initWithQueue:self.device.queue]; + MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { + MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID + controller:self.device.deviceController]; + auto * bridge = new MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseCallbackBridge( + self.device.queue, + ^(id _Nullable value, NSError * _Nullable error) { + MTRClustersLogCompletion(logPrefix, value, error); + dispatch_async(self.callbackQueue, ^{ + completion(value, error); + }); + [workItem endWork]; + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, + RoboticVacuumOperationalStateClusterOperationalCommandResponseCallbackType successCb, MTRErrorCallback failureCb, + MTRCallbackBridgeBase * bridge) { + auto * typedBridge + = static_cast(bridge); + Optional timedInvokeTimeoutMs; + Optional invokeTimeout; + ListFreer listFreer; + RoboticVacuumOperationalState::Commands::Pause::Type request; + if (timedInvokeTimeoutMsParam != nil) { + timedInvokeTimeoutMs.SetValue(timedInvokeTimeoutMsParam.unsignedShortValue); + } + if (params != nil) { + if (params.serverSideProcessingTimeout != nil) { + // Clamp to a number of seconds that will not overflow 32-bit + // int when converted to ms. + auto * serverSideProcessingTimeout + = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); + invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); + } + } + + return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, + self->_endpoint, timedInvokeTimeoutMs, invokeTimeout); + }); + std::move(*bridge).DispatchAction(baseDevice); + }; + workItem.readyHandler = readyHandler; + MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); + [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + + if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { + expectedValues = nil; + } else { + expectedValueIntervalMs = MTRClampedNumber(expectedValueIntervalMs, @(1), @(UINT32_MAX)); + } + if (expectedValues) { + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; + } +} + +- (void)stopWithExpectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion +{ + [self stopWithParams:nil expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs completion:completion]; +} +- (void)stopWithParams:(MTRRoboticVacuumOperationalStateClusterStopParams * _Nullable)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion +{ + NSString * logPrefix = [NSString stringWithFormat:@"MTRDevice command %u %u %u %u", self.device.deviceController.fabricIndex, + _endpoint, (unsigned int) MTRClusterIDTypeRoboticVacuumOperationalStateID, + (unsigned int) MTRCommandIDTypeClusterRoboticVacuumOperationalStateCommandStopID]; + // Make a copy of params before we go async. + params = [params copy]; + NSNumber * timedInvokeTimeoutMsParam = params.timedInvokeTimeoutMs; + if (timedInvokeTimeoutMsParam) { + timedInvokeTimeoutMsParam = MTRClampedNumber(timedInvokeTimeoutMsParam, @(1), @(UINT16_MAX)); + } + MTRAsyncCallbackQueueWorkItem * workItem = [[MTRAsyncCallbackQueueWorkItem alloc] initWithQueue:self.device.queue]; + MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { + MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID + controller:self.device.deviceController]; + auto * bridge = new MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseCallbackBridge( + self.device.queue, + ^(id _Nullable value, NSError * _Nullable error) { + MTRClustersLogCompletion(logPrefix, value, error); + dispatch_async(self.callbackQueue, ^{ + completion(value, error); + }); + [workItem endWork]; + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, + RoboticVacuumOperationalStateClusterOperationalCommandResponseCallbackType successCb, MTRErrorCallback failureCb, + MTRCallbackBridgeBase * bridge) { + auto * typedBridge + = static_cast(bridge); + Optional timedInvokeTimeoutMs; + Optional invokeTimeout; + ListFreer listFreer; + RoboticVacuumOperationalState::Commands::Stop::Type request; + if (timedInvokeTimeoutMsParam != nil) { + timedInvokeTimeoutMs.SetValue(timedInvokeTimeoutMsParam.unsignedShortValue); + } + if (params != nil) { + if (params.serverSideProcessingTimeout != nil) { + // Clamp to a number of seconds that will not overflow 32-bit + // int when converted to ms. + auto * serverSideProcessingTimeout + = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); + invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); + } + } + + return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, + self->_endpoint, timedInvokeTimeoutMs, invokeTimeout); + }); + std::move(*bridge).DispatchAction(baseDevice); + }; + workItem.readyHandler = readyHandler; + MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); + [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + + if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { + expectedValues = nil; + } else { + expectedValueIntervalMs = MTRClampedNumber(expectedValueIntervalMs, @(1), @(UINT32_MAX)); + } + if (expectedValues) { + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; + } +} + +- (void)startWithExpectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion +{ + [self startWithParams:nil expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs completion:completion]; +} +- (void)startWithParams:(MTRRoboticVacuumOperationalStateClusterStartParams * _Nullable)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion +{ + NSString * logPrefix = [NSString stringWithFormat:@"MTRDevice command %u %u %u %u", self.device.deviceController.fabricIndex, + _endpoint, (unsigned int) MTRClusterIDTypeRoboticVacuumOperationalStateID, + (unsigned int) MTRCommandIDTypeClusterRoboticVacuumOperationalStateCommandStartID]; + // Make a copy of params before we go async. + params = [params copy]; + NSNumber * timedInvokeTimeoutMsParam = params.timedInvokeTimeoutMs; + if (timedInvokeTimeoutMsParam) { + timedInvokeTimeoutMsParam = MTRClampedNumber(timedInvokeTimeoutMsParam, @(1), @(UINT16_MAX)); + } + MTRAsyncCallbackQueueWorkItem * workItem = [[MTRAsyncCallbackQueueWorkItem alloc] initWithQueue:self.device.queue]; + MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { + MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID + controller:self.device.deviceController]; + auto * bridge = new MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseCallbackBridge( + self.device.queue, + ^(id _Nullable value, NSError * _Nullable error) { + MTRClustersLogCompletion(logPrefix, value, error); + dispatch_async(self.callbackQueue, ^{ + completion(value, error); + }); + [workItem endWork]; + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, + RoboticVacuumOperationalStateClusterOperationalCommandResponseCallbackType successCb, MTRErrorCallback failureCb, + MTRCallbackBridgeBase * bridge) { + auto * typedBridge + = static_cast(bridge); + Optional timedInvokeTimeoutMs; + Optional invokeTimeout; + ListFreer listFreer; + RoboticVacuumOperationalState::Commands::Start::Type request; + if (timedInvokeTimeoutMsParam != nil) { + timedInvokeTimeoutMs.SetValue(timedInvokeTimeoutMsParam.unsignedShortValue); + } + if (params != nil) { + if (params.serverSideProcessingTimeout != nil) { + // Clamp to a number of seconds that will not overflow 32-bit + // int when converted to ms. + auto * serverSideProcessingTimeout + = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); + invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); + } + } + + return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, + self->_endpoint, timedInvokeTimeoutMs, invokeTimeout); + }); + std::move(*bridge).DispatchAction(baseDevice); + }; + workItem.readyHandler = readyHandler; + MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); + [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + + if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { + expectedValues = nil; + } else { + expectedValueIntervalMs = MTRClampedNumber(expectedValueIntervalMs, @(1), @(UINT32_MAX)); + } + if (expectedValues) { + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; + } +} + +- (void)resumeWithExpectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion +{ + [self resumeWithParams:nil expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs completion:completion]; +} +- (void)resumeWithParams:(MTRRoboticVacuumOperationalStateClusterResumeParams * _Nullable)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion +{ + NSString * logPrefix = [NSString stringWithFormat:@"MTRDevice command %u %u %u %u", self.device.deviceController.fabricIndex, + _endpoint, (unsigned int) MTRClusterIDTypeRoboticVacuumOperationalStateID, + (unsigned int) MTRCommandIDTypeClusterRoboticVacuumOperationalStateCommandResumeID]; + // Make a copy of params before we go async. + params = [params copy]; + NSNumber * timedInvokeTimeoutMsParam = params.timedInvokeTimeoutMs; + if (timedInvokeTimeoutMsParam) { + timedInvokeTimeoutMsParam = MTRClampedNumber(timedInvokeTimeoutMsParam, @(1), @(UINT16_MAX)); + } + MTRAsyncCallbackQueueWorkItem * workItem = [[MTRAsyncCallbackQueueWorkItem alloc] initWithQueue:self.device.queue]; + MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { + MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID + controller:self.device.deviceController]; + auto * bridge = new MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseCallbackBridge( + self.device.queue, + ^(id _Nullable value, NSError * _Nullable error) { + MTRClustersLogCompletion(logPrefix, value, error); + dispatch_async(self.callbackQueue, ^{ + completion(value, error); + }); + [workItem endWork]; + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, + RoboticVacuumOperationalStateClusterOperationalCommandResponseCallbackType successCb, MTRErrorCallback failureCb, + MTRCallbackBridgeBase * bridge) { + auto * typedBridge + = static_cast(bridge); + Optional timedInvokeTimeoutMs; + Optional invokeTimeout; + ListFreer listFreer; + RoboticVacuumOperationalState::Commands::Resume::Type request; + if (timedInvokeTimeoutMsParam != nil) { + timedInvokeTimeoutMs.SetValue(timedInvokeTimeoutMsParam.unsignedShortValue); + } + if (params != nil) { + if (params.serverSideProcessingTimeout != nil) { + // Clamp to a number of seconds that will not overflow 32-bit + // int when converted to ms. + auto * serverSideProcessingTimeout + = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); + invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); + } + } + + return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, + self->_endpoint, timedInvokeTimeoutMs, invokeTimeout); + }); + std::move(*bridge).DispatchAction(baseDevice); + }; + workItem.readyHandler = readyHandler; + MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); + [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + + if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { + expectedValues = nil; + } else { + expectedValueIntervalMs = MTRClampedNumber(expectedValueIntervalMs, @(1), @(UINT32_MAX)); + } + if (expectedValues) { + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; + } +} + +- (NSDictionary *)readAttributePhaseListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(_endpoint) + clusterID:@(MTRClusterIDTypeRoboticVacuumOperationalStateID) + attributeID:@(MTRAttributeIDTypeClusterRoboticVacuumOperationalStateAttributePhaseListID) + params:params]; +} + +- (NSDictionary *)readAttributeCurrentPhaseWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(_endpoint) + clusterID:@(MTRClusterIDTypeRoboticVacuumOperationalStateID) + attributeID:@(MTRAttributeIDTypeClusterRoboticVacuumOperationalStateAttributeCurrentPhaseID) + params:params]; +} + +- (NSDictionary *)readAttributeCountdownTimeWithParams:(MTRReadParams * _Nullable)params +{ + return + [self.device readAttributeWithEndpointID:@(_endpoint) + clusterID:@(MTRClusterIDTypeRoboticVacuumOperationalStateID) + attributeID:@(MTRAttributeIDTypeClusterRoboticVacuumOperationalStateAttributeCountdownTimeID) + params:params]; +} + +- (NSDictionary *)readAttributeOperationalStateListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device + readAttributeWithEndpointID:@(_endpoint) + clusterID:@(MTRClusterIDTypeRoboticVacuumOperationalStateID) + attributeID:@(MTRAttributeIDTypeClusterRoboticVacuumOperationalStateAttributeOperationalStateListID) + params:params]; +} + +- (NSDictionary *)readAttributeOperationalStateWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device + readAttributeWithEndpointID:@(_endpoint) + clusterID:@(MTRClusterIDTypeRoboticVacuumOperationalStateID) + attributeID:@(MTRAttributeIDTypeClusterRoboticVacuumOperationalStateAttributeOperationalStateID) + params:params]; +} + +- (NSDictionary *)readAttributeOperationalErrorWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device + readAttributeWithEndpointID:@(_endpoint) + clusterID:@(MTRClusterIDTypeRoboticVacuumOperationalStateID) + attributeID:@(MTRAttributeIDTypeClusterRoboticVacuumOperationalStateAttributeOperationalErrorID) + params:params]; +} + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device + readAttributeWithEndpointID:@(_endpoint) + clusterID:@(MTRClusterIDTypeRoboticVacuumOperationalStateID) + attributeID:@(MTRAttributeIDTypeClusterRoboticVacuumOperationalStateAttributeGeneratedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device + readAttributeWithEndpointID:@(_endpoint) + clusterID:@(MTRClusterIDTypeRoboticVacuumOperationalStateID) + attributeID:@(MTRAttributeIDTypeClusterRoboticVacuumOperationalStateAttributeAcceptedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeEventListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(_endpoint) + clusterID:@(MTRClusterIDTypeRoboticVacuumOperationalStateID) + attributeID:@(MTRAttributeIDTypeClusterRoboticVacuumOperationalStateAttributeEventListID) + params:params]; +} + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params +{ + return + [self.device readAttributeWithEndpointID:@(_endpoint) + clusterID:@(MTRClusterIDTypeRoboticVacuumOperationalStateID) + attributeID:@(MTRAttributeIDTypeClusterRoboticVacuumOperationalStateAttributeAttributeListID) + params:params]; +} + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(_endpoint) + clusterID:@(MTRClusterIDTypeRoboticVacuumOperationalStateID) + attributeID:@(MTRAttributeIDTypeClusterRoboticVacuumOperationalStateAttributeFeatureMapID) + params:params]; +} + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params +{ + return + [self.device readAttributeWithEndpointID:@(_endpoint) + clusterID:@(MTRClusterIDTypeRoboticVacuumOperationalStateID) + attributeID:@(MTRAttributeIDTypeClusterRoboticVacuumOperationalStateAttributeClusterRevisionID) + params:params]; +} + +@end + @implementation MTRClusterHEPAFilterMonitoring - (instancetype)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters_Internal.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusters_Internal.h index 8c738156db2ce6..129f5bdc5ad9fc 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters_Internal.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters_Internal.h @@ -226,6 +226,11 @@ @property (nonatomic, readonly) MTRDevice * device; @end +@interface MTRClusterRoboticVacuumOperationalState () +@property (nonatomic, readonly) uint16_t endpoint; +@property (nonatomic, readonly) MTRDevice * device; +@end + @interface MTRClusterHEPAFilterMonitoring () @property (nonatomic, readonly) uint16_t endpoint; @property (nonatomic, readonly) MTRDevice * device; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h index c8e9c13f87d418..0cb9be344b6023 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h @@ -4266,6 +4266,138 @@ MTR_NEWLY_AVAILABLE error:(NSError * __autoreleasing *)error MTR_NEWLY_AVAILABLE; @end +MTR_NEWLY_AVAILABLE +@interface MTRRoboticVacuumOperationalStateClusterPauseParams : NSObject +/** + * Controls whether the command is a timed command (using Timed Invoke). + * + * If nil (the default value), a regular invoke is done for commands that do + * not require a timed invoke and a timed invoke with some default timed request + * timeout is done for commands that require a timed invoke. + * + * If not nil, a timed invoke is done, with the provided value used as the timed + * request timeout. The value should be chosen small enough to provide the + * desired security properties but large enough that it will allow a round-trip + * from the sever to the client (for the status response and actual invoke + * request) within the timeout window. + * + */ +@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; + +/** + * Controls how much time, in seconds, we will allow for the server to process the command. + * + * The command will then time out if that much time, plus an allowance for retransmits due to network failures, passes. + * + * If nil, the framework will try to select an appropriate timeout value itself. + */ +@property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; +@end + +MTR_NEWLY_AVAILABLE +@interface MTRRoboticVacuumOperationalStateClusterStopParams : NSObject +/** + * Controls whether the command is a timed command (using Timed Invoke). + * + * If nil (the default value), a regular invoke is done for commands that do + * not require a timed invoke and a timed invoke with some default timed request + * timeout is done for commands that require a timed invoke. + * + * If not nil, a timed invoke is done, with the provided value used as the timed + * request timeout. The value should be chosen small enough to provide the + * desired security properties but large enough that it will allow a round-trip + * from the sever to the client (for the status response and actual invoke + * request) within the timeout window. + * + */ +@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; + +/** + * Controls how much time, in seconds, we will allow for the server to process the command. + * + * The command will then time out if that much time, plus an allowance for retransmits due to network failures, passes. + * + * If nil, the framework will try to select an appropriate timeout value itself. + */ +@property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; +@end + +MTR_NEWLY_AVAILABLE +@interface MTRRoboticVacuumOperationalStateClusterStartParams : NSObject +/** + * Controls whether the command is a timed command (using Timed Invoke). + * + * If nil (the default value), a regular invoke is done for commands that do + * not require a timed invoke and a timed invoke with some default timed request + * timeout is done for commands that require a timed invoke. + * + * If not nil, a timed invoke is done, with the provided value used as the timed + * request timeout. The value should be chosen small enough to provide the + * desired security properties but large enough that it will allow a round-trip + * from the sever to the client (for the status response and actual invoke + * request) within the timeout window. + * + */ +@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; + +/** + * Controls how much time, in seconds, we will allow for the server to process the command. + * + * The command will then time out if that much time, plus an allowance for retransmits due to network failures, passes. + * + * If nil, the framework will try to select an appropriate timeout value itself. + */ +@property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; +@end + +MTR_NEWLY_AVAILABLE +@interface MTRRoboticVacuumOperationalStateClusterResumeParams : NSObject +/** + * Controls whether the command is a timed command (using Timed Invoke). + * + * If nil (the default value), a regular invoke is done for commands that do + * not require a timed invoke and a timed invoke with some default timed request + * timeout is done for commands that require a timed invoke. + * + * If not nil, a timed invoke is done, with the provided value used as the timed + * request timeout. The value should be chosen small enough to provide the + * desired security properties but large enough that it will allow a round-trip + * from the sever to the client (for the status response and actual invoke + * request) within the timeout window. + * + */ +@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; + +/** + * Controls how much time, in seconds, we will allow for the server to process the command. + * + * The command will then time out if that much time, plus an allowance for retransmits due to network failures, passes. + * + * If nil, the framework will try to select an appropriate timeout value itself. + */ +@property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; +@end + +MTR_NEWLY_AVAILABLE +@interface MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams : NSObject + +@property (nonatomic, copy) + MTRRoboticVacuumOperationalStateClusterErrorStateStruct * _Nonnull commandResponseState MTR_NEWLY_AVAILABLE; + +/** + * Initialize an MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams with a response-value dictionary + * of the sort that MTRDeviceResponseHandler would receive. + * + * Will return nil and hand out an error if the response-value dictionary is not + * a command data response or is not the right command response. + * + * Will return nil and hand out an error if the data response does not match the known + * schema for this command. + */ +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error MTR_NEWLY_AVAILABLE; +@end + MTR_NEWLY_AVAILABLE @interface MTRHEPAFilterMonitoringClusterResetConditionParams : NSObject /** diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm index 2b97a1e5560931..d1d8bfd771ed4c 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm @@ -6691,15 +6691,222 @@ - (CHIP_ERROR)_setFieldsFromDecodableStruct: { self.commandResponseState = [MTROperationalStateClusterErrorStateStruct new]; self.commandResponseState.errorStateID = - [NSNumber numberWithUnsignedChar:chip::to_underlying(decodableStruct.commandResponseState.errorStateID)]; - if (decodableStruct.commandResponseState.errorStateLabel.IsNull()) { + [NSNumber numberWithUnsignedChar:decodableStruct.commandResponseState.errorStateID]; + if (decodableStruct.commandResponseState.errorStateLabel.HasValue()) { + self.commandResponseState.errorStateLabel = AsString(decodableStruct.commandResponseState.errorStateLabel.Value()); + if (self.commandResponseState.errorStateLabel == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + return err; + } + } else { self.commandResponseState.errorStateLabel = nil; + } + if (decodableStruct.commandResponseState.errorStateDetails.HasValue()) { + self.commandResponseState.errorStateDetails = AsString(decodableStruct.commandResponseState.errorStateDetails.Value()); + if (self.commandResponseState.errorStateDetails == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + return err; + } } else { + self.commandResponseState.errorStateDetails = nil; + } + } + return CHIP_NO_ERROR; +} +@end +@implementation MTRRoboticVacuumOperationalStateClusterPauseParams +- (instancetype)init +{ + if (self = [super init]) { + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRRoboticVacuumOperationalStateClusterPauseParams alloc] init]; + + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: >", NSStringFromClass([self class])]; + return descriptionString; +} + +@end +@implementation MTRRoboticVacuumOperationalStateClusterStopParams +- (instancetype)init +{ + if (self = [super init]) { + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRRoboticVacuumOperationalStateClusterStopParams alloc] init]; + + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: >", NSStringFromClass([self class])]; + return descriptionString; +} + +@end +@implementation MTRRoboticVacuumOperationalStateClusterStartParams +- (instancetype)init +{ + if (self = [super init]) { + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRRoboticVacuumOperationalStateClusterStartParams alloc] init]; + + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: >", NSStringFromClass([self class])]; + return descriptionString; +} + +@end +@implementation MTRRoboticVacuumOperationalStateClusterResumeParams +- (instancetype)init +{ + if (self = [super init]) { + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRRoboticVacuumOperationalStateClusterResumeParams alloc] init]; + + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: >", NSStringFromClass([self class])]; + return descriptionString; +} + +@end +@implementation MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams +- (instancetype)init +{ + if (self = [super init]) { + + _commandResponseState = [MTRRoboticVacuumOperationalStateClusterErrorStateStruct new]; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams alloc] init]; + + other.commandResponseState = self.commandResponseState; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = + [NSString stringWithFormat:@"<%@: commandResponseState:%@; >", NSStringFromClass([self class]), _commandResponseState]; + return descriptionString; +} + +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error +{ + if (!(self = [super init])) { + return nil; + } + + using DecodableType = chip::app::Clusters::RoboticVacuumOperationalState::Commands::OperationalCommandResponse::DecodableType; + chip::System::PacketBufferHandle buffer = [MTRBaseDevice _responseDataForCommand:responseValue + clusterID:DecodableType::GetClusterId() + commandID:DecodableType::GetCommandId() + error:error]; + if (buffer.IsNull()) { + return nil; + } + + chip::TLV::TLVReader reader; + reader.Init(buffer->Start(), buffer->DataLength()); + + CHIP_ERROR err = reader.Next(chip::TLV::AnonymousTag()); + if (err == CHIP_NO_ERROR) { + DecodableType decodedStruct; + err = chip::app::DataModel::Decode(reader, decodedStruct); + if (err == CHIP_NO_ERROR) { + err = [self _setFieldsFromDecodableStruct:decodedStruct]; + if (err == CHIP_NO_ERROR) { + return self; + } + } + } + + NSString * errorStr = [NSString stringWithFormat:@"Command payload decoding failed: %s", err.AsString()]; + MTR_LOG_ERROR("%s", errorStr.UTF8String); + if (error != nil) { + NSDictionary * userInfo = @{ NSLocalizedFailureReasonErrorKey : NSLocalizedString(errorStr, nil) }; + *error = [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeSchemaMismatch userInfo:userInfo]; + } + return nil; +} + +@end + +@implementation MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::RoboticVacuumOperationalState::Commands::OperationalCommandResponse::DecodableType &)decodableStruct +{ + { + self.commandResponseState = [MTRRoboticVacuumOperationalStateClusterErrorStateStruct new]; + self.commandResponseState.errorStateID = + [NSNumber numberWithUnsignedChar:decodableStruct.commandResponseState.errorStateID]; + if (decodableStruct.commandResponseState.errorStateLabel.HasValue()) { self.commandResponseState.errorStateLabel = AsString(decodableStruct.commandResponseState.errorStateLabel.Value()); if (self.commandResponseState.errorStateLabel == nil) { CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; return err; } + } else { + self.commandResponseState.errorStateLabel = nil; } if (decodableStruct.commandResponseState.errorStateDetails.HasValue()) { self.commandResponseState.errorStateDetails = AsString(decodableStruct.commandResponseState.errorStateDetails.Value()); diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h index 28f95b18ae822e..f7058c2accf769 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h @@ -224,6 +224,14 @@ NS_ASSUME_NONNULL_BEGIN @end +@interface MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::RoboticVacuumOperationalState::Commands::OperationalCommandResponse::DecodableType &) + decodableStruct; + +@end + @interface MTRDoorLockClusterGetWeekDayScheduleResponseParams (InternalMethods) - (CHIP_ERROR)_setFieldsFromDecodableStruct: diff --git a/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm index d02da1d9f29b48..28390e012b6421 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm @@ -1771,16 +1771,110 @@ static id _Nullable DecodeEventPayloadForOperationalStateCluster(EventId aEventI do { MTROperationalStateClusterErrorStateStruct * _Nonnull memberValue; memberValue = [MTROperationalStateClusterErrorStateStruct new]; - memberValue.errorStateID = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.errorState.errorStateID)]; - if (cppValue.errorState.errorStateLabel.IsNull()) { + memberValue.errorStateID = [NSNumber numberWithUnsignedChar:cppValue.errorState.errorStateID]; + if (cppValue.errorState.errorStateLabel.HasValue()) { + memberValue.errorStateLabel = AsString(cppValue.errorState.errorStateLabel.Value()); + if (memberValue.errorStateLabel == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + } else { memberValue.errorStateLabel = nil; + } + if (cppValue.errorState.errorStateDetails.HasValue()) { + memberValue.errorStateDetails = AsString(cppValue.errorState.errorStateDetails.Value()); + if (memberValue.errorStateDetails == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + } else { + memberValue.errorStateDetails = nil; + } + value.errorState = memberValue; + } while (0); + + return value; + } + case Events::OperationCompletion::Id: { + Events::OperationCompletion::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + + __auto_type * value = [MTROperationalStateClusterOperationCompletionEvent new]; + + do { + NSNumber * _Nonnull memberValue; + memberValue = [NSNumber numberWithUnsignedChar:cppValue.completionErrorCode]; + value.completionErrorCode = memberValue; + } while (0); + do { + NSNumber * _Nullable memberValue; + if (cppValue.totalOperationalTime.HasValue()) { + if (cppValue.totalOperationalTime.Value().IsNull()) { + memberValue = nil; + } else { + memberValue = [NSNumber numberWithUnsignedInt:cppValue.totalOperationalTime.Value().Value()]; + } } else { + memberValue = nil; + } + value.totalOperationalTime = memberValue; + } while (0); + do { + NSNumber * _Nullable memberValue; + if (cppValue.pausedTime.HasValue()) { + if (cppValue.pausedTime.Value().IsNull()) { + memberValue = nil; + } else { + memberValue = [NSNumber numberWithUnsignedInt:cppValue.pausedTime.Value().Value()]; + } + } else { + memberValue = nil; + } + value.pausedTime = memberValue; + } while (0); + + return value; + } + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; + return nil; +} +static id _Nullable DecodeEventPayloadForRoboticVacuumOperationalStateCluster( + EventId aEventId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::RoboticVacuumOperationalState; + switch (aEventId) { + case Events::OperationalError::Id: { + Events::OperationalError::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + + __auto_type * value = [MTRRoboticVacuumOperationalStateClusterOperationalErrorEvent new]; + + do { + MTRRoboticVacuumOperationalStateClusterErrorStateStruct * _Nonnull memberValue; + memberValue = [MTRRoboticVacuumOperationalStateClusterErrorStateStruct new]; + memberValue.errorStateID = [NSNumber numberWithUnsignedChar:cppValue.errorState.errorStateID]; + if (cppValue.errorState.errorStateLabel.HasValue()) { memberValue.errorStateLabel = AsString(cppValue.errorState.errorStateLabel.Value()); if (memberValue.errorStateLabel == nil) { CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; *aError = err; return nil; } + } else { + memberValue.errorStateLabel = nil; } if (cppValue.errorState.errorStateDetails.HasValue()) { memberValue.errorStateDetails = AsString(cppValue.errorState.errorStateDetails.Value()); @@ -1804,11 +1898,11 @@ static id _Nullable DecodeEventPayloadForOperationalStateCluster(EventId aEventI return nil; } - __auto_type * value = [MTROperationalStateClusterOperationCompletionEvent new]; + __auto_type * value = [MTRRoboticVacuumOperationalStateClusterOperationCompletionEvent new]; do { NSNumber * _Nonnull memberValue; - memberValue = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.completionErrorCode)]; + memberValue = [NSNumber numberWithUnsignedChar:cppValue.completionErrorCode]; value.completionErrorCode = memberValue; } while (0); do { @@ -3050,6 +3144,9 @@ id _Nullable MTRDecodeEventPayload(const ConcreteEventPath & aPath, TLV::TLVRead case Clusters::OperationalState::Id: { return DecodeEventPayloadForOperationalStateCluster(aPath.mEventId, aReader, aError); } + case Clusters::RoboticVacuumOperationalState::Id: { + return DecodeEventPayloadForRoboticVacuumOperationalStateCluster(aPath.mEventId, aReader, aError); + } case Clusters::HepaFilterMonitoring::Id: { return DecodeEventPayloadForHEPAFilterMonitoringCluster(aPath.mEventId, aReader, aError); } diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h index 2631ce6538c68c..df9df1aa8f266f 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h @@ -768,7 +768,7 @@ MTR_NEWLY_AVAILABLE MTR_NEWLY_AVAILABLE @interface MTROperationalStateClusterOperationalStateStruct : NSObject @property (nonatomic, copy) NSNumber * _Nonnull operationalStateID MTR_NEWLY_AVAILABLE; -@property (nonatomic, copy) NSString * _Nonnull operationalStateLabel MTR_NEWLY_AVAILABLE; +@property (nonatomic, copy) NSString * _Nullable operationalStateLabel MTR_NEWLY_AVAILABLE; @end MTR_NEWLY_AVAILABLE @@ -783,6 +783,31 @@ MTR_NEWLY_AVAILABLE @property (nonatomic, copy) NSNumber * _Nullable pausedTime MTR_NEWLY_AVAILABLE; @end +MTR_NEWLY_AVAILABLE +@interface MTRRoboticVacuumOperationalStateClusterErrorStateStruct : NSObject +@property (nonatomic, copy) NSNumber * _Nonnull errorStateID MTR_NEWLY_AVAILABLE; +@property (nonatomic, copy) NSString * _Nullable errorStateLabel MTR_NEWLY_AVAILABLE; +@property (nonatomic, copy) NSString * _Nullable errorStateDetails MTR_NEWLY_AVAILABLE; +@end + +MTR_NEWLY_AVAILABLE +@interface MTRRoboticVacuumOperationalStateClusterOperationalStateStruct : NSObject +@property (nonatomic, copy) NSNumber * _Nonnull operationalStateID MTR_NEWLY_AVAILABLE; +@property (nonatomic, copy) NSString * _Nullable operationalStateLabel MTR_NEWLY_AVAILABLE; +@end + +MTR_NEWLY_AVAILABLE +@interface MTRRoboticVacuumOperationalStateClusterOperationalErrorEvent : NSObject +@property (nonatomic, copy) MTRRoboticVacuumOperationalStateClusterErrorStateStruct * _Nonnull errorState MTR_NEWLY_AVAILABLE; +@end + +MTR_NEWLY_AVAILABLE +@interface MTRRoboticVacuumOperationalStateClusterOperationCompletionEvent : NSObject +@property (nonatomic, copy) NSNumber * _Nonnull completionErrorCode MTR_NEWLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable totalOperationalTime MTR_NEWLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable pausedTime MTR_NEWLY_AVAILABLE; +@end + API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) @interface MTRDoorLockClusterCredentialStruct : NSObject @property (nonatomic, copy) NSNumber * _Nonnull credentialType API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm index 1cc982890290bd..49c260685ea8d8 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm @@ -3027,7 +3027,7 @@ - (instancetype)init _operationalStateID = @(0); - _operationalStateLabel = @""; + _operationalStateLabel = nil; } return self; } @@ -3114,6 +3114,134 @@ - (NSString *)description @end +@implementation MTRRoboticVacuumOperationalStateClusterErrorStateStruct +- (instancetype)init +{ + if (self = [super init]) { + + _errorStateID = @(0); + + _errorStateLabel = nil; + + _errorStateDetails = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRRoboticVacuumOperationalStateClusterErrorStateStruct alloc] init]; + + other.errorStateID = self.errorStateID; + other.errorStateLabel = self.errorStateLabel; + other.errorStateDetails = self.errorStateDetails; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: errorStateID:%@; errorStateLabel:%@; errorStateDetails:%@; >", + NSStringFromClass([self class]), _errorStateID, _errorStateLabel, _errorStateDetails]; + return descriptionString; +} + +@end + +@implementation MTRRoboticVacuumOperationalStateClusterOperationalStateStruct +- (instancetype)init +{ + if (self = [super init]) { + + _operationalStateID = @(0); + + _operationalStateLabel = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRRoboticVacuumOperationalStateClusterOperationalStateStruct alloc] init]; + + other.operationalStateID = self.operationalStateID; + other.operationalStateLabel = self.operationalStateLabel; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: operationalStateID:%@; operationalStateLabel:%@; >", + NSStringFromClass([self class]), _operationalStateID, _operationalStateLabel]; + return descriptionString; +} + +@end + +@implementation MTRRoboticVacuumOperationalStateClusterOperationalErrorEvent +- (instancetype)init +{ + if (self = [super init]) { + + _errorState = [MTRRoboticVacuumOperationalStateClusterErrorStateStruct new]; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRRoboticVacuumOperationalStateClusterOperationalErrorEvent alloc] init]; + + other.errorState = self.errorState; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = + [NSString stringWithFormat:@"<%@: errorState:%@; >", NSStringFromClass([self class]), _errorState]; + return descriptionString; +} + +@end + +@implementation MTRRoboticVacuumOperationalStateClusterOperationCompletionEvent +- (instancetype)init +{ + if (self = [super init]) { + + _completionErrorCode = @(0); + + _totalOperationalTime = nil; + + _pausedTime = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRRoboticVacuumOperationalStateClusterOperationCompletionEvent alloc] init]; + + other.completionErrorCode = self.completionErrorCode; + other.totalOperationalTime = self.totalOperationalTime; + other.pausedTime = self.pausedTime; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = + [NSString stringWithFormat:@"<%@: completionErrorCode:%@; totalOperationalTime:%@; pausedTime:%@; >", + NSStringFromClass([self class]), _completionErrorCode, _totalOperationalTime, _pausedTime]; + return descriptionString; +} + +@end + @implementation MTRDoorLockClusterCredentialStruct - (instancetype)init { diff --git a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp index 7d95541b504db2..25de60374eea9f 100644 --- a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp +++ b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp @@ -9699,6 +9699,180 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) } // namespace Attributes } // namespace OperationalState +namespace RoboticVacuumOperationalState { +namespace Attributes { + +namespace CurrentPhase { + +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::RoboticVacuumOperationalState::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (Traits::IsNullValue(temp)) + { + value.SetNull(); + } + else + { + value.SetNonNull() = Traits::StorageToWorking(temp); + } + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::RoboticVacuumOperationalState::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); +} + +EmberAfStatus SetNull(chip::EndpointId endpoint) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); + return emberAfWriteAttribute(endpoint, Clusters::RoboticVacuumOperationalState::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); +} + +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) +{ + if (value.IsNull()) + { + return SetNull(endpoint); + } + + return Set(endpoint, value.Value()); +} + +} // namespace CurrentPhase + +namespace CountdownTime { + +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::RoboticVacuumOperationalState::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (Traits::IsNullValue(temp)) + { + value.SetNull(); + } + else + { + value.SetNonNull() = Traits::StorageToWorking(temp); + } + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::RoboticVacuumOperationalState::Id, Id, writable, ZCL_ELAPSED_S_ATTRIBUTE_TYPE); +} + +EmberAfStatus SetNull(chip::EndpointId endpoint) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); + return emberAfWriteAttribute(endpoint, Clusters::RoboticVacuumOperationalState::Id, Id, writable, ZCL_ELAPSED_S_ATTRIBUTE_TYPE); +} + +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) +{ + if (value.IsNull()) + { + return SetNull(endpoint); + } + + return Set(endpoint, value.Value()); +} + +} // namespace CountdownTime + +namespace FeatureMap { + +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::RoboticVacuumOperationalState::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + *value = Traits::StorageToWorking(temp); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::RoboticVacuumOperationalState::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); +} + +} // namespace FeatureMap + +namespace ClusterRevision { + +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::RoboticVacuumOperationalState::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + *value = Traits::StorageToWorking(temp); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::RoboticVacuumOperationalState::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); +} + +} // namespace ClusterRevision + +} // namespace Attributes +} // namespace RoboticVacuumOperationalState + namespace HepaFilterMonitoring { namespace Attributes { diff --git a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h index 43bbc64c943f50..cb4e413dc21d55 100644 --- a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h +++ b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h @@ -1812,6 +1812,36 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace Attributes } // namespace OperationalState +namespace RoboticVacuumOperationalState { +namespace Attributes { + +namespace CurrentPhase { +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); +EmberAfStatus SetNull(chip::EndpointId endpoint); +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); +} // namespace CurrentPhase + +namespace CountdownTime { +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // elapsed_s +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); +EmberAfStatus SetNull(chip::EndpointId endpoint); +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); +} // namespace CountdownTime + +namespace FeatureMap { +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // bitmap32 +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); +} // namespace FeatureMap + +namespace ClusterRevision { +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); +} // namespace ClusterRevision + +} // namespace Attributes +} // namespace RoboticVacuumOperationalState + namespace HepaFilterMonitoring { namespace Attributes { diff --git a/zzz_generated/app-common/app-common/zap-generated/callback.h b/zzz_generated/app-common/app-common/zap-generated/callback.h index 5df828f260f298..6fbefcb1aca444 100644 --- a/zzz_generated/app-common/app-common/zap-generated/callback.h +++ b/zzz_generated/app-common/app-common/zap-generated/callback.h @@ -457,6 +457,14 @@ void emberAfSmokeCoAlarmClusterInitCallback(chip::EndpointId endpoint); */ void emberAfOperationalStateClusterInitCallback(chip::EndpointId endpoint); +/** @brief Robotic Vacuum Operational State Cluster Init + * + * Cluster Init + * + * @param endpoint Endpoint that is being initialized + */ +void emberAfRoboticVacuumOperationalStateClusterInitCallback(chip::EndpointId endpoint); + /** @brief HEPA Filter Monitoring Cluster Init * * Cluster Init @@ -5171,6 +5179,83 @@ void emberAfOperationalStateClusterServerTickCallback(chip::EndpointId endpoint) */ void emberAfOperationalStateClusterClientTickCallback(chip::EndpointId endpoint); +// +// Robotic Vacuum Operational State Cluster +// + +/** @brief Robotic Vacuum Operational State Cluster Server Init + * + * Server Init + * + * @param endpoint Endpoint that is being initialized + */ +void emberAfRoboticVacuumOperationalStateClusterServerInitCallback(chip::EndpointId endpoint); + +/** @brief Robotic Vacuum Operational State Cluster Server Shutdown + * + * Server Shutdown + * + * @param endpoint Endpoint that is being shutdown + */ +void MatterRoboticVacuumOperationalStateClusterServerShutdownCallback(chip::EndpointId endpoint); + +/** @brief Robotic Vacuum Operational State Cluster Client Init + * + * Client Init + * + * @param endpoint Endpoint that is being initialized + */ +void emberAfRoboticVacuumOperationalStateClusterClientInitCallback(chip::EndpointId endpoint); + +/** @brief Robotic Vacuum Operational State Cluster Server Attribute Changed + * + * Server Attribute Changed + * + * @param attributePath Concrete attribute path that changed + */ +void MatterRoboticVacuumOperationalStateClusterServerAttributeChangedCallback( + const chip::app::ConcreteAttributePath & attributePath); + +/** @brief Robotic Vacuum Operational State Cluster Server Pre Attribute Changed + * + * Server Pre Attribute Changed + * + * @param attributePath Concrete attribute path to be changed + * @param attributeType Attribute type + * @param size Attribute size + * @param value Attribute value + */ +chip::Protocols::InteractionModel::Status MatterRoboticVacuumOperationalStateClusterServerPreAttributeChangedCallback( + const chip::app::ConcreteAttributePath & attributePath, EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); + +/** @brief Robotic Vacuum Operational State Cluster Client Pre Attribute Changed + * + * Client Pre Attribute Changed + * + * @param attributePath Concrete attribute path to be changed + * @param attributeType Attribute type + * @param size Attribute size + * @param value Attribute value + */ +chip::Protocols::InteractionModel::Status MatterRoboticVacuumOperationalStateClusterClientPreAttributeChangedCallback( + const chip::app::ConcreteAttributePath & attributePath, EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); + +/** @brief Robotic Vacuum Operational State Cluster Server Tick + * + * Server Tick + * + * @param endpoint Endpoint that is being served + */ +void emberAfRoboticVacuumOperationalStateClusterServerTickCallback(chip::EndpointId endpoint); + +/** @brief Robotic Vacuum Operational State Cluster Client Tick + * + * Client Tick + * + * @param endpoint Endpoint that is being served + */ +void emberAfRoboticVacuumOperationalStateClusterClientTickCallback(chip::EndpointId endpoint); + // // HEPA Filter Monitoring Cluster // @@ -11730,6 +11815,30 @@ bool emberAfOperationalStateClusterStartCallback( bool emberAfOperationalStateClusterResumeCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, const chip::app::Clusters::OperationalState::Commands::Resume::DecodableType & commandData); +/** + * @brief Robotic Vacuum Operational State Cluster Pause Command callback (from client) + */ +bool emberAfRoboticVacuumOperationalStateClusterPauseCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::RoboticVacuumOperationalState::Commands::Pause::DecodableType & commandData); +/** + * @brief Robotic Vacuum Operational State Cluster Stop Command callback (from client) + */ +bool emberAfRoboticVacuumOperationalStateClusterStopCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::RoboticVacuumOperationalState::Commands::Stop::DecodableType & commandData); +/** + * @brief Robotic Vacuum Operational State Cluster Start Command callback (from client) + */ +bool emberAfRoboticVacuumOperationalStateClusterStartCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::RoboticVacuumOperationalState::Commands::Start::DecodableType & commandData); +/** + * @brief Robotic Vacuum Operational State Cluster Resume Command callback (from client) + */ +bool emberAfRoboticVacuumOperationalStateClusterResumeCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::RoboticVacuumOperationalState::Commands::Resume::DecodableType & commandData); /** * @brief HEPA Filter Monitoring Cluster ResetCondition Command callback (from client) */ diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-enums-check.h b/zzz_generated/app-common/app-common/zap-generated/cluster-enums-check.h index 843538b9e1e2a3..df5387fba26364 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-enums-check.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-enums-check.h @@ -1500,6 +1500,38 @@ static auto __attribute__((unused)) EnsureKnownEnumValue(OperationalState::Opera } } +static auto __attribute__((unused)) EnsureKnownEnumValue(RoboticVacuumOperationalState::ErrorStateEnum val) +{ + using EnumType = RoboticVacuumOperationalState::ErrorStateEnum; + switch (val) + { + case EnumType::kFailedToFindChargingDock: + case EnumType::kStuck: + case EnumType::kDustBinMissing: + case EnumType::kDustBinFull: + case EnumType::kWaterTankEmpty: + case EnumType::kWaterTankMissing: + case EnumType::kWaterTankLidOpen: + case EnumType::kMopCleaningPadMissing: + return val; + default: + return static_cast(0); + } +} +static auto __attribute__((unused)) EnsureKnownEnumValue(RoboticVacuumOperationalState::OperationalStateEnum val) +{ + using EnumType = RoboticVacuumOperationalState::OperationalStateEnum; + switch (val) + { + case EnumType::kSeekingCharger: + case EnumType::kCharging: + case EnumType::kDocked: + return val; + default: + return static_cast(0); + } +} + static auto __attribute__((unused)) EnsureKnownEnumValue(HepaFilterMonitoring::ChangeIndicationEnum val) { using EnumType = HepaFilterMonitoring::ChangeIndicationEnum; diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h b/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h index 0d755baec83fee..75ef76a7a7ba03 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h @@ -1835,6 +1835,40 @@ enum class OperationalStateEnum : uint8_t }; } // namespace OperationalState +namespace RoboticVacuumOperationalState { + +// Enum for ErrorStateEnum +enum class ErrorStateEnum : uint8_t +{ + kFailedToFindChargingDock = 0x40, + kStuck = 0x41, + kDustBinMissing = 0x42, + kDustBinFull = 0x43, + kWaterTankEmpty = 0x44, + kWaterTankMissing = 0x45, + kWaterTankLidOpen = 0x46, + kMopCleaningPadMissing = 0x47, + // All received enum values that are not listed above will be mapped + // to kUnknownEnumValue. This is a helper enum value that should only + // be used by code to process how it handles receiving and unknown + // enum value. This specific should never be transmitted. + kUnknownEnumValue = 0, +}; + +// Enum for OperationalStateEnum +enum class OperationalStateEnum : uint8_t +{ + kSeekingCharger = 0x40, + kCharging = 0x41, + kDocked = 0x42, + // All received enum values that are not listed above will be mapped + // to kUnknownEnumValue. This is a helper enum value that should only + // be used by code to process how it handles receiving and unknown + // enum value. This specific should never be transmitted. + kUnknownEnumValue = 0, +}; +} // namespace RoboticVacuumOperationalState + namespace HepaFilterMonitoring { // Enum for ChangeIndicationEnum diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp index ffc13c37e3fe2a..fdc1b4ebd4b475 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp @@ -166,6 +166,54 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) } } // namespace ApplicationStruct +namespace ErrorStateStruct { +CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const +{ + TLV::TLVType outer; + ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kErrorStateID), errorStateID)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kErrorStateLabel), errorStateLabel)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kErrorStateDetails), errorStateDetails)); + ReturnErrorOnFailure(writer.EndContainer(outer)); + return CHIP_NO_ERROR; +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVType outer; + VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); + err = reader.EnterContainer(outer); + ReturnErrorOnFailure(err); + while ((err = reader.Next()) == CHIP_NO_ERROR) + { + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } + switch (TLV::TagNumFromTag(reader.GetTag())) + { + case to_underlying(Fields::kErrorStateID): + ReturnErrorOnFailure(DataModel::Decode(reader, errorStateID)); + break; + case to_underlying(Fields::kErrorStateLabel): + ReturnErrorOnFailure(DataModel::Decode(reader, errorStateLabel)); + break; + case to_underlying(Fields::kErrorStateDetails): + ReturnErrorOnFailure(DataModel::Decode(reader, errorStateDetails)); + break; + default: + break; + } + } + + VerifyOrReturnError(err == CHIP_END_OF_TLV, err); + ReturnErrorOnFailure(reader.ExitContainer(outer)); + + return CHIP_NO_ERROR; +} + +} // namespace ErrorStateStruct namespace LabelStruct { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { @@ -210,6 +258,50 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) } } // namespace LabelStruct +namespace OperationalStateStruct { +CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const +{ + TLV::TLVType outer; + ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kOperationalStateID), operationalStateID)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kOperationalStateLabel), operationalStateLabel)); + ReturnErrorOnFailure(writer.EndContainer(outer)); + return CHIP_NO_ERROR; +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVType outer; + VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); + err = reader.EnterContainer(outer); + ReturnErrorOnFailure(err); + while ((err = reader.Next()) == CHIP_NO_ERROR) + { + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } + switch (TLV::TagNumFromTag(reader.GetTag())) + { + case to_underlying(Fields::kOperationalStateID): + ReturnErrorOnFailure(DataModel::Decode(reader, operationalStateID)); + break; + case to_underlying(Fields::kOperationalStateLabel): + ReturnErrorOnFailure(DataModel::Decode(reader, operationalStateLabel)); + break; + default: + break; + } + } + + VerifyOrReturnError(err == CHIP_END_OF_TLV, err); + ReturnErrorOnFailure(reader.ExitContainer(outer)); + + return CHIP_NO_ERROR; +} + +} // namespace OperationalStateStruct } // namespace Structs } // namespace detail @@ -13113,15 +13205,14 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) } // namespace SmokeCoAlarm namespace OperationalState { -namespace Structs { -namespace ErrorStateStruct { +namespace Structs {} // namespace Structs + +namespace Commands { +namespace Pause { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kErrorStateID), errorStateID)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kErrorStateLabel), errorStateLabel)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kErrorStateDetails), errorStateDetails)); ReturnErrorOnFailure(writer.EndContainer(outer)); return CHIP_NO_ERROR; } @@ -13131,8 +13222,7 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVType outer; VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); - err = reader.EnterContainer(outer); - ReturnErrorOnFailure(err); + ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { if (!TLV::IsContextTag(reader.GetTag())) @@ -13141,15 +13231,105 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) } switch (TLV::TagNumFromTag(reader.GetTag())) { - case to_underlying(Fields::kErrorStateID): - ReturnErrorOnFailure(DataModel::Decode(reader, errorStateID)); + default: break; - case to_underlying(Fields::kErrorStateLabel): - ReturnErrorOnFailure(DataModel::Decode(reader, errorStateLabel)); + } + } + + VerifyOrReturnError(err == CHIP_END_OF_TLV, err); + ReturnErrorOnFailure(reader.ExitContainer(outer)); + return CHIP_NO_ERROR; +} +} // namespace Pause. +namespace Stop { +CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const +{ + TLV::TLVType outer; + ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(writer.EndContainer(outer)); + return CHIP_NO_ERROR; +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVType outer; + VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); + ReturnErrorOnFailure(reader.EnterContainer(outer)); + while ((err = reader.Next()) == CHIP_NO_ERROR) + { + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } + switch (TLV::TagNumFromTag(reader.GetTag())) + { + default: break; - case to_underlying(Fields::kErrorStateDetails): - ReturnErrorOnFailure(DataModel::Decode(reader, errorStateDetails)); + } + } + + VerifyOrReturnError(err == CHIP_END_OF_TLV, err); + ReturnErrorOnFailure(reader.ExitContainer(outer)); + return CHIP_NO_ERROR; +} +} // namespace Stop. +namespace Start { +CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const +{ + TLV::TLVType outer; + ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(writer.EndContainer(outer)); + return CHIP_NO_ERROR; +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVType outer; + VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); + ReturnErrorOnFailure(reader.EnterContainer(outer)); + while ((err = reader.Next()) == CHIP_NO_ERROR) + { + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } + switch (TLV::TagNumFromTag(reader.GetTag())) + { + default: break; + } + } + + VerifyOrReturnError(err == CHIP_END_OF_TLV, err); + ReturnErrorOnFailure(reader.ExitContainer(outer)); + return CHIP_NO_ERROR; +} +} // namespace Start. +namespace Resume { +CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const +{ + TLV::TLVType outer; + ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(writer.EndContainer(outer)); + return CHIP_NO_ERROR; +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVType outer; + VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); + ReturnErrorOnFailure(reader.EnterContainer(outer)); + while ((err = reader.Next()) == CHIP_NO_ERROR) + { + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } + switch (TLV::TagNumFromTag(reader.GetTag())) + { default: break; } @@ -13157,18 +13337,104 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) VerifyOrReturnError(err == CHIP_END_OF_TLV, err); ReturnErrorOnFailure(reader.ExitContainer(outer)); + return CHIP_NO_ERROR; +} +} // namespace Resume. +namespace OperationalCommandResponse { +CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const +{ + TLV::TLVType outer; + ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kCommandResponseState), commandResponseState)); + ReturnErrorOnFailure(writer.EndContainer(outer)); + return CHIP_NO_ERROR; +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVType outer; + VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); + ReturnErrorOnFailure(reader.EnterContainer(outer)); + while ((err = reader.Next()) == CHIP_NO_ERROR) + { + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } + switch (TLV::TagNumFromTag(reader.GetTag())) + { + case to_underlying(Fields::kCommandResponseState): + ReturnErrorOnFailure(DataModel::Decode(reader, commandResponseState)); + break; + default: + break; + } + } + VerifyOrReturnError(err == CHIP_END_OF_TLV, err); + ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } +} // namespace OperationalCommandResponse. +} // namespace Commands -} // namespace ErrorStateStruct -namespace OperationalStateStruct { +namespace Attributes { +CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path) +{ + switch (path.mAttributeId) + { + case Attributes::PhaseList::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, phaseList)); + break; + case Attributes::CurrentPhase::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, currentPhase)); + break; + case Attributes::CountdownTime::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, countdownTime)); + break; + case Attributes::OperationalStateList::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, operationalStateList)); + break; + case Attributes::OperationalState::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, operationalState)); + break; + case Attributes::OperationalError::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, operationalError)); + break; + case Attributes::GeneratedCommandList::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, generatedCommandList)); + break; + case Attributes::AcceptedCommandList::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, acceptedCommandList)); + break; + case Attributes::EventList::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, eventList)); + break; + case Attributes::AttributeList::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, attributeList)); + break; + case Attributes::FeatureMap::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, featureMap)); + break; + case Attributes::ClusterRevision::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, clusterRevision)); + break; + default: + break; + } + + return CHIP_NO_ERROR; +} +} // namespace Attributes + +namespace Events { +namespace OperationalError { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kOperationalStateID), operationalStateID)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kOperationalStateLabel), operationalStateLabel)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kErrorState), errorState)); ReturnErrorOnFailure(writer.EndContainer(outer)); return CHIP_NO_ERROR; } @@ -13178,8 +13444,7 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVType outer; VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); - err = reader.EnterContainer(outer); - ReturnErrorOnFailure(err); + ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { if (!TLV::IsContextTag(reader.GetTag())) @@ -13188,11 +13453,8 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) } switch (TLV::TagNumFromTag(reader.GetTag())) { - case to_underlying(Fields::kOperationalStateID): - ReturnErrorOnFailure(DataModel::Decode(reader, operationalStateID)); - break; - case to_underlying(Fields::kOperationalStateLabel): - ReturnErrorOnFailure(DataModel::Decode(reader, operationalStateLabel)); + case to_underlying(Fields::kErrorState): + ReturnErrorOnFailure(DataModel::Decode(reader, errorState)); break; default: break; @@ -13201,12 +13463,59 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) VerifyOrReturnError(err == CHIP_END_OF_TLV, err); ReturnErrorOnFailure(reader.ExitContainer(outer)); + return CHIP_NO_ERROR; +} +} // namespace OperationalError. +namespace OperationCompletion { +CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const +{ + TLV::TLVType outer; + ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kCompletionErrorCode), completionErrorCode)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kTotalOperationalTime), totalOperationalTime)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kPausedTime), pausedTime)); + ReturnErrorOnFailure(writer.EndContainer(outer)); + return CHIP_NO_ERROR; +} +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVType outer; + VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); + ReturnErrorOnFailure(reader.EnterContainer(outer)); + while ((err = reader.Next()) == CHIP_NO_ERROR) + { + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } + switch (TLV::TagNumFromTag(reader.GetTag())) + { + case to_underlying(Fields::kCompletionErrorCode): + ReturnErrorOnFailure(DataModel::Decode(reader, completionErrorCode)); + break; + case to_underlying(Fields::kTotalOperationalTime): + ReturnErrorOnFailure(DataModel::Decode(reader, totalOperationalTime)); + break; + case to_underlying(Fields::kPausedTime): + ReturnErrorOnFailure(DataModel::Decode(reader, pausedTime)); + break; + default: + break; + } + } + + VerifyOrReturnError(err == CHIP_END_OF_TLV, err); + ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } +} // namespace OperationCompletion. +} // namespace Events -} // namespace OperationalStateStruct -} // namespace Structs +} // namespace OperationalState +namespace RoboticVacuumOperationalState { +namespace Structs {} // namespace Structs namespace Commands { namespace Pause { @@ -13514,7 +13823,7 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) } // namespace OperationCompletion. } // namespace Events -} // namespace OperationalState +} // namespace RoboticVacuumOperationalState namespace HepaFilterMonitoring { namespace Commands { @@ -28080,6 +28389,13 @@ bool CommandIsFabricScoped(ClusterId aCluster, CommandId aCommand) return false; } } + case Clusters::RoboticVacuumOperationalState::Id: { + switch (aCommand) + { + default: + return false; + } + } case Clusters::HepaFilterMonitoring::Id: { switch (aCommand) { diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h index 3dd2881b9049c1..502e4e9063aaaa 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h @@ -124,6 +124,31 @@ struct Type using DecodableType = Type; } // namespace ApplicationStruct +namespace ErrorStateStruct { +enum class Fields : uint8_t +{ + kErrorStateID = 0, + kErrorStateLabel = 1, + kErrorStateDetails = 2, +}; + +struct Type +{ +public: + uint8_t errorStateID = static_cast(0); + Optional errorStateLabel; + Optional errorStateDetails; + + CHIP_ERROR Decode(TLV::TLVReader & reader); + + static constexpr bool kIsFabricScoped = false; + + CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; +}; + +using DecodableType = Type; + +} // namespace ErrorStateStruct namespace LabelStruct { enum class Fields : uint8_t { @@ -147,6 +172,29 @@ struct Type using DecodableType = Type; } // namespace LabelStruct +namespace OperationalStateStruct { +enum class Fields : uint8_t +{ + kOperationalStateID = 0, + kOperationalStateLabel = 1, +}; + +struct Type +{ +public: + uint8_t operationalStateID = static_cast(0); + Optional operationalStateLabel; + + CHIP_ERROR Decode(TLV::TLVReader & reader); + + static constexpr bool kIsFabricScoped = false; + + CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; +}; + +using DecodableType = Type; + +} // namespace OperationalStateStruct } // namespace Structs } // namespace detail @@ -16635,54 +16683,8 @@ struct DecodableType } // namespace SmokeCoAlarm namespace OperationalState { namespace Structs { -namespace ErrorStateStruct { -enum class Fields : uint8_t -{ - kErrorStateID = 0, - kErrorStateLabel = 1, - kErrorStateDetails = 2, -}; - -struct Type -{ -public: - ErrorStateEnum errorStateID = static_cast(0); - DataModel::Nullable errorStateLabel; - Optional errorStateDetails; - - CHIP_ERROR Decode(TLV::TLVReader & reader); - - static constexpr bool kIsFabricScoped = false; - - CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; -}; - -using DecodableType = Type; - -} // namespace ErrorStateStruct -namespace OperationalStateStruct { -enum class Fields : uint8_t -{ - kOperationalStateID = 0, - kOperationalStateLabel = 1, -}; - -struct Type -{ -public: - OperationalStateEnum operationalStateID = static_cast(0); - chip::CharSpan operationalStateLabel; - - CHIP_ERROR Decode(TLV::TLVReader & reader); - - static constexpr bool kIsFabricScoped = false; - - CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; -}; - -using DecodableType = Type; - -} // namespace OperationalStateStruct +namespace ErrorStateStruct = Clusters::detail::Structs::ErrorStateStruct; +namespace OperationalStateStruct = Clusters::detail::Structs::OperationalStateStruct; } // namespace Structs namespace Commands { @@ -17050,7 +17052,7 @@ struct Type static constexpr ClusterId GetClusterId() { return Clusters::OperationalState::Id; } static constexpr bool kIsFabricScoped = false; - ErrorStateEnum completionErrorCode = static_cast(0); + uint8_t completionErrorCode = static_cast(0); Optional> totalOperationalTime; Optional> pausedTime; @@ -17064,7 +17066,7 @@ struct DecodableType static constexpr EventId GetEventId() { return Events::OperationCompletion::Id; } static constexpr ClusterId GetClusterId() { return Clusters::OperationalState::Id; } - ErrorStateEnum completionErrorCode = static_cast(0); + uint8_t completionErrorCode = static_cast(0); Optional> totalOperationalTime; Optional> pausedTime; @@ -17073,6 +17075,402 @@ struct DecodableType } // namespace OperationCompletion } // namespace Events } // namespace OperationalState +namespace RoboticVacuumOperationalState { +namespace Structs { +namespace ErrorStateStruct = Clusters::detail::Structs::ErrorStateStruct; +namespace OperationalStateStruct = Clusters::detail::Structs::OperationalStateStruct; +} // namespace Structs + +namespace Commands { +// Forward-declarations so we can reference these later. + +namespace Pause { +struct Type; +struct DecodableType; +} // namespace Pause + +namespace Stop { +struct Type; +struct DecodableType; +} // namespace Stop + +namespace Start { +struct Type; +struct DecodableType; +} // namespace Start + +namespace Resume { +struct Type; +struct DecodableType; +} // namespace Resume + +namespace OperationalCommandResponse { +struct Type; +struct DecodableType; +} // namespace OperationalCommandResponse + +} // namespace Commands + +namespace Commands { +namespace Pause { +enum class Fields : uint8_t +{ +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::Pause::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RoboticVacuumOperationalState::Id; } + + CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; + + using ResponseType = Clusters::RoboticVacuumOperationalState::Commands::OperationalCommandResponse::DecodableType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::Pause::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RoboticVacuumOperationalState::Id; } + + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace Pause +namespace Stop { +enum class Fields : uint8_t +{ +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::Stop::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RoboticVacuumOperationalState::Id; } + + CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; + + using ResponseType = Clusters::RoboticVacuumOperationalState::Commands::OperationalCommandResponse::DecodableType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::Stop::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RoboticVacuumOperationalState::Id; } + + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace Stop +namespace Start { +enum class Fields : uint8_t +{ +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::Start::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RoboticVacuumOperationalState::Id; } + + CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; + + using ResponseType = Clusters::RoboticVacuumOperationalState::Commands::OperationalCommandResponse::DecodableType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::Start::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RoboticVacuumOperationalState::Id; } + + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace Start +namespace Resume { +enum class Fields : uint8_t +{ +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::Resume::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RoboticVacuumOperationalState::Id; } + + CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; + + using ResponseType = Clusters::RoboticVacuumOperationalState::Commands::OperationalCommandResponse::DecodableType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::Resume::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RoboticVacuumOperationalState::Id; } + + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace Resume +namespace OperationalCommandResponse { +enum class Fields : uint8_t +{ + kCommandResponseState = 0, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::OperationalCommandResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RoboticVacuumOperationalState::Id; } + + Structs::ErrorStateStruct::Type commandResponseState; + + CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; + + using ResponseType = DataModel::NullObjectType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::OperationalCommandResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RoboticVacuumOperationalState::Id; } + + Structs::ErrorStateStruct::DecodableType commandResponseState; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace OperationalCommandResponse +} // namespace Commands + +namespace Attributes { + +namespace PhaseList { +struct TypeInfo +{ + using Type = chip::app::DataModel::Nullable>; + using DecodableType = chip::app::DataModel::Nullable>; + using DecodableArgType = const chip::app::DataModel::Nullable> &; + + static constexpr ClusterId GetClusterId() { return Clusters::RoboticVacuumOperationalState::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::PhaseList::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace PhaseList +namespace CurrentPhase { +struct TypeInfo +{ + using Type = chip::app::DataModel::Nullable; + using DecodableType = chip::app::DataModel::Nullable; + using DecodableArgType = const chip::app::DataModel::Nullable &; + + static constexpr ClusterId GetClusterId() { return Clusters::RoboticVacuumOperationalState::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::CurrentPhase::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace CurrentPhase +namespace CountdownTime { +struct TypeInfo +{ + using Type = chip::app::DataModel::Nullable; + using DecodableType = chip::app::DataModel::Nullable; + using DecodableArgType = const chip::app::DataModel::Nullable &; + + static constexpr ClusterId GetClusterId() { return Clusters::RoboticVacuumOperationalState::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::CountdownTime::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace CountdownTime +namespace OperationalStateList { +struct TypeInfo +{ + using Type = + chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList< + chip::app::Clusters::RoboticVacuumOperationalState::Structs::OperationalStateStruct::DecodableType>; + using DecodableArgType = const chip::app::DataModel::DecodableList< + chip::app::Clusters::RoboticVacuumOperationalState::Structs::OperationalStateStruct::DecodableType> &; + + static constexpr ClusterId GetClusterId() { return Clusters::RoboticVacuumOperationalState::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::OperationalStateList::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace OperationalStateList +namespace OperationalState { +struct TypeInfo +{ + using Type = chip::app::Clusters::RoboticVacuumOperationalState::Structs::OperationalStateStruct::Type; + using DecodableType = chip::app::Clusters::RoboticVacuumOperationalState::Structs::OperationalStateStruct::DecodableType; + using DecodableArgType = + const chip::app::Clusters::RoboticVacuumOperationalState::Structs::OperationalStateStruct::DecodableType &; + + static constexpr ClusterId GetClusterId() { return Clusters::RoboticVacuumOperationalState::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::OperationalState::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace OperationalState +namespace OperationalError { +struct TypeInfo +{ + using Type = chip::app::Clusters::RoboticVacuumOperationalState::Structs::ErrorStateStruct::Type; + using DecodableType = chip::app::Clusters::RoboticVacuumOperationalState::Structs::ErrorStateStruct::DecodableType; + using DecodableArgType = const chip::app::Clusters::RoboticVacuumOperationalState::Structs::ErrorStateStruct::DecodableType &; + + static constexpr ClusterId GetClusterId() { return Clusters::RoboticVacuumOperationalState::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::OperationalError::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace OperationalError +namespace GeneratedCommandList { +struct TypeInfo : public Clusters::Globals::Attributes::GeneratedCommandList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::RoboticVacuumOperationalState::Id; } +}; +} // namespace GeneratedCommandList +namespace AcceptedCommandList { +struct TypeInfo : public Clusters::Globals::Attributes::AcceptedCommandList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::RoboticVacuumOperationalState::Id; } +}; +} // namespace AcceptedCommandList +namespace EventList { +struct TypeInfo : public Clusters::Globals::Attributes::EventList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::RoboticVacuumOperationalState::Id; } +}; +} // namespace EventList +namespace AttributeList { +struct TypeInfo : public Clusters::Globals::Attributes::AttributeList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::RoboticVacuumOperationalState::Id; } +}; +} // namespace AttributeList +namespace FeatureMap { +struct TypeInfo : public Clusters::Globals::Attributes::FeatureMap::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::RoboticVacuumOperationalState::Id; } +}; +} // namespace FeatureMap +namespace ClusterRevision { +struct TypeInfo : public Clusters::Globals::Attributes::ClusterRevision::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::RoboticVacuumOperationalState::Id; } +}; +} // namespace ClusterRevision + +struct TypeInfo +{ + struct DecodableType + { + static constexpr ClusterId GetClusterId() { return Clusters::RoboticVacuumOperationalState::Id; } + + CHIP_ERROR Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path); + + Attributes::PhaseList::TypeInfo::DecodableType phaseList; + Attributes::CurrentPhase::TypeInfo::DecodableType currentPhase; + Attributes::CountdownTime::TypeInfo::DecodableType countdownTime; + Attributes::OperationalStateList::TypeInfo::DecodableType operationalStateList; + Attributes::OperationalState::TypeInfo::DecodableType operationalState; + Attributes::OperationalError::TypeInfo::DecodableType operationalError; + Attributes::GeneratedCommandList::TypeInfo::DecodableType generatedCommandList; + Attributes::AcceptedCommandList::TypeInfo::DecodableType acceptedCommandList; + Attributes::EventList::TypeInfo::DecodableType eventList; + Attributes::AttributeList::TypeInfo::DecodableType attributeList; + Attributes::FeatureMap::TypeInfo::DecodableType featureMap = static_cast(0); + Attributes::ClusterRevision::TypeInfo::DecodableType clusterRevision = static_cast(0); + }; +}; +} // namespace Attributes +namespace Events { +namespace OperationalError { +static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Critical; + +enum class Fields : uint8_t +{ + kErrorState = 0, +}; + +struct Type +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return Events::OperationalError::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RoboticVacuumOperationalState::Id; } + static constexpr bool kIsFabricScoped = false; + + Structs::ErrorStateStruct::Type errorState; + + CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; +}; + +struct DecodableType +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return Events::OperationalError::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RoboticVacuumOperationalState::Id; } + + Structs::ErrorStateStruct::DecodableType errorState; + + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +} // namespace OperationalError +namespace OperationCompletion { +static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; + +enum class Fields : uint8_t +{ + kCompletionErrorCode = 0, + kTotalOperationalTime = 1, + kPausedTime = 2, +}; + +struct Type +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return Events::OperationCompletion::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RoboticVacuumOperationalState::Id; } + static constexpr bool kIsFabricScoped = false; + + uint8_t completionErrorCode = static_cast(0); + Optional> totalOperationalTime; + Optional> pausedTime; + + CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; +}; + +struct DecodableType +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return Events::OperationCompletion::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RoboticVacuumOperationalState::Id; } + + uint8_t completionErrorCode = static_cast(0); + Optional> totalOperationalTime; + Optional> pausedTime; + + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +} // namespace OperationCompletion +} // namespace Events +} // namespace RoboticVacuumOperationalState namespace HepaFilterMonitoring { namespace Commands { diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h b/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h index 9df5738cf6be5c..acebe9520aa223 100644 --- a/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h +++ b/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h @@ -3021,6 +3021,60 @@ static constexpr AttributeId Id = Globals::Attributes::ClusterRevision::Id; } // namespace Attributes } // namespace OperationalState +namespace RoboticVacuumOperationalState { +namespace Attributes { + +namespace PhaseList { +static constexpr AttributeId Id = 0x00000000; +} // namespace PhaseList + +namespace CurrentPhase { +static constexpr AttributeId Id = 0x00000001; +} // namespace CurrentPhase + +namespace CountdownTime { +static constexpr AttributeId Id = 0x00000002; +} // namespace CountdownTime + +namespace OperationalStateList { +static constexpr AttributeId Id = 0x00000003; +} // namespace OperationalStateList + +namespace OperationalState { +static constexpr AttributeId Id = 0x00000004; +} // namespace OperationalState + +namespace OperationalError { +static constexpr AttributeId Id = 0x00000005; +} // namespace OperationalError + +namespace GeneratedCommandList { +static constexpr AttributeId Id = Globals::Attributes::GeneratedCommandList::Id; +} // namespace GeneratedCommandList + +namespace AcceptedCommandList { +static constexpr AttributeId Id = Globals::Attributes::AcceptedCommandList::Id; +} // namespace AcceptedCommandList + +namespace EventList { +static constexpr AttributeId Id = Globals::Attributes::EventList::Id; +} // namespace EventList + +namespace AttributeList { +static constexpr AttributeId Id = Globals::Attributes::AttributeList::Id; +} // namespace AttributeList + +namespace FeatureMap { +static constexpr AttributeId Id = Globals::Attributes::FeatureMap::Id; +} // namespace FeatureMap + +namespace ClusterRevision { +static constexpr AttributeId Id = Globals::Attributes::ClusterRevision::Id; +} // namespace ClusterRevision + +} // namespace Attributes +} // namespace RoboticVacuumOperationalState + namespace HepaFilterMonitoring { namespace Attributes { diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h b/zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h index afbdd5fdf33410..daa8633beadfa5 100644 --- a/zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h +++ b/zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h @@ -184,6 +184,9 @@ static constexpr ClusterId Id = 0x0000005C; namespace OperationalState { static constexpr ClusterId Id = 0x00000060; } // namespace OperationalState +namespace RoboticVacuumOperationalState { +static constexpr ClusterId Id = 0x00000061; +} // namespace RoboticVacuumOperationalState namespace HepaFilterMonitoring { static constexpr ClusterId Id = 0x00000071; } // namespace HepaFilterMonitoring diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h b/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h index 54ed91151d52cd..fc3462859b428d 100644 --- a/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h +++ b/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h @@ -785,6 +785,32 @@ static constexpr CommandId Id = 0x00000004; } // namespace Commands } // namespace OperationalState +namespace RoboticVacuumOperationalState { +namespace Commands { + +namespace Pause { +static constexpr CommandId Id = 0x00000000; +} // namespace Pause + +namespace Stop { +static constexpr CommandId Id = 0x00000001; +} // namespace Stop + +namespace Start { +static constexpr CommandId Id = 0x00000002; +} // namespace Start + +namespace Resume { +static constexpr CommandId Id = 0x00000003; +} // namespace Resume + +namespace OperationalCommandResponse { +static constexpr CommandId Id = 0x00000004; +} // namespace OperationalCommandResponse + +} // namespace Commands +} // namespace RoboticVacuumOperationalState + namespace HepaFilterMonitoring { namespace Commands { diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Events.h b/zzz_generated/app-common/app-common/zap-generated/ids/Events.h index cc23a3c7c6d1c6..1265841a3eabfe 100644 --- a/zzz_generated/app-common/app-common/zap-generated/ids/Events.h +++ b/zzz_generated/app-common/app-common/zap-generated/ids/Events.h @@ -341,6 +341,20 @@ static constexpr EventId Id = 0x00000001; } // namespace Events } // namespace OperationalState +namespace RoboticVacuumOperationalState { +namespace Events { + +namespace OperationalError { +static constexpr EventId Id = 0x00000000; +} // namespace OperationalError + +namespace OperationCompletion { +static constexpr EventId Id = 0x00000001; +} // namespace OperationCompletion + +} // namespace Events +} // namespace RoboticVacuumOperationalState + namespace DoorLock { namespace Events { diff --git a/zzz_generated/app-common/app-common/zap-generated/print-cluster.h b/zzz_generated/app-common/app-common/zap-generated/print-cluster.h index a254d99be4a077..1572384dcf7798 100644 --- a/zzz_generated/app-common/app-common/zap-generated/print-cluster.h +++ b/zzz_generated/app-common/app-common/zap-generated/print-cluster.h @@ -363,6 +363,13 @@ #define CHIP_PRINTCLUSTER_OPERATIONAL_STATE_CLUSTER #endif +#if defined(ZCL_USING_OPERATIONAL_STATE_RVC_CLUSTER_SERVER) || defined(ZCL_USING_OPERATIONAL_STATE_RVC_CLUSTER_CLIENT) +#define CHIP_PRINTCLUSTER_OPERATIONAL_STATE_RVC_CLUSTER \ + { chip::app::Clusters::RoboticVacuumOperationalState::Id, "Robotic Vacuum Operational State" }, +#else +#define CHIP_PRINTCLUSTER_OPERATIONAL_STATE_RVC_CLUSTER +#endif + #if defined(ZCL_USING_HEPA_FILTER_MONITORING_CLUSTER_SERVER) || defined(ZCL_USING_HEPA_FILTER_MONITORING_CLUSTER_CLIENT) #define CHIP_PRINTCLUSTER_HEPA_FILTER_MONITORING_CLUSTER \ { chip::app::Clusters::HepaFilterMonitoring::Id, "HEPA Filter Monitoring" }, @@ -978,6 +985,7 @@ CHIP_PRINTCLUSTER_AIR_QUALITY_CLUSTER \ CHIP_PRINTCLUSTER_SMOKE_CO_ALARM_CLUSTER \ CHIP_PRINTCLUSTER_OPERATIONAL_STATE_CLUSTER \ + CHIP_PRINTCLUSTER_OPERATIONAL_STATE_RVC_CLUSTER \ CHIP_PRINTCLUSTER_HEPA_FILTER_MONITORING_CLUSTER \ CHIP_PRINTCLUSTER_ACTIVATED_CARBON_FILTER_MONITORING_CLUSTER \ CHIP_PRINTCLUSTER_CERAMIC_FILTER_MONITORING_CLUSTER \ diff --git a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h index e286a82888ae37..5f02b1ee77f828 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h @@ -85,6 +85,7 @@ | AirQuality | 0x005B | | SmokeCoAlarm | 0x005C | | OperationalState | 0x0060 | +| RoboticVacuumOperationalState | 0x0061 | | HepaFilterMonitoring | 0x0071 | | ActivatedCarbonFilterMonitoring | 0x0072 | | CeramicFilterMonitoring | 0x0073 | @@ -4863,6 +4864,150 @@ class OperationalStateResume : public ClusterCommand chip::app::Clusters::OperationalState::Commands::Resume::Type mRequest; }; +/*----------------------------------------------------------------------------*\ +| Cluster RoboticVacuumOperationalState | 0x0061 | +|------------------------------------------------------------------------------| +| Commands: | | +| * Pause | 0x00 | +| * Stop | 0x01 | +| * Start | 0x02 | +| * Resume | 0x03 | +|------------------------------------------------------------------------------| +| Attributes: | | +| * PhaseList | 0x0000 | +| * CurrentPhase | 0x0001 | +| * CountdownTime | 0x0002 | +| * OperationalStateList | 0x0003 | +| * OperationalState | 0x0004 | +| * OperationalError | 0x0005 | +| * GeneratedCommandList | 0xFFF8 | +| * AcceptedCommandList | 0xFFF9 | +| * EventList | 0xFFFA | +| * AttributeList | 0xFFFB | +| * FeatureMap | 0xFFFC | +| * ClusterRevision | 0xFFFD | +|------------------------------------------------------------------------------| +| Events: | | +| * OperationalError | 0x0000 | +| * OperationCompletion | 0x0001 | +\*----------------------------------------------------------------------------*/ + +/* + * Command Pause + */ +class RoboticVacuumOperationalStatePause : public ClusterCommand +{ +public: + RoboticVacuumOperationalStatePause(CredentialIssuerCommands * credsIssuerConfig) : ClusterCommand("pause", credsIssuerConfig) + { + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) command (0x00000000) on endpoint %u", endpointIds.at(0)); + + return ClusterCommand::SendCommand(device, endpointIds.at(0), 0x00000061, 0x00000000, mRequest); + } + + CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) command (0x00000000) on Group %u", groupId); + + return ClusterCommand::SendGroupCommand(groupId, fabricIndex, 0x00000061, 0x00000000, mRequest); + } + +private: + chip::app::Clusters::RoboticVacuumOperationalState::Commands::Pause::Type mRequest; +}; + +/* + * Command Stop + */ +class RoboticVacuumOperationalStateStop : public ClusterCommand +{ +public: + RoboticVacuumOperationalStateStop(CredentialIssuerCommands * credsIssuerConfig) : ClusterCommand("stop", credsIssuerConfig) + { + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) command (0x00000001) on endpoint %u", endpointIds.at(0)); + + return ClusterCommand::SendCommand(device, endpointIds.at(0), 0x00000061, 0x00000001, mRequest); + } + + CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) command (0x00000001) on Group %u", groupId); + + return ClusterCommand::SendGroupCommand(groupId, fabricIndex, 0x00000061, 0x00000001, mRequest); + } + +private: + chip::app::Clusters::RoboticVacuumOperationalState::Commands::Stop::Type mRequest; +}; + +/* + * Command Start + */ +class RoboticVacuumOperationalStateStart : public ClusterCommand +{ +public: + RoboticVacuumOperationalStateStart(CredentialIssuerCommands * credsIssuerConfig) : ClusterCommand("start", credsIssuerConfig) + { + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) command (0x00000002) on endpoint %u", endpointIds.at(0)); + + return ClusterCommand::SendCommand(device, endpointIds.at(0), 0x00000061, 0x00000002, mRequest); + } + + CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) command (0x00000002) on Group %u", groupId); + + return ClusterCommand::SendGroupCommand(groupId, fabricIndex, 0x00000061, 0x00000002, mRequest); + } + +private: + chip::app::Clusters::RoboticVacuumOperationalState::Commands::Start::Type mRequest; +}; + +/* + * Command Resume + */ +class RoboticVacuumOperationalStateResume : public ClusterCommand +{ +public: + RoboticVacuumOperationalStateResume(CredentialIssuerCommands * credsIssuerConfig) : ClusterCommand("resume", credsIssuerConfig) + { + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) command (0x00000003) on endpoint %u", endpointIds.at(0)); + + return ClusterCommand::SendCommand(device, endpointIds.at(0), 0x00000061, 0x00000003, mRequest); + } + + CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) command (0x00000003) on Group %u", groupId); + + return ClusterCommand::SendGroupCommand(groupId, fabricIndex, 0x00000061, 0x00000003, mRequest); + } + +private: + chip::app::Clusters::RoboticVacuumOperationalState::Commands::Resume::Type mRequest; +}; + /*----------------------------------------------------------------------------*\ | Cluster HepaFilterMonitoring | 0x0071 | |------------------------------------------------------------------------------| @@ -15528,6 +15673,93 @@ void registerClusterOperationalState(Commands & commands, CredentialIssuerComman commands.Register(clusterName, clusterCommands); } +void registerClusterRoboticVacuumOperationalState(Commands & commands, CredentialIssuerCommands * credsIssuerConfig) +{ + using namespace chip::app::Clusters::RoboticVacuumOperationalState; + + const char * clusterName = "RoboticVacuumOperationalState"; + + commands_list clusterCommands = { + // + // Commands + // + make_unique(Id, credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + // + // Attributes + // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, "phase-list", Attributes::PhaseList::Id, credsIssuerConfig), // + make_unique(Id, "current-phase", Attributes::CurrentPhase::Id, credsIssuerConfig), // + make_unique(Id, "countdown-time", Attributes::CountdownTime::Id, credsIssuerConfig), // + make_unique(Id, "operational-state-list", Attributes::OperationalStateList::Id, credsIssuerConfig), // + make_unique(Id, "operational-state", Attributes::OperationalState::Id, credsIssuerConfig), // + make_unique(Id, "operational-error", Attributes::OperationalError::Id, credsIssuerConfig), // + make_unique(Id, "generated-command-list", Attributes::GeneratedCommandList::Id, credsIssuerConfig), // + make_unique(Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, credsIssuerConfig), // + make_unique(Id, "event-list", Attributes::EventList::Id, credsIssuerConfig), // + make_unique(Id, "attribute-list", Attributes::AttributeList::Id, credsIssuerConfig), // + make_unique(Id, "feature-map", Attributes::FeatureMap::Id, credsIssuerConfig), // + make_unique(Id, "cluster-revision", Attributes::ClusterRevision::Id, credsIssuerConfig), // + make_unique>(Id, credsIssuerConfig), // + make_unique>>>( + Id, "phase-list", Attributes::PhaseList::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>( + Id, "current-phase", 0, UINT8_MAX, Attributes::CurrentPhase::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>(Id, "countdown-time", 0, UINT32_MAX, + Attributes::CountdownTime::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>( + Id, "operational-state-list", Attributes::OperationalStateList::Id, WriteCommandType::kForceWrite, + credsIssuerConfig), // + make_unique< + WriteAttributeAsComplex>( + Id, "operational-state", Attributes::OperationalState::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>( + Id, "operational-error", Attributes::OperationalError::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>( + Id, "generated-command-list", Attributes::GeneratedCommandList::Id, WriteCommandType::kForceWrite, + credsIssuerConfig), // + make_unique>>( + Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>( + Id, "event-list", Attributes::EventList::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>( + Id, "attribute-list", Attributes::AttributeList::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>(Id, "feature-map", 0, UINT32_MAX, Attributes::FeatureMap::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>(Id, "cluster-revision", 0, UINT16_MAX, Attributes::ClusterRevision::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, "phase-list", Attributes::PhaseList::Id, credsIssuerConfig), // + make_unique(Id, "current-phase", Attributes::CurrentPhase::Id, credsIssuerConfig), // + make_unique(Id, "countdown-time", Attributes::CountdownTime::Id, credsIssuerConfig), // + make_unique(Id, "operational-state-list", Attributes::OperationalStateList::Id, credsIssuerConfig), // + make_unique(Id, "operational-state", Attributes::OperationalState::Id, credsIssuerConfig), // + make_unique(Id, "operational-error", Attributes::OperationalError::Id, credsIssuerConfig), // + make_unique(Id, "generated-command-list", Attributes::GeneratedCommandList::Id, credsIssuerConfig), // + make_unique(Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, credsIssuerConfig), // + make_unique(Id, "event-list", Attributes::EventList::Id, credsIssuerConfig), // + make_unique(Id, "attribute-list", Attributes::AttributeList::Id, credsIssuerConfig), // + make_unique(Id, "feature-map", Attributes::FeatureMap::Id, credsIssuerConfig), // + make_unique(Id, "cluster-revision", Attributes::ClusterRevision::Id, credsIssuerConfig), // + // + // Events + // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, "operational-error", Events::OperationalError::Id, credsIssuerConfig), // + make_unique(Id, "operation-completion", Events::OperationCompletion::Id, credsIssuerConfig), // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, "operational-error", Events::OperationalError::Id, credsIssuerConfig), // + make_unique(Id, "operation-completion", Events::OperationCompletion::Id, credsIssuerConfig), // + }; + + commands.Register(clusterName, clusterCommands); +} void registerClusterHepaFilterMonitoring(Commands & commands, CredentialIssuerCommands * credsIssuerConfig) { using namespace chip::app::Clusters::HepaFilterMonitoring; @@ -24447,6 +24679,7 @@ void registerClusters(Commands & commands, CredentialIssuerCommands * credsIssue registerClusterAirQuality(commands, credsIssuerConfig); registerClusterSmokeCoAlarm(commands, credsIssuerConfig); registerClusterOperationalState(commands, credsIssuerConfig); + registerClusterRoboticVacuumOperationalState(commands, credsIssuerConfig); registerClusterHepaFilterMonitoring(commands, credsIssuerConfig); registerClusterActivatedCarbonFilterMonitoring(commands, credsIssuerConfig); registerClusterCeramicFilterMonitoring(commands, credsIssuerConfig); diff --git a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp index 120444bbebbb8b..15f4b09c3119c8 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp @@ -125,6 +125,46 @@ void ComplexArgumentParser::Finalize(chip::app::Clusters::detail::Structs::Appli ComplexArgumentParser::Finalize(request.applicationID); } +CHIP_ERROR ComplexArgumentParser::Setup(const char * label, chip::app::Clusters::detail::Structs::ErrorStateStruct::Type & request, + Json::Value & value) +{ + VerifyOrReturnError(value.isObject(), CHIP_ERROR_INVALID_ARGUMENT); + + // Copy to track which members we already processed. + Json::Value valueCopy(value); + + ReturnErrorOnFailure( + ComplexArgumentParser::EnsureMemberExist("ErrorStateStruct.errorStateID", "errorStateID", value.isMember("errorStateID"))); + + char labelWithMember[kMaxLabelLength]; + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "errorStateID"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.errorStateID, value["errorStateID"])); + valueCopy.removeMember("errorStateID"); + + if (value.isMember("errorStateLabel")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "errorStateLabel"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.errorStateLabel, value["errorStateLabel"])); + } + valueCopy.removeMember("errorStateLabel"); + + if (value.isMember("errorStateDetails")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "errorStateDetails"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.errorStateDetails, value["errorStateDetails"])); + } + valueCopy.removeMember("errorStateDetails"); + + return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); +} + +void ComplexArgumentParser::Finalize(chip::app::Clusters::detail::Structs::ErrorStateStruct::Type & request) +{ + ComplexArgumentParser::Finalize(request.errorStateID); + ComplexArgumentParser::Finalize(request.errorStateLabel); + ComplexArgumentParser::Finalize(request.errorStateDetails); +} + CHIP_ERROR ComplexArgumentParser::Setup(const char * label, chip::app::Clusters::detail::Structs::LabelStruct::Type & request, Json::Value & value) { @@ -154,6 +194,40 @@ void ComplexArgumentParser::Finalize(chip::app::Clusters::detail::Structs::Label ComplexArgumentParser::Finalize(request.value); } +CHIP_ERROR ComplexArgumentParser::Setup(const char * label, + chip::app::Clusters::detail::Structs::OperationalStateStruct::Type & request, + Json::Value & value) +{ + VerifyOrReturnError(value.isObject(), CHIP_ERROR_INVALID_ARGUMENT); + + // Copy to track which members we already processed. + Json::Value valueCopy(value); + + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("OperationalStateStruct.operationalStateID", "operationalStateID", + value.isMember("operationalStateID"))); + + char labelWithMember[kMaxLabelLength]; + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "operationalStateID"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.operationalStateID, value["operationalStateID"])); + valueCopy.removeMember("operationalStateID"); + + if (value.isMember("operationalStateLabel")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "operationalStateLabel"); + ReturnErrorOnFailure( + ComplexArgumentParser::Setup(labelWithMember, request.operationalStateLabel, value["operationalStateLabel"])); + } + valueCopy.removeMember("operationalStateLabel"); + + return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); +} + +void ComplexArgumentParser::Finalize(chip::app::Clusters::detail::Structs::OperationalStateStruct::Type & request) +{ + ComplexArgumentParser::Finalize(request.operationalStateID); + ComplexArgumentParser::Finalize(request.operationalStateLabel); +} + CHIP_ERROR ComplexArgumentParser::Setup(const char * label, chip::app::Clusters::Scenes::Structs::AttributeValuePair::Type & request, Json::Value & value) @@ -1903,79 +1977,6 @@ void ComplexArgumentParser::Finalize(chip::app::Clusters::IcdManagement::Structs ComplexArgumentParser::Finalize(request.fabricIndex); } -CHIP_ERROR ComplexArgumentParser::Setup(const char * label, - chip::app::Clusters::OperationalState::Structs::ErrorStateStruct::Type & request, - Json::Value & value) -{ - VerifyOrReturnError(value.isObject(), CHIP_ERROR_INVALID_ARGUMENT); - - // Copy to track which members we already processed. - Json::Value valueCopy(value); - - ReturnErrorOnFailure( - ComplexArgumentParser::EnsureMemberExist("ErrorStateStruct.errorStateID", "errorStateID", value.isMember("errorStateID"))); - ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("ErrorStateStruct.errorStateLabel", "errorStateLabel", - value.isMember("errorStateLabel"))); - - char labelWithMember[kMaxLabelLength]; - snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "errorStateID"); - ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.errorStateID, value["errorStateID"])); - valueCopy.removeMember("errorStateID"); - - snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "errorStateLabel"); - ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.errorStateLabel, value["errorStateLabel"])); - valueCopy.removeMember("errorStateLabel"); - - if (value.isMember("errorStateDetails")) - { - snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "errorStateDetails"); - ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.errorStateDetails, value["errorStateDetails"])); - } - valueCopy.removeMember("errorStateDetails"); - - return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); -} - -void ComplexArgumentParser::Finalize(chip::app::Clusters::OperationalState::Structs::ErrorStateStruct::Type & request) -{ - ComplexArgumentParser::Finalize(request.errorStateID); - ComplexArgumentParser::Finalize(request.errorStateLabel); - ComplexArgumentParser::Finalize(request.errorStateDetails); -} - -CHIP_ERROR ComplexArgumentParser::Setup(const char * label, - chip::app::Clusters::OperationalState::Structs::OperationalStateStruct::Type & request, - Json::Value & value) -{ - VerifyOrReturnError(value.isObject(), CHIP_ERROR_INVALID_ARGUMENT); - - // Copy to track which members we already processed. - Json::Value valueCopy(value); - - ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("OperationalStateStruct.operationalStateID", "operationalStateID", - value.isMember("operationalStateID"))); - ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist( - "OperationalStateStruct.operationalStateLabel", "operationalStateLabel", value.isMember("operationalStateLabel"))); - - char labelWithMember[kMaxLabelLength]; - snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "operationalStateID"); - ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.operationalStateID, value["operationalStateID"])); - valueCopy.removeMember("operationalStateID"); - - snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "operationalStateLabel"); - ReturnErrorOnFailure( - ComplexArgumentParser::Setup(labelWithMember, request.operationalStateLabel, value["operationalStateLabel"])); - valueCopy.removeMember("operationalStateLabel"); - - return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); -} - -void ComplexArgumentParser::Finalize(chip::app::Clusters::OperationalState::Structs::OperationalStateStruct::Type & request) -{ - ComplexArgumentParser::Finalize(request.operationalStateID); - ComplexArgumentParser::Finalize(request.operationalStateLabel); -} - CHIP_ERROR ComplexArgumentParser::Setup(const char * label, chip::app::Clusters::DoorLock::Structs::CredentialStruct::Type & request, Json::Value & value) diff --git a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h index dea2397ae70c89..752647ee7e54bf 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h @@ -37,10 +37,20 @@ static CHIP_ERROR Setup(const char * label, chip::app::Clusters::detail::Structs static void Finalize(chip::app::Clusters::detail::Structs::ApplicationStruct::Type & request); +static CHIP_ERROR Setup(const char * label, chip::app::Clusters::detail::Structs::ErrorStateStruct::Type & request, + Json::Value & value); + +static void Finalize(chip::app::Clusters::detail::Structs::ErrorStateStruct::Type & request); + static CHIP_ERROR Setup(const char * label, chip::app::Clusters::detail::Structs::LabelStruct::Type & request, Json::Value & value); static void Finalize(chip::app::Clusters::detail::Structs::LabelStruct::Type & request); +static CHIP_ERROR Setup(const char * label, chip::app::Clusters::detail::Structs::OperationalStateStruct::Type & request, + Json::Value & value); + +static void Finalize(chip::app::Clusters::detail::Structs::OperationalStateStruct::Type & request); + static CHIP_ERROR Setup(const char * label, chip::app::Clusters::Scenes::Structs::AttributeValuePair::Type & request, Json::Value & value); @@ -234,16 +244,6 @@ static CHIP_ERROR Setup(const char * label, static void Finalize(chip::app::Clusters::IcdManagement::Structs::MonitoringRegistrationStruct::Type & request); -static CHIP_ERROR Setup(const char * label, chip::app::Clusters::OperationalState::Structs::ErrorStateStruct::Type & request, - Json::Value & value); - -static void Finalize(chip::app::Clusters::OperationalState::Structs::ErrorStateStruct::Type & request); - -static CHIP_ERROR Setup(const char * label, chip::app::Clusters::OperationalState::Structs::OperationalStateStruct::Type & request, - Json::Value & value); - -static void Finalize(chip::app::Clusters::OperationalState::Structs::OperationalStateStruct::Type & request); - static CHIP_ERROR Setup(const char * label, chip::app::Clusters::DoorLock::Structs::CredentialStruct::Type & request, Json::Value & value); diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp index 085d9de02833c8..596893dc438cf6 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp @@ -112,6 +112,39 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const chip::app::Clusters::detail::Structs::ErrorStateStruct::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = LogValue("ErrorStateID", indent + 1, value.errorStateID); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'ErrorStateID'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("ErrorStateLabel", indent + 1, value.errorStateLabel); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'ErrorStateLabel'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("ErrorStateDetails", indent + 1, value.errorStateDetails); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'ErrorStateDetails'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} + CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const chip::app::Clusters::detail::Structs::LabelStruct::DecodableType & value) { @@ -137,6 +170,31 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const chip::app::Clusters::detail::Structs::OperationalStateStruct::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = LogValue("OperationalStateID", indent + 1, value.operationalStateID); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'OperationalStateID'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("OperationalStateLabel", indent + 1, value.operationalStateLabel); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'OperationalStateLabel'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} + CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const chip::app::Clusters::Scenes::Structs::AttributeValuePair::DecodableType & value) { @@ -1719,65 +1777,6 @@ DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } -CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const chip::app::Clusters::OperationalState::Structs::ErrorStateStruct::DecodableType & value) -{ - DataModelLogger::LogString(label, indent, "{"); - { - CHIP_ERROR err = LogValue("ErrorStateID", indent + 1, value.errorStateID); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'ErrorStateID'"); - return err; - } - } - { - CHIP_ERROR err = LogValue("ErrorStateLabel", indent + 1, value.errorStateLabel); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'ErrorStateLabel'"); - return err; - } - } - { - CHIP_ERROR err = LogValue("ErrorStateDetails", indent + 1, value.errorStateDetails); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'ErrorStateDetails'"); - return err; - } - } - DataModelLogger::LogString(indent, "}"); - - return CHIP_NO_ERROR; -} - -CHIP_ERROR -DataModelLogger::LogValue(const char * label, size_t indent, - const chip::app::Clusters::OperationalState::Structs::OperationalStateStruct::DecodableType & value) -{ - DataModelLogger::LogString(label, indent, "{"); - { - CHIP_ERROR err = LogValue("OperationalStateID", indent + 1, value.operationalStateID); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'OperationalStateID'"); - return err; - } - } - { - CHIP_ERROR err = LogValue("OperationalStateLabel", indent + 1, value.operationalStateLabel); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'OperationalStateLabel'"); - return err; - } - } - DataModelLogger::LogString(indent, "}"); - - return CHIP_NO_ERROR; -} - CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const chip::app::Clusters::DoorLock::Structs::CredentialStruct::DecodableType & value) { @@ -3713,6 +3712,54 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const RoboticVacuumOperationalState::Events::OperationalError::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = DataModelLogger::LogValue("ErrorState", indent + 1, value.errorState); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'ErrorState'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const RoboticVacuumOperationalState::Events::OperationCompletion::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = DataModelLogger::LogValue("CompletionErrorCode", indent + 1, value.completionErrorCode); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'CompletionErrorCode'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("TotalOperationalTime", indent + 1, value.totalOperationalTime); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'TotalOperationalTime'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("PausedTime", indent + 1, value.pausedTime); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'PausedTime'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const DoorLock::Events::DoorLockAlarm::DecodableType & value) { @@ -4494,6 +4541,15 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, DataModelLogger::LogString(indent, "}"); return CHIP_NO_ERROR; } +CHIP_ERROR +DataModelLogger::LogValue(const char * label, size_t indent, + const RoboticVacuumOperationalState::Commands::OperationalCommandResponse::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + ReturnErrorOnFailure(DataModelLogger::LogValue("commandResponseState", indent + 1, value.commandResponseState)); + DataModelLogger::LogString(indent, "}"); + return CHIP_NO_ERROR; +} CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const DoorLock::Commands::GetWeekDayScheduleResponse::DecodableType & value) { @@ -8483,6 +8539,74 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP } break; } + case RoboticVacuumOperationalState::Id: { + switch (path.mAttributeId) + { + case RoboticVacuumOperationalState::Attributes::PhaseList::Id: { + chip::app::DataModel::Nullable> value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("PhaseList", 1, value); + } + case RoboticVacuumOperationalState::Attributes::CurrentPhase::Id: { + chip::app::DataModel::Nullable value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("CurrentPhase", 1, value); + } + case RoboticVacuumOperationalState::Attributes::CountdownTime::Id: { + chip::app::DataModel::Nullable value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("CountdownTime", 1, value); + } + case RoboticVacuumOperationalState::Attributes::OperationalStateList::Id: { + chip::app::DataModel::DecodableList< + chip::app::Clusters::RoboticVacuumOperationalState::Structs::OperationalStateStruct::DecodableType> + value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("OperationalStateList", 1, value); + } + case RoboticVacuumOperationalState::Attributes::OperationalState::Id: { + chip::app::Clusters::RoboticVacuumOperationalState::Structs::OperationalStateStruct::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("OperationalState", 1, value); + } + case RoboticVacuumOperationalState::Attributes::OperationalError::Id: { + chip::app::Clusters::RoboticVacuumOperationalState::Structs::ErrorStateStruct::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("OperationalError", 1, value); + } + case RoboticVacuumOperationalState::Attributes::GeneratedCommandList::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + } + case RoboticVacuumOperationalState::Attributes::AcceptedCommandList::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + } + case RoboticVacuumOperationalState::Attributes::EventList::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("EventList", 1, value); + } + case RoboticVacuumOperationalState::Attributes::AttributeList::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("AttributeList", 1, value); + } + case RoboticVacuumOperationalState::Attributes::FeatureMap::Id: { + uint32_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("FeatureMap", 1, value); + } + case RoboticVacuumOperationalState::Attributes::ClusterRevision::Id: { + uint16_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("ClusterRevision", 1, value); + } + } + break; + } case HepaFilterMonitoring::Id: { switch (path.mAttributeId) { @@ -16308,6 +16432,17 @@ CHIP_ERROR DataModelLogger::LogCommand(const chip::app::ConcreteCommandPath & pa } break; } + case RoboticVacuumOperationalState::Id: { + switch (path.mCommandId) + { + case RoboticVacuumOperationalState::Commands::OperationalCommandResponse::Id: { + RoboticVacuumOperationalState::Commands::OperationalCommandResponse::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("OperationalCommandResponse", 1, value); + } + } + break; + } case DoorLock::Id: { switch (path.mCommandId) { @@ -16920,6 +17055,22 @@ CHIP_ERROR DataModelLogger::LogEvent(const chip::app::EventHeader & header, chip } break; } + case RoboticVacuumOperationalState::Id: { + switch (header.mPath.mEventId) + { + case RoboticVacuumOperationalState::Events::OperationalError::Id: { + chip::app::Clusters::RoboticVacuumOperationalState::Events::OperationalError::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("OperationalError", 1, value); + } + case RoboticVacuumOperationalState::Events::OperationCompletion::Id: { + chip::app::Clusters::RoboticVacuumOperationalState::Events::OperationCompletion::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("OperationCompletion", 1, value); + } + } + break; + } case DoorLock::Id: { switch (header.mPath.mEventId) { diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h index 5199662816d440..e7e743dfb77cdf 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h @@ -29,9 +29,15 @@ static CHIP_ERROR LogValue(const char * label, size_t indent, static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::detail::Structs::ApplicationStruct::DecodableType & value); +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::detail::Structs::ErrorStateStruct::DecodableType & value); + static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::detail::Structs::LabelStruct::DecodableType & value); +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::detail::Structs::OperationalStateStruct::DecodableType & value); + static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::Scenes::Structs::AttributeValuePair::DecodableType & value); @@ -147,12 +153,6 @@ static CHIP_ERROR LogValue(const char * label, size_t indent, static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::IcdManagement::Structs::MonitoringRegistrationStruct::DecodableType & value); -static CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::OperationalState::Structs::ErrorStateStruct::DecodableType & value); - -static CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::OperationalState::Structs::OperationalStateStruct::DecodableType & value); - static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::DoorLock::Structs::CredentialStruct::DecodableType & value); @@ -330,6 +330,12 @@ static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::OperationalState::Events::OperationalError::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::OperationalState::Events::OperationCompletion::DecodableType & value); +static CHIP_ERROR +LogValue(const char * label, size_t indent, + const chip::app::Clusters::RoboticVacuumOperationalState::Events::OperationalError::DecodableType & value); +static CHIP_ERROR +LogValue(const char * label, size_t indent, + const chip::app::Clusters::RoboticVacuumOperationalState::Events::OperationCompletion::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::DoorLock::Events::DoorLockAlarm::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, @@ -472,6 +478,9 @@ static CHIP_ERROR LogValue(const char * label, size_t indent, static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::OperationalState::Commands::OperationalCommandResponse::DecodableType & value); +static CHIP_ERROR +LogValue(const char * label, size_t indent, + const chip::app::Clusters::RoboticVacuumOperationalState::Commands::OperationalCommandResponse::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::DoorLock::Commands::GetWeekDayScheduleResponse::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, diff --git a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h index b30091d2b0e58e..7469d4fb62afec 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h @@ -88,6 +88,7 @@ | AirQuality | 0x005B | | SmokeCoAlarm | 0x005C | | OperationalState | 0x0060 | +| RoboticVacuumOperationalState | 0x0061 | | HepaFilterMonitoring | 0x0071 | | ActivatedCarbonFilterMonitoring | 0x0072 | | CeramicFilterMonitoring | 0x0073 | @@ -45032,6 +45033,1057 @@ class SubscribeAttributeOperationalStateClusterRevision : public SubscribeAttrib } }; +/*----------------------------------------------------------------------------*\ +| Cluster RoboticVacuumOperationalState | 0x0061 | +|------------------------------------------------------------------------------| +| Commands: | | +| * Pause | 0x00 | +| * Stop | 0x01 | +| * Start | 0x02 | +| * Resume | 0x03 | +|------------------------------------------------------------------------------| +| Attributes: | | +| * PhaseList | 0x0000 | +| * CurrentPhase | 0x0001 | +| * CountdownTime | 0x0002 | +| * OperationalStateList | 0x0003 | +| * OperationalState | 0x0004 | +| * OperationalError | 0x0005 | +| * GeneratedCommandList | 0xFFF8 | +| * AcceptedCommandList | 0xFFF9 | +| * EventList | 0xFFFA | +| * AttributeList | 0xFFFB | +| * FeatureMap | 0xFFFC | +| * ClusterRevision | 0xFFFD | +|------------------------------------------------------------------------------| +| Events: | | +| * OperationalError | 0x0000 | +| * OperationCompletion | 0x0001 | +\*----------------------------------------------------------------------------*/ + +/* + * Command Pause + */ +class RoboticVacuumOperationalStatePause : public ClusterCommand { +public: + RoboticVacuumOperationalStatePause() + : ClusterCommand("pause") + { + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) command (0x00000000) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + __auto_type * params = [[MTRRoboticVacuumOperationalStateClusterPauseParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster pauseWithParams:params + completion:^(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable values, + NSError * _Nullable error) { + NSLog(@"Values: %@", values); + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return CHIP_NO_ERROR; + } + +private: +}; + +/* + * Command Stop + */ +class RoboticVacuumOperationalStateStop : public ClusterCommand { +public: + RoboticVacuumOperationalStateStop() + : ClusterCommand("stop") + { + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) command (0x00000001) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + __auto_type * params = [[MTRRoboticVacuumOperationalStateClusterStopParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster stopWithParams:params + completion:^(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable values, + NSError * _Nullable error) { + NSLog(@"Values: %@", values); + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return CHIP_NO_ERROR; + } + +private: +}; + +/* + * Command Start + */ +class RoboticVacuumOperationalStateStart : public ClusterCommand { +public: + RoboticVacuumOperationalStateStart() + : ClusterCommand("start") + { + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) command (0x00000002) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + __auto_type * params = [[MTRRoboticVacuumOperationalStateClusterStartParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster startWithParams:params + completion:^(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable values, + NSError * _Nullable error) { + NSLog(@"Values: %@", values); + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return CHIP_NO_ERROR; + } + +private: +}; + +/* + * Command Resume + */ +class RoboticVacuumOperationalStateResume : public ClusterCommand { +public: + RoboticVacuumOperationalStateResume() + : ClusterCommand("resume") + { + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) command (0x00000003) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + __auto_type * params = [[MTRRoboticVacuumOperationalStateClusterResumeParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster resumeWithParams:params + completion:^(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable values, + NSError * _Nullable error) { + NSLog(@"Values: %@", values); + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return CHIP_NO_ERROR; + } + +private: +}; + +/* + * Attribute PhaseList + */ +class ReadRoboticVacuumOperationalStatePhaseList : public ReadAttribute { +public: + ReadRoboticVacuumOperationalStatePhaseList() + : ReadAttribute("phase-list") + { + } + + ~ReadRoboticVacuumOperationalStatePhaseList() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) ReadAttribute (0x00000000) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + [cluster readAttributePhaseListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"RoboticVacuumOperationalState.PhaseList response %@", [value description]); + if (error != nil) { + LogNSError("RoboticVacuumOperationalState PhaseList read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeRoboticVacuumOperationalStatePhaseList : public SubscribeAttribute { +public: + SubscribeAttributeRoboticVacuumOperationalStatePhaseList() + : SubscribeAttribute("phase-list") + { + } + + ~SubscribeAttributeRoboticVacuumOperationalStatePhaseList() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) ReportAttribute (0x00000000) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributePhaseListWithParams:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"RoboticVacuumOperationalState.PhaseList response %@", [value description]); + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute CurrentPhase + */ +class ReadRoboticVacuumOperationalStateCurrentPhase : public ReadAttribute { +public: + ReadRoboticVacuumOperationalStateCurrentPhase() + : ReadAttribute("current-phase") + { + } + + ~ReadRoboticVacuumOperationalStateCurrentPhase() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) ReadAttribute (0x00000001) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + [cluster readAttributeCurrentPhaseWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"RoboticVacuumOperationalState.CurrentPhase response %@", [value description]); + if (error != nil) { + LogNSError("RoboticVacuumOperationalState CurrentPhase read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeRoboticVacuumOperationalStateCurrentPhase : public SubscribeAttribute { +public: + SubscribeAttributeRoboticVacuumOperationalStateCurrentPhase() + : SubscribeAttribute("current-phase") + { + } + + ~SubscribeAttributeRoboticVacuumOperationalStateCurrentPhase() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) ReportAttribute (0x00000001) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeCurrentPhaseWithParams:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"RoboticVacuumOperationalState.CurrentPhase response %@", [value description]); + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute CountdownTime + */ +class ReadRoboticVacuumOperationalStateCountdownTime : public ReadAttribute { +public: + ReadRoboticVacuumOperationalStateCountdownTime() + : ReadAttribute("countdown-time") + { + } + + ~ReadRoboticVacuumOperationalStateCountdownTime() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) ReadAttribute (0x00000002) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + [cluster readAttributeCountdownTimeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"RoboticVacuumOperationalState.CountdownTime response %@", [value description]); + if (error != nil) { + LogNSError("RoboticVacuumOperationalState CountdownTime read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeRoboticVacuumOperationalStateCountdownTime : public SubscribeAttribute { +public: + SubscribeAttributeRoboticVacuumOperationalStateCountdownTime() + : SubscribeAttribute("countdown-time") + { + } + + ~SubscribeAttributeRoboticVacuumOperationalStateCountdownTime() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) ReportAttribute (0x00000002) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeCountdownTimeWithParams:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"RoboticVacuumOperationalState.CountdownTime response %@", [value description]); + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute OperationalStateList + */ +class ReadRoboticVacuumOperationalStateOperationalStateList : public ReadAttribute { +public: + ReadRoboticVacuumOperationalStateOperationalStateList() + : ReadAttribute("operational-state-list") + { + } + + ~ReadRoboticVacuumOperationalStateOperationalStateList() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) ReadAttribute (0x00000003) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + [cluster readAttributeOperationalStateListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"RoboticVacuumOperationalState.OperationalStateList response %@", [value description]); + if (error != nil) { + LogNSError("RoboticVacuumOperationalState OperationalStateList read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeRoboticVacuumOperationalStateOperationalStateList : public SubscribeAttribute { +public: + SubscribeAttributeRoboticVacuumOperationalStateOperationalStateList() + : SubscribeAttribute("operational-state-list") + { + } + + ~SubscribeAttributeRoboticVacuumOperationalStateOperationalStateList() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) ReportAttribute (0x00000003) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeOperationalStateListWithParams:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"RoboticVacuumOperationalState.OperationalStateList response %@", [value description]); + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute OperationalState + */ +class ReadRoboticVacuumOperationalStateOperationalState : public ReadAttribute { +public: + ReadRoboticVacuumOperationalStateOperationalState() + : ReadAttribute("operational-state") + { + } + + ~ReadRoboticVacuumOperationalStateOperationalState() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) ReadAttribute (0x00000004) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + [cluster readAttributeOperationalStateWithCompletion:^( + MTRRoboticVacuumOperationalStateClusterOperationalStateStruct * _Nullable value, NSError * _Nullable error) { + NSLog(@"RoboticVacuumOperationalState.OperationalState response %@", [value description]); + if (error != nil) { + LogNSError("RoboticVacuumOperationalState OperationalState read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeRoboticVacuumOperationalStateOperationalState : public SubscribeAttribute { +public: + SubscribeAttributeRoboticVacuumOperationalStateOperationalState() + : SubscribeAttribute("operational-state") + { + } + + ~SubscribeAttributeRoboticVacuumOperationalStateOperationalState() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) ReportAttribute (0x00000004) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeOperationalStateWithParams:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^( + MTRRoboticVacuumOperationalStateClusterOperationalStateStruct * _Nullable value, NSError * _Nullable error) { + NSLog(@"RoboticVacuumOperationalState.OperationalState response %@", [value description]); + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute OperationalError + */ +class ReadRoboticVacuumOperationalStateOperationalError : public ReadAttribute { +public: + ReadRoboticVacuumOperationalStateOperationalError() + : ReadAttribute("operational-error") + { + } + + ~ReadRoboticVacuumOperationalStateOperationalError() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) ReadAttribute (0x00000005) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + [cluster readAttributeOperationalErrorWithCompletion:^( + MTRRoboticVacuumOperationalStateClusterErrorStateStruct * _Nullable value, NSError * _Nullable error) { + NSLog(@"RoboticVacuumOperationalState.OperationalError response %@", [value description]); + if (error != nil) { + LogNSError("RoboticVacuumOperationalState OperationalError read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeRoboticVacuumOperationalStateOperationalError : public SubscribeAttribute { +public: + SubscribeAttributeRoboticVacuumOperationalStateOperationalError() + : SubscribeAttribute("operational-error") + { + } + + ~SubscribeAttributeRoboticVacuumOperationalStateOperationalError() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) ReportAttribute (0x00000005) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeOperationalErrorWithParams:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(MTRRoboticVacuumOperationalStateClusterErrorStateStruct * _Nullable value, NSError * _Nullable error) { + NSLog(@"RoboticVacuumOperationalState.OperationalError response %@", [value description]); + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute GeneratedCommandList + */ +class ReadRoboticVacuumOperationalStateGeneratedCommandList : public ReadAttribute { +public: + ReadRoboticVacuumOperationalStateGeneratedCommandList() + : ReadAttribute("generated-command-list") + { + } + + ~ReadRoboticVacuumOperationalStateGeneratedCommandList() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) ReadAttribute (0x0000FFF8) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"RoboticVacuumOperationalState.GeneratedCommandList response %@", [value description]); + if (error != nil) { + LogNSError("RoboticVacuumOperationalState GeneratedCommandList read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeRoboticVacuumOperationalStateGeneratedCommandList : public SubscribeAttribute { +public: + SubscribeAttributeRoboticVacuumOperationalStateGeneratedCommandList() + : SubscribeAttribute("generated-command-list") + { + } + + ~SubscribeAttributeRoboticVacuumOperationalStateGeneratedCommandList() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) ReportAttribute (0x0000FFF8) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeGeneratedCommandListWithParams:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"RoboticVacuumOperationalState.GeneratedCommandList response %@", [value description]); + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute AcceptedCommandList + */ +class ReadRoboticVacuumOperationalStateAcceptedCommandList : public ReadAttribute { +public: + ReadRoboticVacuumOperationalStateAcceptedCommandList() + : ReadAttribute("accepted-command-list") + { + } + + ~ReadRoboticVacuumOperationalStateAcceptedCommandList() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) ReadAttribute (0x0000FFF9) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"RoboticVacuumOperationalState.AcceptedCommandList response %@", [value description]); + if (error != nil) { + LogNSError("RoboticVacuumOperationalState AcceptedCommandList read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeRoboticVacuumOperationalStateAcceptedCommandList : public SubscribeAttribute { +public: + SubscribeAttributeRoboticVacuumOperationalStateAcceptedCommandList() + : SubscribeAttribute("accepted-command-list") + { + } + + ~SubscribeAttributeRoboticVacuumOperationalStateAcceptedCommandList() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) ReportAttribute (0x0000FFF9) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeAcceptedCommandListWithParams:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"RoboticVacuumOperationalState.AcceptedCommandList response %@", [value description]); + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute EventList + */ +class ReadRoboticVacuumOperationalStateEventList : public ReadAttribute { +public: + ReadRoboticVacuumOperationalStateEventList() + : ReadAttribute("event-list") + { + } + + ~ReadRoboticVacuumOperationalStateEventList() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) ReadAttribute (0x0000FFFA) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"RoboticVacuumOperationalState.EventList response %@", [value description]); + if (error != nil) { + LogNSError("RoboticVacuumOperationalState EventList read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeRoboticVacuumOperationalStateEventList : public SubscribeAttribute { +public: + SubscribeAttributeRoboticVacuumOperationalStateEventList() + : SubscribeAttribute("event-list") + { + } + + ~SubscribeAttributeRoboticVacuumOperationalStateEventList() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) ReportAttribute (0x0000FFFA) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeEventListWithParams:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"RoboticVacuumOperationalState.EventList response %@", [value description]); + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute AttributeList + */ +class ReadRoboticVacuumOperationalStateAttributeList : public ReadAttribute { +public: + ReadRoboticVacuumOperationalStateAttributeList() + : ReadAttribute("attribute-list") + { + } + + ~ReadRoboticVacuumOperationalStateAttributeList() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) ReadAttribute (0x0000FFFB) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"RoboticVacuumOperationalState.AttributeList response %@", [value description]); + if (error != nil) { + LogNSError("RoboticVacuumOperationalState AttributeList read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeRoboticVacuumOperationalStateAttributeList : public SubscribeAttribute { +public: + SubscribeAttributeRoboticVacuumOperationalStateAttributeList() + : SubscribeAttribute("attribute-list") + { + } + + ~SubscribeAttributeRoboticVacuumOperationalStateAttributeList() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) ReportAttribute (0x0000FFFB) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeAttributeListWithParams:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"RoboticVacuumOperationalState.AttributeList response %@", [value description]); + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute FeatureMap + */ +class ReadRoboticVacuumOperationalStateFeatureMap : public ReadAttribute { +public: + ReadRoboticVacuumOperationalStateFeatureMap() + : ReadAttribute("feature-map") + { + } + + ~ReadRoboticVacuumOperationalStateFeatureMap() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) ReadAttribute (0x0000FFFC) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"RoboticVacuumOperationalState.FeatureMap response %@", [value description]); + if (error != nil) { + LogNSError("RoboticVacuumOperationalState FeatureMap read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeRoboticVacuumOperationalStateFeatureMap : public SubscribeAttribute { +public: + SubscribeAttributeRoboticVacuumOperationalStateFeatureMap() + : SubscribeAttribute("feature-map") + { + } + + ~SubscribeAttributeRoboticVacuumOperationalStateFeatureMap() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) ReportAttribute (0x0000FFFC) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeFeatureMapWithParams:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"RoboticVacuumOperationalState.FeatureMap response %@", [value description]); + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute ClusterRevision + */ +class ReadRoboticVacuumOperationalStateClusterRevision : public ReadAttribute { +public: + ReadRoboticVacuumOperationalStateClusterRevision() + : ReadAttribute("cluster-revision") + { + } + + ~ReadRoboticVacuumOperationalStateClusterRevision() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) ReadAttribute (0x0000FFFD) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"RoboticVacuumOperationalState.ClusterRevision response %@", [value description]); + if (error != nil) { + LogNSError("RoboticVacuumOperationalState ClusterRevision read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeRoboticVacuumOperationalStateClusterRevision : public SubscribeAttribute { +public: + SubscribeAttributeRoboticVacuumOperationalStateClusterRevision() + : SubscribeAttribute("cluster-revision") + { + } + + ~SubscribeAttributeRoboticVacuumOperationalStateClusterRevision() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) ReportAttribute (0x0000FFFD) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeClusterRevisionWithParams:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"RoboticVacuumOperationalState.ClusterRevision response %@", [value description]); + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + /*----------------------------------------------------------------------------*\ | Cluster HepaFilterMonitoring | 0x0071 | |------------------------------------------------------------------------------| @@ -122595,6 +123647,51 @@ void registerClusterOperationalState(Commands & commands) commands.Register(clusterName, clusterCommands); } +void registerClusterRoboticVacuumOperationalState(Commands & commands) +{ + using namespace chip::app::Clusters::RoboticVacuumOperationalState; + + const char * clusterName = "RoboticVacuumOperationalState"; + + commands_list clusterCommands = { + make_unique(Id), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(Id), // + make_unique(), // + make_unique(Id), // + make_unique(Id), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(Id), // + make_unique(Id), // + }; + + commands.Register(clusterName, clusterCommands); +} void registerClusterHepaFilterMonitoring(Commands & commands) { using namespace chip::app::Clusters::HepaFilterMonitoring; @@ -125301,6 +126398,7 @@ void registerClusters(Commands & commands) registerClusterAirQuality(commands); registerClusterSmokeCoAlarm(commands); registerClusterOperationalState(commands); + registerClusterRoboticVacuumOperationalState(commands); registerClusterHepaFilterMonitoring(commands); registerClusterActivatedCarbonFilterMonitoring(commands); registerClusterDoorLock(commands);